wiki:GROUP_DEPLOYMENT_JWS_APPLET
Last modified 16 years ago Last modified on 07/27/09 15:42:35

Applet Deployment

How to self-sign jars

  • Research about self-signing has been made. First you have to create keystore and use it to sign the launcher jar. The commands are:
keytool -selfcert -alias AsteaCert -keystore sophie-keystore 

and

jarsigner org.sophie2.launcher-2.0-SNAPSHOT.jar AsteaCert

Note: This commands are needed for java web start deployment too.

So we have a keystore named sophie-keystore with alias AsteaCert, with which we can sign the needed jars.

Applet configuration

	<applet width="1000" height="600" name="sophie2-applet" codebase="sophie2-bundles/"  
			code="org.sophie2.launcher.SophieApplet" 
			archive="org.sophie2.launcher-2.0-SNAPSHOT.jar 
					, and other needed jars 
					"> 
	You need java installed to run Sophie 2.0 applet. 
	</applet> 

Implementation ideas

  • One of the things that should be done is to make the Main class of the org.sophie2.launcher module extends Applet class. In this case Felix will start in the init() method of the newly created SophieApplet. Applet layout engine should be created(this is connected with GUI redesign). it will use SophieApplet instead of JFrame in standalone editions.

Location

The runnable applet has to be stored in sophie2.org server on http://sophie2.org/applet location. This should be done in the implementation section.

Java Web Start persistence

The main purpose of this is to have a local copy of *.bundles.config file in the file system of the client machine. In this way the functionality of plugin enable/disable can be included in the applet. The file will be read from the machine and if it is edited there will be changes in the switched modules. After research about this the following is found:

  • jnlp library must be used - in the API classes, listed below, are needed:
    • BasicService - this class manage to retrieve the codebase of the application (path to the launcher module in Sophie 2 case)
  • PersistenceService - this service provides methods for storing local data in the client machine. It is something like storing cookies on the local machine. There is useful method .get which return the file content of the given url of the data store entry. This has to be used when getting the *.bundle.config file for writing/reading. Another important thing is to update the server when the config file is changed on the local machine. This is done using PersistenceService tag DIRTY that keeps track when the file was changed. When the server copy is updated with the new file the tag has to be changed to CHACHED(using setTag method). With create method a new storage entry in the client side is created.
  • FileContents - file utilities are here. Methods that we need are getInputStream and getMaxLength when reading the config file.

Here is simple example that uses all of the above and is almost what is needed:

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/examples.html#PersistenceService

Location

The runnable jws has to be stored in sophie2.org server on http://sophie2.org/jws location. This should be done in the implementation section.

Estimation

Running application through applet and java web start local storage on the client machine will be done on week 3 and 4 milestone 10.