<publishing> element
This article describes how the <publishing>
element can be modified to provide custom processing for different types of documents. The content on this element determines the options that are presented to users when the publisher is invoked.
See also PSML Ant scripts.
<publishing>
is valid in the following files:
document-config.xml
– the<publishing>
element is under the<document-config>
element and controls processing for a specific document type.- To access this file, go to the administration menu, template configuration page, Config column, then select the row for the document type.
url-config.xml
– the<publishing>
element is under the<url-config>
element and controls processing for a specific URL type.- To access this file,
- Go to the global template page, click Manage global types.
- Or, go to the administration menu, template configuration page, click the Edit global types button at top right, under heading URL types then Config column, select the row for the URL type.
publish-config.xml
– is the root element of the file and controls publishing across all groups, folders and documents or a batch of search results in a project.- To access this file, from the project, administration menu, select Template > Template files > publish folder, then select the edit option on the right of the config file.
The configuration follows the structure below:
<publishing> <action ... />* </publishing>
When editing config files in PageSeeder, ctrl-space provides suggestions that are contextually correct at the insertion point. This ensures that the config file is valid.
Behavior
The PageSeeder model allows the default functionality to be extended by adding the @override
attribute to the <publishing>
element.
<publishing override="true"> <action ... />* </publishing>
If the <publishing>
element is not specified, or the config file doesn’t exist, options are inherited from the default files. To view the default document-config.xml
and publish-config.xml
, from the system administration menu, select Templates > Default files.
Element details
<action>
Each <action>
defines:
Attribute | Description |
---|---|
type |
One of the following actions (required)
or actions only valid in
|
* The type upload-preview
is deprecated as of PageSeeder v5.98 and only supported in the v5 UI. Use @previewname
on <target>
below instead.
<source>
In publish-config.xml,
each <action>
element must have a <source>
element. The batch
type requires PageSeeder v5.98 or higher and only works in the v6 UI. The <source>
element can define:
Attribute | Description |
---|---|
type |
The type of object (required)
|
extension | The extension of the source file (required if type="document" ) |
<target>
Each <action>
element must have one or more <target>
elements that corresponds to each target in the Ant script. The <target>
element defines:
Attribute | Description |
---|---|
name | Must match the target name in the Ant script (required) |
previewname | The target name in the Ant script for previewing the action (only supported in the v6 UI and only for upload actions) |
perspective |
Determines which perspective the target name is displayed in (to hide the target use
lab and standard have no effect in v6. |
role |
The minimal role required to run the process
|
configfile | The name of the config file in the same folder as the build.xml which can be edited by contributors (only word-export-config.xml , word-import-config.xml and pdf-export-config.xml are currently supported) |
override | If true , this target overrides any target with the same name and action type (e.g. <target name="create-consolidated-docx" override="true"> overrides the default DocX export but leaves the other default exports available) - default false . |
Each <target>
element must have a <description>
element to describe the process in the user interface. Each <target>
element can have one or more <param>
elements for the specified parameters.
<param>
Each <param>
element can have the following attributes and can also contain an <autosuggest>
element when @type="document"
.
Attribute | Description |
---|---|
name | The name of the parameter (required) |
label | Displayed next to the field (required) |
type |
One of the following values (default is
|
perspective | Which perspective the target name is to be displayed in. |
description | Text displayed as a tooltip or info box. Requires PageSeeder v6.1 or higher. |
placeholder | Guidance text to display inside a field |
pattern | A regular expression to constrain the value of a field |
default | The default value of a field |
min | The minimum value for a number field only |
max | The maximum value for a number field only |
required | Whether this parameter is required - true |false (default is false ) requires PageSeeder v5.9807 or higher. |
step | The allowable value by which the minimum number can increment to the maximum number (default is 1 ). |
Following are the available options when the value of @type
is text
:
text
– displays an input box for text to be entered manually.placeholder
– can be used to display a hint in the box when no value has been specified.pattern
– can specify a regular expression that the value must match to be submitted. This can constrain the format or value of the field.
Where type="date"
, the pattern can override the date picker default (e.g. dd-mm-yyyy for 01-11-2017).
When the value of @type
is select
, the <param>
element can have one or more <value>
elements for the valid choices.
select
– displays a drop-down list and allows only one value to be selected. The content of each<value>
element is displayed as an option in the list.checkbox
– displays a checkbox which has possible values oftrue
orfalse
.date
– invokes a date picker interface and stores the value as ISO8601 (yyyy-mm-dd).number
– displays a number field which allows only valid numbers as defined by the@min
,@max
and@
step
attributes.
The following options provide additional flexibility for users to select content for processing:
documentversion
– drop-down list of all document versions used in the current group.localdocumentversion
– drop-down list of document versions in the current document.publicationid
– drop-down list of all publication IDs in the current group.localpublicationid
– drop-down list of publication IDs for the current document.documentlabel
– drop-down list of document labels for the current group.documentstatus
– drop-down list of document status values for the current group.fragmentlabel
– drop-down list of fragment labels for the current group.document
orfolder
– allows selection of a document or folder through browse. Sends four parameters to the publish script by adding the following suffixes to the parameter name:.group.name, .uri.path, .uri.id, .uri.document.id, .uri.document.type
(e.g. if the name wasdest
the params would bedest.group.name, dest.uri.path, dest.uri.id, dest.uri.document.id, dest.uri.document.type
). Requires PageSeeder v5.9802 or higher.
Auto-suggest configuration
This uses the same search as the search box. It is configured through the following attributes on the <autosuggest>
element. Requires PageSeeder v5.99 or higher.
Attribute | Description | Default value |
---|---|---|
displayfields |
A comma-separated list of fields to display in the search results.
| psfolder,psfilename |
filters |
A comma-separated list of
| |
group |
The project and group to search for target documents (for example, | [current group] |
questionfields | A comma-separated list of index fields to search | pstitle,psfilename, psdocid,psid |
Examples
File document-config.xml
Following is an example of the <publishing>
element deployed to a document-config.xml
file:
<publishing> <action type="publish"> <target name="psml-to-website"> <description>Publish to website</description> </target> <target name="psml-to-blog"> <description>Publish to blog</description> </target> </action> <action type="export" > <target name="psml-to-pdf-columns" perspective="developer"> <description>Export as PDF in 3 columns</description> <param name="depth" label="Depth of XRefs to publish" type="number" min="1" max="8" /> <param name="isbn" type="text" label="ISBN" placeholder="Enter a valid ISBN number (97xxxxxxxxxxx)" pattern="97[89][0-9]{10}" /> <param name="in-stock" type="checkbox" label="In Stock" default="true" perspective="developer" /> <param name="language" type="select" label="Language" default="Spanish"> <value>English</value> <value>French</value> <value>Spanish</value> </param> </target> </action> </publishing>
File publish-config.xml
Following is an example of the <publishing>
element deployed to a publish-config.xml
file:
<publishing> <action type="export"> <source type="document" extension="psml" /> <target name="psml-to-pdf-columns" perspective="developer"> <description>Export as PDF in 3 columns</description> </target> </action> <action type="publish"> <source type="folder" /> <target name="psml-to-website"> <description>Publish to website</description> <param name="depth" label="Depth of XRefs to publish" type="number" min="1" max="8" /> </target> </action> </publishing>