AnsweredAssumed Answered

Javascript API & CMIS for Atom Feeds

Question asked by nancygaillard on Oct 30, 2014
Latest reply on Oct 31, 2014 by nancygaillard
Hi,

Alfresco 4.2.e on Windows 7 x64bits

I had recently post this => <a href="http://forums.alfresco.com/forum/developer-discussions/other-apis/javascript-api-variable-site-dashlet-10212014-0951">Javascript API - variable "site" for dashlet</a>

I am progressing thanks to the community. It is really slow, because of my ignorance on Alfresco…
and I have some difficulties to find informations.

My problem now is to access properties of my datalists (title, path…)
Currently, I have a dashlet which works :) I can see my datalists but only by name and not by title and my links direct towards atom feeds and not towards the datalists :/

How to access to properties?

There is my code, my simplified atomFeed.XML and my list of atom functions :
datalists-list.get.js
<javascript>
var rep = remote.call("/cmis/p/Sites/gestion/dataLists/children");//?format=json cause an error
var lists = [];

if(rep.status == 200){
   var feed = atom.toFeed(rep);
   var size = feed.getEntries().size();
   
   for(var i=0; i < size ; i++){
      var entry = feed.getEntries().get(i);
      lists = entry;
   }
}
model.lists = lists;
</javascript>

datalists-list.get.html.ftl

<@markup id="js">
   <#– Your JavaScript file. You actually only need the my-dashlet-min.js file (unless in development mode), but we usually keep the original source in my-dashlet.js there so we can change it later.–>
   <@script type="text/javascript" src="${url.context}/res/components/dashlets/datalists-list.js" group="dashlets"/>
</@>
<@markup id="html">
  <@uniqueIdDiv>
      <div class="dashlet">
         <div class="title">Lites d'appels et de courriers</div>
         <div class="body scrollableList">
            <#if lists?size != 0>
               <#list lists as l>
                  <div class="detail-list-item">
                     <div class="details">
                        <#assign links = l.getLinks()>
                        <#list links[1..1] as link><a href="${link.href}">${l.title} (${length})</a></#list>
                     </div>
                  </div>
               </#list>
               <div class="">
               </div>
            <#else>
               Il n'y a pas de liste disponible
            </#if>
         </div>
      </div>
   </@>
</@>

Outcomes