Andreas Hartmann wrote:
Hi Jörn,

[EMAIL PROTECTED] schrieb:
Author: nettings
Date: Sun Jul 22 13:45:10 2007
New Revision: 558544

URL: http://svn.apache.org/viewvc?view=rev&rev=558544
Log:
introduced generic editors.insertLink usecase implementation.
the view is created by a cocoon pipeline, not a jxtemplate, because the
necessary data is more readily available as input modules than via the
java api.

that's an issue that should definitely be addressed immediately.
We can't declare JX templates the recommended way of implementing
usecase views if they don't provide access to information which
is necessary for rendering.

well, it's a matter of taste, actually. i like to implement usecase views as cocoon pipelines, because i know how to get at stuff using input modules, and i find jxtemplates nasty...

Would you mind giving a short description of what kind of information
you were missing?

here is the information i needed to make the existing tree code work:

+     <!-- this is a usecase view (see 
config/cocoon-xconf/usecase-insertLink.xconf) -->
+      <map:match pattern="editors.insertLink">
+        <map:generate src="context://lenya/content/util/empty.xml"/>
+        <map:transform 
src="fallback://lenya/modules/editors/xslt/insertLink.xsl">
+          <map:parameter name="publicationId" 
value="{page-envelope:publication-id}"/>
+          <map:parameter name="area" value="authoring"/>
+          <map:parameter name="areaBasePath"
+             
value="{proxy:/{page-envelope:publication-id}/{page-envelope:area}}"/>
+          <map:parameter name="tab" value="en"/>
+          <map:parameter name="chosenLanguage" 
value="{page-envelope:document-language}"/>
+          <map:parameter name="path" value="{page-envelope:document-path}"/>
+          <map:parameter name="documentId" 
value="{page-envelope:document-uuid}"/>
+          <map:parameter name="documentExtension" 
value="{page-envelope:document-extension}"/>
+          <map:parameter name="defaultLanguage" 
value="{page-envelope:default-language}"/>
+          <map:parameter name="languages" 
value="{page-envelope:publication-languages-csv}"/>
+          <map:parameter name="editorModule" 
value="{request-param:lenya.editorModule}"/>
+        </map:transform>
+        <map:call resource="style-cms-page"/>
+        <map:serialize />
+      </map:match>

i did not mean to imply it's not obtainable via java, just that i could not figure out how in a reasonable timeframe.

plus in this case, we don't really cause server-side effects, hence it seems overkill to implement a special usecase handler just to obtain some view-related data. my approach uses the dummy handler instead.

do you still think we had better use jxtemplate? comments are appreciated.

jörn


--
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

Kurt is up in Heaven now.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to