cancel
Showing results for 
Search instead for 
Did you mean: 

What is the file structure of the Share Webscript extensions

zladuric
Champ on-the-rise
Champ on-the-rise
Hello,

I've been reading David Drapers' blog on the new feature - the extension of share webscripts.
But I didn't find any working example: 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, correct?
And 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 the
share/WEB-INF/classes/alfresco/something.xml
?
Thanks for the answers.
3 REPLIES 3

ddraper
World-Class Innovator
World-Class Innovator
Hi,

Sorry for the slow response on this…

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, but "alfresco/site-data" on the classpath is the most common). Extension config files should be placed in the "extensions" folder within the directory… so you could place an extension config file in:

"alfresco/site-data/extensions" or "alfresco/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/lib" directory (obviously your server will need to be restarted to pick up new JAR contents).

WebScripts should can be in (on the classpath):
"alfresco/site-webscripts"
"alfresco/web-extension/site-webscripts"
"webscripts"

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.

Regards,
Dave

zladuric
Champ on-the-rise
Champ on-the-rise
Thank you very much for the reply! If you care for stackoverflow points, copy this post here:
http://stackoverflow.com/questions/12569495/what-is-the-file-structure-of-the-share-webscript-extens...
🙂


Also, this sounds awesome, I could basically have half my stuff packed in a jar, half lying around…
Like you said, endlesly customizable. I'll stick to having it in a single jar though, thanks anyway.

ddraper
World-Class Innovator
World-Class Innovator
I'm not especially bothered about the points but I've posted the answer and a link back to this topic in case other people find the question,

Regards,
Dave