TechnoBuzz

A Techno Blog, mainly about Java

ANT & MAVEN

ANT by Apache:
lets you construct your build scripts in much the same fashion as the “make” tool in C or C++.

Download the ANT src apache-ant-1.6.2-bin.zip
Extract the zip files to C:\ant
Refer to C:\ant\docs\manual\index.html for installation instructions
– set ANT_HOME=c:\ant
– set JAVA_HOME=C:\WebSphere\AppServer\jdk
– set PATH=%PATH%;C:\apache\apache-ant-1.6.2\bin
– ant -h

Maven tool:
Maven builds, documentation creation, site
publication, and distribution publication.
release

July 30, 2004 Posted by | SW Tools | Leave a comment

ANT & MAVEN

ANT by Apache:
lets you construct your build scripts in much the same fashion as the “make” tool in C or C++.

Download the ANT src apache-ant-1.6.2-bin.zip
Extract the zip files to C:\ant
Refer to C:\ant\docs\manual\index.html for installation instructions
– set ANT_HOME=c:\ant
– set JAVA_HOME=C:\WebSphere\AppServer\jdk
– set PATH=%PATH%;C:\apache\apache-ant-1.6.2\bin
– ant -h

Maven tool:
Maven builds, documentation creation, site
publication, and distribution publication.
release

July 30, 2004 Posted by | SW Tools | Leave a comment

Using JAXB

Marshalling – is the process of traversing a content tree and
writing an XML document that reflects the tree’s content.
Unmarshalling – is the process of reading an XML document and constructing a content tree of Java content objects.

The JAXB binding framework (javax.xml.bind package) is a runtime API that
provides interfaces for unmarshalling, marshalling, and validating XML content
in a Java application.

JAXB is now contained within the Web Services Developer Pack [download] [Tutorial]

C:\jwsdp-1.4\docs\GettingStarted.html

C:\jwsdp-1.4\jaxb

JWSDP_HOME C:\jwsdp-1.4\

Set environment variables for JWSDP_HOME :

C:\>set JWSDP_HOME=C:\jwsdp-1.4\
C:\>echo %JWSDP_HOME%
C:\jwsdp-1.4\
cd C:\jwsdp-1.4\jaxb\samples\ unmarshal-read
This directory contains files po.xsd, po.xml, build.xml, and src/Main.java
po.xsd is the name of the source XML schema
po.xml is the name of the source XML instance file

Use the xjc.bat command to generate JAXB Java classes from the source XML
schema:

C:\jwsdp-1.4\jaxb\samples\unmarshal-read>%JWSDP_HOME%\jaxb\bin\xjc.bat po.xsd -p
primer.po

The -p primer.po switch tells the JAXB compiler to put the generated classes in a Java package named primer.po.

Here is the output:
parsing a schema…
compiling a schema…
primer\po\impl\CommentImpl.java
primer\po\impl\ItemsImpl.java
primer\po\impl\JAXBVersion.java
primer\po\impl\PurchaseOrderImpl.java
primer\po\impl\PurchaseOrderTypeImpl.java
primer\po\impl\USAddressImpl.java
primer\po\impl\runtime\ValidatorImpl.java
primer\po\impl\runtime\SAXUnmarshallerHandlerImpl.java
primer\po\impl\runtime\PrefixCallback.java
primer\po\impl\runtime\GrammarInfoImpl.java
primer\po\impl\runtime\ErrorHandlerAdaptor.java
primer\po\impl\runtime\InterningUnmarshallerHandler.java
primer\po\impl\runtime\XMLSerializable.java
primer\po\impl\runtime\UnmarshallerImpl.java
primer\po\impl\runtime\SAXMarshaller.java
primer\po\impl\runtime\UnmarshallingContext.java
primer\po\impl\runtime\UnmarshallingEventHandlerAdaptor.java
primer\po\impl\runtime\XMLSerializer.java
primer\po\impl\runtime\Util.java
primer\po\impl\runtime\UnmarshallableObject.java
primer\po\impl\runtime\ValidatableObject.java
primer\po\impl\runtime\MarshallerImpl.java
primer\po\impl\runtime\GrammarInfo.java
primer\po\impl\runtime\UnmarshallingEventHandler.java
primer\po\impl\runtime\ValidationContext.java
primer\po\impl\runtime\SAXUnmarshallerHandler.java
primer\po\impl\runtime\AbstractUnmarshallingEventHandlerImpl.java
primer\po\impl\runtime\DefaultJAXBContextImpl.java
primer\po\impl\runtime\Discarder.java
primer\po\impl\runtime\MSVValidator.java
primer\po\impl\runtime\NamespaceContextImpl.java
primer\po\impl\runtime\NamespaceContext2.java
primer\po\impl\runtime\ContentHandlerAdaptor.java
primer\po\impl\runtime\GrammarInfoFacade.java
primer\po\impl\runtime\ValidatingUnmarshaller.java
primer\po\Comment.java
primer\po\Items.java
primer\po\ObjectFactory.java
primer\po\PurchaseOrder.java
primer\po\PurchaseOrderType.java
primer\po\USAddress.java
primer\po\jaxb.properties
primer\po\bgm.ser
C:\jwsdp-1.4\jaxb\samples\unmarshal-read>

