cancel
Showing results for 
Search instead for 
Did you mean: 

How to create an action evalutor too detect multiple node types.

bobalfresco
Champ in-the-making
Champ in-the-making
I have created two custom types.
1. pm:myFolder extends cm:folder
2. pm:myFile extends cm:content

I have also create a custom action called deploy.
I am trying to create an evaluator that will allow the
deploy action to be available for only these two custom
types, not for ordinary files and folders.

In share-config-custom.xml I have added the evaluator with this line in
the action definition:

<evaluator>evaluator.doclib.action.isDeployable</evaluator>

In custom-slingshot-application-context,xml, I have included this bean:

   <bean id="evaluator.doclib.action.isDeployable" parent="evaluator.doclib.action.nodeType">
      <property name="types">
         <list>
            <value>pm:myFile</value>
                                <value>pm:myFolder</type>
         </list>
      </property>
   </bean>

When I include only one "<value>" line, it works, but when I have both lines, it
only shows the action for one type.

Am I missing something or using the wrong syntax?
Thanks
2 REPLIES 2

art99trash
Star Contributor
Star Contributor
Add this line to your share-config-custom.xml action definition

<evaluator>evaluator.doclib.action.isDeployable</evaluator>

angelborroy
Community Manager Community Manager
Community Manager
It only accepts one, so you have to use composition.



   <bean id="evaluator.doclib.metadata.isDeployable" parent="evaluator.doclib.action.chainedMatchOne">
      <property name="evaluators">
         <list>
            <ref bean="evaluator.doclib.metadata.foldertype" />
            <ref bean="evaluator.doclib..metadata.filetype" />
         </list>
      </property>
   </bean>
Hyland Developer Evangelist