Create a set of pages automatically ?
Asked by Jason Pepper:

Is there a simple way to allow users to create a group of pages in a single click ?

User wants to create a pre-defined set of pages for each new customer page they create..

I guess I'm wanting a page template macro that also creates sub-pages (naming them uniquely as it goes)..

Anyone have any good tips on this ?


Answers:
author: Bob Swift (personal)
body: [How to semi-automate repetitive tasks](https://bobswift.atlassian.net/wiki/display/CCLI/How+to+semi-automate+repetitive+tasks) describes how to do this using the [run](https://bobswift.atlassian.net/wiki/display/RUN/Run+macro) and [cli](https://bobswift.atlassian.net/wiki/display/CCLI/Documentation) macros.

Oops, this doesn't work with OnDemand because you can't install the plugins. You could use [Confluence Command Line Interface](https://bobswift.atlassian.net/wiki/display/CSOAP) on a client machine to do the creates.

comments: author: Jason Pepper
body: Thanks that worked a treat.. I did consider your CLI but I was working under the misaprehension that on-demand didn't allow the remote API, but it's actually enabled by default :-)


author: Jason Pepper
body: Hmm.. I got it working on my local instance but when I run it against my on-demand account I get a problem..

* My confluence.sh looks like this

java -jar \`dirname $0\`/lib/confluence-cli-2.6.0.jar --server <https://myondmenadurl> --user un --password pw "$@"

* the calling script looks like this

sh confluence.sh --action addPage --space "spacename" --title "Xxxxxx" --parent "Home"

* and the error I get is

Unable to log in to server: <https://myondmenadurl/rpc/soap-axis/confluenceservice-v1> with user: un.

Cause: (503)Service Temporarily Unavailable

The CLI/RPC checkbox in the admin privs is checked..

I was using 2.4.0 of the CLI so switched to 2.6.0 but that has had no effect either..

bit stumped now :-(


author: Bob Swift (personal)
body: Looks fine. Are you sure your instance is available (not down for maintenance or backup)? I access my onDemand instance all the time this way. Take the url listed and paste into the browser and see what you get. If there are problems with that, you will need to talk to Atlassian support.


author: Jason Pepper
body: Thanks for that.. the URL returns a 'down for maintenance' message. I've raised an SR so I guess I'll have to wait for them to come back to me. Thanks for your help so far..


author: RianA
body: Hi Jason,

Have you tried to use [https://myondmenadurl/wiki/rpc/soap-axis/confluenceservice-v1](https://myondmenadurl/rpc/soap-axis/confluenceservice-v1) instead of the previous URL and checked whether it works?

Cheers!


author: Jason Pepper
body: Figured it out !

--service is your friend ;-)

Thanks Bob - your CLI rocks again !


author: Jason Pepper
body: Response from atlassian..

"We have checked that your instance is up. However we noticed something on the URL that you used for request. Could you please try with the following URL instead? Notice the missing wiki that you need to add in order to access your Confluence.

[https://myondemandinstance/wiki/rpc/soap-axis/confluenceservice-v1](https://bkhgroup.atlassian.net/wiki/rpc/soap-axis/confluenceservice-v1)"

How do I get the "wiki" part of the URL to be produced by CCLI ?

Thanks


author: Bob Swift (personal)
body: Ah, didn't notice, but for OnDemand, your server address for Confluence needs to have /wiki at the end, otherwise you are trying to talk to JIRA. Just look at the urls for looking at pages - Confluence is a context in the application server.


author: JohnA
body: Hi Jason,

Please accept our apologies for this spam answer that has been left on your question. I have converted it to a comment so that your question still shows up as unanswered and one of our moderators will be along shortly to remove it entirely.

All the best,  
John


author: Alejandro Conde Carrillo
body: Probably the API is the best way to achieve that. You will need to call an script to create the pages though.


Tags: cloud

confluence-cloud