Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence CLI Tool, selecting pages by date, then export as PDF

Christopher Lederer October 6, 2014

Hey

There is a couple of example out how to export pages as pdf's via CLI

Now I would like to know if I can create a list via getPageList and select only for pages created after a certain date.

Is that possible?

thanks

4 answers

0 votes
John Paz
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.
October 7, 2014

Here is part of the solution...

While getPageList seems like the best route, I just couldn't get it working right away. But getContentList seemed promising, and sure enough I was able to get it to generate a list of pages modified within the LASTDAY, and I even made it export the list as a comma-separated .txt file (something which isn't even listed as an option for this action, very exciting!).

confluence --action getContentList --search "type:page" --space HOME --searchTypes "page" --searchModified "LASTDAY" --outputFormat 2 --file "target/output/atlassiancli/getContentList.txt"

With all that said, however, I was not able to turn this list into an exported PDF of the actual pages, which was OP's original goal. So if anyone wants to take this solution a bit further I'd would love nothing more!

I may tinker with this a bit more later, but for now I'm a bit stumped. 

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.
October 7, 2014

If the problem is exporting ALL the pages selected to one PDF, then that is not currently supported by the remote APIs as far as I am aware currently.

0 votes
John Paz
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.
October 7, 2014

So I've mastered how to get CLI to spit out a list of pages within a specified date range, even got it to export it as a .txt file (that could be used as a .csv file, with heading information included and comma-separated). But getting the exportPage function to export from a file source doesn't seem to be possible as of yet. I can dream up another combination of solutions, but I wonder if you need to adjust your approach a bit or use some other addons. For instance, this would be much easier to accomplish using ServiceRocket's Reporting plugin. You could even use a simpler solution with content reporting macros (or other built-in, free macros) to generate a report. You would need a very complex solution to achieve this with the current requirements, with exporting the actual pages themselves being the biggest blocker. In any case I'll post my partial solution as an answer and see if someone else from the community might be able to weigh in and provide some insight.

0 votes
Christopher Lederer October 7, 2014

pages themselves - so I would use PageList with date and only export those pages that have a recent created or modified date thanks c.

0 votes
John Paz
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.
October 7, 2014

Are you trying to export the list of pages, or the pages themselves?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events