Page: http://wiki.cocoondev.org/Wiki.jsp?page=LenyaAddingCustomDocType , 
version: 5 on Mon Apr  6 17:46:17 2004 by 217.227.134.78

- * define a doctype ID: ''mydoctype''
+ * Choose a name for the doctype ID: ''mydoctype''
- * define the doctype in {{mypub/config/doctypes/doctypes.xconf}}
?   ^

+ * Define the doctype ID in {{mypub/config/doctypes/doctypes.xconf}}
?   ^                 +++

+ {{{<doctypes>
+   <!-- Here is the document ID -->
+   <doc type="mydoctype">
+     <!-- if the document is allowed to have children, define what doctypes 
they can be -->
+     <children>
+       <!-- this doctype is allowed to have xhtml and/or mydoctype documents 
as children -->
+       <doc type="xhtml"/>
+       <doc type="mydoctype"/>
+     </children>
+     <!-- ??? -->
+     <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
+       <!-- this sample file is created later -->
+       <sample-name>mydoctype.xml</sample-name>
+     </creator>
+     <!-- [FixMe] the tasks allowed for this document type ? -->
+     <!-- tasks are defined in mypub/config/tasks/tasks.xconf -->
+     <tasks>
+       <task id="publish"/>
+     </tasks>
+     <!-- [FixMe] the workflow process allowed for this document type ? -->
+     <!-- workflow process is defined in mypub/config/workflow/workflow.xml 
(see below) -->
+     <workflow src="workflow.xml"/>
+   </doc>
+ 
+ </doctypes>}}}
+ {{{<?xml version="1.0" encoding="UTF-8"?>
+ <!--+
+     | mydoctype doctype
+     +-->
+ 
+ <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 -->
+ <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"/>
+       <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"/>
+   </define>
+ 
+ </include>
+ 
+ 
+ <!-- additional block elements -->
+ <define name="Block.class" combine="choice">
+   <choice>
+     <ref name="lenya.asset"/>
+   </choice>
+ </define>
+ 
+ 
+ </grammar>}}}
- * add doctype matcher in {{mypub/parameter-doctype.xmap}}
?   ^

+ * Add doctype matcher in {{mypub/parameter-doctype.xmap}}
?   ^

+ {{mypub/parameter-doctype.xmap}} is map:mounted from 
{{mypub/publication-sitemap.xmap}}
+ [FixMe], describe the options for matching, or link to the relevant cocoon 
documentation
+ [FixMe], if creating another xhtml type document is there any need to modify 
this file?
- * add a sample file: {{mypub/config/doctypes/samples/mydoctype.xml}}
?   ^

+ * Add a sample file: {{mypub/config/doctypes/samples/mydoctype.xml}}
?   ^

- * create presentation XSLT and CSS
+ {{{<?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 doctype</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 doctype</title>
+   </head>
+   <body>
+     <h1>New Doctype sample</h1>
+     <p>This sample page is the basis for pages based on this doctype</p>
+   </body>
+ </html>}}}
+ * Create presentation XSLT and CSS.  If the XSLT and CSS are specific to the 
publication, you may want to store them in {{mypub/xslt/mydoctype2xhtml.xsl}} 
and {{mypub/resources/shared/css/mydoctype.css}}, respectively.
- * add the presentation pipelines in {{mypub/sitemap.xmap}}
?   ^

+ * Add the presentation pipelines in {{mypub/sitemap.xmap}}
?   ^

+ ;:[FixMe], doesn't this go into {{mypub/doctypes.xmap}}? Is it even needed?
- * configure the menus (either 1. or 2.)
?   ^

+ * Configure the menus (either 1. or 2.)
?   ^

- ## use an existing menu and add necessary menu items
?    ^

+ ## Use an existing menu and add necessary menu items
?    ^

- *** creating new ''mydoctype'' document
- *** edit, ...
+ *** Edit {{mypub/config/menus/generic.xsp}} and add an entry for the new 
document type
+ *** {{{...
+     <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=mydoctype"><i18n:text>New ''Doc type'' 
Document</i18n:text></item>
+         }
+           }
+         </xsp:logic>
+       </block>
+ ...}}}
- ## create a custom menu for this doctype
?    ^

+ ## or Create a custom menu for this doctype
?    ^^^^



Reply via email to