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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,768
Community Members
 
Community Events
176
Community Groups

How can I show the Comala Workflows status in a Confluence User Macro

We have a Confluence User Macro which presents information about a page and its descendants in a table. The attributes for each page are inserted into cells in a row of the HTML table as Confluence macros e.g., 

<td> $page.version <\td>
<td> $page.lastModifier.name </td>

I want to add a new column containing the Comala Workflow status of the page (as both icon and text) eg.:

 image.png 

This way I can easily see if the parent page and descendants are all Published. I cannot figure out how to get at the Comala pagestatus information from the Confluence user macro.  The Document Report macro isn't what I want. I just want to add the page status to the existing table .

Does anyone have any suggestions for how to insert a page's Comala workflow status into the table cell?

Thanks in advance.

2 answers

1 accepted

0 votes
Answer accepted

Followup:  I contacted the folks at Comala who said they didn't support integration of Comala Document Management with user macros.  They did however suggest I look at the following:

Using a CQL filter in the document-state-report macro to report on grandchildren of a page

I found that I could use the document-state-report macro and use a CQL filter of

    ancestor=pageid OR id=pageid

to include the root (index) page as well as descendant pages.

However there were a few issues still remaining:

  1. The page order is not the hierarchical one, although various columns can be sorted.
  2. When I included a last final version column it was only populated if the page had been approved at some time, otherwise the entry was blank. When populated it showed the last approved version, not the current version. They have a ticket to fix this.
  3. The biggest issue was when I used Space Tools > Content Tools  > Export to produce a single PDF of the whole page tree from the root downwards. In this case the table rendered on-screen was not reproduced in the PDF file. Instead the placeholder text

        Comala Document Management add-on...

    appeared in its place.

    I could do Print in the browser and select Microsoft Print to PDF as the printer, as that does render the Comala macro correctly, Then I could use Space Tools to export the descendant pages as a second PDF file and then stitch the two together. However this is a bit of a hassle when the aim was to easily and quickly produce a single PDF I could archive.

Hopefully this is useful to others.

Best regards, 

--JWM

0 votes
Bill Bailey Community Leader Aug 03, 2022

Hello @John W_ Machar , yes this type of thing can often be challenging. First, that object has to be exposed in the Velocity context (many are not) and then second, you have to figure correct reference.

So first, I will share something that has worked with Scroll (K15t) products:

## ContentPropertyManager setup
#set ($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set ($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))
#set ($containerManager=$getInstanceMethod.invoke(null,null))
#set ($containerContext=$containerManager.containerContext)
#set ($contentPropertyManager=$containerContext.getComponent('contentPropertyManager'))

....

#set($fileName=$contentPropertyManager.getTextProperty($content, "metadata.scroll.pagetitle"))

So something like:

#set($pageStatu$contentPropertyManager.getTextProperty($content, "metadata.properties.comalaworkflows.currentState"))

Or

#set($pageStatu$contentPropertyManager.getTextProperty($content, "metadata.comalaworkflows.currentState"))

You can try to play with this. The Comala people are pretty friendly, so you may want to file a case with them.

Bill Bailey Community Leader Aug 03, 2022

BTW, you say you are on Confluence Cloud, but user macros are not available on the cloud. I assume that is in error?

Bill,  thanks for the reply. I will try this out. I was hoping there was some simple thing I hadn't managed to discover. 

We are using the server edition but I couldn't select that when creating the request. I figured that the user macro information would be the same in each case so just went with one of the allowed options.

Best regards, 

--JWM

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Atlassian Community Events