Skip to main content


Publishing PageSeeder data to print, the Web or both

Task request

Allows Ant scripts to make one or more HTTP requests to PageSeeder and write the responses to a file or multiple files.

If an HTTP code 202 is returned, the request is treated as an Asynchronous process by polling PageSeeder until the process is finished and then returning the final thread XML as the response.


    path="[request path]"
    config="[config name]">
  <parameter name="[param name]"
             value="[param value]"/>
  <fileset dir="[requests directory]"
           includes="[request.xml]" />


pathThe path for the request after the /ps site prefix (e.g. /service/groups/mygroup)Yes, unless specified in request XML files
outputSpecifies the path of the file to write the response to (e.g. output.xml)Yes
methodSpecifies the HTTP method for the requestNoGET
failonerrorIf true, stop ANT build script on errorNotrue
pollingintervalThe number of milliseconds between each check to see if an  Asynchronous process is complete (must not be more than 60000).No2000
configUniversal PS config nameNodefault


Element <parameter>

If specified set the parameters for the request.

nameThe parameter nameYes
valueThe parameter valueYes

Element <body>

If specified set the request body for method="PUT".

valueThe body valueYes

Element <fileset>

The standard ANT fileset  element can be used to specify one or more request XML files that contain details of the requests.

Request XML files

Request XML files can be used to override any path, method, output or <parameter> defined by the <ps:request> and perform multiple requests—one for each file.

A Request File is a UTF-8-encoded XML document that expresses the parameters for a single request in the following syntax where <parameter>, <body> and the attributes are optional:

<request [path="[request path]"]
         [output="[output]"] >
  <parameter name="x" [type="[text|xml]"]>a</parameter>
  <parameter name="y" [type="[text|xml]"]>b</parameter>
  <body [type="[text|xml]"]>c</body>
  • type="text": means unescape content when sending (e.g. “x &gt; 1” is sent as “x > 1”)—this is the default if type is not specified.
  • type="xml": means send content as XML (for example, “<para>x &gt; 1</para>” is sent as is).

Processed in alphabetical path order, each Request that does not specify an output has a response written to the main output file as follows:

  <response filepath="z/d.xml"> ... </response>
  <response filepath="z/e.xml"> ... </response>


This task uses the following ps:config environment properties:

  • scheme – scheme for connecting to PageSeeder.
  • host – host for connecting to PageSeeder.
  • port – port for connecting to PageSeeder.
  • site.prefix – site prefix for connecting to PageSeeder – default  /ps.
  • user.token or jsessionid or username/password – access token or jsessionid or  username/password for connecting to PageSeeder.

Example scripts

Validate all documents in a folder

This script starts a validation thread on a folder and waits until it finishes, then downloads the validation report. It includes properties for running inside PageSeeder and the /api prefix requires v6.

<property name="working" value="${ps.config.default.working}" />
<property name="member"  value="${}" />
<property name="group"   value="${}" />
<property name="folder"  value="${}" />

<ps:request output="${working}/output.xml"
  <parameter name="schema" value="default.sch"/>
<ps:request output="${working}/validation.xml"
  <parameter name="group" value="${group}"/>

The 8 in /uris/8 is the URI ID of the folder.

Create multiple comments

<ps:request output="output.xml"
  <fileset dir="c:\input\comments">
    <include name="*.*"/>

Files in c:\input\comments:


<?xml version="1.0" encoding="utf-8" ?>
  <parameter name="url"></parameter>
  <parameter name="title">My Comment</parameter>
  <parameter name="groups">test-mygroup</parameter>
  <parameter name="content">Hello world!</parameter>
  <parameter name="authorname">John Jones</parameter>


<?xml version="1.0" encoding="utf-8" ?>
  <parameter name="url"></parameter>
  <parameter name="title">My Comment 2</parameter>
  <parameter name="groups">test-mygroup</parameter>
  <parameter name="content">Hello again world!</parameter>
  <parameter name="authorname">John Jones</parameter>

Get edit history for multiple documents

<ps:request output="output.xml">
  <fileset dir="c:\input\history">
    <include name="*.*"/>

Files in c:\input\history:

The 123 in /uris/123 is the URI ID of the document.


<?xml version="1.0" encoding="utf-8" ?>
<request path="/service/groups/test-mygroup/uris/123/history">
  <parameter name="events">edit</parameter>


<?xml version="1.0" encoding="utf-8" ?>
<request path="/service/groups/test-mygroup/uris/456/history">
  <parameter name="events">edit</parameter>
Created on , last edited on