Visual Beans Samples Readme
This directory contains samples demonstrating the use of the visual beans.
There are two applications - the Sample Client and the Sample Viewer.
Setup Instructions:
The samples can be executed using the EIP environment. Compile all
the sample files by executing the following command:
javac *.java
Note that the sample client provides translations into many languages, some
of which may not be supported in your environment. If you have an error
compiling one of these language-specific files (named CMBCATextResources_xx.java,
where xx is a 2-letter code for a locale), then rename or delete the file
so you can successfully compile all the files.
Sample Client
The visual beans SampleClient allows you to connect to the EIP federated
database or directly to content servers. It demonstrates the use of the following
visual beans:
- CMBLogonPanel
- CMBSearchTemplateList
- CMBSearchTemplateViewer
- CMBSearchPanel
- CMBSearchResultsViewer
- CMBDocumentViewer
- CMBItemAttributesEditor
- CMBVersionsViewer
It also demonstrates the use of the non-visual CMBConnection bean in an application.
The main application window consists of an area that allows you to enter
search criteria and execute searches, and an area that displays search results.
From the results view, you can edit attributes of a document, view its versioning
information if it has any, and view the document itself. An options dialog
lets you modify some properties of the visual beans.
To run the SampleClient, open an EIP development window. Invoke the Sample
Client with the following command:
java SampleClient
or
java -Xms16M -Xmx256M SampleClient
Usage notes
Customization
To customize the sample client for your location and installation,
modify the constants at the top of the CMBClientPane.java file, and the
property values in the client.
Connect String
Connecting to different native datastores can require setting
a connection string or a configuration string on the CMBConnection non-visual
bean. If you are connecting to a native datastore that requires a connection
string, such as IP/390 or DES, set the connectString or configString property
on the non-visual bean prior to the call to connect. Here are some examples
of setting the connect strings:
For connecting to IP/390:
connection.setConnectString("APPL=01;FAFIP=9.67.43.83;IODMIP=9.67.43.83;FAFPORT=3061;IODMPORT=3082;FAFPROT=4000;IODMPROT=4000;FAFSITE=cs61");
connection.connect();
For JDBC:
connection.setConfigString("JDBCDRIVER=(COM.ibm.db2.jdbc.app.DB2Driver)");
// set datastore type AFTER setting the config string connection.setDsType(CMBBaseConstant.CMB_DSTYPE_JDBC);
connection.connect();
For DES:
connection.setConnectString("PORT=80;DESAPPID=appid;DESAPPPW=apppw");
connection.connect();
Shared Memory with CM V7
When performing a search against CM V7 servers,
you may encounter an error similar to the following:
FRN9255A: Cp=14; Fc=FrnSysInitSharedMem; Tr=5;
MC=9256; Fi=slpglint.cpp; Ln=1205; LA=(null); RC=-2538;
To help avoid this error, specify Java memory options when invoking the sample
client:
java -Xms16M -Xmx256M SampleClient
Setting Mime Types:
To set different mime type/viewer pairs
for the CMBDocumentViewer visual bean, the mime2app property may be set on
the CMBDocumentViewer bean. Programmers can add their own
definitions for MIME type and application pairs by following these rules:
key: MimeType
value: a=application x=file extension (where a="application name",
x="common file extension for this application")
Example:
Properties mime2app = new Properties();
mime2app.put("text/plain", "a=notepad x=.txt");
mime2app.put("text/richtext", "a=c:/progra~1/acceso~1/wordpad x=.txt");
mime2app.put("image/tiff", "a=c:\\progra~1\\acceso~1\\imagevue\\wangimg x=.tiff");
documentViewer.setMime2App(mime2app);
Sample Viewer
The sample viewer is a sample Java document viewer that is launched by the
CMBDocumentViewer visual bean and uses the CMBDocumentServices non-visual
bean for document rendering.
To enable the viewer, compile it, and add an entry to the mime2app properties
on the CMBDocumentViewer bean in your application: mimetype=SampleViewer.class
where mimetype is the MIME content type to be handled by the sample viewer.
A wildcard of '*' can be entered for the mimetype, which will cause the
viewer to be used for documents of any type (see limitations below).
mime2app.put("*", "SampleViewer.class");
You will also need to place /samples/beans/gui in your classpath,
or copy all the gif files (for the icons of the toolbar) from this directory
into a directory in your classpath. Additionally you need to copy the SampleViewerConfiguration.properties
file to the current directory to enable the toolbars.
Limitations
The AFP conversion support
in CMBDocumentServices translates pages of AFP documents to HTML 4.0 with
a background images. Java's JEditorPane, which is used by this sample, only
supports HTML 3.2. Therefore, the converted pages cannot be viewed using
this sample.