Confluence Remote Java Wrapper

Name Confluence Remote Java Wrapper
Version 0.2
Product Versions  
Author(s) Brendan Patterson
Homepage  
Price Free
License  
JavaDocs  
IssueTracking  
Download JAR  
Download Source http://svn.atlassian.com/svn/public/contrib/confluence/confluence-remote-java-wrapper

Description/Features

The Confluence Remote Java Wrapper is meant to make at as easy as possible for developers writing Java applications to communicate directly with Confluence while hiding the underlying communication protocol. Currently uses the relatively robust and well documented XML-RPC communication layer.

Usage

Subversion:

Examples

Coming, but for now see the JUnit tests which demonstrate how to use the API.

Version History

Open Issues

Screenshots

Labels

confluence confluence Delete
soap soap Delete
java java Delete
xml-rpc xml-rpc Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Oct 30, 2006

    Phil Wilson says:

    Is there any maintenance on this, or should be content working on my own version...

    Is there any maintenance on this, or should be content working on my own version?

    I have some patches for very simple things like createUser, getUser and a slightly simplified build.xml

    1. Oct 30, 2006

      Brendan Patterson says:

      I'm not currently actively working on this, but do plan to pick it up again. Als...

      I'm not currently actively working on this, but do plan to pick it up again. Also I'm going to swap this in as being what drives the UWC so it will be kept up to date if the XML-RPC interface ever changes.

      I'd say definitely if you can contribute those methods that would be great. Please contribute to this unless you have reasons for working on your own version.

      Thanks!

    2. Apr 04, 2008

      Lubos Strapko says:

      Did you commit those changes? I would like to continue in developing this greate...

      Did you commit those changes? I would like to continue in developing this greate think.

      1. Jul 31, 2008

        Brendan Patterson says:

        Sorry I wasn't watching this page before for comments. Yes all changes are check...

        Sorry I wasn't watching this page before for comments. Yes all changes are checked in. This library is actively used and maintained as the communication layer for the UWC

  2. Feb 02

    Aaron Hamid says:

    Does this support instances behind SSL (i.e. URLs starting with "https://")?&nbs...

    Does this support instances behind SSL (i.e. URLs starting with "https://")?  Last time I used it I had to make a modification to support this:

    + if (confSettings.url.startsWith("http://")) {
    +            connectionURL = confSettings.url + "/rpc/xmlrpc";
    +            try {
    +                clientConnection = new XmlRpcClient(connectionURL);
    +            } catch (MalformedURLException e) {
    +                e.printStackTrace(); 
    +            }
    +        } else if (confSettings.url.startsWith("https://")) {
    +            connectionURL = confSettings.url + "/rpc/xmlrpc";
    +            try {
    +                clientConnection = new SecureXmlRpcClient(connectionURL);
    +            } catch (MalformedURLException e) {
    +                e.printStackTrace(); 
    +            }
    +        } else {
    +            connectionURL = "http://" + confSettings.url + "/rpc/xmlrpc";
    +            try {
    +                clientConnection = new XmlRpcClient(connectionURL);
    +            } catch (MalformedURLException e) {
    +                e.printStackTrace(); 
    +            }
             }
    

    I see there have been updates since then though.

    1. Feb 06

      Brendan Patterson says:

      Thanks for the info. Was that the only change needed to support SSL? Did you hav...

      Thanks for the info. Was that the only change needed to support SSL? Did you have to do other things along the lines of adding a certificate to the Java installation?

      1. Feb 06

        Aaron Hamid says:

        I think that's all I needed to do. Our target installation had a legit cert.

        I think that's all I needed to do. Our target installation had a legit cert.

  3. Mar 02

    Alex Karg says:

    Can someone just real quick give some installation instructions? Do I need to i...

    Can someone just real quick give some installation instructions?

    Do I need to install something on server side? What? and How?

    When I try a simple test I get:

    java.io.FileNotFoundException: http://mycomp.com:8080/rpc/xmlrpc
    	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    	at org.apache.xmlrpc.DefaultXmlRpcTransport.sendXmlRpc(DefaultXmlRpcTransport.java:87)
    	at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72)
    	at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
    	at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
    	at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
    	at biz.artemis.confluence.xmlrpcwrapper.RemoteWikiBroker.getLoginTokenThrowExceptions(RemoteWikiBroker.java:270)
    	at biz.artemis.confluence.xmlrpcwrapper.RemoteWikiBroker.getLoginToken(RemoteWikiBroker.java:222)
    	at ch.otms.tools.wikidocgenerator.WikiDocGenerator.<init>(WikiDocGenerator.java:49)
    	at ch.otms.tools.wikidocgenerator.WikiDocGenerator.main(WikiDocGenerator.java:136)
    
    1. Mar 02

      Brendan Patterson says:

      Hi, You don't need to install anything on the server. It interacts with existin...

      Hi,

      You don't need to install anything on the server. It interacts with existing Confluence web services.

      You might want to try to get the RemoteWikiBrokerTest JUnit class working by creating a properties file and related Confluence space/pages/etc. for it to access.

      This brings up a good point though that this API could definitely benefit from some 'getting started' documentation. Up to this point it's been very much just been something that fell out of an existing project and seemed useful to split off. It is used heavily in the UWC where you could look for additional examples in the source code, but that code is much more complex than the junit class.

      Hope that helps,
      Brendan

      1. Mar 09

        Alex Karg says:

        Hi Brendan, Thanks for your help. My earlier mistake was actually only that I m...

        Hi Brendan,

        Thanks for your help. My earlier mistake was actually only that I missed to put ../confluence in the url.

        My next problem which I am stuck at is accessing and editing page permissions. (example:
        only one certain user can edit this page, which is in this case is me, since the page is generated in Java)

        The page interface (PageForXmlRpc) doesn't seem to support it and as well I didn't find anything in the
        RemoteWikiBroker. What I tried is to set the page parameter "permissions" to "1", but not surprisingly
        that alone would not do the trick.

        Cheers,
        Alex

  4. Jun 11

    Harish says:

    Hi, I am new to confluence, can someone help me in resolving this error on build...

    Hi,
    I am new to confluence, can someone help me in resolving this error on building remote Java wrapper

    Running biz.artemis.confluence.xmlrpcwrapper.test.RemoteWikiBrokerTest
    [junit] Exception in thread "main" java.lang.NullPointerException
    [junit] at junit.framework.ComparisonFailure.getMessage(ComparisonFailure.java:34)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.addFailure(JUnitTestRunner.java:510)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.addFailure(JUnitTestRunner.java:524)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner$3.addFailure(JUnitTestRunner.java:991)
    [junit] at junit.framework.TestResult.addFailure(TestResult.java:46)
    [junit] at junit.framework.TestResult.runProtected(TestResult.java:127)
    [junit] at junit.framework.TestResult.run(TestResult.java:109)
    [junit] at junit.framework.TestCase.run(TestCase.java:118)
    [junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit] at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:420)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911)
    [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768)
    [junit] Running biz.artemis.confluence.xmlrpcwrapper.test.RemoteWikiBrokerTest

    Thanks

  5. Jun 30

    Damodar says:

    Hi Brendan, How do I delete page?I dont see any api for page deletes.Every end ...

    Hi Brendan,

    How do I delete page?I dont see any api for page deletes.Every end of the day page will be updated in order to show business metrics and I have large file of history.To avoid this situation,I want to delete page first and create new one to show metrics.could you please advise??

    Thanks

    Damodar

    1. Jun 30

      Brendan Patterson says:

      Hi Damodar, It sounds like you're hopefully finding the API helpful. I've been...

      Hi Damodar,

      It sounds like you're hopefully finding the API helpful.

      I've been a bit reluctant to add any delete functionality to the API nothing else the API currently does can really do anything you can't recover from.

      That being said there is no real reason not to add these methods.

      The way to do this would be to simply add another method to the RemoteWikiBroke.java file referencing the remote API. It appears the method you'd want is void removePage(String token, String pageId)

      So you'd have to add that method then rebuild the API into a jar to include in your project.

      Otherwise there is currently no existing Java method in this API.

      Hope that's helpful,
      Brendan