You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ro...@apache.org on 2004/10/24 12:38:10 UTC

svn commit: rev 55424 - incubator/lenya/trunk/src/webapp/lenya/usecases/1formedit

Author: roku
Date: Sun Oct 24 03:38:08 2004
New Revision: 55424

Added:
   incubator/lenya/trunk/src/webapp/lenya/usecases/1formedit/
   incubator/lenya/trunk/src/webapp/lenya/usecases/1formedit/usecase-1formedit.xmap
Log:
[Merged from 1.2.x]
Extraced 1oneformedit usecase to its own sitemap.
Using flow to save doc. 
Fixed blank pages on save and exit.

Added: incubator/lenya/trunk/src/webapp/lenya/usecases/1formedit/usecase-1formedit.xmap
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/src/webapp/lenya/usecases/1formedit/usecase-1formedit.xmap	Sun Oct 24 03:38:08 2004
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 1999-2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id$ -->
+
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+  <!-- =========================== Components ================================ -->
+  <map:components/>
+  <!-- =========================== Resources ================================ -->
+  <map:resources>
+    <map:resource name="style-cms-page">
+      <map:transform type="i18n">      
+        <map:parameter name="locale" value="{request:locale}"/>
+      </map:transform>    
+      <map:transform src="{global:basedir}/xslt/util/page2xhtml.xsl">
+        <map:parameter name="contextprefix" value="{request:contextPath}"/>
+      </map:transform>
+      <map:transform src="{global:basedir}/xslt/util/strip_namespaces.xsl"/>
+      <map:serialize type="xhtml"/>
+    </map:resource>    
+  </map:resources>  
+  <!-- =========================== Flow ===================================== -->
+  <map:flow language="javascript">
+    <map:script src="../edit-document.js"/>
+  </map:flow>
+  <!-- =========================== Pipelines ================================ -->  
+  <map:pipelines>
+    
+    <map:component-configurations>
+      <global-variables>
+        <!-- To access core resources -->
+        <basedir>../..</basedir>
+      </global-variables>
+    </map:component-configurations>
+
+
+    <map:pipeline internal-only="true">     
+      <map:match pattern="request2document">
+        <map:generate src="{global:basedir}/pubs/{page-envelope:publication-id}/work/oneformeditor/authoring/tutorial.xml"/>
+        <map:serialize type="xml-utf-8"/>
+      </map:match>
+    </map:pipeline>   
+    
+    <!-- Usecase pipeline -->  
+    <map:pipeline>           
+         <map:match pattern="1formedit" type="usecase">
+
+          <map:match pattern="open" type="step">
+            <map:match pattern="*/authoring/**.html">
+              <map:act type="reserved-checkout">
+                <map:generate type="serverpages" src="{global:basedir}/content/rc/{exception}.xsp">
+                  <map:parameter name="user" value="{user}"/>
+                  <map:parameter name="filename" value="{filename}"/>
+                  <map:parameter name="date" value="{date}"/>
+                  <map:parameter name="message" value="{message}"/>
+                </map:generate>
+                <map:transform src="{global:basedir}/xslt/rc/rco-exception.xsl"/>
+                <map:call resource="style-cms-page"/>
+              </map:act>
+              
+              <map:generate src="{global:basedir}/pubs/{1}/content/authoring/{page-envelope:document-path}"/>
+              <map:transform src="{global:basedir}/xslt/authoring/edit/oneform.xsl">
+                <map:parameter name="docid" value="{page-envelope:document-id}"/>
+                <map:parameter name="language" value="{page-envelope:document-language}"/>
+              </map:transform>
+              <map:call resource="style-cms-page"/>
+            </map:match>
+          </map:match>
+	
+          <map:match pattern="close" type="step">
+            <map:match pattern="*/authoring/**.html">
+              <map:act type="request-parameter-exists">
+                <map:parameter name="parameters" value="save"/>
+                <map:act type="oneformeditorsave">
+                  <map:parameter name="file" value="{global:basedir}/pubs/{../1}/work/oneformeditor/authoring/{../2}.xml"/>
+                  <map:parameter name="schema" value="{global:basedir}/pubs/{../1}/config/doctypes/schemas/{page-envelope:document-type}.rng"/>
+                  <map:generate src="{global:basedir}/pubs/{../../1}/content/authoring/{page-envelope:document-path}"/>
+                  <map:transform src="{global:basedir}/xslt/authoring/edit/oneform.xsl">
+                    <map:parameter name="docid" value="{page-envelope:document-id}"/>
+                    <map:parameter name="language" value="{page-envelope:document-language}"/>
+                    <map:parameter name="message" value="{message}"/>
+                  </map:transform>
+                  <map:call resource="style-cms-page"/>
+                </map:act>
+
+                <!-- Validation succeeded -->
+                <!-- Save: Overwrite original file  -->
+                <map:call function="editDocument">
+                  <map:parameter name="sourceUri" value="cocoon:/request2document"/>
+                  <map:parameter name="useBuffer" value="false"/>
+                  <map:parameter name="noStatus" value="true"/>
+                  <map:parameter name="redirectUrl" value="{request:requestURI}"/>
+                </map:call>               
+<!--
+                <map:act type="reserved-checkin">
+                  <map:parameter name="backup" value="true"/>
+                  <map:generate src="content/rc/{exception}.xsp" type="serverpages">
+                    <map:parameter name="user" value="{user}"/>
+                    <map:parameter name="filename" value="{filename}"/>
+                    <map:parameter name="checkType" value="{checkType}"/>
+                    <map:parameter name="date" value="{date}"/>
+                    <map:parameter name="message" value="{message}"/>
+                  </map:generate>
+                  <map:transform src="{global:basedir}/xslt/rc/rco-exception.xsl"/>
+                  <map:serialize/>
+                </map:act>
+
+                <map:act type="workflow">
+                  <map:parameter name="area" value="{page-envelope:area}"/>
+                  <map:parameter name="document-id" value="{page-envelope:document-id}"/>
+                  <map:parameter name="language" value="{page-envelope:document-language}"/>
+                  <map:parameter name="event" value="edit"/>
+                </map:act>                
+                
+                <map:redirect-to uri="{request:requestURI}"/> -->
+<!--                <map:generate src="{global:basedir}/pubs/{page-envelope:publication-id}/content/authoring/{page-envelope:document-path}"/>
+                <map:serialize/>
+                -->
+              </map:act>
+              <!-- 
+                Cancel is pressed. Unlock the document. 
+                Alternatively one could use the reserved-checkin action direct.
+              -->
+              <map:redirect-to uri="{page-envelope:context-prefix}/{1}/authoring/{2}.html?lenya.usecase=checkin&amp;lenya.step=checkin&amp;backup=false"/>
+            </map:match>
+          </map:match>
+
+        </map:match>
+
+    </map:pipeline>
+  </map:pipelines>
+
+</map:sitemap>

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