Perforce JViews Maps Sample: Map Viewer (JSF)
Description
This sample shows how to bind a map view to a Perforce JViews JSF component.
How to Use the Sample
- Choose the preferred view size, tiling mode, and page language on the top line.
- To select a node, choose the button on the toolbar and click the desired node.
- To select several nodes, press the Ctrl key while clicking a node to add it to the current selection.
- To move nodes, select them and then drag the current selection to the desired location.
- If only one node is selected, its properties are displayed. You can edit its properties by right-clicking on the view to display a shortcut menu.
- You can edit each of the properties.
- When done, the changes can be sent to the server using the Commit button. Uncommitted changes are lost.
- To create a new node, use the button on the toolbar and click the desired position on the view.
- To delete one or several nodes or links, select them and click the button on the toolbar.
- To start the simulation, use the button on the toolbar. The button changes to , which you can use to stop the simulation.
- Select which layer should be visible in the Displayed Layers table.
Note:If the view uses the tiling mechanism, tiles are generated on demand and cached both server side and client side. To prevent inconsistencies, you cannot hide any of those layers.
Installing the Thin-Client Sample
The sample contains a WAR file (Web Archive) that allows you to easily install the sample 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 Sample 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 sample by opening the following page:
- Perforce JViews Maps Sample: Map Viewer (JSF)
http://localhost:8080/jsf-maps-tiled
Running the Sample 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 sample
by opening the following page:
http://localhost:9443/jsf-maps-tiled
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 Maps
- Thin client
Detailed Description
This sample is based on the Perforce JViews JSF component library. The map view is filled using data from either an IDPR Diagrammer project or from a Map Builder IVL file chosen from a set of files. The data is displayed using the JSF component.
Installation Directory
The Map Viewer (JSF) sample is installed here.
Classes Involved
- ilog.views.maps.faces.component.IlvFacesLayerVisibilityTool
- ilog.views.maps.faces.dhtml.component.IlvFacesDHTMLMapView
- ilog.views.maps.servlet.IlvFacesMapsServlet
Source Files
-
world
The JSP Page source code.
-
data.scripts
The additional JavaScript functions.
-
data.sampletags
The additional JSP tags.
-
demo.JavaScriptVariableComponent
A JSF Component used to internationalize JavaScript code.
-
demo.JavaScriptVariableRenderer
A JSF Renderer used to internationalize JavaScript code.
-
demo.JavaScriptVariableTag
A JSF Tag used to internationalize JavaScript code.
-
demo.LocaleBean
A Bean that stores the preferred session locale.
-
demo.ViewConfigurationBean
A Bean that stores the preferred view parameters for the session.
-
demo.ProjectBean
A Bean that stores the map chosen for the session.
-
demo.SelectionProviderBean
A Bean that manages the properties of the selection.
-
demo.UpdatingServlet
A Servlet that updates nodes and manages the start/stop button.