User Tools

Site Tools


forum:alfresco:custom-action

This is an old revision of the document!


alfresco

Custom Action

References

Alfresco Custom Action

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.

Alfresco SDK

Goal

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:

  • checkout the document into a dedicated space inside the users home folder
  • create this space if it doesn't exist
  • after finishing the checkout open this space or the details view of the working copy

Additionall changes in the user interface:

  • the check out action button is replaced by the quick checkout button
  • the edit action button is removed from all documents which have the quick checkout action
  • in the details view the edit action is available as a button

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.

Implementation

The action class

The QuickCheckout class is the actual implementation of the QuickCheckout action. It extends ActionExecuterAbstractBase and overrides executeImpl().

Making the action available to the web client

To make the QuickCheckout available to the web client the following steps have to be done: 1. Create a backing bean for the action. 2. Make the backing bean managed. 3. Customize the web client configuration to include the action. For the rest of this example some Java Server Faces (JSF) knowledge is presumed.

The backing bean

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

Enter your comment. Wiki syntax is allowed:
U A U D S
 
forum/alfresco/custom-action.1211541532.txt.gz · Last modified: 2023/11/19 22:45 (external edit)