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

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

This widget could not be displayed.

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 .

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

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?

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

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 7 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

13 views 0 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you