AnsweredAssumed Answered

How to retrieve properties description via Javascript

Question asked by kitelabs on Nov 5, 2012
Latest reply on Nov 6, 2012 by kitelabs
Hi guys,
I need help to retrieve properties descriptions as specified in my customModel.xml

In my model I have something like that:


        <property name="fa:customer">
           <title>Customer Name</title>
           <index enabled="true">
Now I need to retrieve the string "Customer Name" between  <title></title> tag.
Using a simple webscript, I am able to get the full list of properties for a desired document in this way:

<shortname>Document Properties</shortname>
<description>It provides document’s property</description>
<format default="json">argument</format>

 var query = "@sys\\:node-uuid:" + "\"" + args.nodeRef + "\"" + " AND TYPE:\"cm:content\"";
var results = search.luceneSearch(query);
model.document = results[0];

and the .ftl is:

"properties" : [
<#assign props =>
<#list props as t>
    <#– If the property exists –>
       <#– If it is a date, format it accordingly–>
       "${t}": "${[t]?string("yyyy-MM-dd")}"
       <#– If it is a boolean, format it accordingly–>
       "${t}": "${[t]?string("yes", "no")}"
       <#– Otherwise treat it as a string –>
       "${t}": "${[t]}"
    </#if> }
    <#if t_has_next>,</#if>
In this way, I can get the full list pointing to the url http://localhost:8080/alfresco/service/sample/documentprops?nodeRef=beb21716-f5f0-421a-a366-2f0cf85a85b6
but I need to get, for each property, the label as assigned into model file ("Customer Name" in this case).

I can get, for example:
"{}customer": "DELL MAROCCO"

So the property name is "{}customer" and the property value is "DELL MAROCCO"

I would like to know if there is a way to obtain the property description (or property label or displayName I don't know what is the right name) corresponding to "Customer Name".

Thanks in Advance