8.0

Table Of Contents
Integrating and enhancing
QuarkXPress Server Manager
This section is for those who want to enhance QuarkXPress Server Manager or integrate it with other
software. Please refer to http://localhost:8090/qxpsmdocs/apidocs/index.html for manager API
documentation. (Note that the port number used to retrieve the API documentation is 8090 by default,
but you should use whatever port number you specified when installing QuarkXPress Server Manager.)
QuarkXPress Server Manager uses the spring framework to instantiate pluggable objects. This also
means that the manager has been developed using interface-based programming. When the manager
starts up, it reads the contents of ManagerContainerConfig.xml, which is a spring context definition file.
All the beans in the file are instantiated. The manager then proceeds to read
ManagerConfig.xml and initializes manager by reading various configuration options.
Integrating with Other Web Servers
By default, QuarkXPress Server Manager is integrated with Tomcat®. QuarkXPress Server Manager
needs a cache virtual directory to work.
The context definition file contains a bean definition called ContainerAdapter. By default, it uses the
Tomcat adapter, QTomcatContainerAdapterImpl. This adapter assumes the virtual directory to be cache
and reads the location of the virtual directory from the file cache.xml located in the conf/Catalina/localhost
folder of Tomcat.
If QuarkXPress Server Manager needs to be hosted in another web server, the options are to write your
own adapter or use QDefaultContainerAdapterImpl provided with QuarkXPress Server Manager. This
adapter assumes that the cache folder is located under the web application context folder. The name of
the cache folder is also configurable and can be set using the spring configuration file or the
setCacheFolderRelativePath method.
Embedding QuarkXPress Server Manager
You can embed QuarkXPress Server Manager in standalone (and other) applications. To do so, you
must first initialize QuarkXPress Server Manager, as shown below:
QConfigurationData initializationData = new QConfigurationData();
initializationData.setBeanDefinitionConfigFile("ManagerContainerConfig.xml");
QClassFactory.getInstance().init(initializationData);
You can configure other QuarkXPress Manager options using
QConfigurationManager. Next, you must register one or more QuarkXPress Server hosts, as show
below:
QConfigManager configManager =
QClassFactory.getInstance().getExecutionEngine().getConfigManager();
String currentDirectory = System.getProperty("user.dir");
configManager.setCacheFolder(new File(new File(currentDirectory), "cache").getAbsolutePath());
Page 35