AnsweredAssumed Answered

Error on my simple new content type

Question asked by andrea.girardi on Sep 22, 2011
Latest reply on Oct 2, 2011 by openpj
Hi all,

I created this new content type:

<aspect name="kc:HealthNewsItem">
   <title>Knowledge Base Article</title>
      <property name="kc:news_id">
         <title>Old News identifier</title>
      <property name="kc:status_type">
         <title>News status</title>
            <constraint ref="kc:status_constraint"/>

And, with a JS I'm trying to create a new object on Repository:

var title = args.title;
var body = args.body;
var news_id =;

var article = companyhome..createNode("article", "cm:content");
article.addAspect("kc:HealthNewsItem");["kc:news_id"] = news_id;["cm:name"] = title;["kc:status_type"] = "Archived";
article.content = args.body;;

model.article = article;

It's working fine because I found the object on repository but, when I cannot access to properties news_id and status_type if I try this:

      <title>Sample ${}</title>
      <p>Title : ${} = ${} = ${article.news_id}</p>
      <p>Body : ${article.content}</p>

This is the error message I can see on alfresco log: freemarker.core.InvalidReferenceException: Expression article.news_id is undefined on line 6, column 64 in mySample/add.get.html.ftl.

How can I fix that? How can I see the new properties I added on my model with Alfresco?

thanks for your time, I'm really freaking out…..  :shock: