You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/07/19 15:20:43 UTC

svn commit: r557611 - in /lenya/trunk/src/modules/neutron: config/cocoon-xconf/usecase-checkout.xconf sitemap.xmap usecases/ usecases/neutron.jx xslt/introspection.xsl

Author: andreas
Date: Thu Jul 19 06:20:39 2007
New Revision: 557611

URL: http://svn.apache.org/viewvc?view=rev&rev=557611
Log:
Use JX template for neutron instead of old reserved-checkout action approach

Added:
    lenya/trunk/src/modules/neutron/usecases/
    lenya/trunk/src/modules/neutron/usecases/neutron.jx
Modified:
    lenya/trunk/src/modules/neutron/config/cocoon-xconf/usecase-checkout.xconf
    lenya/trunk/src/modules/neutron/sitemap.xmap
    lenya/trunk/src/modules/neutron/xslt/introspection.xsl

Modified: lenya/trunk/src/modules/neutron/config/cocoon-xconf/usecase-checkout.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/neutron/config/cocoon-xconf/usecase-checkout.xconf?view=diff&rev=557611&r1=557610&r2=557611
==============================================================================
--- lenya/trunk/src/modules/neutron/config/cocoon-xconf/usecase-checkout.xconf (original)
+++ lenya/trunk/src/modules/neutron/config/cocoon-xconf/usecase-checkout.xconf Thu Jul 19 06:20:39 2007
@@ -23,7 +23,9 @@
 
   <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'neutron.checkout']">
     <component-instance name="neutron.checkout" logger="lenya.neutron"
-      class="org.apache.lenya.cms.usecase.DummyUsecase">
-      <view uri="cocoon://modules/neutron/load.xml"/>
+      class="org.apache.lenya.cms.workflow.usecases.InvokeWorkflow">
+      <view template="modules/neutron/usecases/neutron.jx" menu="false" createContinuation="false"/>
+      <transaction policy="pessimistic"/>
+      <event id="edit"/>
     </component-instance>
   </xconf>

Modified: lenya/trunk/src/modules/neutron/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/neutron/sitemap.xmap?view=diff&rev=557611&r1=557610&r2=557611
==============================================================================
--- lenya/trunk/src/modules/neutron/sitemap.xmap (original)
+++ lenya/trunk/src/modules/neutron/sitemap.xmap Thu Jul 19 06:20:39 2007
@@ -20,56 +20,28 @@
 
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
   
+  <map:components>
+    <map:matchers default="wildcard">
+      <map:matcher logger="sitemap.matcher.usecase" name="action"
+          src="org.apache.cocoon.matching.WildcardRequestParameterMatcher">
+        <parameter-name>lenya.action</parameter-name>
+      </map:matcher>
+    </map:matchers>
+  </map:components>
+  
   <map:pipelines>
       
     <!-- Introspection -->
-    <map:pipeline>
-      <map:match pattern="*/**/introspection.xml">
+    <map:pipeline type="noncaching">
+      <map:match type="action" pattern="introspect">
         <map:generate src="context://lenya/content/util/empty.xml"/>
         <map:transform src="fallback://lenya/modules/neutron/xslt/introspection.xsl">
-          <map:parameter name="context" value="{page-envelope:context-prefix}"/>
-          <map:parameter name="publication" value="{page-envelope:publication-id}"/>
-          <map:parameter name="area" value="{1}"/>
-          <map:parameter name="page-id" value="{2}"/>
+          <map:parameter name="uri" value="{proxy:{request:requestURI}}"/>
         </map:transform>
         <map:serialize type="xml"/>
       </map:match>
     </map:pipeline>
   
