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/webapp/lenya/xslt/authoring/edit redirect-to.xsl unnumberTags.xsl
Date Fri, 08 Aug 2003 15:37:36 GMT
michi       2003/08/08 08:37:36

  Modified:    src/java/org/apache/lenya/cms/cocoon/acting
                        HTMLFormSaveAction.java
               src/webapp/lenya/pubs/blog/xslt error2html.xsl
               src/webapp/lenya/pubs/oscom usecase-edit.xmap
               src/webapp/lenya/pubs/oscom/xslt/matrix/authoring
                        editWithForms.xsl
               src/webapp/lenya/xslt/authoring/edit unnumberTags.xsl
  Added:       src/webapp/lenya/xslt/authoring/edit redirect-to.xsl
  Log:
  editing cycle implemented
  
  Revision  Changes    Path
  1.2       +15 -9     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HTMLFormSaveAction.java	7 Aug 2003 16:27:54 -0000	1.1
  +++ HTMLFormSaveAction.java	8 Aug 2003 15:37:36 -0000	1.2
  @@ -64,6 +64,7 @@
   
   import java.io.*;
   import java.util.*;
  +import java.util.Enumeration;
   import java.net.URL;
   
   
  @@ -103,12 +104,6 @@
   
           Request request = ObjectModelHelper.getRequest(objectModel);
   
  -        java.util.Enumeration params = request.getParameterNames();
  -        while (params.hasMoreElements()) {
  -            String name = (String) params.nextElement();
  -            getLogger().debug(".act(): Parameter: " + name + " (" + request.getParameter(name)
 + ")");
  -        }
  -
           if(request.getParameter("cancel") != null) {
               getLogger().error(".act(): Cancel editing");
           } else {
  @@ -117,8 +112,19 @@
   
                   try {
                       Document document = DocumentHelper.readDocument(file);
  -                    setNodeValue(document, request.getParameter("system_name"), "/system/system_name");
  -                    setNodeValue(document, request.getParameter("description"), "/system/description");
  +
  +                    Enumeration params = request.getParameterNames();
  +                    while (params.hasMoreElements()) {
  +                        String name = (String) params.nextElement();
  +                        getLogger().debug(".act(): Parameter: " + name + " (" + request.getParameter(name)
 + ")");
  +                        if (name.indexOf("element.") == 0) {
  +                            String xpath = name.substring(8, name.indexOf("["));
  +                            String tagID = name.substring(name.indexOf("[") + 1, name.indexOf("]"));
  +                            xpath = xpath + "[@tagID=\"" + tagID + "\"]";
  +                            getLogger().error(".act(): XPath: " + xpath);
  +                            setNodeValue(document, request.getParameter(name), xpath);
  +                        }
  +                    }
                       DocumentHelper.writeDocument(document, file);
                   } catch (Exception e) {
                       getLogger().error(".act(): Exception: " + e.getMessage(), e);
  
  
  
  1.2       +4 -1      cocoon-lenya/src/webapp/lenya/pubs/blog/xslt/error2html.xsl
  
  Index: error2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/blog/xslt/error2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- error2html.xsl	5 Aug 2003 19:50:48 -0000	1.1
  +++ error2html.xsl	8 Aug 2003 15:37:36 -0000	1.2
  @@ -7,7 +7,10 @@
   <xsl:template match="/">
   <html>
   <body>
  -Page not published yet
  +Page not published yet.
  +<br /><br />
  +Click on the menu "File" within the authoring area and click on the menu item "Publish"
  +in order to publish this page.
   </body>
   </html>
   </xsl:template>
  
  
  
  1.3       +17 -18    cocoon-lenya/src/webapp/lenya/pubs/oscom/usecase-edit.xmap
  
  Index: usecase-edit.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/oscom/usecase-edit.xmap,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- usecase-edit.xmap	8 Aug 2003 12:43:54 -0000	1.2
  +++ usecase-edit.xmap	8 Aug 2003 15:37:36 -0000	1.3
  @@ -34,36 +34,35 @@
             </map:match>
           </map:match>
   
  +<!--
           <map:match pattern="update" type="step">
             <map:match pattern="authoring/matrix/*.html">
  -            <map:act type="save">
  -              <map:parameter name="file" value="content/authoring/matrix/{1}.xml"/>
  -              <!-- FIXME: Error Message -->
  -              <map:redirect-to uri="/lenya/index.html" />
  -            </map:act>
               <map:redirect-to uri="{1}.html" />
             </map:match>
           </map:match>
  +-->
   
           <map:match pattern="close" type="step">
             <map:match pattern="authoring/matrix/*.html">
               <map:act type="save">
  -              <map:parameter name="file" value="content/authoring/matrix/{1}.xml"/>
  +              <map:parameter name="file" value="work/editor/authoring/matrix/{1}.xml"/>
                 <!-- FIXME: Error Message -->
                 <map:redirect-to uri="/lenya/index.html" />
               </map:act>
  -            <map:redirect-to uri="{1}.html" />
  -          </map:match>
  -        </map:match>
  -
  -
   
  -        <!-- DEBUG -->
  -        <map:match pattern="number" type="step">
  -          <map:match pattern="authoring/matrix/*.html">
  -            <map:generate src="content/authoring/matrix/{1}.xml"/>
  -            <map:transform src="../../xslt/authoring/edit/numberTags.xsl"/>
  -            <map:serialize type="xml" />
  +            <map:generate src="work/editor/authoring/matrix/{1}.xml"/>
  +            <map:transform src="../../xslt/authoring/edit/unnumberTags.xsl"/>
  +            <map:transform src="../../xslt/authoring/edit/addSourceTags.xsl">
  +              <map:parameter name="source" value="content/authoring/matrix/{1}.xml"/>
  +            </map:transform>
  +            <map:transform type="write-source"/>
  +            <map:transform src="../../xslt/authoring/edit/redirect-to.xsl">
  +              <map:parameter name="uri" value="{1}.html"/>
  +            </map:transform>
  +            <map:serialize type="html" />
  +<!--
  +            <map:redirect-to uri="{1}.html" />
  +-->
             </map:match>
           </map:match>
         </map:match>
  
  
  
  1.3       +10 -2     cocoon-lenya/src/webapp/lenya/pubs/oscom/xslt/matrix/authoring/editWithForms.xsl
  
  Index: editWithForms.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/pubs/oscom/xslt/matrix/authoring/editWithForms.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- editWithForms.xsl	8 Aug 2003 12:43:54 -0000	1.2
  +++ editWithForms.xsl	8 Aug 2003 15:37:36 -0000	1.3
  @@ -13,11 +13,12 @@
   <form method="post" action="?lenya.usecase=edit&amp;lenya.step=close">
   <table>
   <tr>
  -  <td>Project Name</td><td><input type="text" name="/system/system_name/{/system/system_name/@tagID}"
size="40"><xsl:attribute name="value"><xsl:value-of select="/system/system_name"
/></xsl:attribute></input></td>
  +  <td>Project Name</td><td><input type="text" name="element./system/system_name[{/system/system_name/@tagID}]"
size="40"><xsl:attribute name="value"><xsl:value-of select="/system/system_name"
/></xsl:attribute></input></td>
   </tr>
   <tr>
  -  <td valign="top">Description</td><td><textarea name="/system/description/{/system/description/@tagID}"
cols="40" rows="5"><xsl:value-of select="/system/description" /></textarea></td>
  +  <td valign="top">Description</td><td><textarea name="element./system/description[{/system/description/@tagID}]"
cols="40" rows="5"><xsl:value-of select="/system/description" /></textarea></td>
   </tr>
  +<xsl:apply-templates select="/system/features/feature"/>
   <!--
   <xsl:apply-templates select="/system"/>
   -->
  @@ -28,6 +29,13 @@
   </form>
   </body>
   </html>
  +</xsl:template>
  +
  +
  +<xsl:template match="feature">
  +<tr>
  +  <td>Feature Title</td><td><input type="text" name="element./system/features/feature/title[{title/@tagID}]"
size="40"><xsl:attribute name="value"><xsl:value-of select="title" /></xsl:attribute></input></td>
  +</tr>
   </xsl:template>
    
   </xsl:stylesheet>  
  
  
  
  1.2       +1 -1      cocoon-lenya/src/webapp/lenya/xslt/authoring/edit/unnumberTags.xsl
  
  Index: unnumberTags.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/authoring/edit/unnumberTags.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- unnumberTags.xsl	8 Aug 2003 12:43:07 -0000	1.1
  +++ unnumberTags.xsl	8 Aug 2003 15:37:36 -0000	1.2
  @@ -8,7 +8,7 @@
     <xsl:apply-templates select="*"/>
   </xsl:template>
   
  -<!-- FIXME: there is a bug in here!!! (in Xalan?) wenn wir was vor Copy schreiben, funzts,
sonst nicht.... -->
  +<!-- FIXME: there seems to be something wrong!!! (Xalan?) if something is written in
front of Copy, then it works, else it doesn't ... -->
   <xsl:template match="*|text()">
     <xsl:copy>
       <xsl:copy-of select="@*[name()!='tagID']"/>
  
  
  
  1.1                  cocoon-lenya/src/webapp/lenya/xslt/authoring/edit/redirect-to.xsl
  
  Index: redirect-to.xsl
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  
  <xsl:param name="uri"/>
  
  <xsl:template match="/">
  <html>
  <head>
  <meta http-equiv="Refresh" content="0; URL={$uri}"/>
  </head>
  <body>
  <!--
  Redirect to: <a href="{$uri}"><xsl:value-of select="$uri"/></a>
  -->
  </body>
  </html>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  

---------------------------------------------------------------------
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