This Guide provides numerous sample URLs in QuarkXPress Server format. To convert
these examples for use with QuarkXPress Server Manager, simply insert /
quark/servlet/qxpsm after [port]/ .
Versions of QuarkXPress Server Manager prior to 7.22 required absolute paths. You can
now use both absolute and relative paths when you modify a project with SDK objects or
classes. Relative paths are almost always relative to the document pool. If you use multiple
QuarkXPress Server instances, you should use a common document pool.
Interpreting the QXP Server Manager response
When QuarkXPress Server Manager successfully processes a request through the HTTP
interface, the response is the same as QuarkXPress Server's response unless the user has
supplied additional parameters to QuarkXPress Manager. For more information, see
"Working with QuarkXPress Server Manager" in A Guide to QuarkXPress Server.
If an error occurs, QuarkXPress Server Manager retries the request, either on the same
QuarkXPress server instance or a different one (depending on the error and global settings
established in the QuarkXPress Server Manager client). If QuarkXPress Server Manager
cannot process the request, it returns an XML response describing the error, plys any
header error codes returned by QuarkXPress Server. For example:
<?xml version="1.0" encoding="UTF-8" ?>
<error>
<httpresponsecode>404</httpresponsecode>
<xpressservererrorcode>-43</xpressservererrorcode>
<xpressservererrormessage>File not found.</xpressservererrormessage>
<xpressserverextendedmessage> <![CDATA[ Error #-43 - File not found. ]]>
</xpressserverextendedmessage>
<xpressservermanagererrorcode>M8000001</xpressservermanagererrorcode>
<xpressservermanagererrormessage>The server could not locate the specified
file.
</xpressservermanagererrormessage>
</error>
HTTP GET and POST Requests
The topics below describe how you can use HTML to interact with QuarkXPress Server.
QuarkXPress Server supports both the GET and POST HTML methods. When you use the
GET method, the browser encodes form data into a URL. When you use the POST method,
form data is passed within the message body. Use the GET method only when the form
processing is idempotent. In short: GET is for retrieving data, whereas POST can involve
storing or updating data, ordering a product, or sending an e-mail.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 13
GETTING STARTED
Using HTTP GET with QXP Server
Use HTML like the following to specify a server and port where you want to send a request.
You can specify the name of the target project, the output type, and a scaling value. You
can specify the name of a box and the path of a text or picture files to import into that
box, as long as the file's path is on the server's file system. You can also use HTML like the
following to specify the page number and layout number of the project.
The form section of the HTML should begin with the following line of code:
<form id = form1 method="GET" enctype="application/x-www-form-urlencoded">
For both GET and POST, the browser constructs a form data set and encodes it according
to the ENCTYPE attribute (you can use multipart/form-data for POST and
application/x-www-form-urlencoded (the default) for both POST and GET).
To create fields that let the user specify the server IP address, the port, and the project
The form's method is POST. The user agent conducts an HTTP post transaction using the
value of the action attribute (the URL), and a message is created according to the content
type specified by the enctype attribute.
Using HTTP POST with QXP Server Manager
HTTP POST with QuarkXPress Server Manager works the same way as HTTP POST with
QuarkXPress Server (see "Using HTTP POST with QXP Server"), except that with
QuarkXPress Server Manager, you must use UTF-8.
Getting started: Web services
The Web services interface is a collection of request classes. You can download the SDK
WSDL class definitions from
http://<server>:<port>/quark/services/qxpsmsdk?wsdl (replace <server> with
the QuarkXPress Server Manager computer's IP address and <port> with the
QuarkXPress Server Manager port number.
These classes can be chained together to form compound QuarkXPress Server requests.
The sample applications (see "Sample applications") show how to use these classes to invoke
a QuarkXPress Server command and manipulate the response.
For more information, see "Using the Web interface." In addition to the classes listed there,
the Web services interface includes the following:
•
QManagerSDKSvc processes QuarkXPress Server requests. This object's generic
processRequest() method takes a QRequestContext argument and returns a
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 17
GETTING STARTED
QContentData object containing the response. For more information, see the sample
applications and "Using the Web interface."
•
QRequestContext is the argument you pass to QManagerSDKSvc. This object contains
settings which must be set once per request. Set all chained requests inside the request
context.
•
QRequest is the base class for all request objects (such as PDFRenderRequest).
Consequently, all request objects share some common data members.
•
RequestParameters is a generic class for executing any request and for adding dynamic
properties to a request.
•
NameValueParam is a generic class for adding dynamic properties to a request. This class
is specifically for requests that take a box's name and/or ID as the parameter name and
the box's content as the value.
•
QContentData is the response returned when a request is executed. QContentData is a
hyperlink that follows the same pattern as the classes above.
•
QException is the exception class for QuarkXPress Server Manager. This object is returned
by the getErrorObject() method.
Description
•
QManagerScriptingSvc is the Web services scripting interface.
You can extend the WIG to include your own XTensions software applications by simply
modifying an XML file and redeploying the WIG Web service.
To exclude empty tags in the request HTML, set the value of the appropriate variable to
null.
For Javadocs, WSDL schemas, and JSP samples, see the Welcome page that displays when
you launch QuarkXPress Server Manager.
The following topics describe the general Web services classes.
QRequestContext
An argument passed to QManagerSDKSvc. Contains settings that must be set once per request. All
chained requests must be set inside the request context.
Web service data objectType
NameMembers
documentName
DescriptionTypes
File or object name on which the command will be rendered.String
serverName
serverPort
userName
userPassword
String
18 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Server name. Default is NULL. Load balancer searches for the host
itself in this case.
Port at which the desired server is listening.Integer
Max number of times to try executing the command before
returning failure.
Max time out in milliseconds.Integer
Indicates whether the cache should be checked for an existing
result or if the command should be executed again.
This value indicates whether the server should send the response
as-is (text or binary) or store the response on the server and return
its location as a URL. Because the object model works on SOAP,
which can be slow when transferring large binary files, you might
choose to set this value to "true" if you suspect that the response
is going to be several megabytes or larger.
Indicates whether file info should be fetched before executing the
command.
Context in which the command is being executed.String
QuarkXPress Server request is instances of request objects chained
together.
Description
Methods
//Create the service and call it QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
QManagerSDKSvc
Web service called to process the QuarkXPress Server request. QManagerSDKSvc has a generic method
named processRequest() that takes QRequestContext as an argument and returns QContentData
as the QuarkXPress Server response.
Web serviceType
processRequest
createSession
Processes the request context and returns the result.
DescriptionTypeParameter
QRequestContextrequestCmd
Creates a new session and returns a session ID.
timeout
Long
Argument passed to
QManagerSDKSvc. Contains settings
that must be set once per request.
All chained requests are set inside
the request context.
DescriptionTypeParameter
Timeout for the session in
milliseconds. If no call is executed
in that time, session is expired and
all the open documents in that
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 19
GETTING STARTED
session are closed without saving. If
0 is passed as value of timeout,
default timeout is used. If a negative
value is passed as timeout, the
session never expires.
closeAlldocs
closeDoc
closeSession
Closes all open documents in the session without saving them. If the session
does not exist, an error is returned. If an error occurs while closing the
document, it is logged and the document is marked closed in the internal
cache. No error is returned.
DescriptionTypeParameter
sessionId
Closes the specified document without saving it. If the session does not exist,
an error is returned. If the document is not open, and error is returned. If the
document is open in another session, an error is returned. If an error occurs
while closing the document, it is logged and the document is marked closed
in the internal cache. No error is returned.
docName
sessionId
Closes the specified session. If the session does not exist, an error is returned.
If any documents are still open in the session, an error is returned.
String
String
Session whose documents are to be
closed.
DescriptionTypeParameter
Document to be closed.String
Session in which document was
opened.
DescriptionTypeParameter
getErrorObject
getOpenDocs
getOpenSessions
getPreferences
setPreferences
getXPressDOM
sessionId
Gets the internal error object. If you receive an exception from Web services,
and that exception was caused by QuarkXPress Server or Manager (rather than
a runtime exception such as a null pointer exception), you can call this method
and pass a stringified form of the exception. The method returns an error
object which has easy-to-use methods for getting the error code, getting the
error message, and so forth.
Gets all the open documents in the session. If the session does not exist, an
error is returned.
sessionId
Gets all open sessions.
Gets QuarkXPress Server preferences.
Sets QuarkXPress Server preferences.
Creates a DOM for the specified document.
String
Session to be closed.String
DescriptionTypeParameter
Session whose open documents are
sought.
20 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
GETTING STARTED
newDoc
Creates a new document for modification and keeps it open until further
notice. The document is created with a single layout. To create a more complex
document, use the processRequestEx API. If a document with the same name
is already open, an error is returned. If the session does not exist, an error is
returned.
DescriptionTypeParameter
docName
jobJacketName
jobTicketName
host
String
String
String
Document to be opened for
modification. Provide the name
only. You can proivde a relative
path when you save the document.
Name of the Job Jackets file to be
used. The Job Jackets file is assumed
to be already available on the
QuarkXPress server computer.
Name of the Job Ticket to be used.String
The QuarkXPress Server instance
that should be used for this
document modification. If null, this
value is supplied by the load
balancer. If the indicated server is
not an active registered server, an
error is thrown.
openDoc
port
sessionId
Opens the specified document and keeps it open until further notice. If the
document is already open, an error is returned. If the session does not exist,
an error is returned.
docName
host
port
sessionId
Integer
String
String
String
Integer
String
The port for the server specified in
the host parameter.
Session in which the document
should be opened.
DescriptionTypeParameter
Document (along with relative path
if required) to be opened for
modification.
QuarkXPress Server instance which
should be used for this document
modification. If null, this value is
supplied by the load balancer. If the
indicated server is not an active
registered server, an error is thrown.
The port for the server specified in
the host parameter.
Session in which the document
should be opened.
processRequestEx
Executes the request context. If a session ID is specified, the document is kept
open after the request is executed. If no session ID is specified, the request is
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 21
GETTING STARTED
executed normally without keeping the document open. If the document is
open in another session, an error is returned. If the document is marked dirty,
an error is returned (a document is marked dirty when the server that opened
the document has become inactive; in such a case, the document must be
closed and opened again).
DescriptionTypeParameter
saveAllDocs
QRequestContextreqContextObj
sessionId
Saves all open documents in the session. The documents are saved one by
one. If error occurs while saving a document, an error is returned immediately
and the rest of the documents remain unsaved. If a document is marked dirty,
an error is returned (a document is marked dirty when the server that opened
the document has become inactive; in such a case, the document must be
closed and opened again).
relativePath
String
String
Request to be executed.
Session in which the request should
be executed. This value may be null.
If a session ID is provided, the
document is kept open. If no session
ID is provided, the request is
executed normally, as if
processRequest had been called.
DescriptionTypeParameter
Relative path where open
documents should be saved. If this
value is provided, copies of open
documents with changes made so
far are saved in the new location.
The open documents are not saved
but have all of the changes made so
far.
saveDoc
sessionId
Saves the open document. If a document is marked dirty, an error is returned
(a document is marked dirty when the server that opened the document has
become inactive; in such a case, the document must be closed and opened
again).
docName
newName
relativePath
String
String
String
String
Session in which the document
exists.
DescriptionTypeParameter
Document to be saved. Must be the
same name that was used when
opening or creating the document.
New name of the document. If null,
the document is saved with the old
name.
Relative path where the document
should be saved. The relative path
can also contain the new name of
the document. If this is provided, a
copy of the open document with
22 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
GETTING STARTED
changes made so far is saved in the
new location. The open document
is not saved but has all of the
changes made so far.
JPEGRenderRequest jpegRequest = new JPEGRenderRequest();
rc.request = jpegRequest;
QManagerSDKSvcService svc = new QManagerSDKSvcService();
QContextData response = svc.processRequest(rc);
Lets you create a DOM of a particular layout or portion of a layout.
Creates an XML string out of the DOM.
Takes a raw XML representation of a project as a string and returns an object
model representing that project, with Project as the root class.
String
Session in which the document
exists.
QRequest
Base class for all request objects (such as PDFRenderRequest). All request objects share some common
data members, which are described below.
Web service data objectType
Additional
comments
NameMembers
QRequestrequest
DescriptionTypes
QuarkXPress Server request that includes instances of request objects
chained together.
RequestParameters
Generic class for executing any request and for adding dynamic properties to a request.Description
Web service data objectType
NameMembers
namespace
NameValueParam[]params
You can use this class to send any request for which a specific class does not exist. When this
request exists in the chain, its namespace is concatenated with the namespaces of other requests.
That means the namespace provided here can be null.
The parameters of this class can be used to parameterize a request being sent to the server.
DescriptionType
Namespace of the request (for example, jpeg).String
Parameter array for the specified request (for
example, jpegquality).
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 23
GETTING STARTED
Example, object
model
Description
QRequestContext rc = new QRequestContext();
RequestParameters request = new RequestParameters();
request.setNamespace("jpeg");
rc.setRequest = request;
NameValueParam p1 = new NameValueParam();
p1.setParamName = "jpegquality";
p1.setTextValue = "4";
request.setParams(new NameValueParam[]{p1});
NameValueParam
Generic class for adding dynamic properties to a request. This class is specifically for requests that take
a box name/id as the parameter name and the box content as the parameter value.
Web service data objectType
NameMembers
paramName
textValue
streamValue
String
String
byte[]
DescriptionType
Name of the parameter. In most cases this will be the name/ID of
the box.
Text value of the box. (You can set either textValue or
streamValue.)
Stream value of the box. (You can set either textValue or
streamValue.)
contentType
QContentData
A response to a Web Services call to QuarkXPress Server.Description
Web service data objectType
NameMembers
contentType
textData
responseURL
streamValue
encodingType
actualServerPortUsed
The MIME content type of the parameter.String
String
String
String
binary
String
DescriptionTypes
The type of the response. For example, "text/xml" or
"text/plain."
If the response type is text, this contains the text.
Otherwise, this value is null.
If the responseAsURL parameter was set to "true" in the
request, this contains the URL of the response.
Otherwise, this value is null.
If the response type is binary, this contains the byte
array. Otherwise, this value is null.
If the response type is text, this value indicates the
encoding of the text (for example, UTF-8 or ANSI).
Identifies the server port.String
actualServerUsed
24 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Identifies the server.String
GETTING STARTED
Example, object
model
Description
Type
headers
multipartResponse
QRequestContext context = new QRequestContext();
context.setDocumentName("sample.qxp");
context.setResponseAsURL(true);
JPEGRenderRequest request = new JPEGRenderRequest();
request.setJPEGQuality("4");
context.setRequest(request);
QManagerSDKSvcServiceLocator serviceLocator = new
QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
QContentData response = service.processRequest(context);
System.out.println(response.getResponseURL());
String
String
If the response returned by the server is a set of headers,
this array contains the header response.
If the response returned by the server is multipart, this
array contains the multipart response parts.
QException
Exception class for QuarkXPress Manager. This class is returned by the getErrorObject method.
Exception
NameMembers
httpResponseCode
DescriptionTypes
HTTP response code.String
Example,
object model
managerErrorCode
managerErrorMessage
serverErrorCode
serverErrorMessage
serverExtendedMessage
String docName = "notexisting.qxp";
try {
QRequestContext ctx = getRequestContext(docName);
QRequest request = getJPEGRequest();
ctx.setRequest(ctx);
QContentData response = getService().processRequest(ctx);
System.out.println(response.getResponseURL());
}
catch (Exception ex) {
//PLEASE NOTE that the following would work only if
//QuarkXPress Manager threw an exception and it is not
//a runtime exception. In latter cases, an empty
//error object will be returned.
QException error = getService().getErrorObject(ex.toString());
System.out.println(error.getServerErrorCode());
}
QuarkXPress Server Manager error code.String
QuarkXPress Server Manager localized error message.String
QuarkXPress Server error code.String
QuarkXPress Server response message.String
QuarkXPress Server extended error message.String
QManagerScriptingSvc
Scripting interface via Web service.Description
Web service data objectType
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 25
GETTING STARTED
Methods
checkScriptSyntax
deleteScript
executeScript
executeScriptFunction
executeScriptFunctionWithArguments
Checks the syntax of a script.
DescriptionTypeParameter
id
Deletes a script.
id
Executes a script.
id
Executes a function of a script.
id
function
Executes a function of a script, with passed arguments.
Script ID.String
DescriptionTypeParameter
Script ID.String
DescriptionTypeParameter
Scipt ID.String
DescriptionTypeParameter
String ID.String
Function to execute.String
executeScriptWithVars
getAllScripts
getErrorObject
getScript
DescriptionTypeParameter
id
function
arguments
Executes a script with variables for the script to use.
id
Gets all scripts saved with the system.
Creates an error object from a error string.
errorString
Gets the script with the specified ID.
String[]
QScriptVar[]variables
String ID.String
Function to execute.String
Arguments to pass to
function.
DescriptionTypeParameter
Script ID.String
Variables to be used by
script.
DescriptionTypeParameter
Error string to use.String
getScriptExecutionDetails
26 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
id
Gets the runtime details of a script.
DescriptionTypeParameter
Script ID.String
GETTING STARTED
DescriptionTypeParameter
Script ID.String
DescriptionTypeParameter
Language to check.String
DescriptionTypeParameter
Script to update or add.
getSupportedLanguages
isLanguageSupported
updateScript
scriptId
Gets the supported scripting languages.
Checks whether a particular scripting language is supported.
language
Updates a script. If the script does not exist, this function
adds it.
QScriptscript
QXP Server Manager
The following topics are for people 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 was developed using interface-based programming and uses
the Spring Framework to instantiate pluggable objects. When QuarkXPress Server Manager
starts up, it reads the contents of a Spring context definition file named
"ManagerContainerConfig.xml" and instantiates all of the beans listed in the file.
QuarkXPress Server Manager then initializes by reading various configuration options
from a file named "ManagerConfig.xml."
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 "cache.xml" file, which
is located in Tomcat's conf/Catalina/localhost folder.
If QuarkXPress Server Manager needs to be hosted in another web server, you can write
your own adapter or use QDefaultContainerAdapterImpl (which is 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 can be set using the
Spring configuration file or the setCacheFolderRelativePath method.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 27
GETTING STARTED
Embedding QXP Server Manager
You can embed QuarkXPress Server Manager in applications (stand-alone or otherwise).
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, like so:
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 them. 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. You can then insert this new handler class anywhere in the chain of
responsibility pattern, starting with QDocProviderImpl and ending with
QHostRequestHandler.
Try not to change end points. In your handler implementation, handle your special flags,
then either return a response after handling or pass the control to the successor for further
handling.
28 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Implementing a custom load balancer
To implement a custom load balancer, first implement the
com.quark.manager.lb.QLoadBalancer interface. To use this interface, add a reference
to "managerengine.jar" to your project.
This interface method contains the following methods:
getLoadBalancerAlgorithm
GETTING STARTED
Signature
Description
getLoadBalancerDescription
Signature
Description
useFileInfo
Signature
Description
Returns
getAvailableHost
Signature
public String getLoadBalancerAlgorithm();
Returns the name of the algorithm that is mapped to the current load balancer while loading
the server.
The algorithm name used to load-balance the list of hosts.Returns
public String getLoadBalancerDescription();
Gets the description of the load-balancing algorithm so it can be displayed in the
QuarkXPress Server Manager client.
Description of the load balancer.Returns
public Boolean useFileInfo();
Gets a flag that indicates whether the load balancer uses file information to decide on
which host to use.
True if the fileinfo command should be fired before rendering, otherwise false.
public QHostProxy getAvailableHost(QHostProxy[] hosts, QCommand
command);
Parameters
Gets an available host out of the provided list of hosts to execute the specified command.Description
hosts: List of hosts that should be scanned for the most eligible host.
command: Command for which host is being searched.
Available host. Can be used for next request.Returns
Next:
Make a jar for the load balancer.
1
Deploy the jar to the following folder: {Apache-Tomcat
2
Home}\webapps\axis\WEB-INF\lib
Configure "ManagerContainerConfig.xml" for bean mapping:
3
1
Navigate to {Apache-Tomcat Home}\webapps\axis\WEB-INF\classes .
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 29
GETTING STARTED
2 Open the "ManagerContainerConfig.xml" file and look for the XML tag bean whose
id has the value ConfigurationManager.
3
Within that tag find the property name availableLoadBalancers.
4
In the <list> tag, add the following: <ref bean={your newbeanID}/>
5
Above this ConfigureManager tag, define the bean ID as your new bean ID: <bean
Execute Server/utilities/ClientSDKRequestObjectGenerator.sh (Mac OS) or
3
Server/utilities/ClientSDKRequestObjectGenerator.bat (Windows) and look
for errors. If you encounter an error, address the problem, then execute
ClientSDKRequestObjectGenerator again. When the process completes successfully,
"managersdkro.jar", "managerdomgenerator.jar", and "managerrequestserializer.jar" are
regenerated in the webapps/quark/WEB-INF/lib folder. Check the timestamps to verify
that the files are new.
Launch QuarkXPress Server Manager.
4
Modify Server/utilities/deploy_sdk.wsdd to add the bean mapping for the newly
5
generated class. To make change tracking easier, position the mapping within the classes
to match the position of any changes made to the DTD or XML.
Edit Server/utilities/deploy.sh (Mac OS) or Server/utilities/deploy.bat
6
(Windows) to change the port number where QuarkXPress Server Manager is running (if
it is different from 8090).
Execute Server/utilities/deploy.sh (Mac OS) or Server/utilities/deploy.bat
7
(Windows) and check for errors.
30 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
GETTING STARTED
Open a Web browser and enter the following URL:
8
http://localhost:8090/quark/services/qxpsmsdk?wsdl. Verify that the class you
just added is visible in WSDL.
Generating new SDK stubs
To generate new stubs:
Execute Server/utilities/stub.sh (Mac OS) or Server/utilities/stub.bat
1
(Windows) and look for errors. If you encounter an error, address the problem, then execute
Server/utilities/stub.sh or Server/utilities/stub.bat again. If the process
succeeds, "managerwebservicestubs.jar" is generated in the Server/utilities directory.
You can use these Java stubs in Java applications that communicate with QuarkXPress Server
Manager.
If the application you are developing is in Visual Studio .NET, then you need to generate
2
stubs again. Simply open your solution in Visual Studio, then either refresh the Web service
reference or remove the Web service reference and then add it again.
Understanding ManagerSDK.xml
"ManagerSDK.xml" is used to generate client SDK classes for QuarkXPress Server requests.
Each element in "ManagerSDK.xml" corresponds to a request handler, a render type, or
an element in the DTD.
A client SDK class is generated for each element in the XML. Each property in the DTD
and each parameter of the request handler or render type also corresponds to a unique
element in the XML.
A Class variable is generated for each property, as follows.
•
<Class>: One element for each SDK class generated. The class generated is derived from
QRequest. Attributes are:
•
name: The name of the generated class.
•
namespace: The namespace recognized by QuarkXPress Server when this request
class is translated into a QuarkXPress Server request.
•
description: A description of the class. Unless this value is null, the description
forms the header of the generated class and is included in the generated API docs.
•
alias: The alias to be used as an element name if this request class is serialized to
XML. For example, when the Project class is serialized to XML, the element used
is Project.
•
serializeAs: Determines how the class is serialized. The valid values are:
•
nameValue indicates that all members of the class should be handled as
name-value pairs in the request to QuarkXPress Server. (This is the default
option in JPEGRenderRequest and ModifierStreamRequest.)
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 31
GETTING STARTED
•
xml indicates that the class should be serialized as XML with the class name
or alias as the element value. All of the fields of the class are serialized as
child elements. If the field is a subclass of QRequest, it is processed
recursively. If the field is an array, it must be an array of QRequest-derived
classes.
•
mixed indicates that the class should be serialized as XML with the class
name or alias as the element. All the primitive fields of the class are serialized
as attributes. If the field is a subclass of QRequest, it is serialized as a child
element and processed recursively. If the field is an array, it must be an array
of QRequest-derived classes.
•
attribute indicates that the class should be serialized as XML with the
class name or alias as the element. The class must be primitive. All such
fields must be serialized as attributes of the element. Also, "value" fields
must be serialized as values of the element. Valid only if the parent class
has a serializeAs value of "xml" or "mixed."
•
<Attribute>: One element for each class field.
•
name: The name of the generated class variable.
•
accessor: The name of the accessor that gets the property. If this value is null, the
default accessor name is used. The default name is "get" + CamelCase(name) (for
example, if the name of the property is "quality," the default accessor method is
getQuality).
•
mutator: The name of the accessor that sets the property. If this value is null, the
default mutator name is used. The default name is "set" + CamelCase(name) (for
example, if the name of the property is "quality," the default mutator method is
setQuality).
•
description: A description of the attribute. Unless this value is null, the description
is included in variable headers and accessor and mutator headers and is included in
generated API docs.
•
type: The type of the class variable. If this value is null, the default type (string)
is used. If this is not a primitive data type, it should be defined as a separate Class
element. If this attribute has a value of "reference," it means the class defined by name
is a reference that will be used by a reference attribute in the same Class element.
Before serialization, the referring values are set in this instance.
•
reference: Unless this attribute has a null value, during serialization the value of
the field should be set in the reference class provided. Note that the reference class
should be declared using "type=reference" as explained above.
•
readonly: If this value is true, this field is for read-only purposes and should be
ignored during serialization.
•
hidden: If this value is true, this field should be generated as a private variable. As
such, it would not be included in WSDL.
32 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
GETTING STARTED
•
deprecated: If this value is true, this field has been deprecated, should not be used,
is not supported, and will be removed in a future version of QuarkXPress Server.
•
cdata: If this value is true, the value of this field is to be wrapped in a cdata section
before being sent to QuarkXPress Server. This is valid only if the field is "value", that
is value of the element in modifier XML.
•
<others>: If any other attributes are defined, a class field with the name as
<name>_<others> is created, and you can write your own implementation for it.
Scripting support
You can write server-side scripts for QuarkXPress Server Manager. These scripts are actually
clients that run in the same context as QuarkXPress Server Manager in Tomcat, but do not
have the overhead of SOAP.
Although you can write scripts with almost any script-editing application, you might want
to use the QuarkXPress Server Manager Scripting Environment, which ships with
QuarkXPress Server Manager. You can use this application to write scripts, run scripts
manually, and schedule scripts to start and end at specific times or until specific conditions
are met.
QuarkXPress Server Manager also includes a number of sample scripts and libraries for
reference. The libraries include ready-to-use functions. The samples show you how to use
the libraries, and also how to write scripts without using those libraries.
When writing scripts, you can directly access the functions named print, readUrl,
QuarkXPress Server Manager Scripting Environment and open the sample scripts to see
how these functions are used.
By default, the scripting environment uses the file system to store the scripts. However, if
the need arises, you can write a custom implementation of the storage provider by
implementing the QScriptStorage interface and configuring the Spring configuration
file, "ManagerContainerConfig.xml." Scripts you save in this way can also be executed
remotely using Web services; for more information, see "QManagerScriptingSvc."
Keep document open (sessions)
In early versions of QuarkXPress Server Manager, the software opened a QuarkXPress
project, performed a function, and then closed the project. To avoid the delays involved
in repeatedly opening and closing a QuarkXPress project, QuarkXPress Server Manager
can now keep QuarkXPress projects open until they need to be closed.
To keep projects open for a set period of time, create a session and then open one or more
projects in that session. You can specify a timeout interval while creating the session. If
the session is not used during the interval, all open projects in that session are closed.
An open project can be modified and saved at any time during the process. An open project
can even be saved at another location relative to the QuarkXPress Server document pool.
You can also create a new project and keep it open.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 33
GETTING STARTED
For an example of session management, see the dynamicfit scripting sample included
with QuarkXPress Server Manager. This script opens a session, opens a QuarkXPress project,
and then modifies a text box until the text in it fits.
34 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Using the Web interface
The topics below describe the features available via the QuarkXPress Server Web interface.
The topics covered here include the following:
• Render types are namespaces you can use to return a QuarkXPress project in a specified file
format.
• Render modifiers let you control which parts of a project are rendered and set the scale of
the returned renderings.
USING THE WEB INTERFACE
• Content modifiers let you alter the content and formatting of boxes in layouts without using
the XML modify parameter.
• XML modify lets you modify QuarkXPress projects using XML.
•
The xml namespace deconstructs a project according to the Modifier DTD. The construct
namespace lets you turn an XML representation of a QuarkXPress project back into a
QuarkXPress project.
• Administrative request handlers let you change the behavior of QuarkXPress Server.
QuarkXPress Server uses case-sensitive XML.
Understanding rendering
Rendering is the process in which QuarkXPress Server opens a QuarkXPress project,
transforms it into a different format (the render type), and then sends a response to the
requestor. Depending on the type of rendering operation, the response may be a message
or a rendered file.
For information on how to submit a render request, see "Getting started: HTTP."
Alerts
document type.
Please select a
QuarkXPress
document or
template.
HTTP Error #500Cannot open this
This alert displays if you try to render a file that is not a QuarkXPress project
that exists in the document pool.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 35
USING THE WEB INTERFACE
document pool is
not enabled.
read or write to disk.
required volume or
folder.
HTTP Error #404The file system
This alert displays if the file system document pool is disabled.
What to do: In QuarkXPress Server, choose QuarkXPress Server > Server
Configuration to display the Server Configuration dialog box, then check
Enable File System Document Pool.
HTTP Error #404File not found
QuarkXPress Server Error #–43
This alert displays if you try to render a project that does not exist.
HTTP Error #500I/O error trying to
QuarkXPress Server Error #–36
This alert displays if QuarkXPress Server is running on Windows and a shared
network folder was selected as the document pool, but the folder is no longer
shared.
What to do: In QuarkXPress Server, choose QuarkXPress Server > Server
Configuration to display the Server Configuration dialog box, then choose
a shared folder.
HTTP Error #404Cannot find
QuarkXPress Server Error #–35
This alert displays if QuarkXPress Server is running on Mac OS and a shared
network volume was selected as the document pool, but the volume is no
longer shared.
What to do: In QuarkXPress Server, choose the menu option
QuarkXPress Server > Server Configuration to display the Server
Configuration dialog box, then choose a shared volume.
Logs
Example, GET
URL
Understanding render types
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the QuarkXPress Server Error Log file contains the date and time of the request,
the error code, and the error message. The following is a sample of an error log transaction entry:
8/4/2005 13:51:32 — Error — Error Code: 10119 — Cannot open this document type. Please select
a QuarkXPress project or template.
http://localhost:8080/sample.qxp
There are two ways to specify a render format:Notes
1. Enter the render type directly in the browser address
field:http://localhost:8080/pdf/project.qxp.
2. In QuarkXPress Server, choose QuarkXPress Server > Server Configuration to display the
Server Configuration dialog box, then choose the default render type from the Default Render
Type drop-down menu in the Server tab.
Render types are namespaces you can use to return a QuarkXPress project in a specified file
format. The topics covered here include the following:
36 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
QuarkXPress Server Manager object model classesDescriptionFunction
raw
Returns an EPS file.eps
Returns a JPEG image.jpeg
Returns a PDF file.pdf
Returns a PNG image.png
Returns a PostScript file.postscript
Returns PPML output.ppml
Returns a QuarkCopyDesk article.qcddoc
Returns a QuarkXPress project file.qxpdoc
Returns an RLE Raw Custom format image.qxpr
Returns a project in a QuarkXPress internal
format.
Returns a low-resolution PDF file.screenpdf
Returns a SWF file.swf
The default render type is JPEG.
EPSRenderRequest
JPEGRenderRequest
PDFRenderRequest
PNGRenderRequest
PostScriptRenderRequest
PPMLRenderRequest
CopyDeskDocRequest
QuarkXPressRenderRequest
RLERawCustomRenderRequest
RawCustomRenderRequest
ScreenPDFRenderRequest
SWFRenderRequest
Namespace
Parameters
Developers can implement additional rendering formats through server XTensions software.
eps
The eps render type returns an EPS rendering of a page or spread.
EPS
outputstyle
epsformat
epspreview
stylename
color | dcs2
tiff | none
Lets you specify an output style. To
use a named output style, use the
name of that output style. For
example:
Lets you specify an EPS format. The
default value is color.
Lets you include or omit a TIFF
preview. The default value is tiff.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 37
USING THE WEB INTERFACE
Render modifier
parameters
epsdata
epstransparent
page
produceblankpages
scale
spread
layout
downloadlayoutFonts
ascii | binary |
clean8bit
1 | 0 | true | false
| yes | no
1 | 0 | true | false
| yes | no
Float .1 to 6.92
for Windows .1
to 8 on Mac OS
Integer
String
1 | 0 | true | false
| yes | no
Lets you specify a data type for the
EPS file. The default value is
clean8bit.
Lets you specify whether the EPS
can include transparent areas.
Lets you specify a page.Integer
Lets you specify whether to render
blank pages.
Lets you specify a scaling
percentage. The valid values are
from .1 (10%) to 8 (800%) on
Mac OS or 6.92 (692%) on
Windows.
Lets you specify a spread. The first
spread is spread 1. In a facing-page
document, spread 1 consists of the
first page.
Lets you specify a layout by name
or ID. The first layout is Layout 1.
Lets you specify whether to
download all fonts used in the
layout and all system fonts.
Alerts
Logs
downloadImportedPdfEpsFonts
An EPS file.Response
way of rendering the desired objects.
This Output Style does not exist.
This Output Style cannot be used with
this render type.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
If any alert is displayed, an error message is written to the QuarkXPress Server Error Log file.
The transaction entry in an error log contains the date and time of the request, the error code,
and the error message. The following is a sample of an error log transaction entry:
8/3/2005 11:27:24 — Error — Error Code: 10008 — The renderer for this image type has no
way of rendering the desired objects.
1 | 0 | true | false
| yes | no
HTTP Error #406The renderer for this image type has no
This alert displays if you submit a render request with
the pages or box parameter.
This alert displays if you specify a nonexistent output
style.
This alert displays if you specify an output style that
is incompatible with this render type.
Lets you specify whether to
download all fonts required by
imported PDF and EPS files.
//STEP1: Create the QuarkXPress Server Request
//Context and set the necessary properties
sdk.QRequestContext requestCtx =
new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):
//Create the EPS renderer
//request and embed it in the request context.
EPSRenderRequest epsreq = new EPSRenderRequest();
epsreq.setEPSData(request.getParameter("EPSData"));
epsreq.setEPSFormat(request.getParameter(
"EPSFormat"));
epsreq.setEPSPreview(request.getParameter(
"EPSPreview"));
requestCtx.setRequest(epsreq);
//STEP3: Create the WIG service and call the
//processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service =
serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(
requestCtx);
Notes
Namespace
Parameters
You can specify an output style and set additional local parameters of that output style. For
example, if no bleed setting is specified in the output style named "mystylename", you can
specify a bleed setting with a URL like the following:
You can override settings in an output style. For example, if an asymmetric bleed is specified
in the output style named "mystylename," you could override it with the same URL.
If you do not specify an EPS output style, the default EPS output style is used.
jpeg
The jpeg render type returns a JPEG rendering of a page or spread.
JPEG
jpegquality
upadateimage
1 | 2 | 3 | 4
true | false
Lets you specify the image quality of a rendered JPEG image.
The valid values are: 1 (highest quality), 2 (high quality), 3
(medium quality), and 4 (lowest quality). The default value is 1.
Lets you specify whether to return modified pictures in the
response or not. If set to false, modified pictures are not
returned. If set to true, modified pictures are returned. The
default value is true.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 39
USING THE WEB INTERFACE
Render
modifier
parameters
Logs
pasteboard
boxes
page
scale
box
spread
layout
A JPEG file.Response
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contain the date and time of the request, the error code, and the
error message. The following is a sample of an error log transaction entry:
8/3/2005 11:27:24 — Error — Error Code: 10008 — The renderer for this image type has no way of
rendering the desired objects.
true | false
Float .1 to 6.92
for Windows .1
to 8 on Mac OS)
Integer
String
Lets you specify whether to display pasteboard items. Works
only with spread parameter. The default value is true. For
example:
//STEP1: Create the QuarkXPress Server Request
//Context and set the necessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP2: Create the JPEG renderer request and attach it
//to the request context.
JPEGRenderRequest jpreq = new JPEGRenderRequest();
jpreq.setJPEGQuality(request.getParameter("jpegQuality"));
jpreq.setLayout(request.getParameter("Layout"));
requestCtx.setRequest(jpreq);
//STEP3: Create the WIG service and call the processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(requestCtx);
40 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
literal
The literal render type returns the contents of a file without any attempt to process it
as a template. Depending on the file's MIME type, the requested project can be displayed
within the browser (for example, if the response is a JPEG file) or saved to disk (for example,
if the response is a Microsoft Word document).
Namespace
Alerts
Logs
Example, GET URL
Example, object
model
literal
The requested file returned in the HTTP response.Response
Incorrect
administration
realm username
and password.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
sdk.QRequestContext rc = new sdk.QRequestContext();
if(!this.DocumentSettings1.documentName.Text.Equals(""))
rc.documentName = this.DocumentSettings1.documentName.Text;
rc.request = new LiteralRequest();
HTTP Error #401
This alert displays if you specify an invalid administrator user name and
password.
What to do: Use the user name and password set in theQuarkXPress Server
Manager client Server Configuration dialog box.
Namespace
Parameters
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
pdf
The pdf render type returns a PDF rendering of a project.
PDF
outputstyle
stylename,
document
Lets you specify an output style. To use a named
output style, use the name of that output style.
For example:
Lets you specify the subject of the PDF file.String
Lets you specify the author of the PDF file.String
Lets you specify keywords for the PDF file.String
Lets you specify whether to include hyperlinks
in the PDF file.
Lets you specify whether to export lists as
hyperlinks. To use this parameter, you must set
includehyperlinks to true.
Lets you specify whether to export the index as
hyperlinks. To use this parameter, you must set
includehyperlinks to true.
Lets you specify whether to export lists as
bookmarks. To use this parameter, you must set
includehyperlinks to true.
Lets you specify whether the PDF file is a
composite or includes separations.
Lets you specify the color space of the PDF file.
This option is available only when mode is set to
composite.
plates
produceblankpages
useopi
images
registration
offset
bleed
offsetbleed
converttoprocess,
processandspot,
inripseps
1 | 0 | true |
false | yes | no
false | yes | no
includeimages,
omittiff,
omittiffandeps
off, centered,
offcenter
points)
symmetric
0–6 (in inches)
Lets you specify a separation method. This option
is available only when mode is set to
separations.
Lets you specify whether to include blank pages.
This option is available only when mode is set to
composite.
Lets you specify whether to use OPI.1 | 0 | true |
Lets you specify whether to include TIFF and EPS
images from an OPI server.
Lets you include, omit, and configure registration
marks.
Lets you specify the offset of registration marks.0–30 (in
Lets you specify a bleed type.pageitemsonly,
Lets you specify a bleed offset to use. This option
is available only when bleed is set to
symmetric.
42 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
spreads
lowresolution
colorimagedownsample
grayscaleimagedownsample
monochromeimagedownsample
colorcompression
grayscalecompression
monochromecompression
pdffile
false | yes | no
false | yes | no
9–2400
9–2400
true | false
true | false
true | false
String
Lets you specify whether to output spreads.1 | 0 | true |
Lets you request a low-resolution (36 dpi) PDF.1 | 0 | true |
Lets you specify the resolution of color images.9–2400
Lets you specify the resolution of grayscale
images.
Lets you specify the resolution of monochrome
images.
Lets you specify whether medium-quality manual
JPEG compression should be applied to color
images.
Lets you specify whether medium-quality manual
JPEG compression should be applied to grayscale
images.
Lets you specify whether ZIP compression should
be applied to monochrome images.
Lets you specify the PDF name. This option is
available only when PDF to Folder is selected in
QuarkXPress Server PDF preferences.
psfile
thumbnail
mode
fontdownload
layers
transparencyres
verification
separate
produceblankplates
download
String
separations
yes | no
String
Integer value
from 36 to
3600
yes | no
Boolean
1 | 0 | true |
false
Lets you specify the PostScript file name. This
option is available only when PostScript for laterDistilling is selected in QuarkXPress Server PDF
preferences.
Lets you embed a thumbnail in the PDF file.bw | color
Lets you specify the PDF file's color mode.composite |
Lets you turn font download on or off. You
cannot specify which fonts are downloaded.
Lets you specify which layers should be included,
as a comma-separated list.
Lets you specify the resolution for flattened
content.
Lets you use PDF/X–1a or PDF/X–3 verification.pdfx1a | pdfx3
Lets you specify whether to output each page as
a separate file.
Lets you specify whether to include blank plates.yes | no
When download is true, the browser always
displays a dialog box that lets the end user save
the returned file, even if the browser can display
it.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 43
USING THE WEB INTERFACE
When download is false, the browser attempts
to display the returned file. If the browser cannot
display the file, it lets the end user save the
returned file.
The default value is false.
Render modifier
parameters
layoutstart
layoutend
page
pages
spread
Integer
Integer
range)
Integer
Lets you specify the number of the first layout
to render when you render multiple layouts as
separate PDF files. PDF files are saved at the
location specified in QuarkXPress Server
preferences (Server/QuarkXPress Server >Preferences > PDF pane > PDF to Folder). The
first layout in a project is layout 0. For example:
Lets you specify the number of the last layout to
render when you render multiple layouts as
separate PDF files. PDF files are saved at the
location specified in QuarkXPress Server
preferences (Server/QuarkXPress Server >Preferences > PDF pane > PDF to Folder). The
first layout in a project is layout 0. For example:
Lets you specify a spread. The first spread is
spread 1. In a facing-page document, spread 1
consists of the first page.
layout
spreads
A PDF file.Response
requested contains only blank
pages.
This Output Style cannot be
used with this render type.
String
true | false | yes
| no
HTTP Error #500This page range is invalidAlerts
QuarkXPress Server Error #147
Lets you specify a layout by name or ID. The first
layout is Layout 1.
Lets you specify that the output use spreads.Boolean 1 | 0 |
This alert displays if you try to render an invalid page
range.
HTTP Error #500No file produced. The project
This alert displays if you try to render a a project that
contains only blank pages.
This alert displays if you specify a nonexistent output style.This Output Style does not exist.
This alert displays if you specify an output style that is
incompatible with this render type.
44 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
Logs
Example, GET
URL
Example, object
model
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and the
error message. The following is a sample of an error log transaction entry:
//STEP1: Create the QuarkXPress Server Request Context
//and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):
//Create the PDF renderer request
//and embed it in the request context.
PDFRenderRequest pdfreq = new PDFRenderRequest();
pdfreq.setAuthor(request.getParameter("Author"));
pdfreq.setTitle(request.getParameter("Title"));
pdfreq.setLayout(request.getParameter("Layout"));
pdfreq.setSpread(request.getParameter("Spread"));
pdfreq.setPage(request.getParameter("mPage"));
pdfreq.setPages(request.getParameter("Pages"));
if( strLowResolution !=null &&
strLowResolution.equals("True"))
pdfreq.setLowResolution("true");
requestCtx.setRequest(pdfreq);
Notes
//STEP3: Create the WIG service and
//call the processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service =
serviceLocator.getqxpsmsdk();
sdk.QContentData data =
service.processRequest(requestCtx);
For more information about the object model, see the samples.
There are three ways to generate PDF files with QuarkXPress Server. You can generate a PDF file in
QuarkXPress Server and return it to the end user, generate the PDF in QuarkXPress server and save
it to a folder on the server computer, or generate a PostScript file for later distilling and save it to
a folder on the server computer. To choose one of these output methods in QuarkXPress Server,
choose QuarkXPress Server > Preferences, click PDF in the list on the left, and then click PDFDirect, PDF to Folder, or PostScript for Later Distilling. If you choose either of the last two
options, click Browse and navigate to the target folder, then choose an option from the DefaultName drop-down menu.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 45
USING THE WEB INTERFACE
You can specify an output style and set additional local parameters of that output style. For example,
if no bleed setting is specified in the output style named "mystylename", you can specify a bleed
setting with a URL like the following:
You can override settings in an output style. For example, if an asymmetric bleed is specified in
the output style named "mystylename," you could override it with the same URL.
If you do not specify a PDF output style, the default PDF output style is used.
png
The png render type returns a PNG rendering of a page or spread.
Namespace
Parameters
Render modifier
parameters
PNG
pngcompression
upadateimage
boxes
page
scale
box
spread
layout
1 | 2 | 3 | 4
true | false
Float .1 to
6.92 for
Windows .1
to 8 on
Mac OS
Integer
String
Lets you specify the compression of a PNG response. The valid
values are: 1 (lowest compression), 2 (medium compression),
3 (high compression), and 4 (highest compression). The default
value is 1.
Lets you specify whether to return modified pictures in the
response or not. If set to false, modified pictures are not
returned. If set to true, modified pictures are returned. The
default value is true.
Lets you request multiple boxes.String
Lets you specify a single page.Integer
Lets you specify a scaling percentage. The valid values are
from .1 (10%) to 8 (800%) on Mac OS or 6.92 (692%) on
Windows.
Lets you request a single box.String
Lets you specify a spread. The first spread is spread 1. In a
facing-page document, spread 1 consists of the first page.
Lets you specify a layout by name or ID. The first layout is
Layout 1.
A PNG file.Response
Logs
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
8/3/2005 11:27:24 — Error — Error Code: 10008 — The renderer for this image type has no way
of rendering the desired objects.
//STEP1: Create the QuarkXPress Server Request
//Context and set the nescessary properties
sdk.QRequestContext rc = new sdk.QRequestContext();
Boolean responseAsURL = false;
rc.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):Create the PNG renderer
//request and embed it in the request context.
PNGRenderRequest pngreq = new PNGRenderRequest();
pngreq.setPNGCompression(request.getParameter(
"PNGCompression"));
pngreq.setLayout(request.getParameter("Layout"));
pngreq.setSpread(request.getParameter("Spread"));
pngreq.setPage(request.getParameter("mPage"));
rc.setRequest(pngreq);
//STEP3: Create the WIG service and call the processRequest(
//) API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(rc);
postscript
The postscript render type returns a PostScript rendering of a project.
To use settings that have been captured with the Capture
Settings in the QuarkXPress Print dialog box, use
document. For example:
http://localhost:8080/
postscript/
sample.qxp?outputstyle=document
Lets you specify a single page.Integer
Lets you specify a range of pages.String (page
Lets you specify a spread. The first spread is spread 1. In a
facing-page document, spread 1 consists of the first page.
Lets you specify a layout by name or ID. The first layout is
Layout 1.
Logs
HTTP Error #500No file produced.
The document
requested contains
only blank pages.
mapped to file not
found
does not exist.
This Output Style
cannot be used
with this render
type.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
8/2/2005 19:58:27 — Error — Error Code: 10121 — No file produced. The document requested
contains only blank pages.
This alert displays if you try to render a a project that contains only blank pages.
HTTP Error #500PostScript printer
This alert displays if the PostScript printer or driver is not set to Print to File.
This alert displays if you specify a nonexistent output style.This Output Style
This alert displays if you specify an output style that is incompatible with this
render type.
48 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
Example, GET
URL
Example, object
model
http://localhost:8080/postscript/Sample.qxp
Request object name: PostScriptRenderRequest
//STEP1: Create the QuarkXPress Server Request
//Context and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):
//Create the Post Script renderer
//request and embed it in the request context.
PostScriptRenderRequest pscreq =
new PostScriptRenderRequest();
pscreq.setPrintBleed(request.getParameter("PrintBleed"));
pscreq.setPrintPPD(request.getParameter("PrintPPD"));
pscreq.setPages(request.getParameter("Pages"));
requestCtx.setRequest(pscreq);
//STEP3: Create the WIG service and call the
//processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(requestCtx);
To create a PostScript file, you must have a PostScript driver on the server computer.Notes
You can specify an output style and set additional local parameters of that output style. For example,
if no bleed setting is specified in the output style named "mystylename", you can specify a bleed
setting with a URL like the following:
You can override settings in an output style. For example, if an asymmetric bleed is specified in
the output style named "mystylename," you could override it with the same URL.
If you do not specify a PostScript-compatible output style, the default PostScript-compatible output
style is used.
Namespace
Parameters
ppml
The ppml render type returns a PPML rendering of a page or spread.
PPML
outputstyle
path
stylename
String
Lets you specify an output style. To use a named output style,
use the name of that output style. For example:
Lets you specify a location for PPML output. For example:
path=C:\output
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 49
USING THE WEB INTERFACE
Render modifier
parameters
Alerts
layout
PPML output.Response
image type has no
way of rendering the
desired objects.
does not exist.
This Output Style
cannot be used with
this render type.
invalid.
XMLthexmldoc
XMLpaginate
String
HTTP Error #406The renderer for this
This alert displays if you submit a render request with the pages or box
parameter.
This alert displays if you specify a nonexistent output style.This Output Style
This alert displays if you specify an output style that is incompatible with
this render type.
HTTP Error #500The file path is
This alert displays if you specify an invalid path parameter.
Lets you supply XML that matches the placeholders in the
project.
Lets you supply XML that matches the placeholders in the
project. This parameter creates a new layout containing the
imported and formatted XML.
Lets you specify a layout by name or ID. The first layout is
Layout 1.
Logs
Example, GET
URL
Example, object
model
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If any alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in an error log contains the date and time of the request, the error code, and the
error message. The following is a sample of an error log transaction entry:
8/3/2005 11:27:24 — Error — Error Code: 10008 — The renderer for this image type has no way
of rendering the desired objects.
//STEP1: Create the QuarkXPress Server Request
//Context and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):
//Create the PPML renderer
//request and embed it in the request context.
PPMLRenderRequest ppmlreq = new PPMLRenderRequest();
ppmlreq.setExportPath(request.getParameter("path"));
ppmlreq.setLayout(request.getParameter("layout"));
ppmlreq.setOutputStyle(
request.getParameter("outputstyle"));
requestCtx.setRequest(ppmlreq);
50 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
//STEP3: Create the WIG service and
//call the processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data =
service.processRequest(requestCtx);
USING THE WEB INTERFACE
Notes
Namespace
Parameters
You can specify an output style and set additional local parameters of that output style. For example,
if no bleed setting is specified in the output style named "mystylename", you can specify a bleed
setting with a URL like the following:
You can override settings in an output style. For example, if an asymmetric bleed is specified in
the output style named "mystylename," you could override it with the same URL.
If you do not specify a PPML output style, the default PPML output style is used.
qcddoc
The qcddoc render type returns a QuarkCopyDesk article.
qcddoc
article
component
String
String
Lets you specify which article in a project to render.
For example:
in the article name can't be
greater than max limit.
The article/component
name is not unique.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message.
http://localhost:8080/qcddoc/copydesk/sample.qcd
This alert displays if the box corresoponding to a referenced component
does not exist.
This alert displays if an article name is longer than 32 characters.The number of characters
This alert displays if you create or change the name of an article or
component so that it is the same as the name of an existing article or
component.
Lets you modify the article with XML. For more
information, see "Using XML modify."
Example, object
model
Request object name: CopyDeskDocRequest
qxpdoc
The qxpdoc render type returns a QuarkXPress project.
Namespace
Parameters
qxpdoc
qxpdocver
upadateimage
saveastemplate
7 | 8 | korean6
| japanese6
true | false
true | false
52 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Indicates the QuarkXPress version format to use. For example:
Lets you specify whether to return modified pictures in the
response or not. If set to false, modified pictures are not
returned. If set to true, modified pictures are returned. The
default value is true.
Lets you save a copy of a project as a template. The default
value is true. For example:
this image type
has no way of
rendering the
desired objects.
QuarkXPress
Project down to an
earlier version.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
This alert displays if Disable QuarkXPress Document Return is checked in
the Server tab of the QuarkXPress Server Server Configuration dialog box
(QuarkXPress Server > Server Configuration).
HTTP Error #406The renderer for
This alert displays if you submit a qxpdoc render request with the page, pages,
box, or spread parameter.
HTTP Error #500Cannot save a
This alert displays if you attempt to save a QuarkXPress 6.x project to an earlier
version of QuarkXPress with the qxpdocver parameter.
Lets you specify a layout by name or ID. The first layout is
Layout 1.
Example, GET
URL
Example, object
model
http://localhost:8080/qxpdoc/sample.qxp
Request object name: QuarkXPressRenderRequest
//STEP1: Create the QuarkXPress Server Request
//Context and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):Create the QuarkXPress
//renderer request and embed it in the request context.
QuarkXPressRenderRequest qxpreq = new
QuarkXPressRenderRequest();
qxpreq.setDocumentVersion(request.getParameter(
"XpressDocVersion"));
qxpreq.setLayout(request.getParameter("Layout"));
requestCtx.setRequest(qxpreq);
//STEP3: Create the WIG service and call the processRequest(
) API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 53
USING THE WEB INTERFACE
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(requestCtx);
screenpdf
The screenpdf render type returns a low-resolution PDF rendering of a project. This
render type overrides the setting in the PDF Workflow area of the PDF pane in the
QuarkXPress Server Preferences dialog box (QuarkXPress Server > Preferences) and always
sends the PDF file to the browser.
Namespace
Parameters
Screenpdf
outputstyle
title
subject
author
keywords
includehyperlinks
exportlistsashyperlinks
stylename
1 | 0 | true | false |
yes | no
1 | 0 | true | false |
yes | no
Lets you specify an output style. To use a named
output style, use the name of that output style.
For example:
Lets you specify the subject of the PDF file.String
Lets you specify the author of the PDF file.String
Lets you specify keywords of the PDF file.String
Lets you specify whether to include hyperlinks
in the PDF file.
Lets you specify whether to export lists as
hyperlinks. To use this parameter, you must set
includehyperlinks to true.
exportindexesashyperlinks
exportlistsasbookmarks
mode
printcolors
plates
1 | 0 | true | false |
yes | no
1 | 0 | true | false |
yes | no
composite or
separations
cmyk, rgb,
grayscale,
cmykandspot, asis
converttoprocess,
processandspot,
inripseps
54 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
Lets you specify whether to export the index as
hyperlinks. To use this parameter, you must set
includehyperlinks to true.
Lets you specify whether to export lists as
bookmarks. To use this parameter, you must set
includehyperlinks to true.
Lets you specify whether the PDF file is a
composite or includes separations.
Lets you specify the color space of the PDF file.
This option is available only when mode is set to
composite.
Lets you specify a separation method. This option
is available only when mode is set to
separations.
USING THE WEB INTERFACE
produceblankpages
useopi
images
registration
offset
bleed
offsetbleed
spreads
lowresolution
1 | 0 | true | false |
yes | no
yes | no
includeimages,
omittiff,
omittiffandeps
off, centered,
offcenter
symmetric
0–6 (in inches)
yes | no
yes | no
Lets you specify whether to include blank pages.
This option is available only when mode is set to
composite.
Lets you specify whether to use OPI.1 | 0 | true | false |
Lets you specify whether to include TIFF and EPS
images from an OPI server.
Lets you include, omit, and configure registration
marks.
Lets you specify the offset of registration marks.0–30 (in points)
Lets you specify a bleed type.pageitemsonly,
Lets you specify a bleed offset to use. This option
is available only when bleed is set to symmetric.
Lets you specify whether to output spreads.1 | 0 | true | false |
Lets you request a low-resolution (36 dpi) PDF.1 | 0 | true | false |
colorimagedownsample
grayscaleimagedownsample
monochromeimagedownsample
colorcompression
grayscalecompression
monochromecompression
pdffile
psfile
9–2400
9–2400
true | false
true | false
true | false
String
String
Lets you specify the resolution of color images.9–2400
Lets you specify the resolution of grayscale
images.
Lets you specify the resolution of monochrome
images.
Lets you specify whether medium-quality manual
JPEG compression should be applied to color
images.
Lets you specify whether medium-quality manual
JPEG compression should be applied to grayscale
images.
Lets you specify whether ZIP compression should
be applied to monochrome images.
Lets you specify the PDF name. This option is
available only when PDF to Folder is selected in
QuarkXPress Server PDF preferences.
Lets you specify the PostScript file name. This
option is available only when PostScript for laterDistilling is selected in QuarkXPress Server PDF
preferences.
thumbnail
mode
Lets you embed a thumbnail in the PDF file.bw | color
Lets you specify the PDF file's color mode.composite |
separations
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 55
USING THE WEB INTERFACE
Render
modifier
parameters
fontdownload
layers
transparencyres
verification
separate
produceblankplates
page
pages
spread
layout
spreads
yes | no
String
Integer value from
36 to 3600
yes | no
Integer
String
| false | yes | no)
Lets you turn font download on or off. You
cannot specify which fonts are downloaded.
Lets you specify which layers should be included,
as a comma-separated list.
Lets you specify the resolution for flattened
content.
Lets you use PDF/X–1a or PDF/X–3 verification.pdfx1a | pdfx3
Lets you specify whether to output each page as
a separate file.
Lets you specify whether to include blank plates.yes | no
Lets you specify a single page.Integer
Lets you specify a range of pages.String (page range)
Lets you specify a spread. The first spread is spread
1. In a facing-page document, spread 1 consists
of the first page.
Lets you specify a layout by name or ID. The first
layout is Layout 1.
Lets you specify that the output use spreads.Boolean (1 | 0 | true
Logs
Example, GET
URL
Example,
object model
A screen-resolution PDF fileResponse
HTTP Error #500This page range is invalid.Alerts
QuarkXPress Server Error #147
This alert displays if you try to render an invalid page range.
HTTP Error #500No file produced. The
document requested contains
only blank pages.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response size
in bytes, and client IP address. For example:
If an alert is displayed, a transaction message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log file contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
//STEP1: Create the QuarkXPress Server Request Context
//and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
String docName = request.getParameter("documentName") ;
This alert displays if you try to render a a project that contains only
blank pages.
56 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):
//Create the QuarkXPress renderer
//request and embed it in the request context.
ScreenPDFRenderRequest screenpdfRequest = new
ScreenPDFRenderRequest();
screenpdfRequest.setColorImageDownSample(
request.getParameter("ColorImageDownSample"));
screenpdfRequest.setCompression(request.getParameter(
"Compression"));
requestCtx.setRequest(screenpdfRequest);
//STEP3: Create the WIG service and
//call the processRequest() API
QManagerSDKSvcServiceLocator serviceLocator = new
QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data =
service.processRequest(requestCtx);
swf
The swf render type returns a SWF (Flash) rendering of a Print layout or an Interactive
layout.
Parameters
SWFNamespace
version
layout
page
pages
fullscreen
embedallfonts
compressswf
compressaudio
jpegquality
swf6 | swf7
string
true | false
true | false
true | false
true | false
1–100
Lets you specify the minimum compatible
version of Flash Player.
Lets you specify a layout by name or ID. The first
layout is Layout 1.
Lets you specify a single page.string
Lets you specify a range of pagesstring
Lets you specify whether the SWF file should run
in full-screen mode by default.
Lets you indicate whether to include any fonts
that are necessary to correctly render text in Text
Box objects within the exported SWF file
Lets you specify whether to compress the
exported file.
Lets you specify whether to compress audio in
the exported file.
Lets you specify the quality of JPEG images in
the exported file, with 100 being highest quality.
download
true | false
When download is true, the browser always
displays a dialog box that lets the end user save
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 57
USING THE WEB INTERFACE
the returned file, even if the browser can display
it.
When download is false, the browser attempts
to display the returned file. If the browser cannot
display the file, it lets the end user save the
returned file.
The default value is false.
Alerts
Logs
spreads
A single SWF file or a multipart reply containing an SWF file and a set of support files.Response
A multipart reply can result if you render an Interactive layout that uses external assets -- for
example, if the layout includes a Video object containing a video file that has been specified by
choosing Choose from a drop-down menu. In this case, the reply includes a "RelativePath" parameter
for each file, and each file is saved in the directory indicated by this "RelativePath" parameter
You can use the saveas request handler to save the files that are included in a multipart reply in
a particular directory, using the relative folder hierarchy that was specified in the multipart reply.
exist.
exist.
Unknown swf player version.
Value of jpegquality is outside
range, valid values are 1 - 100.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and the
error message. The following is a sample of an error log transaction entry:
//STEP1: Create the QuarkXPress Server Request Context
//and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):Create the SWF renderer request
//and embed it in the request context.
SWFRenderRequest swfreq = new SWFRenderRequest();
swfreq.setVersion(request.getParameter("Version"));
//STEP3: Create the WIG service and call the processRequest(
//) API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(requestCtx);
@@@Notes
Understanding render modifiers
USING THE WEB INTERFACE
Box
Boxes
Layer
Layout
Movepages
Page
Pages
Scale
Spread
Spreads
Render modifiers let you control which parts of a project are rendered and set the scale of
the returned renderings. The topics covered here include the following:
DescriptionProperty
The box render modifier lets you render a single box.
The boxes render modifier lets you render multiple boxes.
The layer render modifier lets you show and hide layers prior to rendering. This render modifier also
lets you add and remove layers from a project on the server.
The layout render modifier lets you render a particular layout.
The movepages render modifier lets you move pages prior to rendering.
The page render modifier lets you render a single page.
The pages render modifier lets you render multiple pages.
The scale render modifier lets you specify the scale at which content is rendered.
The spread render modifier lets you render a single spread.
The spreads render modifier lets you render multiple spreads.
Additional render-type-specific parameters are listed on each render type's page.
In the QuarkXPress Server Manager API, render modifiers are properties of render request
classes.
Render modifier names are not case-sensitive.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 59
USING THE WEB INTERFACE
Box
The box render modifier lets you render a single box.
Parameters
Compatible with
Alerts
Logs
box
overlap
jpeg, png, raw
the specified
identifier.
The box must be
within the page
boundaries.
image type has no
way of rendering the
desired objects.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
8/3/2004 15:00:33 — Error — Error Code: 10006 — There is no box with the specified identifier.
String
HTTP Error #500There is no box with
This alert displays if you request a box that does not exist.
HTTP Error #500Cannot render box.
This alert displays if you request a box that is outside the page boundary.
HTTP Error #406The renderer for this
This alert displays if you try to use the box parameter with the eps, pdf,
or qxpdoc render types.
Lets you specify which box to render.String
Lets you specify whether to show the area overlapped by
the specified box.
Example GET
URL
Notes
Parameters
Compatible with
http://localhost:8080/png/sample.qxp?box=pictbox
To render a box in a particular layout, use a URL like the following:
When you render using the box parameter, the box ID has a higher priority than the
box name.
Boxes
The boxes render modifier lets you render multiple boxes.
boxes
overlap
jpeg, png, raw
String
Lets you specify which boxes to render.String
Lets you specify whether to show the area overlapped by the
specified boxes.
60 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
Alerts
Logs
Example GET
URL
Notes
HTTP Error #500There is no box with
the specified
identifier.
The box must be
within the page
boundaries.
image type has no
way of rendering the
desired objects.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
8/3/2004 15:00:33 — Error — Error Code: 10006 — There is no box with the specified identifier.
http://server:port/jpeg/doc.qxp?boxes=box1,box2
To render boxes in a particular layout, use a URL like the following:
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server error log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
12/1/2005 10:39:45 — Error — Error Code: 10401 — Invalid box given in Box Param.
Layer
The layer render modifier lets you show and hide layers prior to rendering. This render
modifier also lets you add and remove layers from a project on the server.
layer
addlayer
deletelayer
alllayers
String
String
String
Boolean (1 | 0 | true
| false | yes | no)
Lets you specify which layer to render. You can specify
multiple layer names in one request.
Lets you add a new layer. You can add one layer per
request.
Lets you delete a layer and the items on that layer. You
can delete one layer per request.
Lets you render every layer in the project, including
hidden and suppressed layers.
layerattribute
name
visible
suppressoutput
locked
keeprunaround
String
String
Boolean (1 | 0 | true
| false | yes | no)
Boolean (1 | 0 | true
| false | yes | no)
Boolean (1 | 0 | true
| false | yes | no)
Boolean (1 | 0 | true
| false | yes | no)
Lets you modify the attributes of a layer. You can
modify one layer per request.
Lets you specify a new name for a layer. You must use
this parameter in conjunction with the
layerattribute parameter.
Lets you make a layer visible or invisible. You can use
this parameter in conjunction with the addlayer and
layerattribute parameters. This parameter overrides
QuarkXPress layer visibility preferences.
Lets you suppress or allow the output of a layer. You
can use this parameter in conjunction with the
Lets you lock or unlock a layer. You can use this
parameter in conjunction with the addlayer and
layerattribute parameters. This parameter overrides
QuarkXPress layer locking preferences.
Lets you set or change a layer's Keep Runaround
setting. You can use this parameter in conjunction
with the addlayer and layerattribute parameters.
This parameter overrides QuarkXPress Keep Runaround
preferences.
HTTP Error #500This layer does not
This alert displays if you specify an invalid layer name with the layer,
layerattribute, or deletelayer parameter.
HTTP Error #500Specify a layer name.
This alert displays if you do not specify a layer name with the layer,
layerattribute, addlayer, or deletelayer parameter.
HTTP Error #500A layer with the
This alert displays if you try to add a layer that already exists or change the
name of a layer to a name is already used in the project.
HTTP Error #500Cannot change the
This alert displays if you try to change the name of the default layer.
HTTP Error #500Cannot delete the
This alert displays if you try to delete the default layer.
HTTP Error #500Invalid parameter
This alert displays if you do not specify additional attributes or specify
attributes with invalid values in an addlayer or layerattribute request.
HTTP Error #500This layer has been
This alert displays if you try to add or modify an item on a locked layer.
Logs
Example GET
URL
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message.
The following is a sample of an error log transaction entry:
11/16/2005 19:42:48 — Error — Error Code: 10358 — A layer with the same name already exists.
To render a single layer, use a URL like the following:
To add a new layer to a project, use code like the following:
Layer layer = new Layer();
layer.name = "New Layer";
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 63
USING THE WEB INTERFACE
layer.operation = "CREATE";
RGBColor rgbcolor = new RGBColor();
layer.RGBColor = rgbcolor;
layout.layer = new Layer[]{layer};
To edit the properties of an existing layer, use the following object hierarchy:
ModifierRequest < Project < Layout < Layer
To delete a layer, set its operation attribute to "DELETE".
You cannot add, modify, or delete multiple layers in a single request.Notes
You cannot print layers whose visible and suppressoutput properties are set to false.
You can render a hidden or suppressed layer by referencing it with the layer parameter.
Suppressed layers are rendered for the jpeg, png, and qxpdoc render types, but not for the pdf,
postscript, and eps render types.
You can use the deconstruct and getdocinfo request handlers to view information about the
layers in a project.
When you add a layer using addlayer, any unspecified attributes use the settings in the
QuarkXPress Server layer preferences (QuarkXPress Server > Preferences > Default Print Layout >Layers).
If the visible property is set to false, the suppressoutput property is automatically set to
true.
Parameters
Compatible with
Alerts
Logs
Example GET
URL
Layout
The layout render modifier lets you render a specific layout.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of a transaction entry:
12/1/2005 10:39:45 — Error — Error Code: 10125 — The requested layout does not exist.
To render a layout by its layer ID, use a URL like the following:
http://localhost:8080/png/sample.qxp?layout=2
To render a layout by its name, use a URL like the following:
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an error occurs, an error message is written to the QuarkXPress Server Error Log. The transaction
entry in the error log contains the date and time of the request, the error code, and the error
message. The following is a sample of an error log transaction entry:
3/24/2009 10:45:45 — Error — Error Code: 61 — This page does not exist. RequestURL:
pdf/5pagedoc.qxp?movepages=AB-AD&afterpage=AF.
String
String
QuarkXPress Server Error #61This page does not
QuarkXPress Server Error #62Invalid page range.
QuarkXPress Server Error #51The specified page
QuarkXPress Server Error #146This page range is
QuarkXPress Server Error #10108Invalid parameter
Lets you specify which pages to move. You can use a single
page number (for example, 2) or a range of pages with the
starting and ending page numbers separated by a hyphen
(for example, 2–5).
Lets you specify the page after which the page or pages
should be moved. To move pages to the beginning of a
layout, use afterpage=start. To move pages to the end
of a layout, use afterpage=end.
Example GET
URL
Example, object
model
To move pages 2–3 to after page 5, use a URL like the following:
To move pages before rendering a layout, use code like the following:
//STEP1: Create the QuarkXPress Server Request Context
//and set the nescessary properties
sdk.QRequestContext requestCtx = new sdk.QRequestContext();
Boolean responseAsURL = false;
requestCtx.setDocumentName(docName);
//STEP 2(SPECIFIC TO REQUESTS):Create the PDF
//renderer request and embed it in the request context. the request context.
PDFRenderRequest pdfreq = new PDFRenderRequest();
pdfreq.setMovePages("2-4");
pdfreq.setAfterPage("7");
requestCtx.setRequest(pdfreq);
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 65
USING THE WEB INTERFACE
//STEP3: Create the WIG service and call the
//processRequest() API
QManagerSDKSvcServiceLocator serviceLocator =
new QManagerSDKSvcServiceLocator();
QManagerSDKSvc service = serviceLocator.getqxpsmsdk();
sdk.QContentData data = service.processRequest(
requestCtx);
Notes
Parameters
Compatible with
Alerts
Logs
The movepages operation executes only after all other modifications are complete. For example,
if you use movepages in a modify request, the pages are moved only after the modify request is
complete.
Page
The page render modifier lets you render a single page.
image type has no way
of rendering the desired
objects.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in an error log contains the date and time of the request, the error code, and the
error message. The following is a sample of an error log transaction entry:
8/3/2005 12:48:15 — Error — Error Code: 10000 — The requested page does not exist.
This alert displays if you attempt to render a page that does not exist.
HTTP Error #406The renderer for this
This alert displays if you use a page parameter with the qxpdoc render
type.
Lets you specify which page to render.Integer
Example GET
URL
Example, object
model
Notes
http://localhost:8080/png/sample.qxp?page=2
To add a new page to an existing spread in a project, use code like the following:
Spread spread = new Spread();
Page page = new Page();
page.UID = "5";
page.operation = "CREATE";
spread.page = new Page[]{page};
To edit the properties of an existing page, use the following object hierarchy:
this image type has
no way of
rendering the
desired objects.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is dispayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
8/3/2005 14:01:44 — Error — Error Code: 147 — This page range is invalid.
http://localhost:8080/pdf/sample.qxp?pages=2–4
QuarkXPress Server Error #147
This alert displays if you try to render a page range that exceeds the number
of pages in the project.
HTTP Error #406The renderer for
This alert displays if you use the pages parameter with the jpeg, eps, png,
or qxpdoc render type.
Lets you specify which pages to render.String (page range)
Notes
Parameters
Compatible with
Alerts
Logs
To render pages in a particular layout, use a URL like the following:
The scale render modifier lets you specify the scale at which content is rendered.
scale
eps, jpeg, png, raw
parameter.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert is displayed, an error message is written to the QuarkXPress Server Error Log file. The
transaction entry in the error log contains the date and time of the request, the error code, and
the error message. The following is a sample of an error log transaction entry:
Float
HTTP Error #500Invalid scale
This alert displays if an invalid scale value is provided.
What to do: Enter a valid scale value.
Lets you specify a scaling percentage. The valid values are
from .1 (10%) to 8 (800%) on Mac OS or 6.92 (692%) on
Windows.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
8/3/2004 15:19:04 — sample.qxp — Type: image/jpeg — Size: 1647112 — Client: 127.0.0.1 If an
alert is displayed, a transaction error message is written to the QuarkXPress Server Error Log file.
The transaction entry in the error log file contains the date and time of the request, the error code,
and the error message. The following is a sample of an error log transaction entry:
8/5/2005 9:43:02 — Error — Error Code: 10072 — The requested spread does not exist.
Integer
HTTP Error #500The requested
This alert displays if you specify an invalid spread.
Lets you specify which spread to render. Spread numbers
start with 1. The first spread is spread 1. In a facing-page
document, spread 1 consists of the first page.
Example, GET
URL
Example, Object
Model
Parameters
Compatible with
Logs
http://localhost:8080/png/sample.qxp?spread=2
To add a spread to a project, use code like the following:
Spread spread = new Spread();
spread.UID = "5";
spread.operation = "CREATE";
layout.spread = new Spread[]{spread};
Spread is located at the following place in the object hierarchy:
ModifierRequest < Project < Layout < Spread
To delete a spread, set its operation attribute to "DELETE".
Spreads
The spreads render modifier lets you render layouts in spreads mode, so that pages in
spreads are rendered side-by-side rather than as individual pages.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
Lets you specify whether to render spreads
(true) or individual pages (false).
68 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
Example, GET
URL
Using content modifiers
http://localhost:8080/pdf/sample.qxp?spreads=true
Content modifiers let you alter the content and formatting of boxes in layouts without using
the XML modify parameter.
Inserting text
This topic explains how to import text into a box. Any existing text in the box is replaced.
The name of the target box.String[box name]Parameters
Specify the name and location of the imported file with the file:
prefix. The imported file must be present in the document pool.
To import a file that is in a subfolder of the document pool on
Mac OS, use a path like the following:
file:subfolder:MyFile.ext
To import a file that is in a subfolder of the document pool on
Windows, use a path like the following:
file:subfolder\MyFile.ext
A preview of the project with the imported text.Response
Logs
Example, GET
URL
Example, object
model
HTTP Error #404File not found.Alerts
QuarkXPress Server Error #–43
This alert displays if the imported file is not present in the
document pool.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
//STEP 2(SPECIFIC TO REQUESTS):Create the Box Param
//renderer request and embed it in
RequestParameters request = new RequestParameters();
NameValueParam nameValue1 = new NameValueParam();
nameValue1.paramName = this.boxname1.Text;
if(!this.boxvalue1.Text.Equals(""))
nameValue1.textValue = this.boxvalue1.Text;
request.params = new NameValueParam[]{nameValue1};
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 69
USING THE WEB INTERFACE
rc.request = request;
//Create the service and
//call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Box names are case-sensitive.Notes
Use "&" to change the contents of multiple boxes in one request. The general URL for the
multiple-box request is:http://localhost:8080/sample.qxp?text1=
NewText1&text2=NewText2 where text1 and text2 are the names of the two different boxes.
You can use "&" to change the contents of multiple boxes in one request. For example:
You can import an XTags file generated by QuarkXPress.
Applying a font at import
This topic explains how to apply a font to a new text flow. When you use this method,
QuarkXPress Server ignores the original font of the target text box and inserts the new
text with the font specified by the parameter.
Parameters
Alerts
Logs
Example, GET
URL
Example, object
model
fontname
A preview of the project with the font applied to the imported text.Response
This alert displays if you specify a font that is unavailable.The specified font is not
available.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an error occurs, the error message is written to the QuarkXPress Server Error Log. The transaction
entry in the error log contains the date and time of the request, the error code, and the error
message. The following is a sample of an error log transaction entry:
To apply Comic Sans MS to text in the box named "HeadBox," use a URL like the following:
http://localhost:8080/png/sample.qxp?HeadBox=
Headline&Story:fontname=Comic Sans MS
Request object name: RequestParameters
sdk.QRequestContext rc =
new sdk.QRequestContext();
if(!this.DocumentSettings1.documentName.Text.Equals(""))
rc.documentName =
this.DocumentSettings1.documentName.Text;
The name of the font to be applied.String
//STEP 2(SPECIFIC TO REQUESTS):Create the fontname
//renderer request and embed it in
RequestParameters request = new RequestParameters();
NameValueParam nameValue1 = new NameValueParam();
nameValue1.paramName = this.boxname.Text;
if(!this.boxvalue1.Text.Equals(""))
nameValue1.textValue = this.fontname.Text;
request.params = new NameValueParam[]{nameValue1};
rc.request = request;
70 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
//Create the service and
//call it with QRequestContext object
QManagerSDKSvcService svc =
new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Inserting a picture
This topic explains how to import a picture into an empty box or replace an existing
picture with a new one.
Parameters
Logs
[box name[
A preview of the project with the imported picture.Response
HTTP Error #404File not found.Alerts
QuarkXPress Server Error #–43
This alert displays if the imported file is not present in the document pool.
HTTP Error #500The specified file
failed to load in
the picture box.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
sdk.QRequestContext rc = new sdk.QRequestContext();
if(!this.DocumentSettings1.documentName.Text.Equals(""))
rc.documentName = this.DocumentSettings1.documentName.Text;
//STEP 2(SPECIFIC TO REQUESTS):Create the Box Param
//renderer request and embed it in
RequestParameters request = new RequestParameters();
NameValueParam nameValue1 = new NameValueParam();
nameValue1.paramName = this.boxname1.Text;
if(!this.boxvalue1.Text.Equals(""))
nameValue1.textValue = this.boxvalue1.Text;
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 71
USING THE WEB INTERFACE
request.params = new NameValueParam[]{nameValue1};
rc.request = request;
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Box names are case-sensitive.Notes
You can use "&" to change the contents of multiple boxes in one request. For example:
QuarkVista XTensions software lets you apply and remove sets of preset picture effects to
imported pictures. To use this feature, you must first create a preset file containing the
effects you want to use and put that file in the document pool. For information on how
to create preset files, see A Guide to QuarkXPress.
To specify the location where QuarkXPress Server looks for preset files, display the Picture
Effects pane of the QuarkXPress Server Preferences dialog box (QuarkXPress Server >
Preferences), then click Preferences to use the "Picture Effects Presets" folder in the
QuarkXPress Server root folder or Other Folder to use a different location. (Note that the
Picture Effects pane is present only if QuarkVista XTensions software is loaded.)
Parameters
Alerts
This feature works only with projects saved in QuarkXPress 6.0 and later.
When you install QuarkXPress Server, QuarkVista XTensions software is enabled by default.
To disable this module in QuarkXPress Server, display the XTensions Manager dialog box
(QuarkXPress Server > Server XTensions Manager), uncheck Vista, click OK, and then
restart QuarkXPress Server.
If QuarkXPress Server opens a project that uses picture effects when QuarkVista XTensions
software is not loaded, the following error message is written to the QuarkXPress Server
error logs (if error reporting is on): "Error. Vista XTensions module is not present."
applyvistaeffect
vistabox
deletevistaeffect
A preview of the project with the effect applied to the picture.Response
specified identifier.
String
String
HTTP Error #500There is no box with the
This alert displays if you specify an invalid box name.
Lets you specify a the name of a preset file.String
A comma-separated list of box IDs or box names
indicatign the boxes to which the preset should be
applied.
A comma-separated list of box IDs or box names
indicatign the boxes to which presets should be
removed.
compatible with the Preset.
72 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
HTTP Error #500The picture is not
to this box.
USING THE WEB INTERFACE
This alert displays if the target picture is in a format that is not
compatible with the picture effects feature
HTTP Error #500Cannot load picture effects
This alert displays if you try to apply picture effects to a non-picture
box or to an empty box.
Logs
This Layout uses Picture
Effects that are not
supported in QuarkXPress
v5 format. Downsaving the
document without picture
effects.
with that name.
The Vista effects were not
applied to one or more
images.boxes specified in the request. This alert is not displayed in the status
This document may not
display or print correctly
because the Vista XTensions
software is not present.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an error occurs, an error message is written to the QuarkXPress Server Error Log. The transaction
entry in the error log contains the date and time of the request, the error code, and the error
message. The following is a sample of an error log transaction entry:
11/21/2005 16:40:13 — Error — Error Code: 10400 — The picture is not compatible with the Preset.
This alert is recorded in the QuarkXPress Server error log file if you
try to apply picture effects to a document saved in QuarkXPress 5.0
or earlier. This alert is not displayed in the status monitor.
HTTP Error #500Invalid Preset File!
This alert displays if the preset file is invalid.
HTTP Error #500There is no Picture Effect
This alert displays if the preset file does not exist.
This alert is recorded in the QuarkXPress Server error log file if
QuarkXPress Server is unable to apply picture effects to some of the
monitor.
This alert is recorded in the QuarkXPress Server error log file if
QuarkVista XTensions software is not present or has been disabled.
This alert is not displayed in the status monitor.
Example, GET
URL
Example, object
model
To apply a picture effects preset to the pictures in the boxes named "pb2" and "box2", use a URL
like the following:
//STEP 2(SPECIFIC TO REQUESTS):
//Create the QuarkVista
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 73
USING THE WEB INTERFACE
//request and embed it in request context
VistaRequest vistareq = new VistaRequest();
vistareq.deleteVistaEffect =
this.deletevistaeffect.Text;
vistareq.vistaBox = this.vistabox.Text;
vistareq.applyVistaEffect =
this.applyvistaeffect.Text;
rc.request = vistareq;
//STEP 3(SPECIFIC TO REQUESTS):
//Create the JPEG renderer
//request and embed it in
JPEGRenderRequest jpreq = new JPEGRenderRequest();
vistareq.request = jpreq;
//Create the service and
//call it with QRequestContext object
QManagerSDKSvcService svc =
new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
This feature works only in master-subrender mode.Notes
If you delete and apply QuarkVista effects in the same URL parameter, the deletevistaeffect
parameter takes precedence.
Parameters
Saving a projects with a new name
The saveas content modifier lets you save modified QuarkXPress projects in any supported
format to the document pool or to any network location accessible to QuarkXPress Server.
If you send a saveas request to QuarkXPress Server Manager using HTTP or the Web
services interface while the common doc pool switch is set to off in the QuarkXPress Server
Manager client, the file is saved to all registered QuarkXPress Server instances. If the
common doc pool is enabled, the file can be saved to any one registered QuarkXPress
server instance.
newname
path
savetopool
replace
String
true | false
true | false
Lets you specify a name for the saved-as project.String
Lets you specify a location for the saved-as project (other than
the document pool).
Lets you specify whether the project should be saved to the
document pool.
The default value for this paramter is true. However, if you specify
a path value, the default value changes to false, which means if
you want the project saved to the document pool, you must
explicitly set savetopool to true.
Lets you specify whether the saved project should replace a project
with the same name. The default value is true.
The message "Document successfully saved."Response
HTTP Error #404File not found.Alerts
QuarkXPress Server Error #–43
This alert displays if you supply an incorrect file name or the file is not in
document pool.
74 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
pathname.
invalid.
folder is
Read-Only.
USING THE WEB INTERFACE
HTTP Error #404Bad filename/
QuarkXPress Server Error #–43
This alert displays if you supply an incorrect file name or the file is not in
document pool.
HTTP Error #500The file path is
This alert displays if you supply an invalid path parameter.
What to do: Specify the correct file path with the path parameter.
HTTP Error #500The specified
This alert displays if you try to save a project to a folder with read-only access.
Logs
Example, GET
URL
Example, object
model
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
If an alert displays, an error message is written to the QuarkXPress Server error log file. For example:
11/16/2005 15:42:12 — Error — Error Code: 10371 — The file path is invalid.
To save a PDF file named "Customer1.pdf" in the folder HDD:temp and also in the document pool,
use a URL like the following. Note that this URL will cause the saved-as file to replace any existing
file with the same name.
//STEP 2(SPECIFIC TO REQUESTS):
//Create the Save as request
//and chain it to the document context
SaveAsRequest saveasreq = new SaveAsRequest();
saveasreq.newName = this.newname.Text;
if((this.path.Text != null) &&
(!this.path.Text.Equals("")))
saveasreq.newFilePath = this.path.Text;
saveasreq.replaceFile = this.replace.Checked.ToString();
saveasreq.saveToPool =
this.savetopool.Checked.ToString();
rc.request = saveasreq;
//Create the service and call it
//with QRequestContext object
QManagerSDKSvcService svc =
new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Importing XML with placeholders
This topic explains how to import XML data into boxes using QuarkXPress placeholders.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 75
USING THE WEB INTERFACE
To use this feature, you must have a QuarkXPress project that has been set up with
placeholders that correspond to the element types in a source XML file. For more
information, see A Guide to XML Import.
Parameters
Alerts
Logs
thexmldoc
layout
paginate
The layout with the imported XML.Response
String
If the project is successfully rendered, a transaction success message is written to the
QuarkXPress Server transaction log file. The transaction entry consists of the date and time of the
request, the render type, the project name, the type of response produced by the server, the size
of the response returned in bytes, and the client IP address. The following is a sample of a transaction
entry:
HTTP Error #500Invalid XML
This alert displays if you supply an invalid XML string in the thexmldoc parameter.
Lets you specify the XML file containing the data to import. The path
can be absolute or relative to the location of the XML file. You can
also supply XML as a string.
Lets you specify which layout to render. The first layout is layout 1.
You can also specify a layout by name.
Lets you specify the XML file containing the data to import. The
paginate parameter reates enough pages in the target layout to
accommodate the records in the XML.
This parameter works only with the pdf, postscript, qxp, and ppml
render types. If you use it with any other render type, the server returns
only the first page of the paginated layout.
If you do not supply an XML string or file (for example:
http://localhost:8080/pdf/Sample.qxp?paginate),
QuarkXPress Server attempts to use the XML file that was associated
with the layout in QuarkXPress.
Example, GET
URL
Example, object
model
When QuarkXPress Server is running on Windows, use a URL like the following:
http://localhost:8080/Sample.qxp?thexmldoc=<?xml
version="1.0"?>
<BookReview><Book><Title>C:\Autumn.jpg</Title>
<Author> Brian Kernighan and Dennis Ritchie</Author>
</Book></BookReview>
When QuarkXPress Server is running on Mac OS, use a URL like the following:
http://localhost:8080/Sample.qxp?thexmldoc=<?xml version=
"1.0"?>
<BookReview><Book><Title>/Volumes/MacHD/Pictures/abc.tiff</
Title>
<Author> Brian Kernighan and Dennis Ritchie</Author>
</Book></BookReview>
Alternatively, you can specify a path to a file containing the XML:
sdk.QRequestContext rc = new sdk.QRequestContext();
76 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
if(!this.DocumentSettings1.
documentName.Text.Equals(""))
rc.documentName =
this.DocumentSettings1.documentName.Text;
//STEP 2(SPECIFIC TO REQUESTS):
//Create the XML Import request
XMLImportRequest xmlimportreq = new XMLImportRequest();
xmlimportreq.XMLDocument = this.thexmldoc.Text;
rc.request = xmlimportreq;
//STEP 3(SPECIFIC TO REQUESTS):
//Create the JPEG renderer
request
JPEGRenderRequest jpreq =
new JPEGRenderRequest();
xmlimportreq.request = jpreq;
//Create the service and call it
//with QRequestContext object
QManagerSDKSvcService svc =
new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Using XML modify
USING THE WEB INTERFACE
Parameters
Example GET
URL
The modify parameter lets you modify a QuarkXPress project using XML.
This topic covers the modify parameter when it is used without the construct namespace.
You can also use the modify parameter to specify an XML file to use when constructing
a project; for more information, see "Constructing a project".
The xml namespace takes two arguments: the name of the project to be modified, and a
modify parameter with the string or the path of the XML file that describes how to create
the project:
http://QXPServer8:8080/project1.qxp?modify=
file:path to XML file on server http://QXPServer8:8080/
project1.qxp?modify=XML string
You can also modify QuarkCopyDesk articles. To modify a QuarkCopyDesk article:
Lets you specify an XML file or string that describes how to create a
project. The path can be absolute or a relative path in the document
pool. Use the file: indicator to specify the path.
If the request succeeds, a transaction success message is written to the QuarkXPress Server
transaction log file. This message includes the date, time, request type, project name, response
type, response size in bytes, and client IP address. For example:
A preview of the QuarkXPress project with a new box created in the specified position.Response
File not found.Alerts
filename/pathname.
document is not
valid or well
formed.
document
contains an
invalid tag value.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
//STEP 2(SPECIFIC TO REQUESTS):
//Create the BOX modifier renderer request and
//embed it in request context
ModifierRequest request = new ModifierRequest();
Project contents = new Project();
Geometry geo = new Geometry();
geo.moveUp = this.moveup.Text;
geo.color = this.color.Text;
geo.growDown = this.growdown.Text;
geo.shrinkAcross = this.shrinkacross.Text;
Box box = new Box();
box.UID = this.Boxid.Text;
box.geometry = geo;
Layout layout1 = new Layout();
layout1.name = this.layout.Text;
layout1.boxes = new Box[]{box};
if(this.runaround.Checked == true)
{
Runaround runaround = new Runaround();
runaround.type = this.runaroundtype.Text;
runaround.top = this.top.Text;
runaround.left = this.left.Text;
runaround.right = this.right.Text;
geo.runaround = runaround;
}
contents.layouts = new Layout[]{layout1};
request.contents = contents;
rc.request = request;
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Example 2, object
model
To edit the geometrical properties of an existing box in a QuarkXPress project, use the following
object hierarchy:
A preview of the QuarkXPress project with new box created in specified position.Response
Logs
File not found.Alerts
pathname.
is not valid or well
formed.
contains an invalid
tag value.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
The following is a sample of a transaction entry: 8/3/2005 11:27:42 — jpeg/sample.qxp — Type:
image/jpeg — Size: 31715 — Client: 127.0.0.1
If an alert displays, an error message is written to the QuarkXPress Server error log file. For example:
HTTP Error #404
QuarkXPress Server Error #–43
This alert displays if you specify an invalid XML file or request a document
that is not in the document pool.
HTTP Error #404Bad filename/
QuarkXPress Server Error #–37
This alert displays if you specify an invalid file name or path.
HTTP Error #500The XML document
This alert displays if the XML you supply is not well-formed or does not
adhere to the Modifier DTD.
HTTP Error #500The XML document
This alert displays if you supply an invalid value in the XML.
4/12/2007 14:51:50 — Error — Error Code: 10207 — The XML document is not
valid or well formed. Project: /table.qxp
Example, GET
URL
When QuarkXPress Server is running on Windows, use a URL like the following:
A preview of the QuarkXPress project with the box deleted.Response
File not found.Alerts
pathname.
HTTP Error #404
QuarkXPress Server Error #–43
This alert displays if you specify an invalid XML file or request a document that
is not in the document pool.
HTTP Error #404Bad filename/
QuarkXPress Server Error #–37
This alert displays if you specify an invalid file name or path.
document is not
HTTP Error #500The XML
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 83
USING THE WEB INTERFACE
Logs
Example GET
URL
valid or well
formed.
document
contains an
invalid tag value.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
The order of the <BOXREF> elements in a <GROUP> indicates the order in which the boxes
were selected prior to grouping. The z-order of boxes in the layout is determined by the
order of the <BOX> elements in the XML, from rearmost to frontmost.
XML representations of groups created by versions of QuarkXPress Server prior to 8.1 are
ignored during construct and modify calls, as they were in earlier versions of QuarkXPress
Server.
Creating tables
To create a new table, use the following parameters in the Modifier DTD:
• "SPREAD (Modifier DTD)"
• "TABLE (Modifier DTD)"
• "COLSPEC (Modifier DTD)"
• "COLUMN (Modifier DTD)"
• "ROW (Modifier DTD)"
• "CELL (Modifier DTD)"
The following XML shows how some of these parameters work.
A preview of the QuarkXPress project with new table created in the specified position.Response
Logs
Example GET
URL
Example, object
model
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
To add a new table to an existing spread, use code like the following:
Spread spread = new Spread();
Table table = new Table();
table.name = "textbox1";
Geometry geometry = new Geometry();
Position position = new Position();
To delete a table, provide the table's name or ID and set the operation attribute to "DELETE".
Modifying text attributes
You can use the modify parameter to change the attributes of text in a QuarkXPress project.
All modifications are done on a text box basis. To modify text properties, use the following
parameters in the Modifier DTD:
86 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
• "BOX (Modifier DTD)"
• "ID (Modifier DTD)"
• "TEXT (Modifier DTD)"
• "STORY (Modifier DTD)"
• "PARAGRAPH (Modifier DTD)"
• "FORMAT (Modifier DTD)"
• "DROPCAP (Modifier DTD)"
• "TABSPEC (Modifier DTD)"
• "TAB (Modifier DTD)"
• "RULE (Modifier DTD)"
• "RICHTEXT (Modifier DTD)"
The following XML shows how some of these parameters work.
<PROJECT>
<LAYOUT>
<ID UID="Layout 1"/>
<SPREAD>
<ID UID="1"/>
<BOX BOXTYPE="CT_TEXT">
<ID NAME="ABOUT"/>
<TEXT>
<STORY CLEAROLDTEXT="true" FITTEXTTOBOX="true"
CONVERTQUOTES="true">
<RICHTEXT FONT="Castellar" PLAIN="true"/>
</STORY>
</TEXT>
</BOX>
<BOX BOXTYPE="CT_TEXT">
<ID NAME="HISTORY"/>
<TEXT>
<STORY>
<PARAGRAPH>
<FORMAT ALIGNMENT="RIGHT"/>
<RICHTEXT SIZE="12">This text is 12pt and right
justified.</RICHTEXT>
</PARAGRAPH>
</STORY>
</TEXT>
</BOX>
<BOX BOXTYPE="CT_TEXT">
<ID NAME="PRODUCTS"/>
<TEXT>
<STORY>
<RICHTEXT BOLD="true">This is bold text.</RICHTEXT>
<RICHTEXT BOLD="true" COLOR="Red" ITALIC="true"
SIZE="20">This text is bold, red, italic, and 20pt.
</RICHTEXT>
</STORY>
</TEXT>
</BOX>
</SPREAD>
</LAYOUT>
</PROJECT>
A preview of a QuarkXPress project with the values in the ModifierXT tags applied on text boxes.Response
File not found.Alerts
HTTP Error #404
QuarkXPress Server Error #–43
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 87
USING THE WEB INTERFACE
pathname.
document is not
valid or well
formed.
with the
specified
identifier.
value is outside
the valid range.
color is not
available to the
document
This alert displays if you specify an invalid XML file or request a document that
is not in the document pool.
HTTP Error #404Bad filename/
QuarkXPress Server Error #–37
This alert displays if you specify an invalid file name or path.
HTTP Error #500The XML
This alert displays if the XML you supply is not well-formed or does not adhere
to the Modifier DTD.
HTTP Error #500There is no box
This alert displays if the box specified by the child text node of an <ID> element
does not exist.
HTTP Error #500The text size
This alert displays if the value specified in a <SIZE> element is invalid.
What to do: Specify a value between 2 and 720 points.
HTTP Error #500The specified
This alert displays if the value specified in a <COLOR> element is invalid.
Logs
Example GET
URL
HTTP Error #500The specified
font is not
available
document
contains an
invalid tag value.
box cannot be
modified.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
//STEP 2(SPECIFIC TO REQUESTS):Create the Text Modifier
//renderer request and embed it in request context
ModifierRequest textReq = new ModifierRequest();
Project contents = new Project();
RichText richText1 = new RichText();
richText1.value = this.text1.Text;
richText1.color = this.color1.Text;
Text boxText1 = new Text();
Story story = new Story();
story.richText = new RichText[]{richText1};
boxText1.story = story;
if(this.fittextbox1.Checked)
boxText1.fitTextToBox = "true";
if(this.clearoldtext1.Checked)
boxText1.clearOldText = "true";
Box box1 = new Box();
box1.UID = txtBox1;
box1.text = boxText1;
Layout layout1 = new Layout();
layout1.name = layoutText;
layout1.boxes = new Box[]{box1};
contents.layouts = new Layout[]{layout1};
textReq.contents = contents;
rc.request = textReq;
Example 2,
object model
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
To edit the properties of an existing text box in a QuarkXPress project, use the following object
hierarchy:
ModifierRequest < Project < Layout < Spread <
Box < Text < Story < Paragraph < RichText
For a list of the RichText object's properties, see the JavaDoc installed with QuarkXPress Manager.
The Story object also contains some text-related properties: fitTextToBox, includeStylesheets,
convertQuotes, and clearOldText.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 89
USING THE WEB INTERFACE
Notes
The <FITTEXTTOBOX> element type depends on two preferences: Allow Text to Grow and Font
Size. To set these preferences in QuarkXPress Server, choose QuarkXPress > Server > Preferences
and then click Modifier in the list on the left.
Modifying picture properties
You can modify the properties (such as origin, scale, angle, skew, and orientation) of
pictures in a QuarkXPress project with XML. To modify picture properties, use the following
parameters in the Modifier DTD:
• "BOX (Modifier DTD)"
• "ID (Modifier DTD)"
• "PICTURE (Modifier DTD)"
The following XML shows how some of these parameters work.
A preview of the QuarkXPress project with image modifier tags applied to the picture boxes.Response
File not found.Alerts
pathname.
document is not
HTTP Error #404
QuarkXPress Server Error #–43
This alert displays if you specify an invalid XML file or request a document that
is not in the document pool.
HTTP Error #404Bad filename/
QuarkXPress Server Error #–37
This alert displays if you specify an invalid file name or path.
HTTP Error #500The XML
90 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
valid or well
formed.
with the specified
identifier.
Across should be
between 10% and
1000%.
Down should be
between 10% and
1000%.
Offset Across is in
invalid range.
Offset Down is in
invalid range
Picture Angle
must be between
–360 and 360
degrees.
This alert displays if the XML you supply is not well-formed or does not adhere
to the Modifier DTD.
HTTP Error #500There is no box
This alert displays if the box specified by the child text node of the <ID> element
does not exist.
HTTP Error #500The value of Scale
This alert displays if the value of the child text node of a <SCALEACROSS>
element is invalid.
HTTP Error #500The Value of Scale
This alert displays if the value of the child text node of a <SCALEDOWN> element
is invalid.
HTTP Error #500The value of
This alert displays if the value of the child text node of the <OFFSETACROSS>
element is invalid.
HTTP Error #500The value of
This alert displays if the value of the child text node of the <OFFSETDOWN>
element is invalid.
HTTP Error #500The value of
This alert displays if the value of the child text node of the <ANGLE> element
is invalid.
Logs
Example GET
URL
HTTP Error #500The value of
Picture Skew must
be between –75
and 75 degrees.
document
contains an
invalid tag value.
cannot be
modified.
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
For a list of the Picture object's properties, see the JavaDoc installed with
QuarkXPress Manager.
92 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
You cannot replace an image with the Modifier XTensions software.Notes
If you specify <FITPICTURETOBOX>, <FITBOXTOPICTURE>, and <FITPICTURETOBOXPRO> for a
picture, only the first of these elements will be applied.
Importing data
Imports text or image data into a project. You can use import any text or picture file format
supported by QuarkXPress, including XPress Tags files.
To import text or image data into a project, use the following parameters in the Modifier
DTD:
• "BOX (Modifier DTD) "
• "ID (Modifier DTD)"
• "PICTURE (Modifier DTD)" (this is not a required element when importing data)
• "TEXT (Modifier DTD)"
• "STORY (Modifier DTD)"
• "CONTENT (Modifier DTD)"
Response
The following XML shows how some of these parameters work.
A preview of a QuarkXPress project with a value in the data import XML tags applied to the text
boxes.
File not found.Alerts
HTTP Error #404
QuarkXPress Server Error #–43
This alert displays if you specify an invalid XML file or request a document that
is not in the document pool.
document is not
valid or well
formed.
HTTP Error #500The XML
This alert displays if the XML you supply is not well-formed or does not adhere
to the Modifier DTD.
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 93
USING THE WEB INTERFACE
with the
specified
identifier.
box is not a
picture or text
box.
cannot be
manipulated.
picture (#106)
pathname
HTTP Error #500There is no box
This alert displays if the box specified by the child text node of the <ID> element
does not exist.
HTTP Error #500The specified
This alert displays if you request a box that is not a text box or a picture box.
HTTP Error #500A locked layer
This alert displays if you request data from a box on a locked layer.
What to do: Open the project in QuarkXPress, display the Layers palette, and
unlock the box's layer.
HTTP Error #500Unable to read
QuarkXPress Server Error #–109
This alert displays if you try to import a text file into a picture box.
HTTP Error #404Bad filename/
QuarkXPress Server Error #–37
This alert displays if you try to import an invalid or nonexistent file into a box.
Logs
Example GET
URL
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
//STEP 2(SPECIFIC TO REQUESTS):Create the data import
//request and embed it in request context
ModifierRequest request = new ModifierRequest();
Project requestContents = new Project();
Content boxContent1 = new Content();
Box box1 = new Box();
box1.UID = txtBox1;
box1.content = boxContent1;
Layout layout1 = new Layout();
layout1.name = layoutText;
if(!this.content1.Text.Equals(""))
{
boxContent1.value = this.content1.Text;
Text text1 = new Text();
text1.font = this.fontname1.Text;
box1.text = text1;
if(this.includestylesheets1.Checked == false)
boxContent1.includeStylesheets = "false";
if(this.convertquotes1.Checked == false)
boxContent1.convertQuotes = "false";
}
else if (null != uplTheFile.PostedFile)
{
Stream theStream = uplTheFile.PostedFile.InputStream;
StreamReader reader = new StreamReader(theStream);
boxContent1.value = reader.ReadToEnd();
}
layout1.boxes = new Box[]{box1};
requestContents.layouts = new Layout[]{layout1};
request.contents = requestContents;
rc.request = request;
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 95
USING THE WEB INTERFACE
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Notes
BoxParam XTensions software lets you import only files in the document pool. Modifier XTensions
software, however, lets you import files located anywhere on the server computer or any accessible
network location.
Exporting Job Jackets files during deconstruction
While using the xml namespace to deconstruct a QuarkXPress project, you can specify the
jjname parameter in the same request to output the Job Jackets file to the document pool.
You can then use the construct namespace to create new QuarkXPress projects that are
based on that Job Jackets file's resources and layout specifications.
The jjname parameter exports QuarkXPress project resources and layout specifications to
a Job Ticket. Resources defined at the Job Jackets level are not exported to the Job Ticket.
Using XML deconstruct and construct
The xml namespace deconstructs a project according to the Modifier DTD. The construct
namespace lets you turn an XML representation of a QuarkXPress project back into a
QuarkXPress project.
This means you can deconstruct a project into an XML representation, change the XML
in accordance with the Modifier DTD, and then have the server generate an updated
version of the QuarkXPress project. You can even create new QuarkXPress projects from
scratch using XML.
In addition, you can use the construct namespace to:
• Create a page based on a master page
• Create a project from XML, using a Job Jackets file as the basis for the project
• Modify text font and style, including OpenType styles
• Apply style sheets and local formatting to text
• Create and populate tables
• Import pictures into picture boxes and specify picture attributes
The DTD used for XML construction and deconstruction is completely Unicode-compliant,
making it ideal for use in international publishing. Furthermore, the use of this DTD
ensures that the schema of XML output created by Constructor does not change when
server preferences change. For more information, see "Modifier DTD (annotated)."
96 | QXP SERVER 8.1 WEB INTEGRATION GUIDE
USING THE WEB INTERFACE
Some minor QuarkXPress features are not available through the Modifier DTD. However,
this DTD represents the majority of all user-editable aspects of a QuarkXPress project.
The deconstruct namespace/request no longer exists. If you try to use it in this version of
QuarkXPress Server, an error is returned.
Deconstructing a project
The xml namespace returns an XML representation of the target project. To use this
namespace, use a URL like the following:
http://QXPServer8:8080/xml/project1.qxp
When you use the xml namespace, QuarkXPress Server returns an XML file that represents
the deconstructed project. This XML file adheres to the Modifier DTD (see "Modifier DTD
(annotated)").
An XML file that represents a deconstructed project does not contain all of the information
necessary to reconstruct the project. The definitions of the project's resources (such as style
sheets, colors, and master page definitions) are stored in a Job Jackets file. For example,
you can apply a style sheet to a paragraph by indicating the style sheet’s name, like so:
Namespace
<PARAGRAPH PARASTYLE="BodyText">
<RICHTEXT>The sun has risen.</RICHTEXT>
</PARAGRAPH>
The above information is included in the deconstructed project’s XML file. The definition
of the “BodyText” style sheet, however, is stored in the Job Jackets file.
The URL of a deconstructed Job Jackets file is indicated by the PROJECT@JOBJACKET
attribute. If you need access to new colors, style sheets, master pages, or other resources,
add them to the Job Jackets file indicated by this URL.
Projects can also refer to resources defined with the QuarkXPress Server Document Controls
submenu (Server/QuarkXPress Server menu). QuarkXPress Server looks for resources first
in the Job Jackets file and then in the server-defined resources.
XML
Creates an XML file from a QuarkXPress project. The XML is returned in a fixed format
that adheres to the Modifier DTD. You can use the returned XML to create or modify a
QuarkXPress document using the construct namespace or modify parameter.
xml
Modifier DTDDTD
Parameters
box
boxes
XSL
Returns XML only for the box with the given ID or name.
Returns XML only for the boxes with the IDs or names supplied as a
comma -separated list.
Specifies the path of an XSL file for transforming the returned XML. Use
the file: indicator to specify the path.
Specifies the name or number of the layout containing the box to render.
The first layout is layout 1. Note that this parameter works only with the
box parameter.
Tells the xml namespace to describe <GEOMETRY> elements using
<RELPOSITION> rather than <POSITION>. This allows an item's position
to be defined either in relation to the page or in relation to the entire
spread.
Use only with the relativegeometry parameter. Tells the xml
namespace to describe <GEOMETRY> elements using <RELPOSITION>
elements in which ORIGIN@RELATIVETO="page" (as opposed to
"spread").
QuarkXPress Server returns copyfitting information for QuarkCopyDesk
articles by default. To retrieve copyfitting information when
deconstructing a QuarkXPress project, include copyfitinfo=true in
the xml request. For example:
If the request succeeds, a transaction success message is written to the QuarkXPress Server transaction
log file. This message includes the date, time, request type, project name, response type, response
size in bytes, and client IP address. For example:
You can also deconstruct QuarkCopyDesk articles. To deconstruct a QuarkCopyDesk article, use
the following:
http://localhost:8080/xml/copydesk/abc.qcd
Request object name: XMLRequest
XMLRequest xmlRequest = new XMLRequest();
QRequestContext context = new QRequestContext();
context.setDocumentName("SAMPLE_DOCUMENT.qxp");
context.setResponseAsURL(false);
context.setRequest(xmlRequest);
QContentData response =
QRequestProcessor.getInstance().processRequest(context);
System.out.println(response.getTextData());
QXP SERVER 8.1 WEB INTEGRATION GUIDE | 99
USING THE WEB INTERFACE
Constructing a project
The construct namespace takes two arguments: The name of the project to be created,
and a modify parameter that points to the XML file or string that describes how to create
the project. For example:
http://QXPServer8:8080/construct/project1.qxp?
modify=file:path to XML file on server
There is a length limitation of 4096 characters on URLs, so you will probably want to use
an XML file rather than an XML string.
If you are using QuarkXPress Server Manager, you can send a similar command with a
QuarkXPress Server Manager URL or through Web services.
Every project created with the construct namespace must be based on a Job Ticket in a
Job Jackets file. Using construct to create a project is roughly equivalent to using the
File > New > Project from Ticket command in QuarkXPress.
Namespace
Parameters
When you create a project using the construct namespace, you must supply the path to
the Job Jackets file that will supply the project's resources. To do so, indicate the URL of
the Job Jackets file in the PROJECT@JOBJACKET attribute and the name of the Job Ticket
in the PROJECT@JOBTICKET attribute. (<PROJECT> is the root element of the Modifier
DTD. For more information, see "Modifier DTD (annotated).")
For example, to create a project from a Job Ticket named "Tall US Brochure Ticket" in a
Job Jackets file named "BrochureJJ.xml," use XML like the following: