Hi there,
Is there a way to override (replace) the ftl file used by workflow related webscript in remote-api package? For example, file `workflow.lib.ftl` used by workflow webscripts, it's under the folder path:
I found an article here: Overriding Alfresco webscript library ftl files - Nick talking about overriding `workflow.lib.ftl` by copying it to same folder structure in a module, but I couldn't figure out where I should copy this file to in my module, so I was wondering what the correct path should be? I've tried to put it in:
resources/alfresco/templates/webscripts/org/alfresco/repository/workflow/workflow.lib.ftl
resources/META-INF/alfresco/templates/webscripts/org/alfresco/repository/workflow/workflow.lib.ftl
None of them works, please help me.
Thank you.
You can not extend /override the lib ftl file and ideally you should not o that.One place where this file is getting used it task-list.get.html.ftl. You should extend task-list.get.html.ftl and do the customization which you would like to do it over there.
Few link on how you can extend share is as below.
Soft29 blog: Alfresco: extend Share javascript component
6. Customize Alfresco Share FreeMarker templates | Alfresco Documentation
Thank you for your reply, Krutik, but the workflow.lib.ftl in question is used by java-end webscripts, not share-end, I do find the workflow.lib.ftl you mentioned as well in share project, which path is:
share/src/main/resources/alfresco/site-webscripts/org/alfresco/components/workflow/workflow.lib.ftl
Which is to say, there are two workflow.lib.ftl files used by java-end and share-end respectively.
I've managed to override the java-end workflow.lib.ftl by manually copying customised version under folder:
tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/repository/workflow
and it's working well now, but I couldn't figure out how to do the same thing via module installation, based on your reply, it seems that we're not able to extend or override the lib ftl file, maybe that's the reason why Alfresco doesn't pick my customised ftl from my module although I put it in the same structure as that in tomcat/shared folder.
We have to modify this free marker template as we have a workflow process variable has the below shape:
[[user1, user2], user3, user4]
Unfortunately, the workflow.lib.ftl can't parse this kind of variable as when loop through the variable, it deems all the elements inside a sequence type variable can be convert to a string directly, while in our case, one of elements is sequence again and can't be converted to string directly, which cause an exception is thrown, so we have to modify the template to deal with this case by ourselves.
Anyway, the issue has been solved for me and thank you for your help Krutik.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.