The JNLP servlet, dynamically generates JNLP used to launch Java applications using Java Web Start. Starting with version 3.5, Elements allows you to register Java applications. Registered applications receive hyperlinks in the "Applications" section of the home page, and can contain special configuration parameters, and command line arguments.
This is a summary of the data and configuration required to use the JNLP launching servlet.
The applications are registered as named text entries, this is specified by type id = 10. The Label column represents the text shown in the application list of the webapp, and the value is the url for the specific application. Access to specific applications can be controlled by named text security.
| ID | LABEL | VALUE | TYPE_ID | EDITED_BY |
|---|---|---|---|---|
| ? | eExplorer | explorer.jnlp | 10 | -1 |
In addition to the named text registry each application will need some specific parameters. Type id 11 is assigned for this purpose. The id column should reference the named text, text_id under which the application is registered.
| ID | TYPE_ID | PARAMETER | VALUE | Note |
|---|---|---|---|---|
| -? | 11 | JNLP_WEB_ICON | images/app_explore.gif | Icon appearing in the web application link that launches this application. |
| -1 | 11 | JNLP_CLASS_NAME | com.ee.client | The Java class name of the application. |
| ? | 11 | JNLP_APP_CLASS | com.ee.client.applications.eexplorer.EExplorer | For Enterprise Elements applications the application to be launched by com.ee.client. |
| -1 | 11 | JNLP_JAR_FILE | ee.jar | The jar file holding the JNLP_CLASS_NAME java class file. |
| ? | 11 | JNLP_DESCRIPTION | Elements Repository Explorer. | |
| -1 | 11 | JNLP_TITLE | Enterprise Elements | |
| -1 | 11 | JNLP_VENDOR | Redefining the Repository | |
| -1 | 11 | JNLP_ICON | images/logo.jpg | The application icon (not shown in the web application). |
| -1 | 11 | JNLP_DEPENDENT_JAR_FILES | Semi colon separated list of dependent jar files.. | |
| -1 | 11 | JNLP_JAVA_VERSION | 1.5+ | Java runtime required for application. See Sun's documentation on JNLP for the exact syntax of this value. |
Id parameters of -1 are common to all apps, id parameters of ? are specific to an individual application, at least for Enterprise Elements applications. Third party applications may override any/all of these. It may look like the jnlp_vendor and jnlp_title are reversed, but that is the way we set them currently to get the desired display on the Web Start dialog.
Additional request parameters to this servlet will be passed through the JNLP as command line arguments to the application defined by the JNLP_CLASS_NAME parameter. For example:
http://mocha:8082/ee/explorer.jnlp?id=5&name=test
The query string of the url will add id=5 and name=test to the command line args of the application.
The existing jnlp servlet will be refactored to query for this data. The key for the query is the combination of named text type_id and value. For the parameter table keying is through the id and type_id.
As with other product extensions, cutom gui could be written, but more likely just mananged by documentation and sample sql statements to add, modify, or remove enteries.
INSERT INTO named_text (text_id,label,value,type_id, edited_by) VALUES(646,'eExplorer','explorer.jnlp',10,-1);
INSERT INTO parameter( id, parameter, value, type_id ) VALUES(646, 'JNLP_APP_NAME', 'com.ee.client.applications.eexplorer.EExplorer', 11);
INSERT INTO parameter( id, parameter, value, type_id ) VALUES(646, 'JNLP_WEB_ICON', 'images/app_explore.gif', 11);
INSERT INTO named_text (text_id,label,value,type_id, edited_by) VALUES(?,'AppName','AppName.jnlp',10,-1);
INSERT INTO parameter( id, parameter, value, type_id ) VALUES(?, 'JNLP_CLASS_NAME', 'com.thirdparty.AppName', 11);
INSERT INTO parameter( id, parameter, value, type_id ) VALUES(?, 'JNLP_WEB_ICON', 'images/app_explore.gif', 11);
INSERT INTO parameter( id, parameter, value, type_id ) VALUES(?, 'JNLP_JAR_FILE', 'App.jar', 11);
UPDATE parameter SET value = 'EE_ADMIN' WHERE type_id = 126 and id = 646
This replaces the default role (EE_USER) for eExplorer ( id = 646 ) with the EE_ADMIN role.