C:\jwsdp-1.4\jaxb\samples\unmarshal-read>%JAVA_HOME%\bin\javadoc -package primer.po -sourcepath . -d docs\api -windowtitle “Generated Interfaces for po.xsd”

Update CLASSPATH:
set CLASSPATH=%CLASSPATH%;C:\jwsdp-1.4\jaxb\lib\jaxb-api.jar;C:\jwsdp-1.4\jaxb\lib\jaxb-impl.jar;C:\jwsdp-1.4\jaxb\lib\jaxb-libs.jar;C:\jwsdp-1.4\jaxb\lib\jaxb-xj
c.jar;C:\jwsdp-1.4\jwsdp-shared\lib\activation.jar;C:\jwsdp-1.4\jwsdp-shared\lib\commons-beanutils.jar;C:\jwsdp-1.4\jwsdp-shared\lib\commons-collections.jar;C:\
jwsdp-1.4\jwsdp-shared\lib\commons-digester.jar;C:\jwsdp-1.4\jwsdp-shared\lib\commons-logging.jar;C:\jwsdp-1.4\jwsdp-shared\lib\jaas.jar;C:\jwsdp-1.4\jwsdp-shar
ed\lib\jax-qname.jar;C:\jwsdp-1.4\jwsdp-shared\lib\jta-spec1_0_1.jar;C:\jwsdp-1.4\jwsdp-shared\lib\namespace.jar;C:\jwsdp-1.4\jwsdp-shared\lib\mail.jar;C:\jwsdp
-1.4\jwsdp-shared\lib\relaxngDatatype.jar;C:\jwsdp-1.4\jwsdp-shared\lib\xsdlib.jar;C:\jwsdp-1.4\jaxp\lib\jaxp-api.jar;C:\jwsdp-1.4\jaxp\lib\endorsed\dom.jar;C:\
jwsdp-1.4\jaxp\lib\endorsed\sax.jar;C:\jwsdp-1.4\jaxp\lib\endorsed\xalan.jar;C:\jwsdp-1.4\jaxp\lib\endorsed\xercesImpl.jar

Compile the Main.java

C:\jwsdp-1.4\jaxb\samples\unmarshal-read>%JAVA_HOME%\bin\javac src/Main.java primer\po\*.java primer\po\impl\*.java

I copied the src Main.java and Main.class to the unmarshal-read directory

C:\jwsdp-1.4\jaxb\samples\unmarshal-read>java Main
Ship the following items to:
Alice Smith
123 Maple Street
Cambridge, MA 12345
US

5 copies of “Nosferatu – Special Edition (1929)”
3 copies of “The Mummy (1959)”
3 copies of “Godzilla and Mothra: Battle for Earth/Godzilla vs. King Ghi
dora”

Note that the unmarshal-read comes with a build.xml for use with ant. It performs the two distinct phases for JAXB:

1. Generating and compiling JAXB Java classes from an XML source schema
2. Unmarshalling, validating, processing, and marshalling XML content

