cancel
Showing results for 
Search instead for 
Did you mean: 

Override tagscope-tags.get.json.ftl in Alfresco 5.0.x

eswbitto
Confirmed Champ
Confirmed Champ
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.


<#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>
3 REPLIES 3

eswbitto
Confirmed Champ
Confirmed Champ
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.

talleyrand
Champ in-the-making
Champ in-the-making
Hello,
Have you tried in Community 5.0d version?
Best regards

eswbitto
Confirmed Champ
Confirmed Champ
Yes I've tested this in both 5.0d and 5.1

Although I just created an amp for it.