8.0

Table Of Contents
configManager.setLogLevel(STANDALONE_CLIENT_LOG_LEVEL);
configManager.setPingType(QPingTypeEnum.PING_SIMPLE);
QConnectionInfo connInfo = new QConnectionInfo();
connInfo.setServerName(<XPRESS_SERVER_NAME>);
connInfo.setServerPort(<XPRESS_SERVER_PORT>);
connInfo.setUserName(<XPRESS_SERVER_ADMIN_USER>);
connInfo.setPassword(<XPRESS_SERVER_ADMIN_PASSWORD>);
QHostSummary host = new QHostSummary();
host.setConnectionInfo(connInfo);
configManager.registerHost(host);
Once you have done so, you can use the embedded QuarkXPress Server Manager as shown below:
XMLRequest xmlRequest = new XMLRequest();
QRequestContext context = new QRequestContext();
context.setDocumentName(<SAMPLE_DOCUMENT>);
context.setResponseAsURL(false);
context.setRequest(xmlRequest);
QContentData response = QRequestProcessor.getInstance().processRequest(context);
System.out.println(response.getTextData());
Writing special request handlers
If you need to perform custom actions on specific flags, you need to define special flags and write
handlers for those. These flags can then be passed as GET parameters to the Servlet, as additional
QParam parameters in QCommand (executed using QManagerSvc.executeCommand), or as additional
NameValueParam parameters in a derived class of QRequest using
QManagerSDKSvc.processRequest. The servlet will automatically create parameters out of these flags
and set these in the command before sending it for execution.
To handle these special flags, you can write your request handler derived from the class
QRequestHandler. This new handler class can then be inserted anywhere in the chain of responsibility
pattern starting with QDocProviderImpl and ending with
QHostRequestHandler. Note: try not to change end points. In your handler implementation, handle your
special flags, and either return a response after handling or pass the control to the successor for further
handling.
Implementing a custom load balancer for
QuarkXPress Server Manager
1.
1.
Implement the com.quark.manager.lb.QLoadBalancer interface.
1.
To use this interface, add a reference to managerengine.jar in your project.
1.
This interface method contains the following methods.
getLoadBalancerAlgorithm
Signature
public String getLoadBalancerAlgorithm();
Description
Returns the name of the algorithm that is mapped
to the current load balancer while loading the
server.
Page 36