AnsweredAssumed Answered

Using customized content model in JavaScript code

Question asked by lcandido on Sep 19, 2013
Latest reply on Sep 20, 2013 by kaynezhang
I'm coding in JavaScript (a .js file at space Data Dictionary/Scripts) and it's necessary to use some customized properties. The code runs fine when using the alfresco.org/model/content/ (cm:) that don't need be explicit, but my "dataprev.gov.br/model/contentModelNotaTec" (notatec:) does. How to do it? For example:

if (document.properties.title == "Restrito")
{
<code>
}
runs OK, but

if (document.properties.tipoAcesso == "Restrito") //meaning {http://dataprev.gov.br/model/contentModelNotaTec/1.0}tipoAcesso
{
<code>
}
does not.

I'm sure it's necessary to put "notatec:" at some place in this line, but where?

A more general question: How to know the content modeling of a document? In this example, the contentModelNotaTec.xml file has the lines:

<model name="notatec:contentModelNotaTec"

<namespaces>
    <namespace uri="http://www.dataprev.gov.br/model/contentModelNotaTec/1.0" prefix="notatec"/>
</namespaces>
…   

Which document property does save this information or method return it?

Thanks for any help,

Outcomes