This site has moved to the integrated Appfire documentation and information site for our apps.
From February 2024 this site is no longer updated.
Take a look here! If you have any questions please email support@appfire.com
Integrate Metadata from User Macros using Value References
This page content is now deprecated and is no longer applicable due to changes in Confluence v7.0 and later and we do not support user macros use with Comala Document Management.
Overview Deprecated
This page describes how to access metadata from Confluence User Macros using Value References. This allows even the integration of 3rd party apps, which set metadata, and get it from your custom workflows.
Example Deprecated
Let's suppose that our custom workflow needs an auditor set in a user macro, as a metadata value (this could be a metadata value already set by a third party app):
1.- A user macro (or the 3rth party app) sets this metadata.auditor:
#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 property
$contentPropertyManager.setTextProperty($content, "metadata.auditor", VALUE)
2. We can validate that the value is properly populated, again with a user macro:
##Test property
#set ($managerProperty = $contentPropertyManager.getTextProperty($content, "metadata.auditor"))
<p>$managerProperty</p
3.- Finally, we reference that metadata with a value reference @metadata.auditor@:
{workflow:name=Metadata example}
{state:Review|approved=Published|rejected=Review}
{approval:Editor in Chief|user=@auditor@}
{state}
{state:Published|final=true|updated=Draft}
{state}
{workflow}
For current practice in the use of metadata references in Comala Document Management please see Metadata references.