Now if all you just want to do is generate the classes for use in an IDE, after ANT does its thing just
grab the folder in the gen-src directory and copy it within the JAVA Source section within a project. You must have the jars listed above in your build path for it to compile. When executing there are two gotchas to be carefull of. You have to determine the base path within the IDE where it looks for input files. I had a problem where it could not find a file. It was either the jaxb property file or the input xml file. Also, the namespace.jar file would not work when executing the Main. It gave me a security error and had to remove the .sfa file from the namespace.jar and rebuild the jar and it worked fine.

July 29, 2004 Posted by | XML | 1 Comment

Borland Together

Free Community download.
The features: UML 1.4 and 2.0 modeling ,Modeling for Logical Entity Relationship diagrams , XMI import , MDL import .

July 27, 2004 Posted by | Patterns & UML | Leave a comment

XML and Java

An XSD refresher:
XMLSchema

Definition (XSD)
– industry standard, platform independent XML Schema Language.

Namespaces

Default Schema Namespace: states that all the elements used within the schema belong to that particular namespace
<schema xmlns=”http://www.w3.org/2001/XMLSchema”&gt;

However, usually in form with a a default prefix:
<xsd:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”&gt;

More than one namespace may be declared. One may be declared as the default namespace, another as a namespace that will be associated with certain elements :

xmlns:prefix=URI

The targetNamespace attribute defines the namespace for the document instance (the XML document.)

By default only globally declared (top-Level) elements are associated with the targetNamespace attribute. These are elements that are directly descended from the RootElement.

If the targetNamespace attribute is added to the schema element, then the prefix DOES NEED to be added to each and every component of the schema.
To add locally declared attributes to the targetNamespace, add the attributeFormDefault attribute to the schema element and use the value of “qualified.”

Stating form=”unqualified” within an schema’s element declaration will unqualify that element from the namespace.

SAX

SAX Project (old URL)
SAX is the Simple API for
XML. SAX has recently switched over to the SourceForge project infrastructure.
It is a standard for XML parsers. It reads the XML document and sends an event
for each element it encounters. Provides “sequential access” into the xml
document. It is fast, requires little memory. Sax works by callbacks. You call
the parser, its calls the methods that you supply.
– SAXParserFactory factory
= SAXParserFactory factory.newInstance();
– SAXParser saxParser =
factory.NewSAXParser();
– XMLReader parser = saxParser.getXMLReader();

[slides]





DOM

DOM

standard for XML parsers. It reads the entire XML document into memory and

stores it into a tree data structure. Provides “random access” into the xml

document. It is slow, requires huge amounts of memory.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

DocumentBuilder builder = factory.newDocumentBuilder();
– Document document
builder.parse(file.xml);
[slides]



XERCES
(named after the Xerces Blue butterfly)

Xerces2 – next generation
of high performance, fully compliant XML parsers in the Apache Xerces family.



[slides] [devshed]






JAXB (Java API for XML Binding)

Generate XML Mapping Code
with JAXB
: “It rapidly generates XML mapping code for you, saving time and
effort, and reducing both costs and risks.



XML
ADVISOR: JAXB: A Foundation for Web Services
:Learn all about the Java Architecture for XML Data Binding and implement
lightweight XML-processing applications using the reference implementation



[slides

July 27, 2004 Posted by | XML | Leave a comment

Portlet Programming

This entry will document my learning on programming with Portlets. First link is an introduction on Portlets by two IBMers. Also, referenced is an article on Understanding the Portal Specification. The JSR168 spec and JavaPassion slides [1] [2].

Three main components:
portal (server): presentation layer, or an application which aggregates portlet applications together in a presentable format. Portals provide a secure, single point of interaction with diverse information, business processes, and people, personalized to a user’s needs and responsibilities. A portal server provides common services such as application connectivity, integration, administration, and presentation that would be required across all portal environments.

portlets: a portlet is a Java servlet that operates inside a portal. In other words, it is an individual web component that is made accessible to users via the portal.

portal container: sits between a portal and its portlets. The portlet container manages the lifecycle of the portlets. Controls portlet mode (View, Edit, and Help ) and window state (how much content should appear).

1) Users issue requests against portlets from the portal.
2) The portlet container receives requests from the portal server (instead of a web browser) and invokes the portlet’s “doView” and “doEdit” .
3)The portlet returns the generated markup.
4) The portal server aggregates the portlet makup for display.
5)The client displays the markup.

