Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Getting Started

An effective collaborative environment not only brings people together, it provides access to important data by tightly integrating with other business critical systems. CollabraSuite, BEA Edition provides an Application Programming Interface (API) to facilitate this integration. This API allows developers to seamlessly bring existing data and systems into their collaborative environment, tailoring it to their specific requirements.

For example, documents can be created in a room or user's briefcase using real-time data such as an RSS feed. The document's subscriber list can then be modified to automatically notify users of the new information. Another example might involve dynamically creating rooms or sessions to deal with a situation in real-time, such as an intrusion detection system. When a pre-defined event occurs, the API could be used to create a new collaborative session and bring a set of online users into that new session.

 


Compiling

In order to begin compiling code using the Integration API, the following CollabraSuite, BEA Edition JAR is required: csuite-i9n-client.jar. This JAR is located under the CollabraSuite, BEA Edition installation in the lib directory. Additionally, the standard Java 2 Enterprise Edition (J2EE) classes are required. These can usually be found bundled with your J2EE application server. For example, WebLogic includes these classes in weblogic.jar. Below is an example of compiling a client using the Integration API:

% javac -classpath csuite-i9n-client.jar:${WL_HOME}/server/lib/weblogic.jar:. CSuiteIntegrationClient.java

 


Running

The Integration API uses Log4j for logging, so running the client code requires all of the JARs mentioned above plus log4j.jar. The following command illustrates running a stand-alone client that connects to a WebLogic application server:

% java -classpath csuite-i9n-client.jar:log4j.jar: ${WL_HOME}/server/lib/weblogic.jar:. CSuiteIntegrationClient

Running client code inside the web tier of an application server requires access to the same list of JAR files. These can be made available by placing them in the WEB-INF/lib directory of a WAR. Additionally, the following changes must be made to web.xml and the application specific deployment descriptor such as weblogic.xml. Note that all of the necessary modifications are automatically performed when installing CollabraSuite, BEA Edition into an existing web application via WebLogic Workshop. See the Installation Guide for additional details.

Listing 1-1 Figure 1: Additions to web.xml

<ejb-ref>

<ejb-ref-name>ejb/CSuiteAdmin</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<home>

com.collabraspace.csuite.server.i9n.interfaces.CSuiteAdminRemoteHome

</home>

<remote>

com.collabraspace.csuite.server.i9n.interfaces.CSuiteAdminRemote

</remote>

</ejb-ref>

<ejb-ref>

<ejb-ref-name>ejb/CSuiteCollaboration</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<home>

com.collabraspace.csuite.server.i9n.interfaces.CSuiteCollaborationRemoteHome

</home>

<remote>

com.collabraspace.csuite.server.i9n.interfaces.CSuiteCollaborationRemote

</remote>

</ejb-ref>

Listing 1-2 Figure 2: Additions to weblogic.xml

<ejb-reference-description>

<ejb-ref-name>ejb/CSuiteAdmin</ejb-ref-name>

<jndi-name>ejb/CSuiteAdmin</jndi-name>

</ejb-reference-description>

<ejb-reference-description>

<ejb-ref-name>ejb/CSuiteCollaboration</ejb-ref-name>

<jndi-name>ejb/CSuiteCollaboration</jndi-name>

</ejb-reference-description>

 


Connecting

The Integration API is accessed via Stateless Session Enterprise Java Beans (EJBs) provided by the CollabraSuite, BEA Edition application. The API can be access both locally and remotely. Local clients run inside the application server while remote clients run stand-alone outside of the application server. The only difference between the two methods is how the code finds and connects to the server using JNDI. When running inside the web tier of an application server, no extra information is required to lookup one of the Stateless Session EJBs:

CSuiteAdminRemote csAdmin = 
        CSuiteFactory.getCSuiteAdminRemoteInstance();

Connecting from a remote client requires more information such as the JNDI initial context factory, provider URL, username and password. The following is an example of connecting remotely using WebLogic.

Hashtable h = new Hashtable();
h.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
      "weblogic.jndi.WLInitialContextFactory");
h.put(javax.naming.Context.PROVIDER_URL, "t3://localhost:7001");
h.put(javax.naming.Context.SECURITY_PRINCIPAL, "username");
h.put(javax.naming.Context.SECURITY_CREDENTIALS, "password");
CSuiteAdminRemote csAdmin = CSuiteFactory.getCSuiteAdminRemoteInstance(h);

  Back to Top       Previous  Next