Quark QuarkXPress Server 9.2 Integration Guide

Category
Software
Type
Integration Guide
QXP Server 9.2 Web
Integration Guide
Contents
Overview.........................................................................................10
Supported interfaces............................................................................................10
The Dynamic Publishing Process (DPP).................................................................10
The WIG and the XTensions Developer Kit (XDK)................................................11
Changes in this version...................................................................12
Getting started...............................................................................14
Getting started: HTTP and HTTPS........................................................................14
Dissecting a QXP Server URL........................................................................................14
Interpreting the QXP Server Manager response...........................................................15
HTTP GET and POST Requests.....................................................................................15
Getting started: Web services..............................................................................19
QRequestContext..........................................................................................................20
RequestService..............................................................................................................21
QRequest......................................................................................................................25
RequestParameters.......................................................................................................25
NameValueParam..........................................................................................................26
QContentData...............................................................................................................26
QException...................................................................................................................27
QXP Server Manager............................................................................................27
Using the Web interface.................................................................29
Understanding rendering......................................................................................29
Understanding logging.........................................................................................30
Understanding render types.................................................................................31
ave.................................................................................................................................31
eps.................................................................................................................................33
epub..............................................................................................................................35
jpeg...............................................................................................................................36
literal..............................................................................................................................37
pdf.................................................................................................................................38
png................................................................................................................................42
postscript.......................................................................................................................43
qcddoc..........................................................................................................................45
ii | QXP SERVER 9.2 WEB INTEGRATION GUIDE
CONTENTS
qxpdoc..........................................................................................................................46
screenpdf.......................................................................................................................47
swf.................................................................................................................................51
Understanding render modifiers...........................................................................53
Box................................................................................................................................53
Boxes.............................................................................................................................54
Compositionzone..........................................................................................................55
Layer..............................................................................................................................55
Layout............................................................................................................................57
Movepages....................................................................................................................57
Page..............................................................................................................................58
Pages.............................................................................................................................59
Scale..............................................................................................................................60
Spread...........................................................................................................................60
Spreads.........................................................................................................................60
Using content modifiers........................................................................................61
Inserting text.................................................................................................................61
Applying a font at import..............................................................................................62
Inserting a picture.........................................................................................................63
Saving a projects with a new name...............................................................................64
Importing XML with placeholders.................................................................................65
Using XML modify................................................................................................67
Modifying box properties and content.........................................................................67
Creating boxes..............................................................................................................71
Deleting boxes..............................................................................................................73
Grouping and ungrouping items...................................................................................74
Creating tables..............................................................................................................75
Using inline tables.........................................................................................................76
Modifying text attributes...............................................................................................79
Modifying picture properties.........................................................................................82
Importing data...............................................................................................................85
Exporting Job Jackets files during deconstruction.......................................................88
Using interactivity..........................................................................................................88
Using XML deconstruct and construct..................................................................88
Deconstructing a project...............................................................................................89
Constructing a project...................................................................................................92
Working with pages and spreads..................................................................................95
Working with layers.......................................................................................................96
Working with boxes.......................................................................................................96
Working with groups.....................................................................................................98
Working with pictures....................................................................................................99
Working with text........................................................................................................100
Working with tables.....................................................................................................102
QXP SERVER 9.2 WEB INTEGRATION GUIDE | iii
CONTENTS
Working with sections.................................................................................................104
Working with Composition Zones...............................................................................105
Using XSL transformation............................................................................................105
Working with lists........................................................................................................106
Working with anchored boxes.....................................................................................106
Working with placeholders..........................................................................................107
Working with metadata...............................................................................................109
Working with hidden text............................................................................................110
Creating and using hyperlinks.............................................................................111
Web hyperlinks............................................................................................................111
Anchor hyperlinks........................................................................................................111
Page hyperlinks...........................................................................................................111
Using the Streaming Document Provider...........................................................112
Using administrative request handlers...............................................................112
Addfile.........................................................................................................................113
Delete..........................................................................................................................116
Evaluate.......................................................................................................................117
Exportprefsasjj.............................................................................................................118
Fileinfo.........................................................................................................................119
Flush............................................................................................................................120
Flushall........................................................................................................................120
Getdocinfo..................................................................................................................121
Getdocpoollist.............................................................................................................122
Getlogs........................................................................................................................123
Getprefs......................................................................................................................123
Getprocessid...............................................................................................................124
Getprojinfo..................................................................................................................124
Getrendererprefs.........................................................................................................125
Getserverinfo...............................................................................................................126
Jobjacket.....................................................................................................................127
Preflight.......................................................................................................................127
Setprefs.......................................................................................................................128
Setrendererprefs..........................................................................................................129
Updateprefsfromjj.......................................................................................................134
Using the QXPSM SDK.................................................................135
Writing a Java QXPSM client..............................................................................135
Java sample: Deconstructing a project.......................................................................136
Java sample: Rendering a PDF....................................................................................136
Java sample: Chained request....................................................................................136
Java sample: AddFile request.....................................................................................137
Writing a .NET QXPSM client.............................................................................137
iv | QXP SERVER 9.2 WEB INTEGRATION GUIDE
CONTENTS
.NET sample: Deconstructing a project......................................................................138
.NET sample: Rendering a PDF...................................................................................139
.NET sample: Chained request...................................................................................139
Writing an Objective-C client for Mac OS or iOS................................................139
Objective-C sample: Deconstructing a project...........................................................141
Objective-C sample: Rendering a PDF.......................................................................141
Objective-C sample: Chained request........................................................................142
Extending QuarkXPress Server Manager...........................................................142
Writing special request handlers.................................................................................143
Implementing a custom load balancer........................................................................143
Keep document open (sessions).................................................................................144
Using the Extensibility tool..........................................................................................144
Understanding ManagerSDK.xml................................................................................146
Using the RequestParameters class.............................................................................147
Modifier DTD (annotated).............................................................149
Entities (Modifier DTD).......................................................................................149
ADDCELLS (Modifier DTD).................................................................................151
ALIGNHORSETTINGS (Modifier DTD).................................................................152
ALIGNVERSETTINGS (Modifier DTD).................................................................153
ALLOWBOXOFFPAGE (Modifier DTD)...............................................................153
ALLOWBOXONTOPASTEBOARD (Modifier DTD)..............................................154
ANCHOREDBOXREF (Modifier DTD)..................................................................154
ARTICLE (Modifier DTD).....................................................................................155
AUTHOR (Modifier DTD).....................................................................................155
BNSTYLE (Modifier DTD)....................................................................................156
BOTTOM (Modifier DTD)....................................................................................156
BOTTOMGRID (Modifier DTD)............................................................................156
BOX (Modifier DTD)............................................................................................157
BOXREF (Modifier DTD).....................................................................................159
CALLOUTANCHOR (Modifier DTD)....................................................................160
CALLOUTBOXREF (Modifier DTD)......................................................................161
CELL (Modifier DTD)...........................................................................................161
CHILDID (Modifier DTD).....................................................................................163
CLIPPING (Modifier DTD)...................................................................................163
COLGROUP (Modifier DTD)................................................................................165
COLSPEC (Modifier DTD)....................................................................................166
COLUMN (Modifier DTD)....................................................................................166
COMPONENT (Modifier DTD)............................................................................167
COMPOSITIONZONE (Modifier DTD).................................................................168
CONTENT (Modifier DTD)..................................................................................170
CONTENTPH (Modifier DTD)..............................................................................172
QXP SERVER 9.2 WEB INTEGRATION GUIDE | v
CONTENTS
CONTINUEDHEADER (Modifier DTD)................................................................172
CONTINUEDTROWSTYLE (Modifier DTD)..........................................................173
CONTOUR (Modifier DTD)..................................................................................173
CONTOURS (Modifier DTD)................................................................................174
COPYFIT (Modifier DTD).....................................................................................174
COPYRIGHT (Modifier DTD)...............................................................................175
DATAPROVIDER (Modifier DTD)........................................................................175
DELETECELLS (Modifier DTD)............................................................................175
DESCRIPTION (Modifier DTD)............................................................................176
DROPCAP (Modifier DTD)..................................................................................176
EBOOKMETADATA (Modifier DTD)...................................................................176
ENTRY (Modifier DTD)........................................................................................177
EVENTCOLSTYLE (Modifier DTD).......................................................................177
EVENTROWSTYLE (Modifier DTD).....................................................................177
FIRSTTCOLSTYLE (Modifier DTD).......................................................................178
FIT (Modifier DTD)..............................................................................................178
FITTEXT (Modifier DTD)......................................................................................179
FOOTER (Modifier DTD).....................................................................................180
FOOTERTROWSTYLE (Modifier DTD).................................................................181
FORMAT (Modifier DTD)....................................................................................181
FRAME (Modifier DTD).......................................................................................183
GEOMETRY (Modifier DTD)................................................................................184
GRID (Modifier DTD)...........................................................................................186
GRIDLINE (Modifier DTD)...................................................................................186
GROUP (Modifier DTD).......................................................................................187
GROUPCHARACTERS (Modifier DTD)................................................................188
GROWACROSS (Modifier DTD)..........................................................................188
GROWDOWN (Modifier DTD).............................................................................189
HEADER (Modifier DTD).....................................................................................189
HEADTROWSTYLE (Modifier DTD).....................................................................189
HEIGHT(Modifier DTD).......................................................................................190
HIDDEN (Modifier DTD)......................................................................................190
HYPERLINK (Modifier DTD)................................................................................191
ID (Modifier DTD)................................................................................................192
INLINETABLE (Modifier DTD).............................................................................192
INSET (Modifier DTD).........................................................................................193
INTERACTIVITY (Modifier DTD)..........................................................................193
ISBN (Modifier DTD)...........................................................................................194
KEEPLINESTOGETHER (Modifier DTD)..............................................................194
KEYWORDS (Modifier DTD)...............................................................................195
LASTTCOLSTYLE (Modifier DTD)........................................................................195
LAYER (Modifier DTD)........................................................................................195
LAYOUT (Modifier DTD).....................................................................................196
vi | QXP SERVER 9.2 WEB INTEGRATION GUIDE
CONTENTS
LAYOUTREF (Modifier DTD)...............................................................................197
LEFT (Modifier DTD)...........................................................................................198
LEFTCONTROLPOINT (Modifier DTD)................................................................198
LEFTGRID (Modifier DTD)...................................................................................198
LINESTYLE (Modifier DTD).................................................................................199
LINKEDBOX (Modifier DTD)...............................................................................200
LIST (Modifier DTD)............................................................................................201
LOCATION (Modifier DTD).................................................................................201
LOCKTOGRID (Modifier DTD).............................................................................201
MAX (Modifier DTD)...........................................................................................202
METADATA (Modifier DTD)................................................................................202
MIN (Modifier DTD)............................................................................................202
MOVEDOWN (Modifier DTD).............................................................................202
MOVELEFT (Modifier DTD).................................................................................203
MOVERIGHT (Modifier DTD)..............................................................................203
MOVEUP (Modifier DTD)....................................................................................203
ODDTROWSTYLE (Modifier DTD).......................................................................203
ODDTCOLSTYLE (Modifier DTD)........................................................................204
ORIGIN (Modifier DTD).......................................................................................204
OVERMATTER (Modifier DTD)............................................................................205
PAGE (Modifier DTD)..........................................................................................205
PAGEREF (Modifier DTD)...................................................................................206
PARAGRAPH (Modifier DTD)..............................................................................207
PARENTTABLE (Modifier DTD)...........................................................................208
PICTURE (Modifier DTD).....................................................................................208
PLACEHOLDER (Modifier DTD)..........................................................................211
POSITION (Modifier DTD)...................................................................................211
PROJECT (Modifier DTD)....................................................................................211
PUBLICATION (Modifier DTD)............................................................................212
PUBLICATIONCHANNEL (Modifier DTD)...........................................................213
PUBLISHER (Modifier DTD).................................................................................213
RELPOSITION (Modifier DTD).............................................................................213
RGBCOLOR (Modifier DTD)................................................................................213
RICHTEXT (Modifier DTD)...................................................................................214
RIGHT (Modifier DTD).........................................................................................222
RIGHTCONTROLPOINT (Modifier DTD)..............................................................223
RIGHTGRID (Modifier DTD)................................................................................223
ROW (Modifier DTD)...........................................................................................224
RUBI (Modifier DTD)...........................................................................................226
RUBITEXT (Modifier DTD)...................................................................................226
RULE (Modifier DTD)..........................................................................................227
RUNAROUND (Modifier DTD)............................................................................229
SAVEAS (Modifier DTD)......................................................................................231
QXP SERVER 9.2 WEB INTEGRATION GUIDE | vii
CONTENTS
SCALETO (Modifier DTD)....................................................................................232
SECTION (Modifier DTD)....................................................................................233
SHADOW (Modifier DTD)...................................................................................233
SHRINKACROSS (Modifier DTD).........................................................................235
SHRINKDOWN (Modifier DTD)...........................................................................236
SIZE (Modifier DTD)............................................................................................236
SPINEIMAGE (Modifier DTD)..............................................................................236
SPLINESHAPE (Modifier DTD)............................................................................237
SPREAD (Modifier DTD)......................................................................................238
STACKINGORDER (Modifier DTD)......................................................................238
STORY (Modifier DTD)........................................................................................238
SUPPRESSOUTPUT (Modifier DTD)....................................................................239
TAB (Modifier DTD)............................................................................................239
TABLE (Modifier DTD).........................................................................................240
TABLEBREAK (Modifier DTD).............................................................................242
TABLESTYLE (Modifier DTD)...............................................................................243
TABSPEC (Modifier DTD)....................................................................................243
TBODY (Modifier DTD).......................................................................................244
TCOL (Modifier DTD)..........................................................................................244
TCOLSTYLE (Modifier DTD)................................................................................244
TCONTINUED (Modifier DTD)............................................................................245
TEXT (Modifier DTD)...........................................................................................245
TEXTNODEPH (Modifier DTD)............................................................................247
TEXTPH (Modifier DTD)......................................................................................247
TFOOT (Modifier DTD)........................................................................................248
THEAD (Modifier DTD).......................................................................................248
TITLE (Modifier DTD)..........................................................................................248
TOP (Modifier DTD)............................................................................................248
TOPGRID (Modifier DTD)....................................................................................248
TROW (Modifier DTD).........................................................................................249
TROWSTYLE (Modifier DTD)...............................................................................250
VALUE (Modifier DTD)........................................................................................250
VERTEX (Modifier DTD)......................................................................................251
VERTEXPOINT (Modifier DTD)...........................................................................251
VERTICES (Modifier DTD)...................................................................................252
WIDTH (Modifier DTD)........................................................................................252
Sample applications.......................................................................253
Sample applications: QXP Server Manager........................................................253
ASP.NET samples........................................................................................................253
C# samples..................................................................................................................253
Java samples...............................................................................................................254
viii | QXP SERVER 9.2 WEB INTEGRATION GUIDE
CONTENTS
JSP samples.................................................................................................................254
Objective-C samples...................................................................................................254
Sample applications legal notice.........................................................................254
Contacting Quark..........................................................................263
Legal notices.................................................................................264
QXP SERVER 9.2 WEB INTEGRATION GUIDE | ix
CONTENTS
Overview
Welcome to the QuarkXPress® Server Web Integration Guide (WIG). The WIG describes the
QuarkXPress Server interface and includes sample applications that demonstrate how to
build a solution that integrates with QuarkXPress Server or QuarkXPress Server Manager.
Supported interfaces
The WIG describes the interfaces available in QuarkXPress Server:
• HTTP: Lets you interact with the server using URLs that contain calls or point to XML
files that contain calls. You can write client applications in any language that supports
HTTP requests. For more information, see "Getting started: HTTP and HTTPS".
• HTTPS: Provides secure HTTP access.
• Web services: Lets you interact with the server via Web services using the
QuarkXPress Server Manager object model. You can write client applications in Java, .NET,
or any other programming language that can consume SOAP-based Web services. For more
information, see "Getting started: Web services".
To develop a custom load balancer or a custom application in Java, you must have
version 1.5 or 1.6 of the JDK.
The Dynamic Publishing Process (DPP)
The Dynamic Publishing Process (DPP) has several stages. You may not need to use all of
these stages every time, but this the order in which they occur:
• Pre-Processing Stage: During this stage, QuarkXPress Server performs any necessary initial
steps, such as creating style sheets, colors, and H&J rules for a new QuarkXPress project.
• Content Loading Stage: During this stage, QuarkXPress Server loads dynamic content into
boxes in the project.
• Layout Modification Stage: During this stage, QuarkXPress Server modifies the layout of the
project.
10 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
OVERVIEW
• Post-Processing Stage: During this stage, QuarkXPress Server examines the project and
performs maintenance tasks.
The WIG and the XTensions Developer Kit (XDK)
The WIG lets Web developers build client applications that use the features available in
QuarkXPress Server. The XDK lets software developers implement features that are not
available in QuarkXPress Server, such as server-side processing and application-specific
services.
The QuarkXPress Server XDK requires knowledge of C or C++.
QXP SERVER 9.2 WEB INTEGRATION GUIDE | 11
OVERVIEW
Changes in this version
This version of the QuarkXPress Server WIG includes the following changes.
New features
The following new features have been added:
• Inline tables: For more information, see "Using inline tables."
• Streaming document providers: For more information, see "Using the Streaming Document
Provider."
• App Studio enrichments: You can now create and modify App Studio assets in Modifier
XML. For more information, see "Using interactivity."
• The ability to create ePUB output with ePUB output styles. For more information, see
"epub."
• The ability to create hyperlinks. For more information, see "Creating and using hyperlinks."
Changes to the Modifier DTD
The following element types have been updated:
• PROJECT (Modifier DTD)
• STORY (Modifier DTD)
The following new element types have been added:
• BOTTOMGRID (Modifier DTD)
• COLGROUP (Modifier DTD)
• CONTINUEDTROWSTYLE (Modifier DTD)
• ENTRY (Modifier DTD)
• EVENTCOLSTYLE (Modifier DTD)
• EVENTROWSTYLE (Modifier DTD)
• FIRSTTCOLSTYLE (Modifier DTD)
• FOOTERTROWSTYLE (Modifier DTD)
12 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
CHANGES IN THIS VERSION
• HEADTROWSTYLE (Modifier DTD)
• INLINETABLE (Modifier DTD)
• LASTTCOLSTYLE (Modifier DTD)
• LEFTGRID (Modifier DTD)
• ODDTCOLSTYLE (Modifier DTD)
• ODDTROWSTYLE (Modifier DTD)
• RIGHTGRID (Modifier DTD)
• TABLESTYLE (Modifier DTD)
• TBODY (Modifier DTD)
• TCOL (Modifier DTD)
• TCOLSTYLE (Modifier DTD)
• TCONTINUED (Modifier DTD)
• TFOOT (Modifier DTD)
• THEAD (Modifier DTD)
• TOPGRID (Modifier DTD)
• TROW (Modifier DTD)
• TROWSTYLE (Modifier DTD)
QXP SERVER 9.2 WEB INTEGRATION GUIDE | 13
CHANGES IN THIS VERSION
Getting started
The topics below describe how to create requests for the QuarkXPress Server Web interface.
For information about the options available in such requests, see "Using the Web interface."
Getting started: HTTP and HTTPS
You can submit HTTP and HTTPS requests to QuarkXPress Server as URLs, either manually
from a browser or automatically from an HTTP client application. QuarkXPress Server
processes such requests and returns rendered content in the HTTP or HTTP responses.
Depending on the type of request, the QuarkXPress Server preferences, and the type of
content returned, the rendered content may be downloaded by the end user, displayed in
the end-user's browser, or saved to a file system location accessible to QuarkXPress Server.
You can write a QuarkXPress Server client application in almost any language that can
generate HTTP GET/POST requests. A QuarkXPress Server HTTP-based solution typically
consists of QuarkXPress Server (running on a server computer connected to a network)
plus a front-end application (usually Web-based) that provides a graphical user interface
(GUI) for end users. The front-end application translates end users' input into HTTP or
HTTPS requests and sends the requests to QuarkXPress Server or QuarkXPress Server
Manager, which processes the requests and returns rendered content.
Dissecting a QXP Server URL
To interact with QuarkXPress Server from a Web browser, use a URL like the following:
http://[server]:[port]/[namespace]/[directory]/[DocumentName]?[parameter]=Value
•
[server]: The name or IP address of the computer for QuarkXPress Server or
QuarkXPress Server Manager.
•
[port]: The port number on which to contact QuarkXPress Server or QuarkXPress Server
Manager. The default port is 8080 for QuarkXPress Server and 8090 for QuarkXPress Server
Manager.
•
[namespace]: Defines what the URL action will be and any parameters and conditions
available to that namespace.
•
[directory]: The path in the document pool where the project is stored, relative to the
QuarkXPress Server document pool. To access the root level, no directory path is necessary.
14 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
GETTING STARTED
(Note that you can also supply assets as part of a multipart HTTP request. For more
information, see "Using HTTP POST with QXP Server.")
•
[DocumentName]: The name of the QuarkXPress project to be processed.
•
[parameter]: Further defines the URL action with attributes and values allowed for the
namespace or general call. Pass parameters in the form attribute=value, with parameters
separated by the "&" character.
For QuarkXPress Server Manager, use a URL like the following:
http://[server]:[port]/qxpsm/request/[namespace]/[directory]/
[DocumentName]?[parameter]=Value
Prior to QuarkXPress Server 9.0, you had to use different URL constructions when sending
requests to an instance of QuarkXPress Server Manager in a QPS installation than you did
when sending requests to a free-standing instance of QuarkXPress Server Manager. In
versions 9.0 and later, both can use /qxpsm/request/ after [port]/ .
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, plus any
header error codes returned by QuarkXPress Server. For example:
<?xml version="1.0" encoding="UTF-8" ?>
<error>
<httpresponsecode>500</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
QXP SERVER 9.2 WEB INTEGRATION GUIDE | 15
GETTING STARTED
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.
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
name, use HTML like the following:
<TABLE cellSpacing=1 cellPadding=1 border=1 id=TABLE1 >
<TBODY>
<TR>
<TD>
<INPUT id=ServerTxt name=ServerTxt value="Server ID"
readOnly size=13 style="WIDTH: 107px; HEIGHT: 22px">
</TD>
<TD>
<INPUT id=Server maxLength=50 size=16 value=localhost name=Server
style="WIDTH: 170px; HEIGHT: 22px">
</TD>
</TR>
<TR>
<TD>
<INPUT id=PortTxt name=PortTxt value="Port Number"
readOnly size=13 style="WIDTH: 107px; HEIGHT: 22px">
</TD>
<TD>
<INPUT id=Port maxLength=50 size=17 value=8080 name=Port
style="WIDTH: 170px; HEIGHT: 22px">
</TD>
</TR>
<TR>
<TBODY>
</TABLE>
<TR>
<p></p>
<TD>
<INPUT id=DocTxt name=DocTxt value="Document Name"
readOnly size=13 style="WIDTH: 107px; HEIGHT: 22px">
</TD>
<TD>
<INPUT id=Doc maxLength=50 size=18 name=Doc style=
"WIDTH: 170px; HEIGHT: 22px">
</TD>
</TR>
To create a drop-down menu that lets the end user specify a render format, use HTML like
the following:
<SELECT id="select1" name="returntype">
<OPTION value="jpeg">JPEG</OPTION>
<OPTION value="pdf">PDF</OPTION>
<OPTION value="qxpdoc">QuarkXPress document</OPTION>
<OPTION value="eps">EPS Document</OPTION>
16 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
GETTING STARTED
<OPTION value="postscript">POSTSCRIPT</OPTION>
<OPTION value="png">PNG</OPTION>
</SELECT><td/>
To create a drop-down menu that lets the end user specify a rendering scale, use HTML
like the following:
<SELECT id="select2" name="scale">
<OPTION value="1">100%</OPTION>
<OPTION value="2">200%</OPTION>
<OPTION value="3">300%</OPTION>
<OPTION value="5">500%</OPTION>
<OPTION value=".5">50%</OPTION>
</SELECT><p/>
To create input fields that let the end user specify a box name and the name of a file to
be imported into that box, use HTML like the following:
<TD>
<INPUT id=box1Txt value="Box Name"
readOnly style="WIDTH: 181px; HEIGHT: 22px" size=16>
</TD>
<TD>
<INPUT id=box1 maxLength=256 size=43 style="
WIDTH: 293px; HEIGHT: 22px"></TD>
</TR>
<TR>
<TR>
<TD>
<INPUT id=box1FileTxt value="File on Server"
readOnly style="WIDTH: 181px; HEIGHT: 22px" >
</TD>
<TD>
<INPUT id=box1File maxLength=256 size=43 style="
WIDTH: 293px; HEIGHT: 22px">
</TD>
</TR>
To create fields that let the end user enter a page number a layout number, use HTML like
the following:
<TABLE cellSpacing=1 cellPadding=1 border=1 style="WIDTH: 188px; HEIGHT: 61px">
<TR>
<TD>
<INPUT id=PageTxt value = "Page"
readOnly style="WIDTH: 50px; HEIGHT: 22px" size=3>
</TD>
<TD>
<input id=Page size="16" maxlength="256"
style="WIDTH: 147px; HEIGHT: 22px">
</TD>
</TR>
<TR>
<TD>
<INPUT id=LayoutTxt value = "Layout"
readOnly style ="WIDTH: 50px; HEIGHT: 22px" size=4>
</TD>
<TD>
<input id=Layout size="16" maxlength="256"
style="WIDTH: 147px; HEIGHT: 22px">
</TD>
</TR>
</TABLE>
To create a button that lets the end user submit the request, use HTML like the following:
<input type="submit" value="Render document"
name="Submit" LANGUAGE="javascript"
onclick="return Submit_onclick()"/>
QXP SERVER 9.2 WEB INTEGRATION GUIDE | 17
GETTING STARTED
The above HTML calls a function named Submit_onclick(). You can add such a function
to the <HEAD> section of the HTML. For example:
<head>
<TITLE>Quark Stream</TITLE>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
function Submit_onclick() {
var prefix;
var renderer;
var file;
var url;
var box1Name;
var dataImportStamp = "@dataimport";
prefix = "http://" + document.getElementById("Server").value + ":";
port = document.getElementById("Port").value + "/";
renderer = document.getElementById("select1").value + "/";
file = document.getElementById("Doc").value;
box1Name = document.getElementById("box1").value;
if (box1Name != "") {
document.getElementById("box1File").name = box1Name + dataImportStamp;
} else {
document.getElementById("box1File").name = "";
}
document.getElementById("Page").name = "Page";
document.getElementById("Layout").name = "Layout";
url = prefix + port + renderer + file;
document.getElementById("form1").action = url;
}
</script>
</head>
The Submit_onclick() function reads the values from the formand builds a request URL
using the server, port, and render type.
If the end user specifies a file name in the "File on Server" text box, he or she must add
file: to the beginning of the file path (for example, file:C:\data.txt).
The code above adds @dataimport to the end of the box name to accommodate data
import.
The action of the form is defined by this line:
document.getElementById("form1").action = url;
This form's method is GET. The user agent gets the value (the URL) of the action, appends
a ? to it, adds the form data set, and submits the URL.
In this scenario, form data must be in ASCII.
Using HTTP GET with QXP Server Manager
HTTP GET with QuarkXPress Server Manager works the same way as HTTP GET with
QuarkXPress Server (see "Using HTTP GET with QXP Server"), except that Quark does not
recommend using GET if you are working with non-ASCII characters. The behavior of GET
requests with characters is highly browser-dependent, and there is no standard that all
browsers follow. Instead, use POST.
18 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
GETTING STARTED
Using HTTP POST with QXP Server
Use HTML like the HTML in "Using HTTP GET with QXP Server" 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 HTML in "Using HTTP GET with QXP Server" to specify the
page number and layout number of the project. Differences between the GET method and
the POST method are described below.
The form section of the HTML should begin with the following line of code:
<form id = form1 method="post" enctype="multipart/form-data">
The following HTML creates a input fields that let the end user specify the name of a file
to be imported into a box:
<TD><INPUT id=box1FileTxt value="File on Client"
readOnly style="WIDTH: 180px; HEIGHT: 22px" ></TD>
<TD><input id=box1File type="file"
size="32" maxlength="256" style="WIDTH: 293px;
HEIGHT: 22px">
</TD></TR>
The action of the form is defined by this line:
document.getElementById("form1").action = url;
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.
When you use a multipart HTTP post request, you can include in the request any files
which are required by the rendering process, including QuarkXPress templates, picture
files, modifier XML, and digital publishing assets. For more information, see "Using the
Streaming Document Provider."
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]/qxpsm/services/RequestService?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.
QXP SERVER 9.2 WEB INTEGRATION GUIDE | 19
GETTING STARTED
For more information, see "Using the Web interface." In addition to the classes listed there,
the Web services interface includes the following:
•
RequestService processes QuarkXPress Server requests. This object's generic
processRequest() method takes a QRequestContext argument and returns a
QContentData object containing the response. For more information, see the sample
applications and "Using the Web interface."
•
QRequestContext is the argument you pass to RequestService's generic
processRequest() method.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. Web services returns
a QException object if an error occurs with any Web service method. You can use try/catch
blocks to handle QException objects.
If you've written a Server XTensions module, you can extend the WIG to include any
changes it makes to the Modifier DTD by simply modifying an XML file and regenerating
the stubs.
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 RequestService. Contains settings that must be set once per request. All
chained requests must be set inside the request context.
Description
Web service data objectType
DescriptionTypes
NameMembers
File or object name on which the command will be rendered.String
documentName
20 | QXP SERVER 9.2 WEB INTEGRATION GUIDE
GETTING STARTED
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269

Quark QuarkXPress Server 9.2 Integration Guide

Category
Software
Type
Integration Guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI