You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by do...@cocoon.apache.org on 2004/07/10 03:31:57 UTC
[Cocoon Wiki] Updated: WyonaParentChildCreator
Date: 2004-07-09T18:31:57
Editor: JoergHeinicke <jo...@gmx.de>
Wiki: Cocoon Wiki
Page: WyonaParentChildCreator
URL: http://wiki.apache.org/cocoon/WyonaParentChildCreator
no comment
Change Log:
------------------------------------------------------------------------------
@@ -15,13 +15,13 @@
<section><title>Sitemap</title>
<ol>
<li>Definition of Action:
- <code><![:CDATA[<map:actionname="parent-child"src="org.apache.lenya.cms.cocoon.acting.ParentChildCreatorAction"><tree-authoringhref="content/authoring/tree.xml"/><docshref="content/authoring"/><doctypeshref="config/doctypes/"/></map:action>]]></code>
+ <code><![CDATA[<map:actionname="parent-child"src="org.apache.lenya.cms.cocoon.acting.!ParentChildCreatorAction"><tree-authoringhref="content/authoring/tree.xml"/><docshref="content/authoring"/><doctypeshref="config/doctypes/"/></map:action>]]></code>
</li>
<li>"Create-Screen":
- <code><![:CDATA[<map:pipeline><map:matchpattern="lenya/ParentChildScreenNewArticle*"><map:generatetype="serverpages"src="../../content/authoring/parent-child.xsp"/><map:transformsrc="../../xslt/authoring/parent-child.xsl"/><map:serializetype="html"/></map:match></map:pipeline>]]></code>
+ <code><![CDATA[<map:pipeline><map:matchpattern="lenya/!ParentChildScreenNewArticle*"><map:generatetype="serverpages"src="../../content/authoring/parent-child.xsp"/><map:transformsrc="../../xslt/authoring/parent-child.xsl"/><map:serializetype="html"/></map:match></map:pipeline>]]></code>
</li>
<li>"Create-Action":
- <code><![:CDATA[<map:pipeline><map:matchpattern="lenya/create*"><map:acttype="parent-child"><map:redirect-touri="{parent_uri}"session="true"/></map:act><map:redirect-touri="ParentChildScreenNewArticle?status=failed"session="true"/></map:match></map:pipeline>]]></code>
+ <code><![CDATA[<map:pipeline><map:matchpattern="lenya/create*"><map:acttype="parent-child"><map:redirect-touri="{parent_uri}"session="true"/></map:act><map:redirect-touri="!ParentChildScreenNewArticle?status=failed"session="true"/></map:match></map:pipeline>]]></code>
</li>
</ol>
</section>
@@ -30,7 +30,7 @@
<p>
Copy the generic XSLT "../../xslt/authoring/parent-child.xsl" into the publication's stylesheet directory "lenya/xslt/authoring/parent-child-new-article.xsl". Don't forget to change the sitemap appropriately. The following parameters have to exist: parentid (generated via XSP), childid (not-empty String, no whitespace), childname (non-empty String), childtype (leaf or branch), doctype (e.g. Article). Exp:
</p>
-<source><![:CDATA[<form><table><tr><td>parent:</td><td>Hidden</td></tr><tr><td>id:</td><td><inputtype="text"name="id"/></td></tr><tr><td>name:</td><td><inputtype="text"name="name"/></td></tr><tr><td>ChildType:</td><td><inputtype="radio"name="childtype"value="branch"/>Branch<inputtype="radio"name="childtype"value="leaf"/>Leaf</td></tr><tr><td>doctype:</td><td><selectname="doctype"size="2"><optionvalue="generic">Generic(XHTML)</option><optionvalue="member">Member</option></select></td></tr></table></form>]]></source>
+<source><![CDATA[<form><table><tr><td>parent:</td><td>Hidden</td></tr><tr><td>id:</td><td><inputtype="text"name="id"/></td></tr><tr><td>name:</td><td><inputtype="text"name="name"/></td></tr><tr><td>!ChildType:</td><td><inputtype="radio"name="childtype"value="branch"/>Branch<inputtype="radio"name="childtype"value="leaf"/>Leaf</td></tr><tr><td>doctype:</td><td><selectname="doctype"size="2"><optionvalue="generic">Generic(XHTML)</option><optionvalue="member">Member</option></select></td></tr></table></form>]]></source>
<figure src="images/parent-child-image.png" alt=""/>
@@ -40,7 +40,7 @@
<ol>
<li> doctypes.xconf
The different doctypes are configured in a file doctypes.xconf: LENYA_CMS/src/webapp/lenya/pubs/*publication*/config/doctypes/doctypes.xconf. Given are their children and their creator.
- <code><![:CDATA[<?xmlversion="1.0"?><doctypes><doctype="Section"><children><doctype="Article"/></children></doc><doctype="Article"><creatorsrc="org.apache.lenya.cms.pubs.forum.NewArticleCreator"/><children><doctype="Comment"/></children></doc></doctypes>]]></code>
+ <code><![CDATA[<?xmlversion="1.0"?><doctypes><doctype="Section"><children><doctype="Article"/></children></doc><doctype="Article"><creatorsrc="org.apache.lenya.cms.pubs.forum.!NewArticleCreator"/><children><doctype="Comment"/></children></doc></doctypes>]]></code>
</li>
</ol>
</section>
@@ -49,21 +49,21 @@
<p>
The document tree.xml has to exist and the branches as well! Please see definition of Action.
</p>
- <source><![:CDATA[<?xmlversion="1.0"?><!--CAUTION:thistreeishandcrafted--><tree><branchrelURI=""doctype="Front"menuName="Home"><branchrelURI="magazin"doctype="Channel"menuName="Magazin"><branchrelURI="gesundheit"doctype="Section"menuName="Gesundheit"><branchrelURI="2002"doctype="Year"menuName="2002"/></branch></branch><branchrelURI="channel"doctype="Channel"menuName="Magazin"><branchrelURI="section"doctype="Section"menuName="Gesundheit"><branchrelURI="year"doctype="Year"menuName="2002"/></branch></branch></branch></tree>]]></source>
+ <source><![CDATA[<?xmlversion="1.0"?><!--CAUTION:thistreeishandcrafted--><tree><branchrelURI=""doctype="Front"menuName="Home"><branchrelURI="magazin"doctype="Channel"menuName="Magazin"><branchrelURI="gesundheit"doctype="Section"menuName="Gesundheit"><branchrelURI="2002"doctype="Year"menuName="2002"/></branch></branch><branchrelURI="channel"doctype="Channel"menuName="Magazin"><branchrelURI="section"doctype="Section"menuName="Gesundheit"><branchrelURI="year"doctype="Year"menuName="2002"/></branch></branch></branch></tree>]]></source>
</section>
<section><title>Extend Java Class !AbstractParentChildCreator</title>
<p>
Finally the Java class !AbstractParentChildCreator has to be extended.
</p>
- <source><![:CDATA[packagech.unizh.unipublic.lenya.cms.authoring;importjava.io.File;importorg.apache.lenya.cms.authoring.AbstractParentChildCreator;importorg.apache.log4j.Category;/***@authorMichaelWechner*@version2002.7.2*/publicclassNewArticleCreatorextendsAbstractParentChildCreator{staticCategorylog=Category.getInstance(NewArticleCreator.class);/****/publicshortgetChildType(shortchildType)throwsException{returnchildType;}/****/publicStringgenerateTreeId(StringchildId,shortchildType)throwsException{returnchildId;}/****/publicvoidcreate(FilesamplesDir,FileparentDir,StringchildId,shortchildType)throwsException{log.warn("NewArticleCreator.create()hasbeencalled.");}}]]></source>
+ <source><![CDATA[packagech.unizh.unipublic.lenya.cms.authoring;importjava.io.File;importorg.apache.lenya.cms.authoring.!AbstractParentChildCreator;importorg.apache.log4j.Category;/***@authorMichaelWechner*@version2002.7.2*/publicclass!NewArticleCreatorextendsAbstractParentChildCreator{staticCategorylog=Category.getInstance(!NewArticleCreator.class);/****/publicshortgetChildType(shortchildType)throwsException{returnchildType;}/****/publicStringgenerateTreeId(StringchildId,shortchildType)throwsException{returnchildId;}/****/publicvoidcreate(FilesamplesDir,FileparentDir,StringchildId,shortchildType)throwsException{log.warn("!NewArticleCreator.create()hasbeencalled.");}}]]></source>
</section>
<section><title>Sample: sample.xml</title>
<p>
When the child is created, the systems takes a sample of the appropriate doctype and makes a copy of that sample, such that the user has a starting point for editing.
</p>
- <source><![:CDATA[<?xmlversion="1.0"?><article><meta><id/></meta><head><title>SampleTitle</title></head><body><p>SamplePersonwrites:<quotation>SampleQuotation...</quotation>SampleText...</p></body><comments/></article>]]></source>
+ <source><![CDATA[<?xmlversion="1.0"?><article><meta><id/></meta><head><title>SampleTitle</title></head><body><p>SamplePersonwrites:<quotation>SampleQuotation...</quotation>SampleText...</p></body><comments/></article>]]></source>
</section>
<section><title>Bread-Crumb Path</title>
@@ -72,7 +72,7 @@
a bread-crumb path and the siblings from the tree. More details can be found within
the publication "Materials Science" (ethz-mat).
</p>
-<source><![:CDATA[<?xmlversion="1.0"?><parentchildrelURI="g06"doctype="Group"name="PolymerChemistry"><parents><parentrelURI=""doctype="Department"name="Department"/></parents><children><childtype="branch"relURI="members"doctype="Members"name="Members"/><childtype="leaf"relURI="research"doctype="Generic"name="Research"/><childtype="leaf"relURI="positions"doctype="Generic"name="OpenPositions"/><childtype="leaf"relURI="related"doctype="Generic"name="RelatedTopics"/></children></parentchild>]]></source>
+<source><![CDATA[<?xmlversion="1.0"?><parentchildrelURI="g06"doctype="Group"name="PolymerChemistry"><parents><parentrelURI=""doctype="Department"name="Department"/></parents><children><childtype="branch"relURI="members"doctype="Members"name="Members"/><childtype="leaf"relURI="research"doctype="Generic"name="Research"/><childtype="leaf"relURI="positions"doctype="Generic"name="OpenPositions"/><childtype="leaf"relURI="related"doctype="Generic"name="RelatedTopics"/></children></parentchild>]]></source>
</section>
</section>