Portlet exposes four lifecycle methods:

– init(PortletConfig config)
– processAction(ActionRequest request, ActionResponse response)
– render(RenderRequest request, RenderResponse response)
– destroy()

* GenericPortlet: implements the render method and defines three empty methods, doView, doEdit, and doHelp. Your subclass of GenericPortlet can implement any of these methods.

* The ActionListener turns user clicks in your pages into action events…the WindowListener notifies your portlet of window events from the portal, such as when your portlet is maximixed, minimized, and restored. The MessageListener lets you handle messages sent from one portlet to another.

*PortletPreferences is an object that can be used to store persistent data for a portlet user.

*PortletSession : storing information within a user’s session.

*PortletRequestDistpacher: works in the same way a RequestDispatcher would in servlets.

*PortalContext: object can be used to query information about a portals supported extensions.

Onto Developing the Portlets:

July 27, 2004 Posted by | Portals | Leave a comment

eclipse web tools

IBM contribution to the Eclipse Web Tools Platform Project is now live. Here is the link. Scroll down to the end of the page and see IBM getting started guide.

Lomboz contribution to the Eclipse Web Tools Platform Project is also now live. Here is the link. Scroll down to the end of the page and see ObjectWeb getting started guide.
Note that after extracting the zip file you got from eclipse.org to the same location as used above, it gives you a lomboz.zip file which must be extracted to your eclipse home directory. Thsi directory is the directory that is directory above the plugin folder. The lomboz tutorial is here.

[blogs]
[serverside]
[Bill Dudney]

Attended Websphere meeting with Gili Mendel / Jim Zhang

VEP

Java Visual Editor (JVE)

JFACE & SWT

XMI Toolkit is available as Eclipse Modeling Framework, which is part of the Eclipse open-source project.

GEF

July 26, 2004 Posted by | SW Tools | 1 Comment

JDO with JPOX

JPOX: a free and full compliant JDO implementation released under an open source license.
JPOX Tutorial

JPOX Install info:
Setting up the environment requires EMF, com.versant.eclipse.jdo_0.9.9_e2.zip, com.versant.eclipse.jdo.jpox_0.9.9_e2.zip.
You can download the the JPOX eclipsejdo.org plugins here .
I also grabbed the com.versant.eclipse.jdo.doc.user_0.9.9_e2.zip which I extracted and added the folder to eclipse plugin folder. Note that to access the help after the doc plugin is in effect, do help contents in eclipse.

For my project, needed following Jars: bcel.jar, btree.jar, db2jcc.jar, jdo.jar, jdo-ri.jar, jdori-enhancer.jar, jpox-enhancer.jar, log4j.jar. Instead of using the jpox jar, we referenced a different project which contained the jpox source. In the jpoc source project, had the ant.jar, bcel.jar, btree.jar, connector-api.jar, db2jcc.jar, jdo.jar, jdori.jar, jdori-enhancer.jar, jta.zip, log4j, and the oracle jars.

for the enhancer, I am running using WSAD. In run…, created a new application within my project. The class that is referenced is org.jpox.enhancer.JPOXEnhancer which executes on my projecting.jdo file (argument org/jpox/tutorial/package.jdo)

Reference the logging file to get info on how to set up log4j. I set up a JVM variable for my class : -Dlog4j.configuration=file:org/jpox/tutorial/log4j.properties

One thing to remember is to always run the enhancer after each compile.

Now, the main.java which performs the persistance. One thing I noticed when I ran the class is that it creates the table, but nowhere is the schema indicated. Something I need to find out how to specify.

