cancel
Showing results for 
Search instead for 
Did you mean: 

4.0 - Evaluators for associations

bengrah
Champ on-the-rise
Champ on-the-rise
Hi guys,

In Share 4.0 I've done some work with the new evaluators. So for example, in custom-slingshot-application-context.xml I added the following bean:

<bean id="evaluator.doclib.metadata.email" class="org.alfresco.web.evaluator.HasAspectEvaluator">
      <property name="aspects">
         <list>
            <value>imap:imapContent</value>
         </list>
      </property>
   </bean>

All this does is use the HasAspectEvaluator to check if the node in question has the out of the box imap aspect attached to it. Then in share-config-custom.xml I have the following:

<config evaluator="string-compare" condition="DocumentLibrary">

      <indicators>
         <indicator id="miller-email-icon" index="10" label="status.miller-notifications-set">
            <evaluator>
               evaluator.doclib.metadata.miller.email
            </evaluator>
         </indicator>
      </indicators>
</config>

Then I get a small mail icon appearing next to any .emls .

Next, I'd like to do something similar only with emails that have attachments. Alfresco IMAP automatically extracts an attachment and places it into a folder that sits alongside the email in the repo. As for the email itself, it then has 2 or more associations linking to the attachment folder and attachment(s).

What I'd like to do is use an evaluator to check if the node in question has any associations of type "imap:attachmentsFolder", but I'm not sure if there's an evaluator (like HasAspectEvaluator) available to do this.

Anyone any ideas?

Thanks,
ben.
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

out-of-the-box I don't think you'll find something like this as only type, aspects, properties and permissions are returned for items loaded in the document library. You would have to enhance the Repository tier data web script via its extension points to provide information about associations in order to actually have data for an evaluator of the kind you propose to work on. In general, this is achievable, but you should take care to only check/load the associations when necessary as you most certainly would impact the performance of the data web script significantly just by checking for the existence of such associations on each item.

Regards
Axel

deepak1987
Star Contributor
Star Contributor
Hi Axel,

I'm facing the same issue. I want association information in Evaluator such that I should render the action if a node has custom association otherwise not. Can you tell me, how to achieve this task and which Data WebScript, we have to override??

Thanks a lot.