Guide

The end-user manual for PageSeeder

 

PSML document editing

This article describes how to use the <editing> element in the PSML document-config.xml file to configure custom PSML editors.

It follows the structure below:

<editing [override="true"]>
  <editor ... />*
</editing>

Behavior

By default, the editing configuration extends the default configuration so that editors defined here are added the base editors. To override the editing configuration, use the override boolean attribute.

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

Details

 Each <editor> element can define:

AttributeDescription
namethe name of the editor to use. Built-in editors include "ck", "psmlxrefs", "psmlproperties", "psmllabelvalues", "plain"
mediatypeto specify the media type the editor applies to (required)
formatto bind a specific fragment element to a different editor (fragment, properties-fragment, xref-fragment, media-fragment)
fragmenttypeto bind a specific fragment type to a different editor

There can be an <options> element under <editor> which defines parameters which will be sent by the editor to the edit-uri-fragment service. It can define the following:

AttributeDescription
htmltrue for editors sending HTML through to PageSeeder
tidytrue to have the HTML filtered by tidy (applies to HTML)
editnoteEdit note behavior can have the following values:
  • optional: user is not prompted to enter an edit note (default).
  • prompt: user is prompted to enter an edit note but may save without typing or selecting an edit label.
  • required: user is prompted to enter an edit note and must type something or select an edit label before saving.

Default

This is the default editor configuration:

<editing>
  <editor name="psmlxrefs"
     mediatype="application/vnd.pageseeder.psml+xml" format="xref-fragment">
    <options tidy="true" html="true"/>
  </editor>
  <editor name="psmlproperties"
      mediatype="application/vnd.pageseeder.psml+xml" format="properties-fragment">
    <options tidy="true" html="true"/>
  </editor>
  <editor name="ck" mediatype="application/vnd.pageseeder.psml+xml">
    <options tidy="true" html="true"/>
  </editor>
  <editor name="plain" mediatype="text/plain" format="media-fragment"/>
  <editor name="plain" mediatype="application/mathml+xml" format="media-fragment"/>
  <editor name="plain" mediatype="application/xml" format="media-fragment"/>
</editing>

Examples

To add the psmllabelvalues editor for <fragment type="mytype"> the configuration would be:

<editing>
  <editor name="psmllabelvalues"
      mediatype="application/vnd.pageseeder.psml+xml" fragmenttype="mytype">
    <options tidy="true" html="true"/>
  </editor>
</editing>

To set edit note required for all editors copy the default and add <options editnote="required"/> to all editors and <editing override="true">.

<editing override="true">
  <editor name="psmlxrefs"
     mediatype="application/vnd.pageseeder.psml+xml" format="xref-fragment">
    <options tidy="true" html="true" editnote="required"/>
  </editor>
  <editor name="psmlproperties"
      mediatype="application/vnd.pageseeder.psml+xml" format="properties-fragment">
    <options tidy="true" html="true" editnote="required"/>
  </editor>
  <editor name="ck" mediatype="application/vnd.pageseeder.psml+xml">
    <options tidy="true" html="true" editnote="required"/>
  </editor>
  <editor name="plain" mediatype="text/plain" format="media-fragment">
    <options editnote="required"/>
  </editor>
  <editor name="plain" mediatype="application/mathml+xml" format="media-fragment">
    <options editnote="required"/>
  </editor>
  <editor name="plain" mediatype="application/xml" format="media-fragment">
    <options editnote="required"/>
  </editor>
</editing>

Created on , last edited on