首页 > 解决方案 > How can i display content atributes using .ftl? Alfresco

问题描述

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

标签: javascriptalfrescofreemarkeralfresco-sharealfresco-webscripts

解决方案


使用 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
        }
     });

参考链接使用 javascript 获取工作流的文件名


推荐阅读