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 status.jx webdav.js
Date Thu, 30 Oct 2003 14:39:39 GMT
unico       2003/10/30 06:39:39

  Modified:    src/blocks/webdav/samples/davmap webdav.js
  Added:       src/blocks/webdav/samples/davmap status.jx
  Log:
  refactorings: simplify PROPFIND, implement PUT using pipeline "T-ing",
  add directory browsing, add MKCOL method, add DELETE method
  
  Revision  Changes    Path
  1.2       +51 -3     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- webdav.js	20 Aug 2003 18:57:21 -0000	1.1
  +++ webdav.js	30 Oct 2003 14:39:39 -0000	1.2
  @@ -1,5 +1,53 @@
  +
  +importPackage(Packages.org.apache.cocoon.components.repository);
  +var repository = cocoon.getComponent(SourceRepository.ROLE);
  +
   function selectMethod() {
  -    var page = cocoon.parameters["page"];
  -    var method = cocoon.request.getMethod();
  -    cocoon.sendPage(method+"/"+page, {});
  +  var page = cocoon.parameters["page"];
  +  var method = cocoon.request.getMethod();
  +  cocoon.sendPage(method+"/"+page, null);
   }
  +
  +function sendStatus() {
  +  var status  = cocoon.parameters["status"];
  +  var msg = cocoon.parameters["message"];
  +  cocoon.sendPage("status/" + status, {message:msg});
  +}
  +
  +function put() {
  +  var src  = cocoon.parameters["src"];
  +  var dest = cocoon.parameters["dest"];
  +  try {
  +    var status = repository.save(src,dest);
  +    cocoon.sendPage("status/" + status, {message:""});
  +  }
  +  catch (e) {
  +    cocoon.log.error(e);
  +    cocoon.sendPage("status/500",{message:"unknown error"});
  +  }
  +}
  +
  +function remove() {
  +  var location = cocoon.parameters["location"];
  +  try {
  +    var status = repository.remove(location);
  +    cocoon.sendPage("status/" + status, {message:""});
  +  }
  +  catch (e) {
  +    cocoon.log.error(e);
  +    cocoon.sendPage("status/500",{message:"unknown error"});
  +  }
  +}
  +
  +function mkcol() {
  +  var location = cocoon.parameters["location"];
  +  try {
  +    var status = repository.makeCollection(location);
  +    cocoon.sendPage("status/" + status, {message:""});
  +  }
  +  catch (e) {
  +    cocoon.log.error(e);
  +    cocoon.sendPage("status/500",{message:"unknown error"});
  +  }
  +}
  +
  
  
  
  1.1                  cocoon-2.1/src/blocks/webdav/samples/davmap/status.jx
  
  Index: status.jx
  ===================================================================
  <message>${message}</message>
  
  

Mime
View raw message