I’ve been reading David Drapers’ blog on the new feature – the extension of share webscripts, but I didn’t find any working examples. What is the file naming and structure convention?
From what I gather, I have a module configuration file, and I don’t know how to name it or where to put it (share/WEB-INF/classes/alfresco?)
Also, I understood that my custom client side resources (.js and .css files) go to META-INF/custom-dashlet/extension/ in the JAR file. Is this correct? Finally, the *.get.js and *.get.html.ftl go to webscripts/com/mycompany/mypackage/*?
So I have now:
*share/WEB-INF/lib/mypackage.jar*
and in it:
*META-INF/mypackage/extension/myfile.js
webscripts/com/mycompany/mypackage/myfile.get.js
webscripts/com/mycompany/mypackage/myfile.get.html.ftl
*
and the
*share/WEB-INF/classes/alfresco/something.xml*
This question was also posted to the Alfresco forums here: https://forums.alfresco.com/en/viewtopic.php?f=48&t=46438
The answer provided was as follows:
An extension module a Surf configuration object so you should place XML files containing module configuration in any of the locations where Surf config gets picked up… e.g.
<web-server>/webapps/share/WEB-INF/classes/alfresco/site-data(there are lots of places where Surf configuration gets picked up, butalfresco/site-dataon theclasspathis the most common). Extension config files should be placed in theextensionsfolder within the directory. So you could place an extension config file in:alfresco/site-data/extensionsoralfresco/web-extension/site-data/extensions, for example.You could create a JAR file containing this folder structure. Everything that the extension refers to (e.g. WebScripts, other Surf config objects such as Pages, Template-Instances, Components, etc) should just be placed in their normal location. These can also be built into a JAR file.
If you want to access resources (e.g. CSS, images, JS) from a JAR file then place them in the META-INF folder of the JAR. You should place your JAR file in the
<web-server>/webapps/share/WEB-INF/libdirectory (obviously your server will need to be restarted to pick up new JAR contents).WebScripts should be in (on the classpath):
You can also configure other locations in the Surf configuration from which to load Surf config
objects/WebScripts. It’s pretty much endlessly customizable but you should probably just stick to the default locations configured for Share.