Adding a new Document Creator
Table of Contents
- Adding a new Menu Item: "New MyDocument"
- Adding usecase "create" to the sitemap
- Create doctypes.xconf
- Create a sample document
Adding a new Menu Item: "New MyDocument"
The Menubars can be found within the directory config/menus.
Add the "New MyDocument" menu item to the appropriate menubar:
<menus>
<menu name="File" label="File">
<block>
<item><xsp:attribute name="href">?lenya.usecase=create&lenya.step=showscreen</xsp:attribute>New MyDocument</item>
</block>
Adding usecase "create" to the sitemap
The pipelines of the usecases are located within usecase.xmap:
<map:pipeline>
<map:match pattern="*/*/*/*/*/index.html">
<map:match type="lenya-usecase" pattern="create">
<map:match type="lenya-step" pattern="showscreen">
<map:generate type="serverpages" src="../../content/authoring/parent-child.xsp"/>
<map:transform src="../../xslt/authoring/create.xsl"/>
<map:serialize type="html"/>
</map:match>
<map:match type="lenya-step" pattern="execute">
<map:act type="parent-child">
<map:redirect-to uri="{parent_uri}" session="true"/>
</map:act>
<map:redirect-to uri="index.html?lenya.usecase=create&lenya.step=showscreen&status=failed" session="true"/>
</map:match>
</map:match>
</map:match>
</map:pipeline>
Create doctypes.xconf
The file doctypes.xconf is supposed to be located within the directory config/doctypes.
<doctypes>
<doc type="nitf">
<creator src="org.apache.lenya.cms.authoring.DefaultLeafCreator">
<sample-name>nitf.xml</sample-name>
</creator>
</doc>
<doc type="xhtml">
<creator src="org.apache.lenya.cms.authoring.DefaultLeafCreator">
<sample-name>xhtml.xml</sample-name>
</creator>
</doc>
</doctypes>
Create a sample document
The sample documents are located within the directory config/doctypes/samples.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<nitf>
<head>
<docdata>
<doc-id regsrc="nitf_export.pl" id-string="0"/>
<date.issue norm="20030314T041021Z"/>
<doc.copyright holder="New OSCOM Times"/>
</docdata>
<pubdata position.section="finance" position.sequence="1"/>
</head>
<body.head>
<hedline>
<hl1>Local OSCOM Sprint @ Zurich, Switzerland</hl1>
