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….


Date Calendar GregorianCalendar

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;


If I extract a date from a node in Alfresco, I cannot cast directly to Calendar or GregorianCalendar. So I cast the Serializable return type from Alfresco to the Date class.
Date d = (java.util.Date) nodeService.getProperty(nr, INCENTROmodel.STARTDATE);


But java.util.Date is depricated since Java 1.1
The date.getTime() function still works.
It return the amount of ms since the beginning of time (aka 1 jan 1970)
long gt = d.getTime();


And the GregorianCalendar knows this. So
GregorianCalendar gc = new GregorianCalendar();

Post no. 3_million_and_1 about the java.util.Date / java.util.Calendar / java.util.GregorianCalendar

getting a boolean value from a Serializable return value (returned from nodeService.getProperty(X,Y);)

So this is the easy way to get a boolean value.

When all you have is a noderef with a boolean aspect (property)

boolean started = DefaultTypeConverter.INSTANCE.booleanValue(nodeService.getProperty(noderef, INCENTROmodel.PROP_TASKPLAN_TASK_STARTED));

boolean stopped = DefaultTypeConverter.INSTANCE.booleanValue(nodeService.getProperty(noderef, INCENTROmodel.PROP_TASKPLAN_TASK_ENDED));

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