-    <map:pipeline>
-        
-      <map:match pattern="load.xml">
-        <map:select type="parameter">
-          <map:parameter name="parameter-selector-test" value="{flow-attr:count(usecase/errorMessages)}"/>
-          <map:when test="0.0">
-            <map:read src="lenya-document:{page-envelope:document-uuid}"/>
-          </map:when>
-          <map:otherwise>
-            <map:generate src="context://lenya/content/util/empty.xml"/>
-            <map:serialize type="xml" status-code="500"/>
-          </map:otherwise>
-        </map:select>
-      </map:match>
-      
-      <map:match pattern="checkout.xml">
-        <map:select type="resource-exists">
-          <map:when test="lenya-document:{page-envelope:document-uuid}">
-            <map:act type="reserved-checkout">
-              <!-- TODO: add info from RCML ... -->
-              <map:generate src="checkout-exception.xml"/>
-              <map:serialize type="xml" status-code="500"/>
-            </map:act>
-            <map:read src="lenya-document:{page-envelope:document-uuid}"/>
-          </map:when>
-          <map:otherwise>
-            <map:generate src="context://lenya/content/util/empty.xml"/>
-            <map:serialize type="xml" status-code="412"/>
-          </map:otherwise>
-        </map:select>
-      </map:match>
-      
-    </map:pipeline>
-    
   </map:pipelines>
 
 </map:sitemap>

Added: lenya/trunk/src/modules/neutron/usecases/neutron.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/neutron/usecases/neutron.jx?view=auto&rev=557611
==============================================================================
--- lenya/trunk/src/modules/neutron/usecases/neutron.jx (added)
+++ lenya/trunk/src/modules/neutron/usecases/neutron.jx Thu Jul 19 06:20:39 2007
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jx:choose
+  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+  xmlns:ci="http://apache.org/cocoon/include/1.0">
+  
+  <jx:when test="${usecase.hasErrors()}">
+    <page:page
+      xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+      >
+      
+      <page:title><i18n:text>Neutron Editor</i18n:text></page:title>
+      
+      <jx:set var="sourceUrl" value="${usecase.getSourceURL()}"/>
+      <jx:set var="steps" value="${sourceUrl.split('/')}"/>
+      <jx:set var="lastStep" value="${steps[steps.size() - 1]}"/>
+      
+      <page:body>
+        <jx:import uri="fallback://lenya/modules/usecase/templates/messages.jx"/>
+      </page:body>
+    </page:page>
+  </jx:when>
+  <jx:otherwise>
+    <jx:set var="document" value="${usecase.getParameter('document')}"/>
+    <ci:include src="lenya-document:${document.getUUID()},lang=${document.getLanguage()}"/>
+  </jx:otherwise>
+</jx:choose>
\ No newline at end of file

Modified: lenya/trunk/src/modules/neutron/xslt/introspection.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/neutron/xslt/introspection.xsl?view=diff&rev=557611&r1=557610&r2=557611
==============================================================================
--- lenya/trunk/src/modules/neutron/xslt/introspection.xsl (original)
+++ lenya/trunk/src/modules/neutron/xslt/introspection.xsl Thu Jul 19 06:20:39 2007
@@ -23,11 +23,7 @@
     xmlns="http://www.wyona.org/neutron/1.0"
 >
 
-<xsl:param name="context" select="'context-null'"/>
-<xsl:param name="publication" select="'publication-null'"/>
-<xsl:param name="area" select="'area-null'"/>
-<xsl:param name="page-id" select="'page-id-null'"/>
-<xsl:param name="uri" select="'/foo/bar.xml'"/>
+<xsl:param name="uri"/>
 
 <xsl:template match="/">
   <introspection>
@@ -43,13 +39,13 @@
     -->
     <edit mime-type="application/xhtml+xml" name="Body Content">
 
-      <checkout url="{$context}/{$publication}/authoring/{$page-id}.xml?lenya.usecase=neutron.checkout" method="GET"/>
+      <checkout url="{$uri}?lenya.usecase=neutron.checkout" method="GET"/>
 
 <!-- Save without releasing the lock, e.g. for "global" temporary saving -->
 <!--
-      <save url="{$context}/{$publication}/authoring/{$page-id}.xml?lenya.module=neutron&amp;lenya.step=save" method="PUT"/>
+      <save url="{$uri}?lenya.module=neutron&amp;lenya.step=save" method="PUT"/>
 -->
-      <checkin url="{$context}/{$publication}/authoring/{$page-id}.xml?lenya.usecase=neutron.checkin" method="PUT"/>
+      <checkin url="{$uri}?lenya.usecase=neutron.checkin" method="PUT"/>
 
 <!--
       <schemas>



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