Skip to main content

 Publishing

Publishing PageSeeder data to print, the Web or both

Publishing

This section explains how PageSeeder can output to different formats and applications.

Overview

Some publishing situations need multiple processing stages in order for resolved values to be available for other parts of the process. 

This is similar to the way a conventional typesetting app must first compose the individual pages, then insert page numbers in the Table of Contents (ToC) then adjust all page numbers based on how many pages the fully resolved ToC is.

Examples include:

  • Creating the navigation and content of a website.
  • Transforming, then generating pages and cross-reference values for PDF.

Multi-stage, batch processing is available through the PageSeeder publish function. Using the PageSeeder Ant API, Publish leverages Apache Ant , an open source technology that is available on most operating systems.

To get the most out of Publish, needs an understanding of Ant. While there are many sources of Ant reference and learning material, the focus of this site is how PageSeeder interacts with Ant. 

More information on batch processing is available through Publish scripts. To modify the user interface or configure different options, see <publishing>. For example publish scripts, see PSML Ant scripts.

Publish Engine components

Publish Engine is a Java servlet that communicates with the PageSeeder Core using HTTP. The publish script is an Apache Ant build script.

After the script is instantiated, the Publish Control passes a request to the Publish Engine for the following actions:

  • query – the engine processes the script, returning a list of user-selectable options, such as the following:
    • generate Table of Contents.
    • use hi-resolution images.
  • publish – executes the script and selected options.
  • check – displays the status of selected publishing task.
  • cancel – cancel the current task.

Depending on the actions initiated, the response is passed back to the Publish Control, processed by XSLT and rendered on the user screen. The architecture is outlined in the following diagram:

Website-Engine-Overview1.png

Publish parameters

These parameters are accessed in ANT using the Task config.

The following table lists the parameters passed to the Publish Ant Script:

ParameterDescriptionExample
ps-jsessionidThe user’s jsessionid in PageSeeder
ps-hostThe webSiteAddress from global.properties
ps-portThe webSitePort from global.properties
ps-servletPrefixThe servletPrefix from global.properties
ps-sitePrefixThe sitePrefix from global.properties
ps-groupIdid of group initiating the publish12
ps-groupNameName of group initiating the publishacme-demo
ps-groupFolderPath of default group folder
/ps/acme/demo
ps-groupFolderNoPrefixPath of default group folder with
no site prefix
/acme/demo

ps-groupHostHost of default group foldermycompany.com
ps-groupPortPort of default group folder80
ps-groupTemplateTemplate for group (or default group if URI)acme
ps-globalTemplateglobalTemplate name from global.propertiesacmedefault
ps-style-ownerTemplate for group (or default group if URI). DEPRECATED in v5.99 use ps-groupTemplate instead.acme
ps-customFolderglobalTemplate name from global.properties. DEPRECATED in v5.99 use ps-globalTemplate instead.acmedefault

ps-workingPath to local unique working folder
or this group/document
ps-workingRootPath to root for all local working folders
ps-documentsRootPath to PageSeeder documents folder
only if Publish Engine is installed on
PageSeeder server)
ps-webRootPath to the root for ps-publisher webapp

ps-engineUrlThe external URL used to contact
the Publish Engine 
http://mycompany.com/ps-publisher
ps-sessionfolderA unique folder name for the current PS
user session to copy result files to
${ps-webRoot}/session/${ps-sessionfolder}
ps-usernameusername of the current userjsmith
ps-userIdID of the current user123
ps-userFirstnameGiven name of the current userJohn
ps-userSurnameFamily name of the current userSmith

Following are the parameters for a Document being published. These are not applicable for a Group or Batch being published or a document in the Loading Zone:

ParameterDescriptionExample
ps-uriIdURI id123
ps-uriSchemeURI schemehttp
ps-uriHostURI hostmycompany.com
ps-uriPortURI port80
ps-uriPathURI path/ps/acme/demo/minutes/2006-12-08.xml
ps-uriPathNoPrefixURI path without prefix/acme/minutes/demo/2006-12-08.xml
ps-uriPathNoGroupURI path without group prefix/minutes/demo/2006-12-08.xml
ps-uriFolderURI folder/ps/acme/demo/minutes
ps-uriFolderNoPrefixURI folder with /ps prefix/acme/demo/minutes
ps-uriFolderNoGroupURI folder without group prefix/minutes
ps-uriFilenameFilename2006-12-08.xml
ps-uriFilenameNoExtFilename without extension2006-12-08
ps-uriExtensionFile extensionxml
ps-uriDocumentIdURI docid (optional)mydoc1
ps-uriPublicationIdThe ID of the publication that URI is
the root of (optional)
mypub1
ps-uriPublicationTypeThe type of the publication that URI
is the root of (optional)
report
ps-style-configURI document typedefinition

The following parameters are for processing a Batch of documents (requires PageSeeder v5.98 or higher):

ParameterDescriptionExample
ps-batchIdsA comma-separated list of URI IDs in the batch123,456,789
ps-searchQuestionThe search question used to select the batch IDs from (optional)green
ps-searchQuestionFieldsThe search question fields used to select the batch IDs from (optional)pstitle,pscontent,psfilename,psdocid,psid
ps-searchFiltersThe search filters used to select the batch IDs from (optional)psdocumenttype:product,pslabel:simple
ps-searchRangesThe search ranges used to select the batch IDs from (optional)psproperty-title:[A;C},ranges=psxrefcount:{50;]

The following parameters are for processing a Document in the Loading Zone:

ParameterDescriptionExample
ps-uploadPathDocument path/minutes/2006-12-08.xml
ps-uploadFolderDocument folder/minutes
ps-uploadFilenameDocument filename2006-12-08.psml
ps-uploadFilenameNoExtFilename without extension2006-12-08
ps-uploadExtensionFile extensionxml
ps-uploadConfirmedIf script is run before displaying the Upload confirmation, the value is false, otherwise it’s true.

Publish messages

Generally all messages output from an Ant script are logged by PageSeeder, but the following special Ant messages are also recognized:

<echoxml><progress percent="[n]" /></echoxml>
  • where n is an integer from 0 to 100, displays progress on the Publish Page (not logged by PageSeeder).
<echoxml><displayUriPath>[url]</displayUriPath></echoxml>
  • where url is a URL beginning with / or http://, displays the content of [url]?t=[timestamp] when the Publish is complete.
<echoxml><previewPath>[path]</previewPath></echoxml>
  • which displays the PSML at this path on the Publish Engine as HTML where path is to start with ‘/session/${ps-sessionfolder}’ (PageSeeder does the translation to HTML).
<echoxml><publisherPath>[path]</publisherPath></echoxml>
  • which displays the file at this path on the Publish Engine where path is to start with ‘/session/${ps-sessionfolder}’. If using a Publish Engine on a different PageSeeder server, this can be used to proxy the request using the local PageSeeder URL; however, it is more efficient to use the direct Publish Engine URL with <displayUriPath>.
<echoxml><downloadLink>[url]</downloadLink></echoxml>
  • where url is a URL beginning with / or http://, displays a link to [url] when the Publish is complete.

PageSeeder Ant tasks

The PageSeeder External API defines a few Ant tasks that are useful to connect and interact with the PageSeeder Server. For details, see Ant API and Using Ant.

Created on , last edited on