cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/webdav/samples/davmap sitemap.xmap webdav.js
Date Thu, 30 Oct 2003 17:08:35 GMT
unico       2003/10/30 09:08:35

  Modified:    src/blocks/webdav/samples/davmap sitemap.xmap webdav.js
  Log:
  simple implementation of WebDAV COPY and MOVE methods, provisional support for PROPPATCH
  
  Revision  Changes    Path
  1.7       +51 -10    cocoon-2.1/src/blocks/webdav/samples/davmap/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/webdav/samples/davmap/sitemap.xmap,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- sitemap.xmap	30 Oct 2003 14:49:31 -0000	1.6
  +++ sitemap.xmap	30 Oct 2003 17:08:34 -0000	1.7
  @@ -14,12 +14,31 @@
         />
         <map:generator name="jx" 
           src="org.apache.cocoon.generation.JXTemplateGenerator" 
  -        logger="sitemap.generator.jx" 
  +        logger="generator.jx" 
           label="content" 
           pool-min="2" pool-grow="2" pool-max="16" 
         />
       </map:generators>
  -
  +    
  +    <map:transformers default="xslt">
  +      <map:transformer 
  +        name="spw" 
  +        src="org.apache.cocoon.transformation.SourcePropsWritingTransformer" 
  +        logger="transformer.spw" 
  +        pool-min="2" pool-grow="2" pool-max="16" 
  +      />
  +    </map:transformers>
  +    
  +    <!-- You'll need event caching if you want to PROPPATCH
  +    <map:pipes default="caching">
  +      <map:pipe name="event-caching" 
  +        src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"
  +      >
  +        <parameter name="cache-role" value="org.apache.cocoon.caching.Cache/EventAware"/>
  +      </map:pipe>
  +    </map:pipes>
  +    -->
  +    
     </map:components>
   
   <!-- ========================== Flowscript ================================= -->
  @@ -80,9 +99,19 @@
       </map:pipeline>
       
   <!-- ========================= Public Resources =========================== -->
  -
  +    
  +    <!--map:pipeline type="event-caching"-->
  +    
       <map:pipeline type="caching">
         
  +      <map:match pattern="test">
  +        <map:generate src="proppatch.xml" />
  +        <map:transform src="styles/proppatch2propwrite.xsl">
  +          <map:parameter name="location" value="test" />
  +        </map:transform>
  +        <map:serialize type="xml" />
  +      </map:match>
  +      
         <map:match pattern="repo">
           <map:call function="selectMethod">
             <map:parameter name="page" value=""/>
  @@ -110,7 +139,7 @@
         
         <map:match pattern="PROPFIND/**">
           <map:generate type="traverse" src="{global:staging}{1}">
  -          <map:parameter name="depth" value="{request-header:depth}" />
  +          <map:parameter name="depth" value="{request-header:Depth}" />
           </map:generate>
           <map:transform src="styles/collection2propfind.xsl">
             <map:parameter name="requestURI" value="{request:requestURI}" />
  @@ -171,17 +200,29 @@
         </map:match>
         
         <map:match pattern="COPY/**">
  -        <map:generate src="dummy.xml"/>
  -        <map:serialize type="xml"/>
  +        <map:call function="copy">
  +          <map:parameter name="from" value="{global:staging}{1}" />
  +          <map:parameter name="to"   value="{request-header:Destination}" />
  +        </map:call>
         </map:match>
  +      
         <map:match pattern="MOVE/**">
  -        <map:generate src="dummy.xml"/>
  -        <map:serialize type="xml"/>
  +        <map:call function="move">
  +          <map:parameter name="from" value="{global:staging}{1}" />
  +          <map:parameter name="to"   value="{request-header:Destination}" />
  +        </map:call>
         </map:match>
  +      
         <map:match pattern="PROPPATCH/**">
  -        <map:generate src="dummy.xml"/>
  -        <map:serialize type="xml"/>
  +        <map:generate type="stream" />
  +        <map:transform src="styles/proppatch2propwrite.xsl" />
  +        <map:transform type="spw" />
  +        <!--
  +        <map:transform src="styles/propwrite2proppatch.xsl" />
  +        -->
  +        <map:serialize type="xml" />
         </map:match>
  +      
         <map:match pattern="LOCK/**">
           <map:generate src="dummy.xml"/>
           <map:serialize type="xml"/>
  
  
  
  1.3       +24 -2     cocoon-2.1/src/blocks/webdav/samples/davmap/webdav.js
  
  Index: webdav.js
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/webdav/samples/davmap/webdav.js,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- webdav.js	30 Oct 2003 14:39:39 -0000	1.2
  +++ webdav.js	30 Oct 2003 17:08:34 -0000	1.3
  @@ -1,6 +1,7 @@
   
  -importPackage(Packages.org.apache.cocoon.components.repository);
  -var repository = cocoon.getComponent(SourceRepository.ROLE);
  +//importPackage(Packages.org.apache.cocoon.components.repository);
  +//var repository = cocoon.getComponent(SourceRepository.ROLE);
  +var repository = cocoon.getComponent("org.apache.cocoon.components.repository.SourceRepository");
   
   function selectMethod() {
     var page = cocoon.parameters["page"];
  @@ -51,3 +52,24 @@
     }
   }
   
  +function copy() {
  +  var from = cocoon.parameters["from"];
  +  var to   = cocoon.parameters["to"];
  +  try {
  +    var status = repository.copy(from,to);
  +    cocoon.sendPage("status/" + status, {message:""});
  +  } catch (e) {
  +    cocoon.log.error("status/500",{message:""});
  +  }
  +}
  +
  +function move() {
  +  var from = cocoon.parameters["from"];
  +  var to   = cocoon.parameters["to"];
  +  try {
  +    var status = repository.move(from,to);
  +    cocoon.sendPage("status/" + status, {message:""});
  +  } catch (e) {
  +    cocoon.log.error("status/500",{message:""});
  +  }
  +}
  
  
  

Mime
View raw message