Note |
---|
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
Status |
---|
subtle | true |
---|
title | 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.
Status |
---|
subtle | true |
---|
title | 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:
Code Block |
---|
|
#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:
Code Block |
---|
|
##Test property
#set ($managerProperty = $contentPropertyManager.getTextProperty($content, "metadata.auditor"))
<p>$managerProperty</p |
3.- Finally, we reference that metadata with a value reference @metadata.auditor@:
Code Block |
---|
|
{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} |
Summary
Comala Document Management can use metadata in Confluence, provided:
...
Info |
---|
For current practice in the use of metadata references in Comala Document Management please see Metadata references. |