Many times we need our own custom action to be called through documentLibrary browse actions (folder actions)
Below are the customization points to achieve it in alfresco 4.
Note: we are adding custom action called "Create Custom Code"
1) share-config-custom.xml
This file is the entry point to customization in share. Lets add our configuration here to add our action.
Note : Here we need to analyse that callYourCustomFunction is the function we would write our own inside /components/documentlibrary/actions.js
write your custom code in that file or call repository side webscript to achieve your goal.
EnJOY !!
Note: we are adding custom action called "Create Custom Code"
1) share-config-custom.xml
This file is the entry point to customization in share. Lets add our configuration here to add our action.
<config evaluator="string-compare" condition="DocLibActions"> <actions> <action id="folder-custom-action" type="javascript" icon="folder-manage-permissions" label="Create Custom Code"> <param name="function">callYourCustomFunction</param> </action> </actions> <actionGroups> <actionGroup id="folder-browse"> <action index="161" id=" folder-custom-action " /> </actionGroup> </actionGroups> </config>
Note : Here we need to analyse that callYourCustomFunction is the function we would write our own inside /components/documentlibrary/actions.js
write your custom code in that file or call repository side webscript to achieve your goal.
EnJOY !!
Thanks Ghanshyam this will really help us.
ReplyDeleteHi,
ReplyDeleteI have a task to add a new action in selected items menu on share. I tried defining an action in repo.toolbar.get.config.xml and then defined the action in share-config.custom.xml. Defined the same function in action.js. But when i click the custom action from selected items menu, the action is not getting invoked.
could you please suggest an example to achieve this?
Appreciate your help asap.
Thanks
Are you calling any webscript? because share will call js based script and then it will call alfresco's remote call.
Delete