Custom Action in Share

I`ll extract the information from here;  and here:
This post = just to be able to quickly grab the files I need to change to add more buttons.

In the Share project (part of the my personal Eclipse setup)


.doclist .onActionXopus a {    background-image: url(plaatje-16.gif) !important; }



/** DocumentList “Recalculate Workflow ” action **/
(function() {
Alfresco.doclib.Actions.prototype.onActionRecalculateWorkflow = function DL_onActionRecalculateWorkflow(asset)  {
nodeRef = new Alfresco.util.NodeRef(asset.nodeRef);
alert(“comment MJB=” + file.nodeRef);
} )  ( ) ;


…..add this line …..
<#– WF Action –>
<@link rel=”stylesheet” type=”text/css” href=”${page.url.context}/res/components/documentlibrary/recalculate-workflow-action.css” />
<script type=”text/javascript” src=”${page.url.context}/res/components/documentlibrary/recalculate-workflow-action.js”></script>


…..add this line …..
<action type=”action-link” id=”onActionRecalculateWorkflow” permission=”edit” label=”actions.document.recalculateWorkflow” />


… there is still something missing here….

..  i’ll figure that out soon….


Logging for scripts – javascript and java

=> This one allows me to see what comment are generated in my javascripts

=> This one give me feedback from my workflow process definition (.xml)

=> And this one allows me to log stuff in my own created java clasess

Workflow in Javascript.

I cant’ make it more clear than this person is doing – so here’s the link to his blog ;

Also – this can explain quite a lot.

But I still can manage to assign a task to a certain user….

This seems usefull information.


The personal task list denotes all the task instances that are assigned to a specific individual. This is indicated with the property actorId on a TaskInstance. So to put a TaskInstance in someone’s personal task list, you just use one of the following ways:
  • Specify an expression in the attribute actor-id of the task element in the process
  • Use TaskInstance.setActorId(String) from anywhere in your code
  • Use assignable.setActorId(String) in an AssignmentHandle

However; Assignable, assignable and TaskInstance cannot be called directly in javascript.

…. <time passes>

…. < more time passes>

And I`m back to messing around with the swimlanes. It seems they have priority over setting parameter in bmp-assignee and other values. So I solved it like this;

<swimlane name=”assignee”>
<assignment class=”org.alfresco.repo.workflow.jbpm.AlfrescoAssignment”>

Lesson learned – This week I`ll close with a succesfull working workflow and next week i`ll start adding behaviour.

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


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

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

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

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


(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>";

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