2018

DEPLOYING QUARKXPRESS SERVER MANAGER
Getting Started with QuarkXPress Server 2018 | 11
This type of deployment model is possible only when the application in which
!
QuarkXPress Server Manager is to be embedded is a Spring application and is
deployed with an embedded or external Tomcat Web container.
To install QuarkXPress Server Manager in a shared Spring context:
Copy the qxpsm and qxpsmadmin Web application to the webapps folder for 1.
your existing application, so that QuarkXPress Server Manager can be
recognized as a Web application in the existing Web container.
Set cacheFolderContextFile to the path of the “cache.xml” file relative
to the current working directory.
Set serverXmlFilePath to the path of the “Server.xml” file relative to the
current working directory.
Copy all QXPSM-dependent jar files from 2.
[QXPSM_Home]/Server/dependencies and [QXPSM_Home]/Server/lib to
a common location, then add all of these jar files to the application classpath so
that they are available to other Web applications that want to use the
QuarkXPress Server Manager API locally.
Import the QuarkXPress Server Manager Spring context file, 3.
“ManagerContainerConfig.xml,” into the existing application Spring context.
Create a Java class named CustomContextLoaderListener that extends 4.
org.springframework.web.context.ContextLoaderListener. Override
the method loadParentContext() as shown here:
public class CustomContextLoaderListener extends
org.springframework.web.context.ContextLoaderListener
{
private static final Logger logger =
Logger.getLogger(GlobalContextLoaderListener.class);
public void contextInitialized(ServletContextEvent
servletContextEvent)
{
super.contextInitialized(servletContextEvent);
String contextName =
servletContextEvent.getServletContext().getServletContextName(
);
}
protected ContextLoader createContextLoader()
{
return new CustomContextLoader();
}
class CustomContextLoader extends ContextLoader
{
protected ApplicationContext
loadParentContext(ServletContext servletContext)
{
//============================================================
=
//Here, returns the spring context to be used as
parent context
//============================================================
=
return
com.xyz.myapplication.MyApplicationContext.getContext();
}
protected WebApplicationContext