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
| Attribute | Description | Required | Default | 
|---|---|---|---|
| name | The name of the config - set to defaultif not specified | No | |
| file | The path of a file containing the properties to load | No | |
| load-default | Whether to load the default properties from PageSeeder (only applicable if script is run within PageSeeder). When running a script within PageSeeder this MUST be falseif setting thepasswordorclient.idproperties. | No | true | 
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.
| Property | Description | 
|---|---|
| jsessionid | The jsessionid for a PageSeeder user | 
| host | Usually localhostunless publishing from a different PageSeeder. | 
| port | Usually 8282(the same asapiPort) unless publishing from a different PageSeeder. | 
| servlet.prefix | The servletPrefix from PageSeeder global.properties | 
| site.prefix | The sitePrefix from PageSeeder global.properties | 
| global.template | globalTemplate name from PageSeeder global.properties(e.g.acmedefault) | 
| group.id | ID of group initiating the publish (e.g. 12) | 
| group.name | Name of group initiating the publish (e.g. acme-demo) | 
| group.folder | Path of default group folder | 
|   /ps/acme/demo | |
| group.folder.no.prefix | Path of default group folder with no site prefix | 
|   /acme/demo | |
| group.scheme | Scheme to find URIs with (should be http) – new property | 
| group.host | Usually the host in the PageSeeder URL (e.g. ps.mycompany.com) | 
| group.port | Port to find URIs with (should be 80) | 
| group.template | Template of group/default group for URI (e.g. acme) – previously ps-style-owner | 
| custom.folder | globalTemplate name from global.properties(e.g.acmedefault). – DEPRECATED in v5.99 useglobal.templateinstead. | 
| working | Path to local unique working folder for this group/document | 
| working.root | Path to root for all local working folders | 
| documents.root | Path to PageSeeder documents folder | 
| web.root | Path to the root for result files (see session.folder). | 
| engine.url | The external URL used to contact the Publish Engine (e.g. http://mycompany.com/ps/publish) | 
| session.folder | A 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):
| Property | Description | 
|---|---|
| uri.id | URI id (e.g. 123) | 
| uri.scheme | URI scheme (e.g. http) | 
| uri.host | URI host (e.g. ps.mycompany.com) | 
| uri.port | URI port (e.g. 80) | 
| uri.path | URI path | 
|   /ps/acme/demo/minutes/2006-12-08.xml | |
| uri.path.no.prefix | URI path without prefix | 
|   /acme/demo/minutes/2006-12-08.xml | |
| uri.path.no.group | URI path without group prefix | 
|   /minutes/2006-12-08.xml | |
| uri.folder | URI folder | 
|   /ps/acme/demo/minutes | |
| uri.folder.no.prefix | URI folder with /ps prefix | 
|  /acme/demo/minutes | |
| uri.folder.no.group | URI folder without group prefix | 
|   /minutes | |
| uri.filename | Filename (e.g. 2006-12-08.xml) | 
| uri.filename.no.ext | Filename without extension (e.g. 2006-12-08) | 
| uri.extension | File extension (e.g. xml) | 
| uri.document.id | URI docid (e.g. mydoc1) | 
| uri.document.type | PSML document type (e.g. definition) | 
| uri.publication.id | The ID of the publication that URI is the root of (e.g. mypub1) | 
| uri.publication.type | The type of the publication that URI is the root of (e.g. report) otherwisedefault. | 
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):
| Parameter | Description | 
|---|---|
| batch.ids | A comma-separated list of URI IDs in the batch. 123,456,789 | 
| search.question | The search question used to select the batch IDs from (optional). green | 
| search.question.fields | The search question fields used to select the batch IDs from (optional). pstitle,pscontent,psfilename,psdocid,psid | 
| search.filters | The search filters used to select the batch IDs from (optional). psdocumenttype:product,pslabel:simple | 
| search.ranges | The search ranges used to select the batch IDs from (optional). 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.
| Property | Description | 
|---|---|
| upload.path | Document path | 
|   /minutes/2006-12-08.xml | |
| upload.folder | Document folder | 
| /minutes | |
| upload.filename | Filename (e.g. 2006-12-08.xml) | 
| upload.filename.no.ext | Filename without extension (e.g. 2006-12-08) | 
| upload.extension | File extension (e.g. xml) | 
| upload.confirmed | If script is run before displaying the Upload confirmation then false, otherwisetrue | 
Current user
The following parameters are only passed when the current user is logged in:
| Property | Description | 
|---|---|
| username | The current user’s username (e.g. jsmith) | 
| user.id | The current users ID (e.g 123) | 
| user.firstname | The current user’s first name (e.g. John) | 
| user.surname | The current user’s surname (e.g. Smith) | 
| user.token | The current user’s access token (only if script was started using an access token) | 
Set manually
The following properties can only be set manually:
| Property | Description | 
|---|---|
| password | The 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.id | The 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 theuser.token. Requiresclient.secrectand PageSeeder v6 or higher. | 
| client.secret | The OAuth client secret used to connect to a remote PageSeeder server. If the secret is correct the user.tokenandusernameproperties are set automatically and may be used to access the remote PageSeeder. Requiresclient.idand PageSeeder v6 or higher. | 
<echoproperties />