Guide

The end-user manual for PageSeeder

PSML document publishing

This article describes how to use the <publishing> element in the PSML document-config.xml file or the publish-config.xml file to customize the Ant scripts that can be run by the Publish Engine.

  • In the document-config.xml file the <publishing> element is under <config> and controls the publishing for a specific PSML document type.
  • In the publish-config.xml file the <publishing> element is at the top level and controls publishing across all groups, folders and documents in the project.

It follows the structure below:

<publishing [override="true"]>
  <action ... />*
</publishing>

Behavior

By default, the publishing configuration extends the default configuration so that publish actions defined here are added to the base actions. To override the publishing configuration, add override="true" to the @publishing element.

If the <publishing> element is not specified or the document-config.xml doesn't exist, then the publishing options are automatically inherited from the default config.

Details

 Each <action> should define:

AttributeDescription
typethe type of action - import|export|publish|process (upload|upload-preview can also be used in publish-config.xml)

If in publish-config.xml each <action> element can have a <source> element.

The <source> element can define:

AttributeDescription
typeThe type of source object - group|folder|document
extensionThe filename extension of the source (only applies to document)

Each <action> element can have a <target> element for each target in the Ant script the user can run.

Each <target> can define:

AttributeDescription
nameThe name of the target (must match target name in Ant script)
perspectiveThe target will only be displayed in this perspective (optional)
roleOnly display this target for users with specified role and above - contributor|manager|approver (optional)

Each <target> element should have a <description> element which is the description of this action for the user interface.

Each <target> element can have a <param> element for each parameter the user can specify.

Each <param> element can define:

AttributeDescription
nameThe name of the parameter (required)
typeOne of "text", "select", "checkbox", "date" or "number" (required)
labelDisplayed next to the field to describe it (required)
perspectiveThe target will only be displayed in this perspective
placeholderDisplayed inside text box to provide guidance
patternA regular expression the field value must match
defaultThe default value
minThe minimum value (for type "number" only)
maxThe maximum value (for type "number" only)
stepThe difference step between valid numbers - default is 1 (for type "number" only)

If the type is "select" or "checkbox" <param> can have <value> elements containing the valid choices.

Text

The text type will display a simple input box for text to be entered manually. The placeholder property can be used to display a hint in the text box when no value has been specified.

The pattern property can specify a regular expression that the value must match to be submitted. This can be useful mechanism to constrain the format or possible values.

Select

The select type will display a simple drop-down list. Only one value can be selected by the user. The list of possible values can be set using the <value> elements. 

Checkbox

The checkbox type will display a list of check boxes so that multiple values can be selected. The list of possible values can be set using the <value> elements. 

Date

The date type will provide a date picker to the user and store the value as ISO8601 (yyyy-mm-dd).

Number

The number type will display a number box which will allow only valid numbers as defined by the @min, @max and @step attributes.

Examples

Below is an example form 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 13 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>

Below is an example form 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 label="Depth of XRefs to publish" type="number" min="1" max="8" />
    </target>
  </action>
</publishing>

Created on , last edited on