Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.2
  • Version 2.0
  • Version 1.2
  • Version 1.2
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorial
      • Introduction
      • 1. Understanding Lenya
      • 2. Installing Lenya
      • 3. Anatomy of the Pipeline
      • 4. Editing in Lenya
      • 5. Custom Navigation in Lenya
      • 6a. Mod Proxy and Lenya
      • 6b. Mod Proxy and Lenya
    • How-To
      • FAQ
      • New Publication
      • Deploy Publication
      • Look and Feel
      • Custom Resource Type
      • Adding Mime Types
      • Site Navigation
      • LDAP Authentication
      • CMS Menus
      • CMS Screens
      • Search Publications
      • External Data
      • Unit Tests
    • Components
      • Access Control
        • Basic Terms
        • Access Controllers
        • Access Controller Resolvers
        • Authenticators
        • Authorizers
        • Policies and Policy Managers
        • Accreditable Managers
        • SSL Encryption
      • Authoring
        • Adding a new document creator
        • Image Upload
        • OpenOffice
      • Deployment
        • Proxying
      • Editors
        • HTML Form Editor
        • HTML One Form Editor
        • Bitflux Editor
        • Kupu
        • Xopus
      • Layout
        • Navigation
        • XHTML templating
        • Serving static resources
        • Lenya Menubar
      • Publication
        • PageEnvelopeModule
        • Site tree
      • Resource Types
        • Resource Types
      • Revision Control
        • Revision Controller
        • RCML
        • Check In
        • Check Out
        • Revisions
        • Rollback
      • Repository
        • WebDAV Servers
      • Search
        • Searching with Lucene
      • URI Handling
        • URI Parametrizer
        • URI Scheme
        • Usecases
      • Asset Management
        • Asset Management
      • Link Management
        • Link Management
      • Meta Data
        • Meta Data Handling
      • Multilingual Documents
        • Multilingual Document Handling
      • Tasks
        • The Task Concept
        • Defining Tasks
        • The TaskAction
        • Scheduling a Task
        • Included tasks
          • AntTask
          • DefaultFilePublisher
          • StaticHTMLExporter
          • MailTask
        • Developing Tasks
      • Workflow
        • Terms
        • The State Machine
        • Configuration
        • Implementation
      • Site Management
        • Archive
        • Copy
        • Deactivate
        • Delete
        • Delete the trash
        • Move
        • Move Up/Down
        • Rename
        • Restore
    • Miscellaneous
      • Namespaces
      • Reserved Names
      • XInclude Processor
    • 1.2 API (Javadoc)

Current Event

Meeting Bad Säckingen 2009

Built with Apache Lenya

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&amp;lenya.step=showscreen</xsp:attribute>New&#160;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&amp;lenya.step=showscreen&amp;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>

Copyright © 1999-2009 The Apache Software Foundation. All rights reserved.