Skip to main content

 Publishing

Publishing PageSeeder data to print, the Web or both

Task config

The Universal Ant PS Config is used to centralize common configuration parameters and to maintain transparency about the config in use.

Definition

<ps:config name="[name]" file="[file]">
  <entry key="[key]" value="[value]"/>
</ps:config>

Attributes

AttributeDescriptionRequiredDefault
nameThe name of the config - set to default if not specifiedNo
fileThe path of a file containing the properties to loadNo
load-defaultWhether to load the default properties from PageSeeder (only applicable if script is run within PageSeeder). When running a script within PageSeeder this MUST be false if setting the password or client.id properties.Notrue

Entries

Entries can also be specified individually using the inner element

<entry key="[key]" value="[value]">

Each entry overwrites any existing one with the same name.

Examples

Simplest case:

<ps:config />

 Reading properties from file:

<ps:config file="ps.properties" />

Named configuration:

<ps:config name="A" file="ps.properties" />
<ps:config name="B" file="ps.properties" />

Overriding file properties:

<ps:config file="ps.properties" >
  <entry key="scheme" value="https"/>
</ps:config>

Connect to a remote PageSeeder:

<ps:config name="destination"
           file="remote.properties"
           load-default="false" />

The remote.properties file (v6 only):

scheme=https
host=ps.example.org
port=443
servlet.prefix=/ps/servlet
site.prefix=/ps
client.id=cd4302db4b7a65b2
client.secret=R12Db1m_LGWZDV_nqUbqyx

If the OAuth client.secret is correct and the client’s grant type is client_credentials the user.token and username properties are set automatically.

Properties

The task adds a list of properties to the current project. Each property can be accessed using the following pattern: 

ps.config.[config].[property]

where [config] is the name of the config (if none was specified, default is used) and [property] is the name of the property.

ps.config.default.[property]

Following are the names of properties created by the PS config. They correspond to the old ps-* Ant properties except where 'new property' is specified.

PropertyDescription
jsessionidThe jsessionid for a PageSeeder user
hostUsually localhost unless publishing from a different PageSeeder.
portUsually 8282 (the same as apiPort) unless publishing from a different PageSeeder.
servlet.prefixThe servletPrefix from PageSeeder global.properties
site.prefixThe sitePrefix from PageSeeder global.properties
global.templateglobalTemplate name from PageSeeder global.properties (e.g. acmedefault)
group.idID of group initiating the publish (e.g. 12)
group.nameName of group initiating the publish (e.g. acme-demo)
group.folderPath of default group folder
  /ps/acme/demo
group.folder.no.prefixPath of default group folder with no site prefix
  /acme/demo
group.schemeScheme to find URIs with (should be http) – new property
group.hostUsually the host in the PageSeeder URL
(e.g. ps.mycompany.com)
group.portPort to find URIs with (should be 80)
group.templateTemplate of group/default group for URI (e.g. acme) – previously ps-style-owner
custom.folderglobalTemplate name from global.properties (e.g. acmedefault). – DEPRECATED in v5.99 use global.template instead.
workingPath to local unique working folder for this group/document
working.rootPath to root for all local working folders
documents.rootPath to PageSeeder documents folder
web.rootPath to the root for result files (see session.folder).
engine.urlThe external URL used to contact the Publish Engine
(e.g. http://mycompany.com/ps/publish)
session.folderA unique folder name for the current PS user session to copy result files to
(i.e. ${ps.config.default.web.root}/session/${ps.config.default.session.folder} )

Document/folder

The following parameters are only passed when a Document/folder is being published (not when a Group or Batch is being published and not when the document is in the Loading Zone):

PropertyDescription
uri.idURI id (e.g. 123)
uri.schemeURI scheme (e.g. http)
uri.hostURI host (e.g. ps.mycompany.com)
uri.portURI port (e.g. 80)
uri.pathURI path
  /ps/acme/demo/minutes/2006-12-08.xml
uri.path.no.prefixURI path without prefix
  /acme/demo/minutes/2006-12-08.xml
uri.path.no.groupURI path without group prefix
  /minutes/2006-12-08.xml
uri.folderURI folder
  /ps/acme/demo/minutes
uri.folder.no.prefixURI folder with /ps prefix
 /acme/demo/minutes
uri.folder.no.groupURI folder without group prefix
  /minutes
uri.filenameFilename (e.g.  2006-12-08.xml)
uri.filename.no.extFilename without extension (e.g.  2006-12-08)
uri.extensionFile extension (e.g.  xml)
uri.document.idURI docid (e.g. mydoc1)
uri.document.typePSML document type (e.g. definition)
uri.publication.idThe ID of the publication that URI is the root of (e.g. mypub1)
uri.publication.typeThe type of the publication that URI is the root of (e.g. report) otherwise default.

When exporting a folder it’s path is uri.path and it’s parent folder path is uri.folder.

Batch

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

ParameterDescription
batch.ids

A comma-separated list of URI IDs in the batch.
For example:

123,456,789
search.question

The search question used to select the batch IDs from (optional).
For example:

green
search.question.fields

The search question fields used to select the batch IDs from (optional).
For example:

pstitle,pscontent,psfilename,psdocid,psid
search.filters

The search filters used to select the batch IDs from (optional).
For example:

psdocumenttype:product,pslabel:simple
search.ranges

The search ranges used to select the batch IDs from (optional).
For example:

psproperty-title:[A;C},ranges=psxrefcount:{50;]

Loading Zone

The following parameters are only passed when a Document in the Loading Zone is being published.

PropertyDescription
upload.pathDocument path
  /minutes/2006-12-08.xml
upload.folderDocument folder
 /minutes
upload.filenameFilename (e.g.  2006-12-08.xml)
upload.filename.no.extFilename without extension (e.g.  2006-12-08)
upload.extensionFile extension (e.g.  xml)
upload.confirmedIf script is run before displaying the Upload confirmation then false, otherwise true

Current user

The following parameters are only passed when the current user is logged in:

PropertyDescription
usernameThe current user’s username (e.g.  jsmith)
user.idThe current users ID (e.g 123)
user.firstnameThe current user’s first name (e.g.  John)
user.surnameThe current user’s surname (e.g.  Smith)
user.tokenThe current user’s access token (only if script was started using an access token)

Set manually

The following properties can only be set manually:

PropertyDescription
passwordThe password used to connect to PageSeeder. When setting this property use load-default="false" on <ps:config> to ensure that the default jsessionid does not override the password.
client.idThe OAuth client ID used to connect to a remote PageSeeder server. When setting this property use load-default="false" on <ps:config> to ensure that the default jsessionid does not override the user.tokenRequires client.secrect and PageSeeder v6 or higher.
client.secretThe OAuth client secret used to connect to a remote PageSeeder server. If the secret is correct the user.token and username properties are set automatically and may be used to access the remote PageSeeder. Requires client.id and PageSeeder v6 or higher.
To see the list of configuration properties while running a script, you can either use the DEBUG or VERBOSE mode (developer only) or use the echo properties Ant task  <echoproperties />

 

Created on , last edited on