You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by eg...@apache.org on 2003/09/11 15:24:35 UTC

cvs commit: cocoon-lenya/src/webapp/lenya/content/info rename.xsp

egli        2003/09/11 06:24:35

  Modified:    src/webapp/lenya/xslt/info rename.xsl
               src/webapp/lenya/content/info rename.xsp
  Log:
  Code cleanup:
  * Use document-node-id from the page envelope input module instead of
    splitting the document-id manually.
  * Renamed the ill-named first- and lastDocumentId to source- and
    destinationDocumentId.
  
  Revision  Changes    Path
  1.11      +20 -23    cocoon-lenya/src/webapp/lenya/xslt/info/rename.xsl
  
  Index: rename.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/xslt/info/rename.xsl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- rename.xsl	5 Sep 2003 14:42:59 -0000	1.10
  +++ rename.xsl	11 Sep 2003 13:24:35 -0000	1.11
  @@ -7,15 +7,12 @@
    <xsl:stylesheet version="1.0"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  -   xmlns:session="http://www.apache.org/xsp/session/2.0"
      xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
      >
     
  -  <xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>
  -
     <xsl:variable name="request-uri"><xsl:value-of select="/page/info/request-uri"/></xsl:variable>
  -  <xsl:variable name="first-document-id"><xsl:value-of select="/page/info/first-document-id"/></xsl:variable>
  -  <xsl:variable name="last-id"><xsl:value-of select="/page/info/last-id"/></xsl:variable>
  +  <xsl:variable name="source-document-id"><xsl:value-of select="/page/info/source-document-id"/></xsl:variable>
  +  <xsl:variable name="destination-id"><xsl:value-of select="/page/info/destination-id"/></xsl:variable>
     <xsl:variable name="area"><xsl:value-of select="/page/info/area"/></xsl:variable>
     <xsl:variable name="task-id"><xsl:value-of select="/page/info/task-id"/></xsl:variable>
   
  @@ -28,7 +25,7 @@
         <page:title>Rename Document</page:title>
         <page:body>
           <xsl:apply-templates select="body"/>
  -	    <xsl:apply-templates select="info"/>
  +        <xsl:apply-templates select="info"/>
         </page:body>
       </page:page>
     </xsl:template>
  @@ -47,29 +44,29 @@
             <input type="hidden" name="lenya.step" value="rename"/>
             
             <table class="lenya-table-noborder">
  -          	<tr>
  -          		<td class="lenya-entry-caption">New Document ID:</td>
  -          		<td><input type="text" class="lenya-form-element" name="properties.node.secdocumentid" value="{last-id}"/></td>
  -          	</tr>
  -          	<tr>
  -          		<td/>
  -          		<td>
  -          			<br/>
  +            <tr>
  +              <td class="lenya-entry-caption">New Document ID:</td>
  +              <td><input type="text" class="lenya-form-element" name="properties.node.secdocumentid" value="{$destination-id}"/></td>
  +            </tr>
  +            <tr>
  +              <td/>
  +              <td>
  +                <br/>
                   <input type="submit" value="Rename"/>&#160;
                   <input type="button" onClick="location.href='{$request-uri}';" value="Cancel"/>
  -          		</td>
  -          	</tr>
  +              </td>
  +            </tr>
             </table>
           </form>
         </div>
       </div>
     </xsl:template>
   
  -<xsl:template name="task-parameters">
  -  <xsl:param name="prefix" select="'task.'"/>
  -  <input type="hidden" name="{$prefix}properties.node.firstdocumentid" value="{$first-document-id}"/>
  -  <input type="hidden" name="{$prefix}properties.firstarea" value="{$area}"/>
  -  <input type="hidden" name="{$prefix}properties.secarea" value="{$area}"/>
  -</xsl:template>
  +  <xsl:template name="task-parameters">
  +    <xsl:param name="prefix" select="'task.'"/>
  +    <input type="hidden" name="{$prefix}properties.node.firstdocumentid" value="{$source-document-id}"/>
  +    <input type="hidden" name="{$prefix}properties.firstarea" value="{$area}"/>
  +    <input type="hidden" name="{$prefix}properties.secarea" value="{$area}"/>
  +  </xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.9       +2 -12     cocoon-lenya/src/webapp/lenya/content/info/rename.xsp
  
  Index: rename.xsp
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/webapp/lenya/content/info/rename.xsp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- rename.xsp	5 Sep 2003 14:41:10 -0000	1.8
  +++ rename.xsp	11 Sep 2003 13:24:35 -0000	1.9
  @@ -7,21 +7,11 @@
     xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
     >
   
  -  <xsp:structure>
  -    <xsp:include>java.util.StringTokenizer</xsp:include>
  -  </xsp:structure>
  -
   <page>
     <info>
  -    <xsp:logic>
  -      String firstDocumentId = <input:get-attribute module="page-envelope" as="string" name="document-id"/>;
  -      String[] tokens = firstDocumentId.split("/");
  -      String lastId = tokens[tokens.length - 1];
  -    </xsp:logic>
  -
       <request-uri><xsp-request:get-uri/></request-uri>
  -    <last-id><xsp:expr>lastId</xsp:expr></last-id>
  -    <first-document-id><xsp:expr>firstDocumentId</xsp:expr></first-document-id>
  +    <destination-id><input:get-attribute module="page-envelope" as="string" name="document-node-id"/></destination-id>
  +    <source-document-id><input:get-attribute module="page-envelope" as="string" name="document-id"/></source-document-id>
       <area><input:get-attribute module="page-envelope" as="string" name="area"/></area>
       <task-id>renameDocument</task-id>
     </info>
  
  
  

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