0

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

Content Props Workflow Form

Gercio_J
  • 32
  • 7

2 Answers2

0

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.

Jeff Potts
  • 10,468
  • 17
  • 40
  • Thanks for the replies. What I really wanted was done on this link http://qaru.site/questions/5561155/get-filename-of-workflow-with-javascript-alfresco. – Gercio_J Sep 09 '19 at 07:31
0

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

Gercio_J
  • 32
  • 7