lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting HTMLFormSaveAction.java
Date Tue, 12 Aug 2003 23:58:27 GMT
michi       2003/08/12 16:58:27

  Modified:    src/webapp/lenya usecase.xmap
               src/java/org/apache/lenya/cms/cocoon/acting
                        HTMLFormSaveAction.java
  Log:
  update cycle fixed
  
  Revision  Changes    Path
  1.59      +19 -19    cocoon-lenya/src/webapp/lenya/usecase.xmap
  
  Index: usecase.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/usecase.xmap,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- usecase.xmap	12 Aug 2003 17:07:50 -0000	1.58
  +++ usecase.xmap	12 Aug 2003 23:58:27 -0000	1.59
  @@ -348,30 +348,30 @@
             <map:match pattern="*/authoring/**/*.html">
               <map:act type="save">
                 <map:parameter name="file" value="pubs/{1}/work/editor/authoring/{2}/{3}.xml"/>
  -              <!-- FIXME: Error Message -->
  -              <map:redirect-to uri="/lenya/index.html" />
  +
  +              <!-- Continue editing: Insert, Delete, etc. -->
  +              <map:generate src="pubs/{../1}/work/editor/authoring/{../2}/{../3}.xml"/>
  +              <map:transform src="xslt/authoring/edit/unnumberTags.xsl"/>
  +
  +              <map:transform src="xslt/authoring/edit/numberTags.xsl"/>
  +              <map:transform src="xslt/authoring/edit/addSourceTags.xsl">
  +                <map:parameter name="source" value="pubs/{../1}/work/editor/authoring/{../2}/{../3}.xml"/>
  +              </map:transform>
  +              <map:transform type="write-source"/>
  +              <map:transform src="xslt/authoring/edit/removeSourceTags.xsl"/>
  +
  +              <map:transform src="pubs/{../1}/xslt/editor/{request-param:doctype}.xsl">
  +                <map:parameter name="docid" value="{../2}/{../3}"/>
  +                <map:parameter name="doctype" value="{request-param:doctype}"/>
  +              </map:transform>
  +              <map:serialize type="html" />
               </map:act>
   
  +            <!-- Stop Editing: Save and Cancel -->
               <map:generate src="pubs/{1}/work/editor/authoring/{2}/{3}.xml"/>
               <map:transform src="xslt/authoring/edit/unnumberTags.xsl"/>
   
  -            <map:transform src="xslt/authoring/edit/numberTags.xsl"/>
  -            <map:transform src="xslt/authoring/edit/addSourceTags.xsl">
  -              <map:parameter name="source" value="pubs/{1}/work/editor/authoring/{2}/{3}.xml"/>
  -            </map:transform>
  -            <map:transform type="write-source"/>
  -            <map:transform src="xslt/authoring/edit/removeSourceTags.xsl"/>
  -
  -            <!-- Continue editing -->
  -<!--
  -            <map:transform src="pubs/{1}/xslt/editor/{request-param:doctype}.xsl">
  -              <map:parameter name="docid" value="{2}/{3}"/>
  -              <map:parameter name="doctype" value="{request-param:doctype}"/>
  -            </map:transform>
  -            <map:serialize type="html" />
  --->
  -
  -            <!-- Save Document -->
  +            <!-- Save: Overwrite original file (FIXME: Cancel should not overwrite original
file) -->
               <map:transform src="xslt/authoring/edit/addSourceTags.xsl">
                 <map:parameter name="source" value="pubs/{1}/content/authoring/{2}/{3}.xml"/>
               </map:transform>
  
  
  
  1.5       +7 -3      cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java
  
  Index: HTMLFormSaveAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HTMLFormSaveAction.java	12 Aug 2003 17:07:50 -0000	1.4
  +++ HTMLFormSaveAction.java	12 Aug 2003 23:58:27 -0000	1.5
  @@ -104,6 +104,8 @@
   
           Request request = ObjectModelHelper.getRequest(objectModel);
   
  +        getLogger().error(".act(): File: " + file.getAbsolutePath());
  +
           if(request.getParameter("save") != null) {
               if(file.isFile()) {
                   getLogger().error(".act(): Save modifications to " + file.getAbsolutePath());
  @@ -124,6 +126,7 @@
                           }
                       }
                       DocumentHelper.writeDocument(document, file);
  +                    return null;
                   } catch (Exception e) {
                       getLogger().error(".act(): Exception: " + e.getMessage(), e);
                       return new HashMap();
  @@ -139,6 +142,7 @@
                   String name = (String) params.nextElement();
                   getLogger().error(".act(): Parameter: " + name + " (" + request.getParameter(name)
 + ")");
               }
  +            return new HashMap();
           } else if(request.getParameter("delete") != null) {
               getLogger().error(".act(): Delete");
               Enumeration params = request.getParameterNames();
  @@ -146,11 +150,11 @@
                   String name = (String) params.nextElement();
                   getLogger().error(".act(): Parameter: " + name + " (" + request.getParameter(name)
 + ")");
               }
  +            return new HashMap();
           } else { // cancel
               getLogger().error(".act(): Cancel editing");
  +            return null;
           }
  -
  -        return null;
       }
   
       /**
  
  
  

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


Mime
View raw message