Using the CTP Application Server

From MircWiki
Revision as of 19:19, 16 August 2012 by Johnperry (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This article describes how to use the CTP Application Server to download and launch Java applications using the Java Web Start protocol (JNLP).

The CTP Application Server is a servlet that is included in all CTP versions starting with 2012/08/15. The servlet is accessed through the URL /webstart/{name}, where {name} is the name of the application program to be launched.

To deploy a Java program for downloading by the Application Server servlet, the program and all the resources it uses (jar libraries, etc.) must be placed in a first-generation child directory of CTP/ROOT. An XSL file with the name {name}.xsl must also appear in the same directory. The XSL file is used by the servlet to process a dynamically generated XML document and produce the JNLP XML structure required to trigger the download and launch of the application.

The structure of the dynamically generated document is:


The values of the elements in the document are constructed by the servlet from the HTTP connection. For example, to launch the TCIASender application, the URL might be:

In this case, the document will be:

        <title><![CDATA[My Institution]]></title>
        <name><![CDATA[My Name]]></name>

The XSL program to launch the application would be:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" />

<xsl:template match="/jnlp">
		codebase="{environment/protocol}://{environment/host}/{environment/application}" >
		<!-- href="{environment/application}.jnlp" > -->

			<title>TCIA Transport Utility</title>
			<homepage href=""/>
			<description>TCIA Transport Utility</description>
			<description kind="short">Java Web Start program for transmitting images to TCIA for clinical trials.</description>
			<!-- <offline-allowed/> -->


			<j2se version="1.5+"/>
			<jar href="TCIASender.jar"/>
			<jar href="CTP.jar"/>
			<jar href="dcm4che.jar"/>
			<jar href="log4j.jar"/>
			<jar href="util.jar"/>

		<application-desc maiin-class="tcia.TCIASender"/>