Publishing Engine Programmer's Guide > PTC Arbortext Publishing > Arbortext Publishing Engine Server Composer > Publishing Applications
  
Publishing Applications
The Arbortext PE server Publishing Application is a standard Arbortext PE Application implemented in Java. It runs in an Arbortext PE sub-process and it's implemented by the class com.arbortext.e3c.Application. It expects to be invoked when the Arbortext PE Request Manager receives a POST request accompanied by an HTTP request body with a content-type of application/x-java-archive and the following request query parameters:
f = java
class = com.arbortext.e3c.Application
composer-class = com.arbortext.e3c.ServerComposer
The Publishing Application will not be called by the Arbortext PE Request Manager if the class parameter has another value. It also issues an error message if there is no request body or the content-type header indicates another type.
The composer-class query parameter could have another value; but the code that runs on the Arbortext Editor client always specifies this value. If another value is specified, it must be a Java class implementing the interface com.arbortext.e3c.E3ServerComposer.
The Publishing Application begins by retrieving and validating the content-type header. It will ignore an optional ; charset= specification as allowed by the HTTP protocol. It retrieves the POST request body and saves it to disk. Then it searches for, loads, and instantiates an object of the class indicated by the composer-class parameter, which is the PE Server Composer. Then it calls the Server Composer's doCompose method.
The Publishing Application maintains a cache of instantiated Server Composer objects, and only loads and instantiates an object for a given class once. This means that Server Composers should be serially reusable. An Arbortext PE sub-process can only process one request at a time, so a Server Composer doesn't need to handle simultaneous requests.
The Server Composer's doCompose method takes the POST request body file as a parameter, and it is expected to return a Java File object referencing a JAR file. The Publishing Application will return the JAR file to the Arbortext PE Request Manager (who returns it to the client) with a content-type of application/x-java-archive.
If the Publishing Application detects any errors, it returns an XHTML document with content-type text/xml instead of a JAR file.