cancel
Showing results for 
Search instead for 
Did you mean: 

Override "item.lib.ftl" file

ValentinLeblanc
Champ on-the-rise
Champ on-the-rise

Hello,

I would like to override the file "item.lib.ftl" which is located in share :  alfresco-share-services/src/main/resources/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary-v2 

Is it possible ? How could I do this ? 

Thank you

1 ACCEPTED ANSWER

I guess that, from an extension point, you should create two modules:

* One module in Share to change the invocation to http://127.0.0.1:8080/alfresco/s/slingshot/doclib2/node/workspace/SpacesStore/XXX to a custom WebScript (i.e. http://127.0.0.1:8080/alfresco/s/slingshot/doclib2/node-custom/workspace/SpacesStore/XXX)

* One module in Repo to implement that new "node-custom" WebScript (including the item.lib.ftl modifications)

I don't see any other approach to get that done.

Hyland Developer Evangelist

View answer in original post

5 REPLIES 5

angelborroy
Community Manager Community Manager
Community Manager

If you're using the Alfresco Maven SDK to create a JAR/AMP, you can create that file in "/src/main/resources/alfresco/extension/templates/webscripts/alfresco/slingshot/documentlibrary-v2/item.lib.ftl". This is a Repository extension.

Hyland Developer Evangelist

That may not work, since this WebScript is included as an additional AMP in Share Services module:

https://github.com/Alfresco/alfresco-community-repo/tree/master/amps/share-services

I guess you'll need to use a different approach.

Hyland Developer Evangelist

Thank you for the quick answer.

Unfortunately, it appears to be not working (or I did it wrong): the same old "item.lib.ftl" from share is used by the system. (I did the test by calling "alfresco/s/slingshot/doclib2/node/workspace/SpacesStore/XXXXX" and check the JSON result).

My file is located in the JAR : alfresco/extension/templates/webscripts/alfresco/slingshot/documentlibrary-v2/item.lib.ftl

Is there any configuration xml file to modify/add or just creating the new file in this location should be enough ?

EDIT : Ok I didn't see your second reply. Thank you for information

Thank you

I guess that, from an extension point, you should create two modules:

* One module in Share to change the invocation to http://127.0.0.1:8080/alfresco/s/slingshot/doclib2/node/workspace/SpacesStore/XXX to a custom WebScript (i.e. http://127.0.0.1:8080/alfresco/s/slingshot/doclib2/node-custom/workspace/SpacesStore/XXX)

* One module in Repo to implement that new "node-custom" WebScript (including the item.lib.ftl modifications)

I don't see any other approach to get that done.

Hyland Developer Evangelist

okay, thanks for this, i will try it this way.