Custom Actions

I added two custom actions to my alfresco environment. This was (relatively) easy to do;

(1) Add the actions you want to  web-client-config-custom.xml

...
<actions>

<action id="CreateMessage">
<permissions> <permission allow="true">Write</permission> </permissions>
<label>CreateMessage</label>
<image>/images/icons/email_users_large.gif</image>
<script>/Company Home/Data Dictionary/Scripts/CreateMessage.js</script>
<params> <param name="nodeRef">#{actionContext.nodeRef}</param> </params>
</action>

<action id="SendMessages">
<permissions> <permission allow="true">Write</permission> </permissions>
<label>SendMessages</label>
<image>/images/icons/check_out_large.gif</image>
<script>/Company Home/Data Dictionary/Scripts/SendMessages.js</script>
<params> <param name="nodeRef">#{actionContext.nodeRef}</param> </params>
</action>	

<action-group id="space_details_actions">
<action idref="CreateMessage" />
<action idref="SendMessages" />
</action-group>

<action-group id="space_browse_menu">
<action idref="CreateMessage" />
<action idref="SendMessages" />
</action-group>

</actions>

(2) Update your scripts.

– Add this to the beginning of your script

nodeRef = args["nodeRef"];
var space = search.findNode(nodeRef);

– Add this to the end of your script

var goBack = "<script>history.back();</script>";
goBack;

That should be enough to make little icons in the details of a space, which will fire of the scripts named here.

Advertenties

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit / Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s