Perforce JViews Diagrammer Code Example: JViews Diagrammer and Framework Integration with OpenAjax
Description
This code example shows how to use the JViews JavaServer Faces components with OpenAjax Hub v2.0.
Installing the Thin-Client Code Example
The code example contains a WAR file (Web Archive) that allows you to easily install the code example on any server that supports the Servlet API 2.1 or later. For your convenience, the WAR will be copied to the Tomcat web server that is supplied with the Perforce JViews installation when you start the server using the supplied scripts. Tomcat is the official reference implementation of the Servlet and JSP specifications. If you are already using an up-to-date Web or application server, there is a good chance that it already has everything you need. The sample can also be deployed to WebSphere Application Server (WAS).
Running the Code Example Using Tomcat
If you intend to use the Tomcat Web server provided with this
installation, follow these instructions to start the server:
Running the Server-Side Samples.
The scripts to start the server can be found in the
tools/tomcat-jsf directory.
Note: if you are running on Windows then you will find menu items in
the Windows "start" menu to start and stop the Tomcat server.
Once the server is running, you can see the code example by opening the following page:
- Perforce JViews Diagrammer Code Example: JViews Diagrammer and Framework Integration with OpenAjax
http://localhost:8080/jsf-diagrammer-oah
Running the Code Example Using WebSphere Application Server
In addition to the instructions provided for using Tomcat, the samples can be
viewed on WebSphere Application Server. Follow the instructions:
Running the Server-Side Samples
and use the scripts to start the server and deploy the sample.
Once the server is running, you can see the code example
by opening the following page:
http://localhost:9443/jsf-diagrammer-oah
The WAS administrative console can be used to verify or modify server settings:
http://localhost:9043/ibm/console/
Note: the WAS server can start on a range of port numbers, therefore the value
is not guaranteed to remain the same.
The scripts provided with the samples can be used to obtain the port numbers used
by the Admin Console
and by the deployed Web applications.
To retrieve a list of all the WAS port numbers, run the command line instruction:
ant -f build_was.xml ws.list.ports
Topics Covered
- JViews Diagrammer JavaServer Faces
- OpenAjax
Detailed Description
This code example illustrates how to integrate JViews JavaServer Faces components with the OpenAjax Hub v2.0 reference implementation through the use of an IFrame Managed Hub container that sandboxes (isolates) the JViews JSF component (client) inside an HTML <IFRAME> element.
Installation Directory
The JViews Diagrammer and Framework Integration with OpenAjax code example is installed here.
Classes Involved
- ilog.views.diagrammer.faces.dhtml.component.IlvFacesDHTMLDiagrammerView
- ilog.views.diagrammer.faces.dhtml.component.IlvFacesDiagrammerPropertyAccessor
- ilog.views.diagrammer.faces.dhtml.component.IlvFacesDiagrammerSelectionManager
Source Files
-
demo.select.SelectBean
A JavaBean that gives access to the properties of an object.
-
demo.select.SelectObjectAction
A server-side action implementation that allows you to select objects by their identifier.
-
demo.servlet.DiagrammerServlet
A custom JViews Diagrammer Servlet used to configure custom server-side actions.
-
WEB-INF/faces-config
The configuration file for beans used in this application.
-
index
Defines the main HTML document for this example. It loads all the JavaScript scripts needed for the OpenAjax Hub.
-
data/managedhub
This file provides the logic for the OpenAjax Manager Application (index.html) by creating the required ManagedHub and the Containers (IframeContainers) for the two Client Applications (diagrammer.jsp).
-
data/client1
Defines the first OpenAjax HubClient (IframeHubClient) that allows the corresponding Client Application (client1.jsp) to communicate with the ManagedHub through the publish and subscribe mechanism.
-
data/client2
Defines the second OpenAjax HubClient (IframeHubClient) that allows the corresponding Client Application (client2.jsp) to communicate with the ManagedHub through the publish and subscribe mechanism.
-
client1
This page is the first OpenAjax Client Application embedded in a Manager Application (index.html).
-
client2
This page is the second OpenAjax Client Application embedded in a Manager Application (index.html).