javascript - 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
解决方案
使用 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
}
});
推荐阅读
- excel - 如何使用 WPS office 或任何其他工具在每个不同列中创建等效于 explode() 的集合数据
- r - 我如何正确地将条形图和折线图重叠在一起
- sql-server - 将 650 万条记录从平面文件加载到 OleDb 目标(即数据库表)的性能更好
- macos - Powershell Core 读取文件元数据
- c++ - 使用单例模板时如何使用g ++编译多个cpp文件
- go - 如何使用 Golang 从 Azure eventthub 获取架构
- google-cloud-platform - 暂时禁用此应用的 Google 登录 - Google OAuth
- java - concatColumn 弹出 UnsupportedOperationException
- html - 具有四个浮动 div 的响应式布局
- python - 如果值包含特定子字符串,如何从列值中删除单词?