Update of /cvsroot/xdoclet-plugins/xdoclet-plugins/reference/src/groovy
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv540/src/groovy

Modified Files:
        confluence-rpc.groovy 
Log Message:
Added exportSpace function (will be used with Confluence 1.4)

Index: confluence-rpc.groovy
===================================================================
RCS file: 
/cvsroot/xdoclet-plugins/xdoclet-plugins/reference/src/groovy/confluence-rpc.groovy,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** confluence-rpc.groovy       11 Dec 2004 15:59:53 -0000      1.4
--- confluence-rpc.groovy       4 May 2005 07:40:33 -0000       1.5
***************
*** 6,14 ****
  class ConfluenceAccess {
      static main(args) {
!         if (args.size()!=3) {
!           println "usage: ConfluenceAccess userId password rootDir"
!           System.exit(-1)
          }
!         new ConfluenceAccess(userId:args[0], password:args[1]).upload(args[2])
      }
  
--- 6,27 ----
  class ConfluenceAccess {
      static main(args) {
!         if (args.size()!=4) {
!           die "usage: ConfluenceAccess userId password rootDir"
!         }
!         confluenceAccess = new ConfluenceAccess(userId:args[1], 
password:args[2])
!         switch (args[0]) {
!           case "upload_docs":
!             confluenceAccess.upload(args[3])
!             break
!           case "export_docs":
!             confluenceAccess.export(args[3])
!           default:
!             die "Please provide the goal name from ('upload_docs', 
'export_docs')"
          }
!     }
! 
!     static die(message) {
!       println message
!       System.exit(-1)
      }
  
***************
*** 20,28 ****
      xdocletPluginPageId = '1921'
  
      upload(rootDir) {
          // check directories exist
          if (!new File(rootDir).exists() || !new File(rootDir, 
'plugin-doc').exists() || !new File(rootDir, 'tag-doc').exists()) {
!             println "There must be plugin-doc and tag-doc directories in " + 
rootDir
!             System.exit(-1)
          }
  
--- 33,53 ----
      xdocletPluginPageId = '1921'
  
+     //exportSpace available only for Confluence ver. 1.4
+     export(rootDir) {
+         serverProxy.confluence1.login(userId, password) { token |
+             try {
+                 url = serverProxy.confluence1.exportSpace(token, 'XDOCLET', 
'TYPE_HTML') 
+                 ant = new AntBuilder()
+                 ant.get(src:url, dest:rootDir+"documentation.zip")
+             } finally {
+                 serverProxy.confluence1.logout(token)
+             }
+         }
+     }
+ 
      upload(rootDir) {
          // check directories exist
          if (!new File(rootDir).exists() || !new File(rootDir, 
'plugin-doc').exists() || !new File(rootDir, 'tag-doc').exists()) {
!             die "There must be plugin-doc and tag-doc directories in " + 
rootDir
          }
  



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits

Reply via email to