cancel
Showing results for 
Search instead for 
Did you mean: 

Metadata template for showing assocs data

cesarista
World-Class Innovator
World-Class Innovator
Hi everybody:


I created a content model with one aspect with an assocciation to cmSmiley Tongueerson (very similar to bpm:assignee in fact i call it zpm:assignee). I can use it with other properties in documents in Share normaly. Then I defined an evaluator for this aspect and a metadata template. I wanted a metadata template that could show the "userName" of the objet person asigned to that aspect/association. No problem when accesing and rendering to other properties. Is it possible?


This is my metadata template:

 
(function()
{
   /**
    * Alfresco Slingshot aliases
    */
   var $html = Alfresco.util.encodeHTML,
   isValueSet = Alfresco.util.isValueSet;

   if (Alfresco.DocumentList)
   {
        YAHOO.Bubbling.fire("registerRenderer",
         {
           propertyName: "zzzz",
           renderer: function content_renderer(record, label)
           {
              var jsNode = record.jsNode,
              properties = jsNode.properties,
              html = "";
              mystatus   = properties["zpm:mystatus"] || "";
              priority   = properties["zpm:priority"] || "";
              percent    = properties["zpm:percentComplete"] || "";
              // I DO NOT KNOW HOW TO ACCESS THIS OBJECT –> zpm:assignee
              //assigned   = ??????
              assigned   = "";
              html = '<span class="item">Estado: <b>' + mystatus + '</b>';
              html = html + 'Priority: <b>'+ priority +'</b>';
              html = html + 'Percent : <b>'+ percent +' %</b>';
              html = html + 'Asigned to: <b>'+ assigned +'</b>';
              html = html + '</span>';
              return html;
          }
      });
   }
})();


I am using 4.2.3 Enterprise.

Thanks in advance.

–C.
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

unless you modify the Repository-side JSONConversionComponent you cannot access association data of nodes in the Share DocumentLibrary tier. Only properties are available by default. Any extension / modification of JSONConversionComponent needs to be aware of the fact that the Records Management module also provides a custom JSONConversionComponent implementation which typically is incompatible with a customization based on the original JSONConversionComponent - that we had to learn the hard way and now deal with by using sub-class proxies (CGlib).

Regards
Axel

cesarista
World-Class Innovator
World-Class Innovator
Hi Axel:

Thanks for the confirmation.
Now, I'm thinking in a walkaround based a rule or custom behaviour for getting user name from the association (cmSmiley Tongueerson) via javascript API for example, that saves the username in a new text property, that can be easily obtained in the metadata template.

–C.