Override tagscope-tags.get.json.ftl in Alfresco 5.0.x
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2014 12:39 PM
Hello Everyone,
I'm trying to find a way to change the behavior in this file. I know that in 5.0.x the alfresco guys have made it harder to actually modify the core files. Normally I would just change this file and be done with it, but I'm trying to go the intended route and change this file in the /tomcat/shared/classes/extension section where it should be in the first place.
So my issue is that I have a requirement to have tags be sorted by name. Normally I would just make the change in the ftl file, but I'm not sure how to go about creating a file that will do this for me.
Is it an xml file that I make….or another ftl? I would appreciate it if someone could point me in the right direction.
Just so everyone knows what I'm doing, here is the code I want to use.
I'm trying to find a way to change the behavior in this file. I know that in 5.0.x the alfresco guys have made it harder to actually modify the core files. Normally I would just change this file and be done with it, but I'm trying to go the intended route and change this file in the /tomcat/shared/classes/extension section where it should be in the first place.
So my issue is that I have a requirement to have tags be sorted by name. Normally I would just make the change in the ftl file, but I'm not sure how to go about creating a file that will do this for me.
Is it an xml file that I make….or another ftl? I would appreciate it if someone could point me in the right direction.
Just so everyone knows what I'm doing, here is the code I want to use.
<#if (noscopefound?? && noscopefound)>{ "tags" : []}<#else> { "tags" : [ <#import "tagging.lib.ftl" as taggingLib/> <#list tags?sort_by("name") as item> <@taggingLib.tagJSON item=item /> <#if item_has_next>,</#if> </#list> ] }</#if>
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2014 03:22 PM
Ok with some help I got it figured out.
Create the following path:
/opt/alfrescoinstall/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/repository/tagging
In the tagging directory create the file the same name as the original:
tagscope-tags.get.json.ftl
Then you put the above code for sorting into this file.
Create the following path:
/opt/alfrescoinstall/tomcat/shared/classes/alfresco/extension/templates/webscripts/org/alfresco/repository/tagging
In the tagging directory create the file the same name as the original:
tagscope-tags.get.json.ftl
Then you put the above code for sorting into this file.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2015 05:50 AM
Hello,
Have you tried in Community 5.0d version?
Best regards
Have you tried in Community 5.0d version?
Best regards
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2015 12:24 PM
Yes I've tested this in both 5.0d and 5.1
Although I just created an amp for it.
Although I just created an amp for it.