Monday, October 15, 2012

.. and posting to action afterwards

in continuation of previous post, you can use the form engine to retrieve your properties for current node and post to your action for special handling by using the share action settings:

<param name="mode">create</param>
<param name="submissionUrl">/api/action/ACTION-ID/formprocessor</param>

Where ACTION-ID is the bean action is in the repo, and mode must be create for html id 'alf_destination' which is needed by ActionFormProcessor :)

Best of both worlds, properties retrieved by form framework and action handling ...

Make Doclib action with a subset of properties for edit

Tested using the 'OnActionFormDialog' for editing properties ...

<action id=".." icon="..." type="javascript" label="...">
                <param name="formId">FORM-ID</param>
                <param name="function">onActionFormDialog</param>
                <param name="itemKind">node</param>
                <param name="itemId">{node.nodeRef}</param>
                <param name="mode">edit</param>
                <param name="destination">{node.nodeRef}</param>
             ...



Now you can specify a new form with id FORM-ID in your node-type form definition! Now this will not call an action anymore thou ... but will persist your property changes.

 

Thursday, October 11, 2012

Ordering forms aspecs and types

The Alfresco Share form can sometimes be tricky, because aspects are configured in one form-config section and the type in another (if you do not duplicate everything for every type). But luckily the order in the form config section matters, and the order in which form-config files are loaded matters. First comes first! So to make an aspect form presentation appear first move in above the type definition and visa versa :)