Task progress
This task was introduced in PageSeeder version 6.2000.
Sends progress info, log messages and result instructions to PageSeeder.
Use this task instead of the ANT <echo>
and <echoxml>
tasks to simplify the code and use new functionality.
Definition
Minimal definition:
<ps:progress />
Full definition:
<ps:progress percent="[0-100]" message="[message]" result="[window|panel|preview|link|urilink|reload]" resultfile="[result file path]"> <fileset dir="[path]" includes="[pattern]" excludes="pattern" /> </ps:transform>
Attributes
Attribute | Description | Required | Default |
---|---|---|---|
percent |
A number from 0 to 100 indicating the percentage of the script that has been completed. | No | |
message |
A short description of what the ANT task will do next. | No | |
result |
Instruction on how to process the script result. Can take the following values:
| No | |
resultfile |
The path to the result file, for example: ${ps.config.default.working}/${ps.config.default.uri.filename.no.ext}.pdf or for /ps/acme/specs/mydoc.psml or /ps/uri/123 | Yes, if result specified and not result="reload" |
Elements
Element <fileset>
A single standard ANT fileset element can be used to include additional files in the result. The result file may be included in the fileset. This is useful for example when previewing an imported DOCX which is split into multiple PSML files in the upload or to include a CSS file for an HTML result.
If a fileset is specified the files it includes are copied to the following folder:
${ps.config.default.web.root}/session/${ps.config.default.session.folder}${ps.config.default.group.folder.no.prefix}/result/[result file name]
Otherwise the result file only is copied to the following folder:
${ps.config.default.web.root}/session/${ps.config.default.session.folder}${ps.config.default.group.folder.no.prefix}/result
Examples
Indicate progress
The following example indicates the script is 40% complete and about to process documents.
<ps:progress percent="40" message="Processing documents" />
Display or download result in a new window
The following example displays the exported PDF in a new window.
<ps:progress result="window" resultfile="${ps.config.default.working}/${ps.config.default.uri.filename.no.ext}.pdf" />
Display result in a panel
The following example is taken from the sample bundle Preview document as HTML which can be viewed under the project admin Template files > Create button. The result includes the CSS file from the preview
folder under the build.xml
.
<ps:progress percent="90" result="panel" resultfile="${working}/${ps.config.default.uri.filename.no.ext}.html"> <fileset dir="preview" includes="*.css" /> </ps:progress>
Display upload preview
The following example is taken from the document/docx/upload/build.xml
which can be viewed under administration Templates > Default files. The result includes all the PSML files and images created by the import splitting up a DOCX file.
<ps:progress percent="90" result="preview" resultfile="${split}/${foldername}/${foldername}.psml"> <fileset dir="${split}/${foldername}" includes="*.*,**" /> </ps:progress>
Display a link to an uploaded document
The following example is taken from the batch/process/build.xml
which can be viewed under administration Templates > Default files.
<ps:progress result="urilink" resultfile="${ps.param.destination.uri.path}/${filename}.psml" />
Reload the current document
The following example is taken from the sample bundle Transform PSML document which can be viewed under the project admin Template files > Create button.
<ps:progress percent="100" message="Transformation successful!" result="reload" />