This is an old revision of the document!
← alfresco
Alfresco Custom Action UI Integration
Howto for creating a custom action
Howto for creating a task history
Also it's a good idea to have installed the Alfresco SDK project in your Eclipse and have unzipped some parts of the Alfresco sources and API docs to understand the functionality.
This article describes the steps to go for creating a simple action. The action - Quick Checkout - will replace the standard checkout action. Instead of offering all the checkout options quick checkout of a document will be a straight forward process without user interaction. QuickCheckout should:
Additionall changes in the user interface:
If that's possible, the quick checkout should be available as an aspect and/or a rule and/or mandatory for special custom content models.
The QuickCheckout class is the actual implementation of the QuickCheckout action. It extends ActionExecuterAbstractBase and overrides executeImpl().
To make the QuickCheckout available to the web client the following steps have to be done:<br> 1. Create a backing bean for the action.<br> 2. Make the backing bean managed.<br> 3. Customize the web client configuration to include the action.<br> For the rest of this example some Java Server Faces (JSF) knowledge is presumed.
To make the action available to Alfresco the web-client-config-custom.xml file has to be changed. This file resides in the /conf/alfresco/extension/ directory. The following lines have to be added:
<config> <actions> <!-- Quick Checkout document --> <action id="quick_checkout_doc"> <evaluator> org.alfresco.web.action.evaluator.CheckoutDocEvaluator </evaluator> <label-id>quickcheckout</label-id> <image>/images/extension/QuickCheckOut_icon.gif</image> <action-listener> #{QuickCheckout.doQuickCheckout} </action-listener> <action>browse</action> <params> <param name="ref">#{actionContext.nodeRef}</param> </params> </action> <!-- Actions for a document in the Browse screen --> <action-group id="document_browse"> <action idref="quick_checkout_doc" /> </action-group> <!-- Actions Menu for Document Details screen --> <action-group id="doc_details_actions"> <action idref="quitck_checkout_doc" /> </action-group> </actions> </config>
Discussion