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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

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

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}

Summary

Comala Document Management can use metadata in Confluence, provided:

  • The value reference is inserted/retrieved as a content property with the setTextProperty/getTextProperty methods.
  • The value reference is prefixed with "metadata."



  • No labels