I want to get attributes of a content using an ftl. Does anyone have an example or idea of how to do it. thank you
0
votes
2 Answers
0
votes
You are asking to show a content property on a workflow form. The workflow does not have direct access to the content properties. And, there could be many pieces of content in the workflow, so which content are you talking about?
So, the way you have to do this is write some JavaScript in your workflow process that iterates over the documents in your workflow package to gather up the values you want to display on the workflow form, then set those values on one or more process variables.
If you have configured the workflow form in share to display those variables, the values will display on the workflow form.
0
votes
Get name (or other properties) of content using javascript - Alfresco
var title;
var unitPrice;
Alfresco.util.Ajax.jsonGet(
{
url: Alfresco.constants.PROXY_URI_RELATIVE + "api/metadata?nodeRef=" + nodeRefContext + "&shortQNames=true" ,
successCallback:
{
fn: function(response)
{
if (response.json)
{
title=response.json.properties["cm:title"];
alert(title);
unitPrice=response.json.properties["art:unitPrice"];
alert(unitPrice);
}
},
scope: this
},
failureCallback:
{
fn: function(response)
{
Alfresco.util.PopupManager.displayPrompt(
{
failureMessage: this.msg("message.failure")
});
},
scope: this
}
});
reference link Get filename of workflow with javascript