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

John W. Machar August 3, 2022

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
John W. Machar October 27, 2022

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
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 3, 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
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 3, 2022

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

John W. Machar August 5, 2022

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
AUG Leaders

Atlassian Community Events