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 15:49:21 UTC

svn commit: rev 55435 - incubator/lenya/trunk/src/webapp/lenya/usecases/edit

Author: roku
Date: Sun Oct 24 06:49:21 2004
New Revision: 55435

Added:
   incubator/lenya/trunk/src/webapp/lenya/usecases/edit/
   incubator/lenya/trunk/src/webapp/lenya/usecases/edit/usecase-edit.xmap
Log:
[Merged from 1.2.x]
- Extracted edit (forms editor) usecase to separte sitemap
- Switched form-encoding to UTF-8 for testing purposes. Lets rip all iso-* out. Please help testing. I guess I had a licky hand this time.

Added: incubator/lenya/trunk/src/webapp/lenya/usecases/edit/usecase-edit.xmap
==============================================================================
--- (empty file)
+++ incubator/lenya/trunk/src/webapp/lenya/usecases/edit/usecase-edit.xmap	Sun Oct 24 06:49:21 2004
@@ -0,0 +1,152 @@
+<?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/editor/authoring/{page-envelope:document-path}"/>
+        <map:transform src="{global:basedir}/xslt/authoring/edit/unnumberTags.xsl"/>
+        <map:serialize type="xml-utf-8"/>
+      </map:match>
+    </map:pipeline>   
+    
+    <!-- Usecase pipeline -->  
+    <map:pipeline>           
+        <map:match pattern="edit" 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/numberTags.xsl"/>
+              <map:transform src="{global:basedir}/xslt/authoring/edit/addSourceTags.xsl">
+                <map:parameter name="source" value="{global:basedir}/pubs/{1}/work/editor/authoring/{page-envelope:document-path}"/>
+              </map:transform>
+              <map:transform type="write-source">
+                <map:parameter name="serializer" value="xml-utf-8"/>
+              </map:transform>
+              <map:transform src="{global:basedir}/xslt/authoring/edit/removeSourceTags.xsl"/>
+              <map:transform src="{global:basedir}/pubs/{1}/lenya/xslt/formeditor/{request-param:form}.xsl">
+                <map:parameter name="docid" value="{page-envelope:document-path}"/>
+                <map:parameter name="form" value="{request-param:form}"/>
+              </map:transform>
+              <map:transform src="{fallback:xslt/authoring/edit/form-layout.xsl}">
+                <map:parameter name="contextPrefix" value="{page-envelope:context-prefix}"/>
+                <map:parameter name="wfevent" value="{request-param:lenya.event}"/>
+              </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="save">
+                <map:parameter name="file" value="{global:basedir}/pubs/{1}/work/editor/authoring/{page-envelope:document-path}"/>
+                <map:parameter name="schema" value="{global:basedir}/pubs/{1}/config/doctypes/schemas/{request-param:form}.rng"/>
+                <map:parameter name="unnumberTagsXSL" value="{global:basedir}/xslt/authoring/edit/unnumberTags.xsl"/>
+                <map:parameter name="numberTagsXSL" value="{global:basedir}/xslt/authoring/edit/numberTags.xsl"/>
+
+                <!-- Continue editing: Insert, Delete, etc. -->
+                <map:generate src="{global:basedir}/pubs/{../1}/work/editor/authoring/{page-envelope:document-path}"/>
+
+                <map:transform src="{global:basedir}/pubs/{../1}/lenya/xslt/formeditor/{request-param:form}.xsl">
+                  <map:parameter name="docid" value="{page-envelope:document-path}"/>
+                  <map:parameter name="form" value="{request-param:form}"/>
+                  <map:parameter name="message" value="{message}"/>
+                </map:transform>
+                <map:transform src="{fallback:xslt/authoring/edit/form-layout.xsl}">
+                  <map:parameter name="contextPrefix" value="{page-envelope:context-prefix}"/>
+                  <map:parameter name="edit" value="{editSelect}"/>
+                  <map:parameter name="wfevent" value="{request-param:lenya.event}"/>
+                </map:transform>
+                <map:call resource="style-cms-page"/>
+              </map:act>
+
+              <!-- Stop Editing: Save and Cancel -->
+              <!-- If temporary file exists, then SAVE else CANCEL -->
+              <map:act type="resource-exists" src="{global:basedir}/pubs/{1}/work/editor/authoring/{page-envelope:document-path}">
+                <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>
+
+              <!-- If CANCEL then the document also needs to be checked in -->
+              <map:act type="reserved-checkin">
+                <map:parameter name="backup" value="false"/>
+                <map:generate src="{global:basedir}/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:redirect-to uri="{request:requestURI}"/>
+            </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