You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Apache Wiki <wi...@apache.org> on 2005/05/14 22:56:32 UTC

[Lenya Wiki] Update of "WyonaParentChildCreator" by GregorRothfuss

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change notification.

The following page has been changed by GregorRothfuss:
http://wiki.apache.org/lenya/WyonaParentChildCreator

The comment on the change is:
obsolete

------------------------------------------------------------------------------
- Parent-Child Creator</title> 
+ deleted
  
-    <section><title>Introduction</title> 
-     <p>
- The Parent-Child Creator is a concrete implementation of the !ResourceCreator pattern.
-     </p>
-    </section>
- 
-    <section><title>Customizing the Menu</title> 
-      <p>
- Normally the "Menus" can be found at <em>config/menus</em>.
-      </p>  
-    </section>
- 
-    <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>
-        </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>                                                                                                                        
-        </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>
-        </li>
-      </ol> 
-    </section>
- 
-    <section><title>Customizing the Create Screen</title> 
-      <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>
- 
- <figure src="images/parent-child-image.png" alt=""/>
- 
-    </section>
- 
-    <section><title>Configuration</title> 
-      <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>
-        </li>
-      </ol>   
-    </section>
- 
-    <section><title>Tree: tree.xml</title> 
-      <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>
-    </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*/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>
-    </section>
- 
-       <section><title>Bread-Crumb Path</title>
- <p>
- You can now easily extract 
- 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"?><parentchild relURI="g06" doctype="Group" name="!PolymerChemistry"><parents><parent relURI="" doctype="Department" name="Department"/></parents><children><child type="branch" relURI="members" doctype="Members" name="Members"/><child type="leaf" relURI="research" doctype="Generic" name="Research"/><child type="leaf" relURI="positions" doctype="Generic" name="!OpenPositions"/><child type="leaf" relURI="related" doctype="Generic"name="!RelatedTopics"/></children></parentchild>]]></source>
-       </section>
- 
-    </section>
- 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org