package org.jpox.tutorial;
import org.jpox.*;
import java.util.Properties;
import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;
import javax.jdo.Transaction;
import model.Person;
public class Main
{
public static void main(String[] args)
{
// Properties for connection
Properties properties = new Properties();

properties.setProperty(“javax.jdo.PersistenceManagerFactoryClass”,”org.jpox.PersistenceManagerFactoryImpl”);
properties.setProperty(“javax.jdo.option.ConnectionDriverName”,”com.ibm.db2.jcc.DB2Driver”);
properties.setProperty(“javax.jdo.option.ConnectionURL”,”jdbc:db2://url:portnum/dsn”);
properties.setProperty(“javax.jdo.option.ConnectionUserName”,”db2inst1″);
properties.setProperty(“javax.jdo.option.ConnectionPassword”,””);
properties.setProperty(“org.jpox.autoCreateSchema”,”true”);
properties.setProperty(“org.jpox.validateTables”,”false”);
properties.setProperty(“org.jpox.validateConstraints”,”false”);

// PMFactory creation and getting the PM instance
PersistenceManagerFactory pmfactory = JDOHelper.getPersistenceManagerFactory(properties);
PersistenceManager pm = pmfactory.getPersistenceManager();

try
{
pm.currentTransaction().begin(); // opening a transaction

Person dude = new Person(); // creates one Person

Product product=new Product(“Sony Discman”,”A standard discman from Sony”,49.99);

pm.makePersistent(product);

pm.currentTransaction().commit(); // committing the transaction

}
finally
{
// if the transaction is still active, rolls it back
if( pm.currentTransaction().isActive() )
{
pm.currentTransaction().rollback();
}
pm.close(); // close the PM
}
}
}


Some of the packages in the jpox jdo include: javax.jdo, org.jpox.

a thesis has been written
comparing JDBC to JDO

Object Identity provides training for the JDO API.

JDO vs SDO

JDO Implementations

OJB or now known as the apache db project.

July 25, 2004 Posted by | CommonJ, JDO | Leave a comment

Robustness Diagrams

I used the robustness diagram as a scratchpad to help my define my sequence diagram. On this web site, be sure to see slides on robustness diagrms. MagicDraw is quite a good tool.

Object Oriented Analysis and Design Using UML

July 21, 2004 Posted by | Patterns & UML | Leave a comment

UML examples

UML Quick reference

Rational

UML in nutshell author page

Together/Borland UML Page

UML resources via college class

Video store example

Ambler’s Data Modeling

Mike Godfrey’s UML page

UML with C++ example

UML with design patterns

UML telecom example

Abstract Data Model for Taxonomy

July 20, 2004 Posted by | Patterns & UML | Leave a comment

MagicDraw UML 8.0

Get the MagicDraw UML 8.0 Beta. It required me to register to get the key. Its says Customers can read the output this tool generates by using the free reader for Magic Draw.

July 20, 2004 Posted by | Patterns & UML | Leave a comment

SDO

IBM & BEA Share the Technologies (commonJ). Consists of SDO (originally IBM called it Websphere Data Object but renamed to SDO), WorkManager for Application Servers (API to schedule work items for concurrent execution), and Timer for Application Servers (API for setting timers to do work actions like CRON within container).

They approached each other, then created JSR235: “Defines core infrastructure APIs for heterogeneous data access that supports common application design patterns and supports higher-level tools and frameworks.”

SDO Overview
SDO
Spec
  SDO
Paper
 –

Webspshere 6 is slated to include SDO later this year. JSF with SDO redbook

With SDO it is what do you want to do, not what technology do you want to use. A higher level of abstraction.

More easily to bind, query, view, update, introspect data.
The data comes from different places (heterogeneity), decouple application code from data access code.
Support for Tools and Object/Relational disconnect.
SDO has API that is applicable to all types of data sources, dont assume back end store.
Based upon disconencted data graphs (tree or graph structured data) – retrieve graph, update the graph, and apply changes back to data source.
Access to data with classes which use data mediator services.

Data Transfer Object – move several pices of data over the network in a
single call in order to reduce number of method calls. Usually an assember is
used to keep the domain model and the data transfer objects independednt of each
other.

EMF 
(tutorial as
shown here:
example)
uses SDO.
[Data Transfer Object (DTO) pattern]

[jdo central article]

[server side article]

July 20, 2004 Posted by | CommonJ | Leave a comment

EJBs intro

Java Enterprise Connectivity: Enterprise Java Beans (EJB) – an
architecture for the development and deployment of transactional, distributed
object applications-based, server-side software components.

The concept behind
the EJB is to allow the application programmer to concentrate on business logic
and and shield him/her from complex system level services. To acheive this, the
EJB components must operate within a controlled environment called the
container. The container is responsible for all system level services such as
instance pooling, transaction handling, security, exception handling, and data
caching.

When a client application invokes a remote method on an
enterprise bean, the container first intercepts the invocation to ensure
persistence (means that its state, the values of its variables, can be perserved
across multiple invocations of a program that references the object),
transactions, and security are applied properly to every operation a client
performs on the bean. The container manages security, transactions, and
persistence automatically for the bean, so the bean developer doesn’t have to
write this type of logic into the bean code itself. The enterprise bean
developer can focus on encapsulating business rules, while the container takes
care of everything else.

Session EJB: is a nonpersistant object that implements some business
logic on the server. A client can access a Session EJB through an implemented
Remote interface. Session EJBs can either be stateful or stateless. Stateful
Session Beans exist for the duration of a single client/server session and the
client has reference to a stateful Session Bean that is potentially valid for
the lifetime of the client. However, a stateless Session Bean is not necessarily
holding reference to a particlular Session Bean. Instead, the stateless Session
Bean executes on behalf of a single client.


Entity EJB: is a persistent object that represents an object view of
information stored in a persistent data store. Each Entity EJB carries its own
identity . Entity EJBS that manage thir own persistance are called BMP Entity
Beans. Entity EJBs that delegate their persistence to the EJB container are
called CMP Entity Beans.

The container lies between the client and the bean.
To create an EJB server side component, the bean developer provides two
interfaces plus the beans implementation class.  The beans are accessed by
client applications over the network through their remote and home
interfaces.  

