cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom action to Document Actions Menu or More Action

mchernecki
Champ in-the-making
Champ in-the-making
I have created a custom action following the wiki example. But, I do not want it in the "Run Action" menu. I want it in either or both the document icon level More Actions menu or the document details actions on the right side of the screen. How do I do this? If not possible, how can I rewrite my action to be available from these menus?
6 REPLIES 6

gavinc
Champ in-the-making
Champ in-the-making
Actions are designed to work within the "Run Action" or "Create Rule" wizards so you won't be able to use your custom action directly from the More Actions menu.

To create an action in the more actions menu or down the right side you just need to add a new action to the actions defintion. Add the config below to your web-client-config-custom.xml file:


<config>
    <actions>
        <action id="your_action_id">
            <label>Your Action</label>
            <image>/images/icons/your-image.gif</image>
            <action-listener>#{YourBean.yourMethod}</action-listener>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
         </action>

         <action-group id="doc_details_actions">
            <action idref="your_action_id" />
         </action-group>
   </actions>
</config>

mchernecki
Champ in-the-making
Champ in-the-making
ok, I can now configure an item to run off both the document_browse_menu and the doc_details_actions menus. Thx

Is it possible to configure my menu item to only appear for documents in a particular space. I want my 'Pay Invoice' menu item to only appear for documents in my 'Approved Invoices' folder/space.

kevinr
Star Contributor
Star Contributor
Yes you can write an Evaluator that examines the current path (from NavigationBean) and returns true/false depending on that result.

In 2.0 code take a look at org.alfresco.web.action.evaluator.CreateFormEvaluator as an example.

Thanks,

Kevin

mchernecki
Champ in-the-making
Champ in-the-making
I took a look at the code you reference, makes sense. But, since i am still learning the Alfresco API and I am a bit confused on some things. Since I want to put the action only on documents in the "Approved Invoice" folder, what do I look for to compare in my evaluator? Do I try and get the folder name this document resides in and compare the name, is this also the parent node? How do I get value of the parent node, I can't find anthing in the api. Is there a better way for me to evaluate this?

Thanks

mchernecki
Champ in-the-making
Champ in-the-making
Still having difficulty with this one. Any help would be appreciated.
Thanks

coffman
Champ in-the-making
Champ in-the-making
I am trying to do something similar to this …

Anyone could point us ?

Regards