cancel
Showing results for 
Search instead for 
Did you mean: 

Custom action linking in the web client

simon
Champ in-the-making
Champ in-the-making
I would like to add a link in the web client for each document that triggers a custom action. The following is a good start for what I need (it goes in the web-client-config-custom.xml of your project):
   <config>
        <actions>
            <action id="log_action">
                <label>Log Action</label>
                <image>/images/icons/add.gif</image>
            </action>
            <action-group id="document_browse">
                <action idref="log_action" />
            </action-group>
        </actions>
    </config>
Now, this is a link but doesn't execute anything at this point. I would like to execute the CustomAction example from the Alfresco SDK which is a jar file in the Alfresco lib folder. Any idea how I can reference this action in the config above? I found something like this:
<evaluator>org.alfresco.web.action.evaluator.EditDocHttpEvaluator</evaluator>
but this doesn't work, the action is not an evaluator but an "executor" or something. Anyone?

Thanks!
2 REPLIES 2

xerox
Champ in-the-making
Champ in-the-making
that evaluator is just a class that evaluate if a link(action) will be visible or not. e.g. the edit link will only rendered if the user has write acces. an evaluator checks this.
For executing an action you should point to the action with a action-listener. example:

      <action id="edit_doc_http">
            <permissions>
               <permission allow="true">Write</permission>
            </permissions>
            <evaluator>org.alfresco.web.action.evaluator.EditDocHttpEvaluator</evaluator>
            <label-id>edit</label-id>
            <image>/images/icons/edit_icon.gif</image>
            <action-listener>#{CheckinCheckoutBean.editFile}</action-listener>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
            <!– can also specify style, class etc. but this is better done in 'actions' element –>
         </action>

simon
Champ in-the-making
Champ in-the-making
Thanks Xerox! Smiley Wink