AnsweredAssumed Answered

Alfresco 4.2d Share: Customization of My Tasks

Question asked by kizman77 on Oct 18, 2013
Latest reply on Oct 20, 2013 by govinda
Hi everyone,

I am trying to customize "My Tasks" in order to remove unnecessary fields (status, label) and to put something else to be a main (clickable) title of the task (For 'Send for Review and Approve' workflow it is not practical to use "description" as a title as it might be a long one.
I found that the piece of HTML for this component has been generated in the Share webapp: <share web app root>\share\components\workflow\task-list.js file. This .js file is imported in the share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\workflow\task-list.get.html.ftl file.

In order to customize this I have created a new jar file with the following folder structure:

alfresco\site-data\extensions\my-tasks-customisation.xml
alfresco\site-webscripts\mytasks\customisation\task-list.get.properties
alfresco\site-webscripts\mytasks\customisation\task-list.get.html.ftl
META-INF\components\workflow\task-list-custom.js (which is customised task-list.js to generate slightly different html in the "renderCellTaskInfo: function TL_renderCellTaskInfo(elCell, oRecord, oColumn, oData)" method).

Content of the my-tasks-customisation.xml:

<extension>
   <modules>
      <module>
         <id>My Tasks Customisation</id>
       <auto-deploy>true</auto-deploy>
         <version>1.0</version>
         <customizations>
            <customization>
               <targetPackageRoot>org.alfresco.components.workflow</targetPackageRoot>
               <sourcePackageRoot>mytasks.customisation</sourcePackageRoot>
           </customization>
         </customizations>
      </module>
   </modules>
</extension>


Content of task-list.get.html.ftl:

<@markup id="my-custom-js" target="js" action="replace" scope="global">
   <#– JavaScript Dependencies –>
   <@script src="${url.context}/res/components/workflow/workflow-actions.js" group="workflow"/>
   <@script src="${url.context}/res/components/workflow/task-list-custom.js" />
</@>


task-list.get.properties contains changed labels for some actions.

I copied the jar file to WEB-INF/lib and have deployed the module via the Share module deployment admin tool.

However, as a result I have the following:
The changes defined in the .properties file work as expected - when the module is deployed I see new labels, when it is not deployed I see the OOTB ones.
However, for the changes in the task list fields Share always reads it from my customised task-list-custom.js file regardless whether the module is deployed or not (I always see the list of tasks without the fields I have removed).

Any ideas?

Thanks.

Outcomes