| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <html> |
| <head> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta content="Apache Forrest" name="Generator"> |
| <meta name="Forrest-version" content="0.9-dev"> |
| <meta name="Forrest-skin-name" content="pelt"> |
| <title>Custom Resource Type How-To</title> |
| <link type="text/css" href="../../../skin/basic.css" rel="stylesheet"> |
| <link media="screen" type="text/css" href="../../../skin/screen.css" rel="stylesheet"> |
| <link media="print" type="text/css" href="../../../skin/print.css" rel="stylesheet"> |
| <link type="text/css" href="../../../skin/profile.css" rel="stylesheet"> |
| <script src="../../../skin/getBlank.js" language="javascript" type="text/javascript"></script><script src="../../../skin/getMenu.js" language="javascript" type="text/javascript"></script><script src="../../../skin/fontsize.js" language="javascript" type="text/javascript"></script> |
| <link rel="shortcut icon" href="../../../favicon.ico"> |
| </head> |
| <body onload="init()"> |
| <script type="text/javascript">ndeSetTextSize();</script> |
| <div id="top"> |
| <!--+ |
| |breadtrail |
| +--> |
| <div class="breadtrail"> |
| <a href="http://www.apache.org/">apache</a> > <a href="http://lenya.apache.org/">lenya</a><script src="../../../skin/breadcrumbs.js" language="JavaScript" type="text/javascript"></script> |
| </div> |
| <!--+ |
| |header |
| +--> |
| <div class="header"> |
| <!--+ |
| |start group logo |
| +--> |
| <div class="grouplogo"> |
| <a href=""><img class="logoImage" alt="Lenya" src="../../../images/apache-lenya-light.png" title=""></a> |
| </div> |
| <!--+ |
| |end group logo |
| +--> |
| <!--+ |
| |start Project Logo |
| +--> |
| <div class="projectlogo"> |
| <a href=""></a> |
| </div> |
| <!--+ |
| |end Project Logo |
| +--> |
| <!--+ |
| |start Search |
| +--> |
| <div class="searchbox"> |
| <form action="http://www.google.com/search" method="get" class="roundtopsmall"> |
| <input value="lenya.apache.org" name="sitesearch" type="hidden"><input onFocus="getBlank (this, 'Search the site with ');" size="25" name="q" id="query" type="text" value="Search the site with "> |
| <input name="Search" value="Search" type="submit"> |
| </form> |
| </div> |
| <!--+ |
| |end search |
| +--> |
| <!--+ |
| |start Tabs |
| +--> |
| <ul id="tabs"> |
| <li> |
| <a class="unselected" href="../../../index.html">Project</a> |
| </li> |
| <li> |
| <a class="unselected" href="../../../docs/index.html">Developer</a> |
| </li> |
| <li> |
| <a class="unselected" href="../../../community/index.html">Community</a> |
| </li> |
| <li> |
| <a class="unselected" href="../../../docs/2_0_x/index.html">Version 2.0</a> |
| </li> |
| <li class="current"> |
| <a class="selected" href="../../../docs/1_2_x/index.html">Version 1.2</a> |
| </li> |
| </ul> |
| <!--+ |
| |end Tabs |
| +--> |
| </div> |
| </div> |
| <div id="main"> |
| <div id="publishedStrip"> |
| <!--+ |
| |start Subtabs |
| +--> |
| <div id="level2tabs"></div> |
| <!--+ |
| |end Endtabs |
| +--> |
| <script type="text/javascript"><!-- |
| document.write("Last Published: " + document.lastModified); |
| // --></script> |
| </div> |
| <!--+ |
| |breadtrail |
| +--> |
| <div class="breadtrail"> |
| |
| |
| </div> |
| <!--+ |
| |start Menu, mainarea |
| +--> |
| <!--+ |
| |start Menu |
| +--> |
| <div id="menu"> |
| <div onclick="SwitchMenu('menu_selected_1.1', '../../../skin/')" id="menu_selected_1.1Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">Version 1.2</div> |
| <div id="menu_selected_1.1" class="selectedmenuitemgroup" style="display: block;"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/index.html">Index</a> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.2', '../../../skin/')" id="menu_1.1.2Title" class="menutitle">Installation</div> |
| <div id="menu_1.1.2" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/installation/index.html">Download</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/installation/subversion.html">Subversion Access</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/installation/source_version.html">Install Instructions</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.3', '../../../skin/')" id="menu_1.1.3Title" class="menutitle">Tutorial</div> |
| <div id="menu_1.1.3" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/index.html">Introduction</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/understanding_lenya.html">1. Understanding Lenya</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/installing_lenya.html">2. Installing Lenya</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/anatomy_of_the_pipeline.html">3. Anatomy of the Pipeline</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/editing_in_lenya.html">4. Editing in Lenya</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/custom_navigation.html">5. Custom Navigation in Lenya</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/mod_proxy_and_lenya.html">6a. Mod Proxy and Lenya</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/tutorial/mod_proxy_and_lenya_continued.html">6b. Mod Proxy and Lenya</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_selected_1.1.4', '../../../skin/')" id="menu_selected_1.1.4Title" class="menutitle" style="background-image: url('../../../skin/images/chapter_open.gif');">How-To</div> |
| <div id="menu_selected_1.1.4" class="selectedmenuitemgroup" style="display: block;"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/faq.html">FAQ</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/new_publication.html">New Publication</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/deploy_publication.html">Deploy Publication</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/look_and_feel.html">Look and Feel</a> |
| </div> |
| <div class="menupage"> |
| <div class="menupagetitle">Custom Resource Type</div> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/new_mime_type.html">Adding Mime Types</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/site_navigation.html">Site Navigation</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/ldap_authentication.html">LDAP Authentication</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/cms_menus.html">CMS Menus</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/cms_screens.html">CMS Screens</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/search.html">Search Publications</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/external_data.html">External Data</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/how-to/unittests.html">Unit Tests</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5', '../../../skin/')" id="menu_1.1.5Title" class="menutitle">Components</div> |
| <div id="menu_1.1.5" class="menuitemgroup"> |
| <div onclick="SwitchMenu('menu_1.1.5.1', '../../../skin/')" id="menu_1.1.5.1Title" class="menutitle">Access Control</div> |
| <div id="menu_1.1.5.1" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/terms.html">Basic Terms</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/accesscontrollers.html">Access Controllers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/accesscontrollerresolvers.html">Access Controller Resolvers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/authenticators.html">Authenticators</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/authorizers.html">Authorizers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/policymanagers.html">Policies and Policy Managers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/accreditablemanagers.html">Accreditable Managers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/accesscontrol/ssl.html">SSL Encryption</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.2', '../../../skin/')" id="menu_1.1.5.2Title" class="menutitle">Authoring</div> |
| <div id="menu_1.1.5.2" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/authoring/adding-document-creator.html">Adding a new document creator</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/authoring/image-upload.html">Image Upload</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/authoring/openoffice.html">OpenOffice</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.3', '../../../skin/')" id="menu_1.1.5.3Title" class="menutitle">Deployment</div> |
| <div id="menu_1.1.5.3" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/deployment/proxying.html">Proxying</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.4', '../../../skin/')" id="menu_1.1.5.4Title" class="menutitle">Editors</div> |
| <div id="menu_1.1.5.4" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/editors/htmlform.html">HTML Form Editor</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/editors/1form.html">HTML One Form Editor</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/editors/bxe.html">Bitflux Editor</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/editors/kupu.html">Kupu</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/editors/xopus.html">Xopus</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.5', '../../../skin/')" id="menu_1.1.5.5Title" class="menutitle">Layout</div> |
| <div id="menu_1.1.5.5" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/layout/navigation.html">Navigation</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/layout/xhtml-templating.html">XHTML templating</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/layout/static-resources.html">Serving static resources</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/layout/lenya-menubar.html">Lenya Menubar</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.6', '../../../skin/')" id="menu_1.1.5.6Title" class="menutitle">Publication</div> |
| <div id="menu_1.1.5.6" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/publication/pageenvelopemodule.html">PageEnvelopeModule</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/publication/siteTree.html">Site tree</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.7', '../../../skin/')" id="menu_1.1.5.7Title" class="menutitle">Resource Types</div> |
| <div id="menu_1.1.5.7" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/resource-types/resource-types.html">Resource Types</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.8', '../../../skin/')" id="menu_1.1.5.8Title" class="menutitle">Revision Control</div> |
| <div id="menu_1.1.5.8" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/revisioncontroller.html">Revision Controller</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/rcml.html">RCML</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/checkin.html">Check In</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/checkout.html">Check Out</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/version.html">Revisions</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/revisioncontrol/rollback.html">Rollback</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.9', '../../../skin/')" id="menu_1.1.5.9Title" class="menutitle">Repository</div> |
| <div id="menu_1.1.5.9" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/repository/index.html">WebDAV Servers</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.10', '../../../skin/')" id="menu_1.1.5.10Title" class="menutitle">Search</div> |
| <div id="menu_1.1.5.10" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/search/lucene.html">Searching with Lucene</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.11', '../../../skin/')" id="menu_1.1.5.11Title" class="menutitle">URI Handling</div> |
| <div id="menu_1.1.5.11" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/uri-handling/URIParametrizer.html">URI Parametrizer</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/uri-handling/standardURI.html">URI Scheme</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/uri-handling/usecases.html">Usecases</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.12', '../../../skin/')" id="menu_1.1.5.12Title" class="menutitle">Asset Management</div> |
| <div id="menu_1.1.5.12" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/asset-management/management.html">Asset Management</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.13', '../../../skin/')" id="menu_1.1.5.13Title" class="menutitle">Link Management</div> |
| <div id="menu_1.1.5.13" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/link-management/link-management.html">Link Management</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.14', '../../../skin/')" id="menu_1.1.5.14Title" class="menutitle">Meta Data</div> |
| <div id="menu_1.1.5.14" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/metadata/metadata.html">Meta Data Handling</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.15', '../../../skin/')" id="menu_1.1.5.15Title" class="menutitle">Multilingual Documents</div> |
| <div id="menu_1.1.5.15" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/multilingual/multilingual.html">Multilingual Document Handling</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.16', '../../../skin/')" id="menu_1.1.5.16Title" class="menutitle">Tasks</div> |
| <div id="menu_1.1.5.16" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/concept.html">The Task Concept</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/defining.html">Defining Tasks</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/taskaction.html">The TaskAction</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/scheduling.html">Scheduling a Task</a> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.16.5', '../../../skin/')" id="menu_1.1.5.16.5Title" class="menutitle">Included tasks</div> |
| <div id="menu_1.1.5.16.5" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/anttask.html">AntTask</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/publisher.html">DefaultFilePublisher</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/exporter.html">StaticHTMLExporter</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/mailtask.html">MailTask</a> |
| </div> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/tasks/development.html">Developing Tasks</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.17', '../../../skin/')" id="menu_1.1.5.17Title" class="menutitle">Workflow</div> |
| <div id="menu_1.1.5.17" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/workflow/terms.html">Terms</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/workflow/state-machine.html">The State Machine</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/workflow/configuration.html">Configuration</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/workflow/implementation.html">Implementation</a> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.5.18', '../../../skin/')" id="menu_1.1.5.18Title" class="menutitle">Site Management</div> |
| <div id="menu_1.1.5.18" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/archive.html">Archive</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/copy.html">Copy</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/deactivate.html">Deactivate</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/delete.html">Delete</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/deletetrash.html">Delete the trash</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/move.html">Move</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/moveupdown.html">Move Up/Down</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/rename.html">Rename</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/components/sitemanagement/restore.html">Restore</a> |
| </div> |
| </div> |
| </div> |
| <div onclick="SwitchMenu('menu_1.1.6', '../../../skin/')" id="menu_1.1.6Title" class="menutitle">Miscellaneous</div> |
| <div id="menu_1.1.6" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/misc/namespaces.html">Namespaces</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/misc/reserved_names.html">Reserved Names</a> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../docs/1_2_x/misc/xinclude-processor.html">XInclude Processor</a> |
| </div> |
| </div> |
| <div class="menuitem"> |
| <a href="../../../apidocs/1.2/index.html">1.2 API (Javadoc)</a> |
| </div> |
| </div> |
| <div id="credit"></div> |
| <div id="roundbottom"> |
| <img style="display: none" class="corner" height="15" width="15" alt="" src="../../../skin/images/rc-b-l-15-1body-2menu-3menu.png"></div> |
| <!--+ |
| |alternative credits |
| +--> |
| <div id="credit2"> |
| <a href="http://wiki.apache.org/lenya/MeetingFreiburg2008"><img border="0" title="Meeting Freiburg 2008" alt="Meeting Freiburg 2008 - logo" src="../../../images/apache-lenya-meeting-freiburg-2008.png" style="width: 160px;height: 40px;"></a> |
| </div> |
| </div> |
| <!--+ |
| |end Menu |
| +--> |
| <!--+ |
| |start content |
| +--> |
| <div id="content"> |
| <div title="Portable Document Format" class="pdflink"> |
| <a class="dida" href="custom_resourcetype.pdf"><img alt="PDF -icon" src="../../../skin/images/pdfdoc.gif" class="skin"><br> |
| PDF</a> |
| </div> |
| <h1>Custom Resource Type How-To</h1> |
| <div id="front-matter"> |
| <div id="minitoc-area"> |
| <ul class="minitoc"> |
| <li> |
| <a href="#Decide+if+you+really+need+a+new+resource+type">Decide if you really need a new resource type</a> |
| </li> |
| <li> |
| <a href="#Choose+a+name">Choose a name</a> |
| </li> |
| <li> |
| <a href="#Define+the+resource+type+ID">Define the resource type ID</a> |
| </li> |
| <li> |
| <a href="#Create+the+schema">Create the schema</a> |
| </li> |
| <li> |
| <a href="#Resource+type+matcher">Resource type matcher</a> |
| </li> |
| <li> |
| <a href="#Sample+File">Sample File</a> |
| </li> |
| <li> |
| <a href="#Presentation">Presentation</a> |
| </li> |
| <li> |
| <a href="#Menus">Menus</a> |
| </li> |
| <li> |
| <a href="#Using+an+existing+menu">Using an existing menu</a> |
| </li> |
| <li> |
| <a href="#using+a+custom+menu">using a custom menu</a> |
| </li> |
| <li> |
| <a href="#Workflow">Workflow</a> |
| </li> |
| </ul> |
| </div> |
| </div> |
| |
| <p>This tutorial explains how to add a custom resource type to the Default publication in order to mix free page editing (as in XHTML) and constrained editing |
| (as you get with a custom resource type). </p> |
| |
| |
| <a name="N10011"></a><a name="Decide+if+you+really+need+a+new+resource+type"></a> |
| <h2 class="h3">Decide if you really need a new resource type</h2> |
| <div class="section"> |
| <p>Introducing a new resource type where you don't need one is a time consuming and often unnecessary excercise. Therefore you should ask yourself first if you really need a new |
| resource type for what you are trying to achieve or if you should be looking for other means of solving your problem. </p> |
| <p>As a rule of thumb, you should use a new resource type if you are going to render documents which are fundamentally different from XHTML. |
| A resource type is all about Lenya turning an arbitraty XML document into XHTML which then will be put into the content page of your publication's page. </p> |
| <p>It might make sense for example to introduce resource types for well known XML schemas such as: </p> |
| <ul> |
| |
| <li> RSS</li> |
| |
| <li> |
| <a href="http://docbook.sourceforge.net/">DocBook</a> |
| </li> |
| |
| <li> |
| <p> NewsML, SportsML, <a href="http://nitf.org/">NITF</a> or <a href="http://www.iptc.org">IPTC</a> |
| </p> |
| |
| </li> |
| |
| <li> |
| <a href="http://xmlns.com/foaf/0.1/">FOAF</a> |
| </li> |
| |
| </ul> |
| <p>It may also make sense to introduce resource types for custom XML schemas such as </p> |
| <ul> |
| |
| <li> |
| <p> the XML format you use for a catalog item in your company </p> |
| |
| </li> |
| |
| </ul> |
| <p>In contrast, it is not a good idea to introduce a custom resource type if you want to render documents that are basically XHTML but just contain some non-XHTML tags such as </p> |
| <ul> |
| |
| <li> |
| <p> <xi:include ...> </p> |
| |
| </li> |
| |
| <li> |
| <p> <ft:...> (Cocoon Form tags) </p> |
| |
| </li> |
| |
| </ul> |
| <p>In this case you should rather add some extra transformers to the pipeline that renders these tags into XHTML. </p> |
| <p>Also resource types are not XHTML templates. </p> |
| </div> |
| <a name="N1005E"></a><a name="Choose+a+name"></a> |
| <h2 class="h3">Choose a name</h2> |
| <div class="section"> |
| <p>Choose a name for the resource type ID: <em>myresourcetype</em> |
| </p> |
| </div> |
| <a name="N1006A"></a><a name="Define+the+resource+type+ID"></a> |
| <h2 class="h3">Define the resource type ID</h2> |
| <div class="section"> |
| <p>Define the resource type ID in <em>mypub/config/doctypes/doctypes.xconf</em> Note that resource types were historically called doctypes, thus the names of the config files. </p> |
| <pre class="code"> |
| <doctypes> |
| <!-- Here is the document ID --> |
| <doc type="myresourcetype"> |
| <!-- if the document is allowed to have children, define what resource types they can be --> |
| <children> |
| <!-- this resource type is allowed to have xhtml and/or myresourcetype documents as children --> |
| |
| <doc type="xhtml"/> |
| <doc type="myresourcetype"/> |
| </children> |
| <!-- This is the class that creates a new instance of this resource type --> |
| <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator"> |
| <!-- this is the sample file that is used when creating a new instance of this resource type. Can be found in config/doctypes/samples --> |
| |
| <sample-name>myresourcetype.xml</sample-name> |
| </creator> |
| <!-- These tasks here refer to ant tasks that should be called for this resource type. For instance, you can have a special publish task. --> |
| <!-- tasks are defined in mypub/config/tasks/tasks.xconf --> |
| <tasks> |
| |
| <task id="publish"/> |
| </tasks> |
| <!-- Specify the workflow definition for this resource type. You can define a seperate workflow for each resource type, for instance with one or two levels of approval. --> |
| <!-- workflow process is defined in mypub/config/workflow/workflow.xml (see below) --> |
| <workflow src="workflow.xml"/> |
| </doc> |
| |
| </doctypes></pre> |
| </div> |
| <a name="N1007A"></a><a name="Create+the+schema"></a> |
| <h2 class="h3">Create the schema</h2> |
| <div class="section"> |
| <p>Create relax NG schema: <em>mypub/config/doctypes/schemas/myresourcetype.rng</em> |
| </p> |
| <p>Note: This is optional, but important if you want to use the form editors. If you get your XML files that you try to render as a custom resource type from |
| somewhere else you can omit this step. You can also omit it if you want to create a sample document manually first to see all the rest working and come back to this point later. </p> |
| <pre class="code"> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <!--+ |
| | myresourcetype resource type |
| +--> |
| |
| <grammar ns="http://www.w3.org/1999/xhtml" |
| xmlns="http://relaxng.org/ns/structure/1.0" |
| xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" |
| xmlns:dc="http://purl.org/dc/elements/1.1/" |
| xmlns:dcterms="http://purl.org/dc/terms/" |
| xmlns:xhtml="http://www.w3.org/1999/xhtml" |
| > |
| |
| <!-- include the general lenya schema --> |
| <!-- you should include the lenya schema if you want to use meta data or assets --> |
| <include href="lenya.rng"/> |
| |
| <!-- include original XHTML transitional schema --> |
| <include href="xhtml/xhtml-basic.rng"> |
| |
| <define name="html"> |
| |
| <element name="html"> |
| <ref name="html.attlist"/> |
| <ref name="lenya.meta"/> <!-- this is the Lenya meta data wrapper --> |
| <ref name="head"/> |
| <ref name="body"/> |
| |
| </element> |
| </define> |
| |
| <define name="html.attlist"> |
| <ref name="XHTML.version.attrib"/> |
| <ref name="I18n.attrib"/> |
| <ref name="dummy.attlist"/> <!-- this is deprecated --> |
| |
| </define> |
| |
| </include> |
| |
| |
| <!-- additional block elements --> |
| <define name="Block.class" combine="choice"> |
| <choice> |
| <ref name="lenya.asset"/> |
| |
| </choice> |
| </define> |
| |
| |
| </grammar></pre> |
| <p>Note that you can generate Relax NG schemas from sample files by using <a href="http://www.thaiopensource.com/relaxng/trang.html"> |
| Trang</a> or <a href="http://wwws.sun.com/software/xml/developers/relaxngconverter/"> Sun RELAX NG Converter</a> |
| </p> |
| </div> |
| <a name="N10098"></a><a name="Resource+type+matcher"></a> |
| <h2 class="h3">Resource type matcher</h2> |
| <div class="section"> |
| <p>Add a sourcetype matcher in <em>mypub/parameter-doctype.xmap</em> |
| |
| </p> |
| <pre class="code"> |
| <!-- This file is map:mounted from mypub/publication-sitemap.xmap --> |
| |
| <map:action name="sourcetype" src="org.apache.cocoon.acting.sourcetype.SourceTypeAction"> |
| <sourcetype name="myresourcetype"> |
| |
| <document-element local-name="myroottag"/> |
| <!-- this matches the root tag --> |
| </sourcetype> |
| </map:action> |
| |
| </pre> |
| <p>The parameter-doctype.xmap allows Lenya to determine the resource type of any URI. the mapping provided in here allows to mix and match resource types freely. |
| It makes use of the <a href="http://forrest.apache.org/docs/cap.html"> Source Type action</a>. There are several ways to identify a resource type, |
| such as by its root tag, the namespace of its root element or its schema. Please note that the name of the resource type you specify here is used throughout |
| Lenya as a naming convention, for instance for the resourcetype2xhtml.xsl. </p> |
| <p>The root-tag is just the doctype within your publication (i.e., 'homepage', if you have a homepage.rng doctype definition). For more background, see: |
| <a href="http://forrest.apache.org/docs/cap.html"> http://forrest.apache.org/docs/cap.html</a> |
| </p> |
| <p>For great examples of complex custom types, please also go to <a href="http://www.wyona.org"> http://www.wyona.org</a> and do a Subversion |
| update to download the example publication (University of Zurich and others). </p> |
| <p>Many problems with resource types not rendering correctly result from this matcher not recognizing the resource type and therefore using the default. |
| So pay special attention to this. Check the overview page in the site area where it will tell you what resource type the document has. </p> |
| </div> |
| <a name="N100C0"></a><a name="Sample+File"></a> |
| <h2 class="h3">Sample File</h2> |
| <div class="section"> |
| <p>Add a sample file: <em>mypub/config/doctypes/samples/myresourcetype.xml</em> |
| </p> |
| <p>The sample file will be used as a template. If you create a new document with this resource type a copy of the sample file will be placed as a starting point. |
| Therefore it makes sense to set some good defaults here. </p> |
| <pre class="code"> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <html xmlns="http://www.w3.org/1999/xhtml" |
| xmlns:xhtml="http://www.w3.org/1999/xhtml" |
| xmlns:dc="http://purl.org/dc/elements/1.1/" |
| xmlns:dcterms="http://purl.org/dc/terms/" |
| xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" |
| xhtml:dummy="FIXME:keepNamespace" dc:dummy="FIXME:keepNamespace" |
| lenya:dummy="FIXME:keepNamespace" dcterms:dummy="FIXME:keepNamespace"> |
| <lenya:meta> |
| <dc:title>dctitle</dc:title> |
| |
| <dc:creator>dccreator</dc:creator> |
| <dc:subject>dcsubject</dc:subject> |
| <dc:description>An empty page for a new resource type</dc:description> |
| <dc:publisher/> |
| |
| <dc:contributor/> |
| <dc:date>2004-4-6</dc:date> |
| <dc:type/> |
| <dc:format/> |
| <dc:identifier/> |
| |
| <dc:source/> |
| <dc:language>en</dc:language> |
| <dc:relation/> |
| <dc:coverage/> |
| <dc:rights>dcrights</dc:rights> |
| |
| </lenya:meta> |
| <head> |
| <title>Sample new resource type</title> |
| </head> |
| <body> |
| |
| <h1>New resource type sample</h1> |
| <p>This sample page is the basis for pages based on this resource type</p> |
| </body> |
| </html></pre> |
| </div> |
| <a name="N100D3"></a><a name="Presentation"></a> |
| <h2 class="h3">Presentation</h2> |
| <div class="section"> |
| <ul> |
| |
| <li> |
| <p> Create presentation XSLT and CSS. If the XSLT and CSS are specific to the publication, you may want to store them in <em>mypub/xslt/myresourcetype2xhtml.xsl</em> |
| and <em>mypub/resources/shared/css/myresourcetype.css</em>, respectively. Take care of the naming conventions for the XSLT files. </p> |
| |
| </li> |
| |
| <li class="gap"> |
| <p> Copy <em>mypub/xslt/page2xhtml-xhtml.xsl</em> to <em>mypub/xslt/page2xhtml-myresourcetype.xsl</em>. This will style your new document type |
| like your old documents. If you wish to change how the new documents look, create your own stylesheet at <em>mypub/xslt/page2xhtml-myresourcetype.xsl</em> |
| </p> |
| |
| |
| </li> |
| |
| <li class="gap"> |
| <p> If you wish to edit your new documents using BXE (Kupu works only with XHTML), you should place a CSS file for styling your documents in |
| <em>mypub/resources/misc/myresourcetype-bxeng.css</em> |
| </p> |
| |
| </li> |
| |
| <li class="gap"> |
| <p> Add presentation pipelines in <em>mypub/sitemap.xmap</em> if you need special pipelines for your resource type </p> |
| |
| </li> |
| |
| </ul> |
| <p>Make sure you understand that for your new resource type you don't need a replacement for page2xhtml.xsl but for xhtml2xhtml. The reason is this: </p> |
| <p>Transforming a document to a page in the browser is always a two-step process, </p> |
| <ol> |
| |
| <li> |
| <p>Using {resourcetype}2xhtml.xsl the document (which might be any arbritary XML such as the link list, Docbook, a RSS feed, etc.) is turned into an XHTML presentation. </p> |
| |
| </li> |
| |
| <li> |
| <p>This XHTML is then processed to contain nagivation, menus and the like using page2xhtml. </p> |
| |
| </li> |
| |
| <li> |
| <p>The stylesheet {resourcetype}2xhtml.xsl must return a document of the form |
| <em><div id="body" xmlns="http://www.w3.org/1999/xhtml"> ... </div></em>. </p> |
| |
| |
| </li> |
| |
| </ol> |
| <p>If you have 5 resource types in your publication, for example: </p> |
| <ul> |
| |
| <li>rss</li> |
| |
| <li> |
| <p> linklist </p> |
| |
| </li> |
| |
| <li> |
| <p> gallery </p> |
| |
| </li> |
| |
| |
| <li> |
| <p> docbook </p> |
| |
| </li> |
| |
| <li> |
| <p> xhtml </p> |
| |
| </li> |
| |
| </ul> |
| <p>the concept would be </p> |
| <pre class="code"> |
| document -> rss2xhtml.xsl --+ |
| document -> linklist2xhtml.xsl --+ |
| document -> gallery2xhtml.xsl --+---> page2xhtml.xsl -> Browser |
| document -> docbook2xhtml.xsl --+ |
| document -> xhtml2xhtml.xsl --+ |
| |
| </pre> |
| </div> |
| <a name="N10147"></a><a name="Menus"></a> |
| <h2 class="h3">Menus</h2> |
| <div class="section"> |
| <p>Configure the menus (either 1. or 2.) </p> |
| </div> |
| <a name="N10150"></a><a name="Using+an+existing+menu"></a> |
| <h2 class="h3">Using an existing menu</h2> |
| <div class="section"> |
| <p>Use an existing menu and add necessary menu items </p> |
| <ul> |
| |
| <li> |
| <p> Edit <em>mypub/config/menus/generic.xsp</em> and add an entry for the new resource type </p> |
| |
| |
| </li> |
| |
| <li> |
| <p> |
| </p> |
| |
| <pre class="code"> |
| ... |
| <menus> |
| <menu i18n:attr="name" name="File" label="File"> |
| <block> |
| <xsp:logic> |
| { |
| if (Publication.ARCHIVE_AREA.equals(area) || Publication.TRASH_AREA.equals(area)) { |
| <item><i18n:text>New Document</i18n:text></item> |
| |
| } |
| else { |
| <item uc:usecase="create" uc:step="showscreen" href="?doctype=xhtml"><i18n:text>New Document</i18n:text></item> |
| <item uc:usecase="create" uc:step="showscreen" href="?doctype=myresourcetype">New "Doc type" Document</item> |
| } |
| } |
| </xsp:logic> |
| |
| </block> |
| ...</pre> |
| |
| </li> |
| |
| </ul> |
| </div> |
| <a name="N1016D"></a><a name="using+a+custom+menu"></a> |
| <h2 class="h3">using a custom menu</h2> |
| <div class="section"> |
| <p>or Create a custom menu for this resource type </p> |
| <ul> |
| |
| <li> |
| <p> edit <em>mypub/menus.xmap</em> |
| </p> |
| |
| |
| </li> |
| |
| <li> |
| <p> create a menu file <em>mypub/config/menus/myresourcetype.xsp</em> |
| </p> |
| |
| </li> |
| |
| </ul> |
| </div> |
| <a name="N10189"></a><a name="Workflow"></a> |
| <h2 class="h3">Workflow</h2> |
| <div class="section"> |
| <p>(optional) define a specific workflow </p> |
| <ul> |
| |
| <li> |
| <p> add the workflow schema to <em>mypub/config/workflow/</em> |
| </p> |
| |
| |
| </li> |
| |
| <li> |
| <p> assign the workflow schema to the resource type in <em>mypub/config/doctypes/doctypes.xconf</em> |
| </p> |
| |
| </li> |
| |
| </ul> |
| </div> |
| </div> |
| <!--+ |
| |end content |
| +--> |
| <div class="clearboth"> </div> |
| </div> |
| <div id="footer"> |
| <!--+ |
| |start bottomstrip |
| +--> |
| <div class="lastmodified"> |
| <script type="text/javascript"><!-- |
| document.write("Last Published: " + document.lastModified); |
| // --></script> |
| </div> |
| <div class="copyright"> |
| Copyright © |
| 2002-2007 <a href="http://www.apache.org/licenses/LICENSE-2.0">The Apache Software Foundation.</a> |
| </div> |
| <div id="feedback"> |
| Send feedback about the website to: |
| <a id="feedbackto" href="mailto:dev@lenya.apache.org?subject=Feedback%C2%A0for%C2%A0docs/1_2_x/how-to/custom_resourcetype.html">dev@lenya.apache.org</a> |
| </div> |
| <!--+ |
| |end bottomstrip |
| +--> |
| </div> |
| </body> |
| </html> |