Anyone have an example of using CLI to attach a csv file and display it in confluence?

Jump Operations June 13, 2013

If I have a file "file1.csv" stored on a server say "file-server1" and I wanted to display the file in confluence how would I go about setting up CLI to do it? I add the macro to a test page but don't know what to put in the body of it

1 answer

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 13, 2013

Normally, you would use the CLI to take the contents of the file and populate a page with the data. For example:

--action storePage --space myspace --title file1 --file file1.csv --content "{noformat}" --content2 "{noformat}"

If you have the Table Plugin for Confluence, then you can replace the noformat macro with the csv macro.

Another approach is to just use the csv macro directly and access a file located in the script directory in the home directory of the Confluence server. See CSV Macro .

Jump Operations June 14, 2013

I will give this a try and get back to you. Thanks for the speedy reply.

Jump Operations June 16, 2013

I am now getting a "Error rendering macro 'cli' : Security restricted macro with parameter 'product' and parameter value 'confluence' is not allowed on this page. A page edit restriction is required that matches the macro authorization list." Error. WHat should change in the \\conflluence-server\ConfluenceData\macro-security.properties file to allow the macro to run?

Jump Operations June 16, 2013

or if it could read the data from the csv then display it on the current confluence page.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
June 16, 2013

cli is a macro security controlled macro and so needs an entry in your macro-security properties - something like:

cli=confluence-administrators
cli.profile.*=confluence-administrators 

For your other question, see the answer regarding the use of the csv macro.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events