jastrachan | 26 Mar 17:31 2004
Picon

Re: You can access Confluence using Groovy XML-RPC!

Wacky cool! :)

Incidentally, now all our documentation is in Radeox format, we could 
move the core documentation over to a Confluence wiki website....

On 26 Mar 2004, at 12:16, John Wilson wrote:

> Atlassian have just released a Wiki called Confluence see 
> http://confluence.atlassian.com/homepage.action
>
> It has an XML-RPC interface see 
> http://confluence.atlassian.com/display/DOC/XML-RPC+API+Specification
>
> Using Groovy XML-RPC it's really easy to use this API.
>
> import java.net.ServerSocket
>
> import groovy.net.xmlrpc.XMLRPCServerProxy
>
> class ConfluenceAccess {
> 	static main(args) {
> 		id = args[0]
> 		password = args[1]
> 		serverProxy = new 
> XMLRPCServerProxy("http://confluence.atlassian.com/rpc/xmlrpc")
>
> 		serverProxy.confluence1.login(id, password) { token |
> 			try {		
> 				serverProxy.confluence1.getSpaces(token) { spaces |
> 					spaces.each { spaceSummary |
> 						serverProxy.confluence1.getSpace(token, spaceSummary.key) { 
> space |
> 							println space
> 						}
> 					}
> 				}
> 			}
> 			finally {
> 				serverProxy.confluence1.logout(token)
> 			}
> 		}
> 	}
> }
>
>
> This logs into Confluence gets the details of all the Spaces the user 
> has access to and prints them out.
>
> Note stuff like
>
> serverProxy.confluence1.getSpace(token, spaceSummary.key) { space |
> 												println space
> 												}
>
> is equivalent to:
>
> space = serverProxy.confluence1.getSpace(token, spaceSummary.key)
> println space
>
>
>
> John Wilson
> The Wilson Partnership
> http://www.wilson.co.uk
>
> _______________________________________________
> groovy-user mailing list
> groovy-user@...
> http://lists.codehaus.org/mailman/listinfo/groovy-user
>
>

James
-------
http://radio.weblogs.com/0112098/

Gmane