 Remote and Home Interfaces: The remote and home interfaces
represent the bean, but the container insulates the beans from direct access
from client applications.  

The Home interface represents life cycle methods of the component (create,destroy,find). 
It extends the javax.ejb.EJBHome interface. 

The Remote interface represent the business methods of the bean. It extends
the javax.ejb.EJBObject interface. 

Enterprise JavaBeans Fundamentals

Developing an Entity Bean

Code
Sample: Session Enterprise Beans
A downloadable ZIP file containing
the complete code for the home and remote interfaces of a session enterprise
bean.

Java
Message Service Overview
An introduction to the Java Message Service
API, outlining how it can be used to add asynchronous messaging to your Java
enterprise applications.

Enterprise
JavaBeans
Sun’s product page for EJB technology.

EJB
Specification
A resources page offering a download of the EJB
specification, from Sun Microsystems

Code
Sample: Bean Implementation Class for a Session Enterprise Bean
A
downloadable ZIP file containing the complete code for a session enterprise
bean’s implementation class.

Code
Sample: Entity Beans
A downloadable ZIP file containing the complete
code for a bean managed entity bean and a test client application.

Code
Sample: Client Applications and Session Beans
A downloadable ZIP
file containing the complete code for a client application that uses a
session bean.

Develop
and deploy an EJB
JavaPro Article

Getting
started with EJBs
DeveloperWorks Course

EJB 3.0 Tutorial

July 18, 2004 Posted by | EJB | Leave a comment

Zone File Records

Name records are a way to tie host names (domain names) to the IP addresses

Type
– A is short for Address record, ties a name [forexampledomain.com] to an IP address.
– MX is short for mail exchange, An MX record ties a name [forexampledomain.com] to a host name for mail.
– NS is short for Name Server. ties a name [forexampledomain.com] to its host server, NS records should never be edited in the zone file.
– CNAME is short for Canonical Name. CNAME record ties a name [example.forexampledomain.com] to another name [test.forexampledomain.com].

July 18, 2004 Posted by | Web/Tech | Leave a comment

Download Guide, etc

Did you say download?
Here is one nice buncha links for Java.

Eclipse Plugins by category

JDKs, dont forget the IBM Linux JDK

July 17, 2004 Posted by | J2EE | Leave a comment

ODBMS

Caché enables rapid Web application development, extraordinary transaction processing speed, massive scalability, and real-time queries against transactional data – with minimal maintenance requirements.

Objectivity Objectivity/DB is the most scalable, high performance, distributed object database (ODBMS).

July 17, 2004 Posted by | Patterns & UML | Leave a comment

Almost Everything Google

For starters, get yourself a Gmail account. Mine is here .

You can get an account for Adsense where you can make money based on clicks. One reason I was against this was it is taxable income, and you have to supply google with additional information to get paid.

Another new adition to the google stable is their blog.

Yes, there are other blogs that cover Google : google.blogspace.com, www.google-watch.org, www.watchinggooglelikeahawk.com, and the google guy.

Some blog on Googlemania.

How long before we have Google on Nasdaq?

July 16, 2004 Posted by | Web/Tech | Leave a comment

Portal choices and more

The Gridsphere project: 100% JSR 168 Portlet API compliant , Portlet API implementation nearly fully compatible with IBM’s WebSphere® 4.2, Support for the easy development and integration of “third-party portlets”

Apache has several open source portal servers. Jetspeed 2 is JSR 168 compliant.

IBM Portal.

Jonas on ObjectWeb

Enhydra/Shark

jawe

Portlet article for newbies

Punit Pandely A Day in the Life of a Software Developer: Portlet Development & Portals.

IBM dw : Comparing the JSR 168 Java Portlet Specification with the IBM Portlet API

Websphere Application Server now has a new name starting with version 5.1 as far as I can tell. This article mentions the new IBM product – WebSphere Business Integration (WBI) Server Foundation 5.1

Also, the site defines SOA or that is SOA Enterprise.

Java Passion intro slides on portlets:

– Managed by Portlet container
– Generates piece of markup called Fragments
– Fragments vary based on user configuration

Portlet API:
init()
DoView()
ProcessAction()
render()
destroy()

For Portlets development, I will need to download the latest websphere studio application developer (called the integration edition) and also the toolkit for portlets. The portal page has the links to these two products.
I just found out yesterday that the websphere appplication server starting in 5.1 is now called WebSphere Business Integration (WBI) Server Foundation

WSRP(Web Services Remote Portlet):
-Presentation Orineted Web Service (enable interactive presentation orinted web services to be
easily plugged into standard compliant portals)

JSR 162
JSR 167
JSR 168

WebSphere Business Integration Server Foundation V5.1

Developing JavaServer Faces portlets using WebSphere Studio and the IBM Portal Toolkit — Part 1

Portlets plugin for eclipse – works w/o WSAD Integ Edtn

SOA

BPEL

July 14, 2004 Posted by | Portals | Leave a comment

Mr Moore

The Movie. And I had no idea what this Bit Torrent thing was til today.

July 13, 2004 Posted by | Movies | Leave a comment

UML fevers

The Fever is Real vs Death by UML Fever

I recently started reading UML Distilled by Fowler. The book has been updated to include info on UML 2.0

I download IBM Rational XDE Modeler 6.0

created a simple modeling project, analysis model template, design model template.

The RTP area has a Rational Users Group.

Other Modeling tools on market:
Gentleware- Poseidon
Magic Draw
Sparx – Ent Architect

Objects by design has some good UML and SW info

All the classes have stereotypes.

Use Case Diagram – requirements gathering. Use case represents the different capabilities the system provides to the client.

Sequence Diagram – can show Object Interactions, Object lifetimes during a use case, Object messaging and when used for analysis it can show overall system behavior thru class/concept interactions.

Actor – any entity that uses the system. Classes relate to other classes via associations.

What UML Is and Isn’t

Model driven Architecture (MDA)

July 12, 2004 Posted by | Patterns & UML | Leave a comment

Enterprise service bus

An article about ESB in regards to IBM (the code name of the product is Jetstream) : “ESB is built around industry standards and tools, including Java and Web services protocols”.

July 12, 2004 Posted by | SOA | Leave a comment

Hibernate

Based on the hibernate.org example application, I came up with a servlet that writes to a db2 database. This uses the hibernate.properties file to specify the jdbc connection. I still would like to try getting the connection information using a JNDI context like is described here.

jars (place in build path):
cglib-full-2.0.1.jar
commons-logging-2.1.jar
hibernate2.jar
jta.jar
odmg-3.0.jar
commons-collections-1.0.3.jar
dom4j-1.4.jar
jdbc2_0-stdext.jar
log4j-1.2.8.jar

hibernate.properties:
hibernate.connection.driver_class = com.ibm.db2.jcc.DB2Driver
hibernate.connection.url = jdbc:db2://ipaddress:portnum/qms
hibernate.connection.username =
hibernate.connection.password =

Users.hbm.xml:
<?xml version=”1.0″?>
<!DOCTYPE hibernate-mapping PUBLIC
“-//Hibernate/Hibernate Mapping DTD//EN”
http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd”&gt;
<hibernate-mapping>
<class name=”Users” table=”QMS.USERS”>
<id name=”name” type=”string” column=”NAME”> <generator class=”assigned”/> </id> 
<property name=”type” type=”integer” column=”TYPE”/>
</class>
</hibernate-mapping>

hibernate.cfg.xml:
<?xml version=’1.0′ encoding=’utf-8′?>
<!DOCTYPE hibernate-configuration PUBLIC
“-//Hibernate/Hibernate Configuration DTD 2.0//EN”
http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd”&gt;
<hibernate-configuration>
<session-factory>
<property name=”hibernate.connection.driver_class”>com.ibm.db2.jcc.DB2Driver
</property>
<property name=”hibernate.connection.url”>jdbc:db2://ipaddress:portnum/qms
</property>
<property name=”hibernate.connection.username”>db2inst1</property>
<property name=”hibernate.connection.password”></property>
<property name=”dialect”>net.sf.hibernate.dialect.DB2Dialect</property>
<property name=”show_sql”>true</property>
<property name=”transaction.factory_class”>
net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name=”hibernate.cache.provider_class”>
net.sf.hibernate.cache.HashtableCacheProvider</property>
<property name=”hibernate.hbm2ddl.auto”>update</property>
<mapping resource=”Users.hbm.xml”/>
</session-factory>
</hibernate-configuration>

Database table:

CREATE TABLE qms.users ( 
NAME VARCHAR(32 ) NOT NULL PRIMARY KEY 
,TYPE INTEGER
) ;


public class Users 

