cancel
Showing results for 
Search instead for 
Did you mean: 

Action with Custom Attributes

lmoulin
Champ in-the-making
Champ in-the-making
Hello,
I want to launch a servlet when the user clicks on a specific menu.
I decided to create a new action.
This action is applied on a document.
I define the following action in the file 'web-client-config-custom.xml':

<action id="view_coffre_fort_watermark">
<label-id>view_coffre_fort_watermark</label-id>
<image>/images/icons/view_coffre_fort_watermark.gif</image>
<href>http://localhost:8080/AlfrescoViewer/ViewerServlet</href>
<target>new</target>
<params>
<param name="isWithWaterMark">true</param>
<param name="id">#{actionContext.id}</param>
</params>
</action>

But I want to add some parameters like document custom properties values to my servlet.
What is the correct syntax of the tag <param>?

Thanks a lot for your help,
Luc
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
The 'actionContext' object represents an Alfresco client Node wrapper object. So it should be possible to retrieve the properties of an item using the following syntax:

Either:
#{actionContext['cm:name']}

Or maybe (can't remember if this will work)
#{actionContext.properties['cm:name']}

And replace 'cm:name' with your custom property uriSmiley Tongueropertyname as appropriate.

Thanks,

Kevin

lmoulin
Champ in-the-making
Champ in-the-making
thanks a lot.
It works 😉