Introduction to Document Template Development

Document templates allow users to create or open XML documents with a single mouse click. They contain a set of XML metadata that accompanies a certain document type. If Serna finds a template, its category and name are shown in the New Document Dialog.

To create a document template, choose Document > New Document and select the Syntext/Serna 2 Document Template template in the New Document Dialog .

In order to be visible to Serna, document templates must:
  1. Have suffix *.sdt.

  2. Be located in sernaInstallationPath/plugins/ <PLUGIN-NAME> directories or in the sernaInstallationPath/xml/templates directory.

    It is also possible to create an additional directory with plugins for Serna outside Serna and place an *.sdt file in its subdirectory. In this case, you must specify the additional plugins path. For example, you can put your document template in the D:\my-plugins\ <PLUGIN-NAME> subdirectory and specify the path to the D:\my-plugins directory.

Note:

In the New Document Dialog and Choose Document Template Dialog, Serna provides a list of Serna document templates ( *.sdt) found in the sernaInstallationPath/plugins/ <PLUGIN-NAME> directories, sernaInstallationPath/xml/templates directory and in a specified additional plugins directory.

To specify the appropriate meta-information, merely insert the corresponding tags and fill them with values. It is best practice to use the variable $SERNA_TEMPLATE_DIR (keeps the current template path) to specify relative paths to files which are stored inside your plugin folder. However, you can also use absolute paths and/or relative paths with the variable $SERNA_DATA_DIR (keeps Serna installation path).