   private String name; 
   private int type;
   public int getType() {
return type;

   public String getName() {
return name;

   public void setType(int type) {
this.type = type;

   public void setName(String i) {
name = i;
}
 }


import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import net.sf.hibernate.Hibernate;
import net.sf.hibernate.Session;
import net.sf.hibernate.Transaction;
import net.sf.hibernate.Query;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.cfg.Configuration;
public class AdminServlet extends HttpServlet {
SessionFactory _sessions;


public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
    response.setContentType("text/html");
    PrintWriter pw = response.getWriter();
    pw.println("<head>”);
    pw.println(“<meta http-equiv=\”Content-Type\” content=\”text/html;
charset=ISO-8859-1\">");
    pw.println("<title>Hibernate example</title>”);
    pw.println("</head>”);
    pw.println();
    pw.println("<body>”);
    pw.println();
    pw.println("<h1>Hibernate example</h1>”);
    pw.println();
    try {
            int i =
do_hibernate();
    } catch (HibernateException e) {
           e.printStackTrace();
    }
}
public void configure() throws HibernateException {
_sessions = new Configuration()
.addClass(Users.class)
.buildSessionFactory();
}
public int do_hibernate() throws HibernateException {
    System.out.println("start");
    configure()
    Session session = _sessions.openSession();
    Transaction tx = null;
    try {
           tx = session.beginTransaction();
           Users u = new Users();
           u.setName("jay@aol.com");
          u.setType(1);
          session.save(u);
          tx.commit();
    } catch (HibernateException e) {
        e.printStackTrace();
    }
    return 0;
}
}

Hibernate API
Hibernate Guide
Mapping
Object to Relational Mapping and Relationships mapping using hibernate
Just looking for some examples on hibernate.
The first example comes from Aaron Johnson

with DB2

properties file

A new book is out called Hibernate – A developers notebook

A blog In relation to…

The Kickstart Guide

Mike Gloegl

Learn Hibernate

Developer Works

and of course Hibernate.org
hibernatedownload

wiki

plugin

Hibernate Sync plugin. To install, go to the install/update perspective , right click, new, enter url of
http://www.binamics.com/hibernatesync/eclipse2.1/site.xml, then on lower panel go down 3 levels,
and single click the item, on right side should see a button thats says install. I did this with wsad 5.1.2.

This article mentions the plugin.

Hibernate with xdoclet tutorial.

July 9, 2004 Posted by | Hibernate & ORM | Leave a comment

HTTRACK

HTTRACK.com : It allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site’s relative link-structure.

July 9, 2004 Posted by | Web/Tech | Leave a comment