How do I use an external table (.csv) to create new pages automatically?

Tom Crapper August 23, 2011

I have a need to create a repository of information on international politicians for my company.

We have a whole stack of information on them (that are formatted as individual records in a .csv), including all their business cards scanned in (as fields in that .csv). Some of the fields contain structured data, some unstructured.

What I want to do is add my table of data (the .csv) to our wiki, but use each individual record as an individual child page in one of our spaces. The result I am looking for is a whole load of pages created, one on each politician, each as a result of the data I have on the .csv.

Is this possible?

I have already added a template that can be used to enter an individual contact/record, which will add a page on a specific person (I can modify those fields as necessary!), and would really like to use it's format for any records added from my .csv.

I'm running on Confluence 3.5.7

4 answers

1 accepted

2 votes
Answer accepted
Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 23, 2011

The Confluence CLI is a good place to start. I'm not sure if it gets your entire use case - you might need to do a bit of extraction and parsing from the csv file.

You might need to write your own Remote API connection (the CLI is just a nicely done implementation of the Remote API that meets lots of use-cases). If you do that, you'll have full control and programatic access to parsing your csv, then uploading the content.

Bob Swift (personal)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2011

Specifically you can use the *runFromCsv* action provided you can make the content conform to the requirements of that action. Otherwise, a combination of scripting and that aciton or others provided by the CLI would work.

Tom Crapper August 24, 2011

Thanks for the comments on this. I'll get some cold towels wrapped round my head and give it a go tomorrow.

Bob, your're a Jedi!

1 vote
Kevin Buchs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2011

Your best bet is to probably attack this with a programming API interface to Confluence. I don't know much about SOAP and other potential mechanisms for this. If you are willing to put in the programming effort, here are some pointers to get you started:

http://confluence.atlassian.com/display/CONFDEV/Confluence+XML-RPC+and+SOAP+APIs

http://confluence.atlassian.com/display/JIRADEV/Remote+API+(SOAP)+Examples

0 votes
Tom Crapper August 23, 2011

Hi,

This will be a recurring need.

0 votes
Kevin Buchs
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 23, 2011

Did you need to do this one time or will it be a recurring need?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events