Skip to main content

 Version 5

Legacy documentation for PageSeeder v5

Task ps-download-xrefs

This task has been removed as of PageSeeder v6. Use Task export instead.

This task allows the Ant script to download a single file, plus files linked to it by cross references from a PageSeeder server.

Definition

   <ps:ps-download-xrefs          
      destination="[destination]"
              uriHost="[uriHost]"            
              uriPort="[uriPort]"            
                    path="[path]" or 
                 uriID="[uri id]"            
        jsessionid="[jsessionid]"            
                    port="[port]"            
                    host="[host]"            
        siteprefix="[siteprefix]"            
  servletprefix="[servletprefix]"            
                output="[output]"            
                  depth="[depth]"            
           existing="overwrite|
                        ignore|
                            fail"            
         loadReverse="true|false"            
           includeTypes="[types]"            
            includes="[includes]"            
            excludes="[excludes]"            
includeFormats="[includeFormats]"            
excludeFormats="[excludeFormats]">
   <parameter 
              name="[param name]"
            value="[param value]"/>
</ps:ps-download-xrefs>

Attributes

AttributeDescriptionRequired
jsessionidThe @jsessionid attribute (optional) is used for authentication. It is not required but it will always be used if specified.Yes, unless username/password or propertiesfile are specified
usernameIf @jsessionid attribute is not specified this can be used for authentication.Yes, unless jsessionid or propertiesfile are specified
passwordIf jsessionid is not specified this can be used for authentication.Yes, unless jsessionid or propertiesfile are specified
propertiesfileThe @propertiesfile attribute (optional) describes the location of the properties file to use to connect to the PageSeeder Server.
The value of the attribute can be the full path of the file, the relative path (the base directory is the location of the Ant script) or simply its name, in which case it MUST be located on the classpath.
Yes, unless (jsessionid or username/password) and host are specified
portThe port address of the PageSeeder Server - default: 80
(used when no properties file is specified)
No
hostThe host name of the PageSeeder Server
(used when no properties file is specified)
Yes, unless propertiesfile is specified
siteprefixThe PageSeeder site prefix defined - default: /ps
(used when no properties file is specified)
No
servletprefixThe PageSeeder servlet prefix defined - default: /servlet
(used when no properties file is specified)
No
destinationThe @destination attribute is the full path of the folder where the file(s) will be downloaded, if it does not exist, it will be created. If creation fails, an error will be raised.Yes
outputLocation of the output file, it is an XML file that contains the list of URIs downloaded along with their cross-references.Yes
pathThe @path attribute is the full path of the file to download (not URLencoded). The full path includes any prefix used for the PageSeeder server and the group name (i.e.: /ps/gen/jbtest/file.xml). The full path can be seen in PageSeeder in the Document Properties. If the file is not found, a 404 error will be raised.Yes, unless uriID is specified
uriIDThe URI ID / uriidof the document to download.Yes, unless path is specified
uriHostRequired when the host of the uri to download is different from webSiteAddress in
WEB-INF/config/template.properties
No
uriPortRequired when the port of the uri to download is different from webSitePort in
WEB-INF/config/template.properties.
No
depthThe cross-references depth of the files to download. The value must be a positive integer, default value is 1.No
existingThe behavior to follow when there is already an existing local file with the same name as a file to download. Possible values are the following:
  • ignore–the remote file will not be downloaded,
  • fail–the process will throw an error,and
  • overwrite– the remote file will overwrite the local file. Default is overwrite.
No
loadReverseA flag that can be used to download the documents that point to this one. Possible values are true or false - default is false.No
includeTypesA comma-separated list of cross-references types. All files targeted by cross-references with types matching these will be downloaded. Usual XRef types are Replace, Transclude, Embed and None. If not specified, all types are matched.No
includesA comma-separated list of patterns matching files to include. If not specified, all files are matched.No
excludesA comma-separated list of patterns matching files to exclude. If not specified, no files are excluded.No
includeFormatsA comma-separated list of formats matching files to include. If not specified, all formats are matched.No
excludeFormatsA comma-separated list of formats matching files to exclude. If not specified, no formats are excluded.No

Parameters

Zero or more <parameter> elements may be nested inside the <ps-download-xrefs> element. They add modifying parameters to the PageSeeder download URL used to request the files. The following parameters are supported:

Parameter NameDescription
ps-releasedecimal number or non-number version used to download a version equal to (or if a number less than) this version
ps-releaseStatusstatus string used to download the latest version with this status
ps-comparedecimal number or non-number version used to compare a version equal to (or if a number less than) this version  with the downloaded version (must be used with ps-fragmentinfo=true)
ps-compareStatusstatus string used to compare a version with the latest version that has this status (must be used with ps-fragmentinfo=true)
xsl-documentInfoif "true" includes <ps:documentInfo> metadata in document. Deprecated: Use ps-documentinfo instead.
xsl-discussionif "true" includes comments in document under <ps:discussion> (must be used with ps-documentinfo=true or ps-fragmentinfo=true or xsl-documentInfo=true)
ps-documentinfoif "true" includes <ps:documentinfo> metadata in document, see Document Metadata Schema 1.3
ps-fragmentinfoif "true" includes <ps:fragmentinfo> metadata in document
ps-reversexrefsif "true" includes <ps:reversexrefs> metadata in document (must be used with ps-documentinfo=true or ps-fragmentinfo=true)

For example <parameter name="ps-release" value="4.1"/> would download the latest versions of the documents with version less than or equal to 4.1

Examples

Stand alone script example:

<ps:ps-download-xrefs
    destination="c:\download"
           path="/ps/acme/demo/mydoc.xml"
          depth="2"
         output="c:\results\download.xml"
           host="mycompany.com"
       username="jsmith"
       password="xyz" />

 Publish script example:

<ps:ps-download-xrefs
  destination="${ps-working}"
        depth="2"
       output="${ps-working}/download.xml"
         path="${ps-uriPath}"
      uriHost="${ps-uriHost}"
      uriPort="${ps-uriPort}"
   jsessionid="${ps-jsessionid}"
         host="${ps-host}"
         port="${ps-port}"
servletPrefix="${ps-servletPrefix}"
   sitePrefix="${ps-sitePrefix}" />
Created on , last edited on