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:19 UTC

svn commit: rev 55425 - in incubator/lenya/trunk/src/webapp/lenya: . pubs/default usecases usecases/kupu

Author: roku
Date: Sun Oct 24 03:38:18 2004
New Revision: 55425

Modified:
   incubator/lenya/trunk/src/webapp/lenya/pubs/default/usecase-bxeng.xmap
   incubator/lenya/trunk/src/webapp/lenya/usecase.xmap
   incubator/lenya/trunk/src/webapp/lenya/usecases/edit-document.js
   incubator/lenya/trunk/src/webapp/lenya/usecases/kupu/usecase-kupu.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.

Modified: incubator/lenya/trunk/src/webapp/lenya/pubs/default/usecase-bxeng.xmap
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/pubs/default/usecase-bxeng.xmap	(original)
+++ incubator/lenya/trunk/src/webapp/lenya/pubs/default/usecase-bxeng.xmap	Sun Oct 24 03:38:18 2004
@@ -252,6 +252,7 @@
           
           <map:call function="editDocument">
             <map:parameter name="sourceUri" value="cocoon:/request2document"/>
+            <map:parameter name="noCheckin" value="true"/>
           </map:call>
           </map:when>
 

Modified: incubator/lenya/trunk/src/webapp/lenya/usecase.xmap
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/usecase.xmap	(original)
+++ incubator/lenya/trunk/src/webapp/lenya/usecase.xmap	Sun Oct 24 03:38:18 2004
@@ -314,87 +314,6 @@
           </map:match>
 
         </map:match>                        
-
-        <!-- ************************************************************** -->
-        <!-- ** HTML One Form Editor                                     ** -->
-        <!-- **                                                          ** -->
-        <!-- ** NOTE: page-envelope:document-path depends on the         ** -->
-        <!-- **       publication specific DocumentIdToPathMapper which  ** -->
-        <!-- **       is configured within config/publication.xconf      ** -->
-        <!-- ************************************************************** -->
-        <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="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="xslt/rc/rco-exception.xsl"/>
-                <map:call resource="style-cms-page"/>
-              </map:act>
-              <map:generate src="pubs/{1}/content/authoring/{page-envelope:document-path}"/>
-              <map:transform src="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="pubs/{../1}/work/oneformeditor/authoring/{../2}.xml"/>
-                  <map:parameter name="schema" value="fallback://config/doctypes/schemas/{page-envelope:document-type}.rng"/>
-                  <map:generate src="pubs/{../../1}/content/authoring/{page-envelope:document-path}"/>
-                  <map:transform src="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:generate src="pubs/{../1}/work/oneformeditor/authoring/{../2}.xml"/>
-                <map:transform src="xslt/authoring/edit/addSourceTags.xsl">
-                  <map:parameter name="source" value="pubs/{../1}/content/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="xslt/authoring/edit/redirect-to.xsl">
-              	   <map:parameter name="uri" value="{page-envelope:context-prefix}/{../1}/authoring/{../2}.html?lenya.usecase=checkin&amp;lenya.step=checkin&amp;backup=true"/>
-                </map:transform>
-                <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:serialize type="htmlnoi" />
-              </map:act>
-              	      
-              <map:generate src="pubs/{1}/publication.xml"/> <!-- used as dummy file -->
-              <map:transform src="xslt/authoring/edit/redirect-to.xsl">
-                <map:parameter name="uri" value="{page-envelope:context-prefix}/{1}/authoring/{2}.html?lenya.usecase=checkin&amp;lenya.step=checkin&amp;backup=false"/>
-              </map:transform>
-              <map:serialize type="html" />
-            </map:match>
-          </map:match>
-
-        </map:match>
-
-        <!-- ************************************************************** -->
-        <!-- ********  /HTML One Form Editor ****************************** -->
-        <!-- ************************************************************** -->
     
         <!-- ************************************************************** -->
         <!-- ** HTML Form Editor                                         ** -->

Modified: incubator/lenya/trunk/src/webapp/lenya/usecases/edit-document.js
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/usecases/edit-document.js	(original)
+++ incubator/lenya/trunk/src/webapp/lenya/usecases/edit-document.js	Sun Oct 24 03:38:18 2004
@@ -26,11 +26,13 @@
 
 /**
  * Saves a Source to the document in the current PageEnvelope.
- * TODO: Use nobby's new usecase fw in 1.4 branch
+ * TODO: Use nobby's new usecase fw in 1.4 branch. Exception handling e.g. display appropriate error pages.
  * @param sourceUri An URI of a Source providing the edited document data
  * @param useBuffer If "true", the source Source is read into a buffer before it is written to its final destination.
  * @param workflowEvent Name of the workflow event to trigger. Default is "edit".
- * @param noWorkflow If true, no workflow event will be triggered.
+ * @param noWorkflow If true, no workflow event will be triggered. Default is false.
+ * @param noCheckin If true, the current document is not checked in. Default is false.
+ * @param backup If true, a new revision is created on checkin. Default is true.
  * @param status Default int value is 204. Used to set the response status.
  * @param noStatus If true, then no response status will be set.     
  */
@@ -42,11 +44,16 @@
         
         SourceUtil.copy(resolver, cocoon.parameters["sourceUri"], dstUri, _getParameter("useBuffer", "false") == "true");
 
+        if(_getParameter("noCheckin", "false") == "false")
+            flowHelper.reservedCheckIn(cocoon, _getParameter("backup", "true") == "true");
+
         if(_getParameter("noWorkflow", "false") == "false")
             flowHelper.triggerWorkflow(cocoon, _getParameter("workflowEvent", "edit"));
 
         if(_getParameter("noStatus", "false") == "false")
             cocoon.sendStatus(_getParameter("status", 204));
+        else
+            cocoon.redirectTo(_getParameter("redirectUrl", "FIXME"));
         
     } catch (exception) {
         cocoon.log.error("Can not edit doucment.", exception);

Modified: incubator/lenya/trunk/src/webapp/lenya/usecases/kupu/usecase-kupu.xmap
==============================================================================
--- incubator/lenya/trunk/src/webapp/lenya/usecases/kupu/usecase-kupu.xmap	(original)
+++ incubator/lenya/trunk/src/webapp/lenya/usecases/kupu/usecase-kupu.xmap	Sun Oct 24 03:38:18 2004
@@ -247,6 +247,7 @@
               <map:call function="editDocument">
                 <map:parameter name="sourceUri" value="cocoon:/request2document"/>
                 <map:parameter name="useBuffer" value="true"/>
+                <map:parameter name="noCheckin" value="true"/>
               </map:call>
             </map:when>
           </map:select>

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