IBM DB2 Intelligent Miner Visualization v. 8.2

Applet Samples

IBM DB2 Intelligent Miner Visualization v. 8.2 provides two applets to:
  1. open a whole visualizer as an applet in a HTML document (embedded in the document or in an own window)  
  2. display a single visualizer view in a HTML document

To embed the visualizer as an applet in a HTML document:
<applet code=" see applet code below"
 codebase="lib"  archive="imvisu.jar"
 width="width in pixels"
 height="height in pixels">
 <param name=" PARAM NAME #1" value="PARAM VALUE #1 ">
 ...
</applet>

To learn how to display models stored in a database, read the section:
Loading a model from a database.

Opening a whole visualizer as an applet:

CODE="com.ibm.iminer.visualizer.applet.IDMVisualizerApplet"

Possible parameters:

Parameter name
Description
model
Path or URL of the model to load.
If the path is relative (ex: ../model.xml) the model will be searched at a location relative to the HTML document.
embedded
If "true", the visualizer will be embedded in the HTML document like a graphic.
Otherwise the HTML document will contain a button to launch the visualizer in its own window.
startButtonLabel
Defines the text of the launch button (in case "embedded" is not "true")
noClone
If "true", the "File->New Window" command will not be available.
noOpen
If "true", the "File->Open/Open in New Window" commands will not be available.
noSave
if "true", the "File->Save/Save As" commands will not be available.
noExport
if "true", the "File->Export..." command will not be available.
noPrint
if "true", the "File->Print.../Print Preview" commands will not be available.
noEditProperties
if "true", the "File->Edit Visualizer Properties" command will not be available.
noLocalProperties
if "true", the visualizer will not try to load/save user properties from the local file system.
locale
if defined, the visualizer will be forced to use the locale defined as value. The locale saved in the user properties will be ignored.
The value must have the form la_CO,
where la is the lower-case two letter code of the language as defined by ISO-639, and CO is the optional upper-case two letter code of the country as defined by ISO-3166.
Example: for US english: locale="en_US", for french locale="fr" , etc...

Samples:

Clustering visualizer launched with a start button . (Using the Java-Plugin )
Associations visualizer embedded in a HTML document . (Using the Java-Plugin )
Classification visualizer embedded in a HTML document with disabled Save function . (Using the Java-Plugin )


Embedding a single view in an HTML document:

CODE="com.ibm.iminer.visualizer.applet.IDMMiningViewApplet"

Possible parameters:

Parameter name
Description
model
Path or URL of the model to load.
If the path is relative (ex: ../model.xml) the model will be searched at a location relative to the HTML document.
view
Name of the view to display. The possible view names are:
  • Clustering visualizer: "graphical", "textual" or "detailed"
  • Association visualizer: "rules", "itemSets" , "graphical" or "statistic"
  • Classification visualizer: "quality" , "classification", "tree", "treeNavigator" , "treeNodeDistribution" or "detailed"
noLegend
if "true", the legend will not be displayed.
noMenuBar
if "true", the menu bar will not be displayed.
locale


if defined, the visualizer will be forced to use the locale defined as value. The locale saved in the user properties will be ignored.
The value must have the form la_CO,
where la is the lower-case two letter code of the language as defined by ISO-639, and CO is the optional upper-case two letter code of the country as defined by ISO-3166.
Example: for US english: locale="en_US", for french locale="fr" , etc...

Samples:

Clustering graphical view embedded in an HTML document with menu bar . (Using the Java-Plugin )
Association "rules" view embedded in an HTML document without menu bar . (Using the Java-Plugin )



Loading a model from a database

To load a model from a database:
  1. Make sure that the JDBC driver of your database is in the classpath of the applet: you can copy it in the same directory as the jar files of the visualizers and add it in the "archive" attribute of the applet.
  2. Make sure that you have not defined the parameter "model".
  3. You must define all the parameters described below which are not marked as being optional.

Parameter name
Description
JDBC_URL
JDBC URL of the database to connect to.

For DB2 type 4 driver, this URL has the following form:
jdbc:db2://hostname:portnumber/DatabaseName

JDBC_Driver
Classname of the JDBC driver to use for the connection with the database.

The name of the JDBC type 4 driver delivered with DB2 is:
com.ibm.db2.jcc.DB2Driver

DBUserName
Name of the user to use for the connection with the database.
DBPassword
Password to use.
DBTable
Name of the table.
DBPrimaryKeyCol
Name of the column containing the primary keys of the models.
DBModelCol
Name of the column containing the model themselves.
DBModelPropCol (optional)
Name of the optional column containing the visualizer properties of the models.
DBModelKey
Key of the model to load.

Example:

The model to display is stored on a DB2 Database which is installed on a host named myHost with port number 50000.The name of the database is myDatabase. The table is named myTable and has 2 columns:
The JDBC type 4 driver for the database is contained in the files db2jcc.zip, db2jcc_license_cisuz.jar
and db2jcc_license_cu.jar.
A user anonymousUser having the password anonymousPassword has a read access on this table.
The key of the model to load is "model_1"

If we assume that the jar files of the visualizer are in a sub directory lib/, relative to the location of the HTML file, and that db2jcc*.jar have been copied in the same directory, the syntax for the applet will be:

<applet code="com.ibm.iminer.visualizer.applet.IDMVisualizerApplet"
 codebase="lib"
archive="imvisu.jar, db2jcc.zip,
 db2jcc_license_cisuz.jar, db2jcc_license_cu.jar"
 width="250" height="40">
<param name="JDBC_URL" value="jdbc:db2://myHost:50000/myDatabase">
<param name="JDBC_Driver" value="com.ibm.db2.jcc.DB2Driver">
<param name="DBUserName" value="anonymousUser">
<param name="DBPassword" value="anonymousPassword">
<param name="DBTable" value="myTable">
<param name="DBPrimaryKeyCol" value="key">
<param name="DBModelCol" value="model">
<param name="DBModelKey" value="model_1">
</applet>