Perforce JViews Diagrammer Code Example: Using JSF components
Description
These examples show how to use the JViews JavaServer Faces components in order to display and interact on a diagram.
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: Using JSF components
http://localhost:8080/jsf-diagrammer-code-fragments
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-code-fragments
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
- JavaServer Faces Diagrammer
- Thin client
- User Manual
Detailed Description
This page gathers several code fragments.
Each code fragment is a JavaServer Page (JSP).
If a component uses a bean in an expression (for example #{myBean.myProperty}), it refers the java class that has the same class name as the bean name.
A small description of the code fragment is present in the JSP page.
Installation Directory
The Using JSF components code example is installed here.
Classes Involved
- ilog.views.diagrammer.IlvDiagrammer
- ilog.views.diagrammer.datasource.IlvDiagrammerDataSource
- ilog.views.diagrammer.datasource.IlvXMLDataSource
- ilog.views.diagrammer.faces.dhtml.component.IlvFacesDiagrammerPropertyAccessor
- ilog.views.faces.dhtml.event.FacesViewActionEvent
- ilog.views.sdm.IlvSDMEngine
- ilog.views.sdm.IlvSDMModel
- ilog.views.sdm.IlvSDMView
- ilog.views.sdm.servlet.IlvSDMImageMapAreaGenerator
- ilog.views.util.servlet.IlvMenuFactory
Source Files
-
faces.dhtml.MenuFactory
A contextual pop-up menu factory.
-
faces.dhtml.DiagrammerBean
A bean that contains properties and actions used in the code fragments.
-
code_fragment1
This JSP page shows how to declare an empty diagram.
-
code_fragment2
This JSP page shows how to display a project created with the Designer for Perforce JViews Diagrammer.
-
code_fragment3
This JSP page shows how to display an XML file.
-
code_fragment4
This JSP page shows how to display an IlvDiagrammeraDataSource instance.
-
code_fragment5
This JSP page shows how to use an IlvDiagrammer instance.
-
code_fragment6
This JSP page shows how to style the diagram through CSS.
-
code_fragment7
This JSP page shows how to install an interactor on the diagrammer view.
-
code_fragment8
This JSP page shows how to use the JavaScript proxies to interactor on Perforce JViews JSF components without a page submit.
-
code_fragment9
This JSP page shows how to connect common components to the diagrammer view.
-
code_fragment10
This JSP page shows how to attach a static pop-up to a diagrammer view.
-
code_fragment11
This JSP page shows how to attach a contextual pop-up menu to a diagrammer view.
-
code_fragment12
This JSP page shows how to trigger an action in the image servlet when picking a node.
-
code_fragment13
This JSP page shows how to trigger an action in the JSF lifecycle when picking a node.
-
code_fragment14
This JSP page shows how to use image maps on top of the diagrammer view.
-
code_fragment15
This JSP page shows how to use the select interactor.
-
code_fragment16
This JSP page shows how to use create nodes and links actions.
-
code_fragment17
This JSP page shows how to get and set properties of selected objects.
-
code_fragment18
This JSP page shows how to delete selected objects.
-
code_fragment19
This JSP page shows how to display a dashboard .idbd project file in JSF.
-
code_fragment20
This JSP page shows how to declare a tiled diagram view.
-
code_fragment21
This JSP page shows how to set the maximum zoom level of a view.
-
code_fragment22
This JSP page shows how to set fixed zoom levels.
-
code_fragment23
This JSP page shows how to resize a selected node.