02-03-2022 09:45 AM
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
02-03-2022 10:31 AM
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.
02-03-2022 09:53 AM
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.
02-03-2022 10:22 AM
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.
02-03-2022 10:26 AM
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
02-03-2022 10:31 AM
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.
02-03-2022 10:40 AM
okay, thanks for this, i will try it this way.
Explore our Alfresco products with the links below. Use labels to filter content by product module.