I've been asked to devise a way to programmatically copy a space from a Confluence wiki to a new space, changing its name and some other attributes. How would I copy a space using the XML-RPC interface?
Community moderators have prevented the ability to post new answers.
The Confluence Command Line interface has a method for this called copySpace.
https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-copySpace
For people who come across this thread...
On Confluence server, if you install Copy Space for Confluence, you can copy a space with the following request info:
POST <confluene base url>/spaces/docopyspace.action?key=<source space key>
Content-Type: "application/x-www-form-urlencoded"
Form data:
You can see this info in the Network view of your browser if you check the "Preserve log" button before copying the space via the UI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could build out your own copySpace method using the methods exposed with the SOAP api. I'm sure that is probably what Bob has done with his copySpace method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Davin, I've started doing that. I can see that this may be a formidable task though...I need to know exactly what to copy and what not to copy...and replicating the hierarchy (i.e. the pages' parentId's) will be an interesting exercise. For pages, I've noticed that I have the following keys:
[:id,
:current,
:content,
:title,
:version,
:modifier,
:url,
:homePage,
:creator,
:contentStatus,
:modified,
:created,
:space,
:parentId,
:permissions]
Of these, I'm thinking I should copy content, title, and permissions; but I may also need current, and homePage...and if there are other keys, can I assume they will not be associated with the space and I should therefore copy them? Any thoughts on any of this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds like you are onto a good start. I knew it would be a formidable task to create your own ... which is why I suggested using the CLI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Based on what I read, I believe that the CLI is mature, stable, and rich in function. However, I'm pretty sure I need an API, and that having a CLI tool will be too coarse an interface for our purposes. That is, I want/need to treat Confluence things like pages and spaces as objects in a running Ruby (or JRuby) program.
Does anyone know of any API libraries, preferably open source ones, in any language, that I could look at, to see how others have interacted with Confluence? I looked within my Ruby community, and could not find any that had enough functionality for what I need.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't do rhis using the existing interface. You might want to expose a new REST resource to do this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Jobin.
When you say 'existing interface', you mean the XML-RPC interface?
Also, how do you mean, expose a new REST resource? I'm an experienced developer, but am new to Confluence development and web services development. By writing a plugin? I've tried to avoid REST for now because for now I need to support a 4.2.12 instance, and I'm assume the RESTful interface for that version is very limited or nonexistent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is not in any intefraces - XML/RPC, SOAP or REST. I suggested REST because going forward REST is the supported way. Check out https://developer.atlassian.com/display/CONFDEV/REST+Modulefor more details.
If you prefer XML/RPC, here is the doc: https://developer.atlassian.com/display/CONFDEV/RPC+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm writing a Ruby gem (library) that can be used to access our Confluence wiki (with syntactic sugar such as treating pages, spaces, etc., as objects with built-in accessors and mutators to avoid hash notation or 'get' methods) and need to be independent of command line utilities and server plugins. If the Command Line Interface can do it, doesn't that mean that the services I need are already exposed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.