cancel
Showing results for 
Search instead for 
Did you mean: 

Share Jar extension

loftux
Star Contributor
Star Contributor
Hi,

I'm trying to use the new share jar extensions for a language pack (but my question has a general validity, hence posting here). I've used Will Absons post http://blogs.alfresco.com/wp/wabson/2010/02/22/share-extensions-build-script/ as a base.
It works fine, properties files are found, and Share shows the added language.

But I also want to add the translation .js files for tinyMCE. And they are not picked up. So my questions are
-Is it supported to add files like /modules/editors/scripts/tiny_mce/langs/sv.js using jar extension?
-If so, where should they go to end up in the correct place?  I've tried putting the structure under META-INF as Wills build script implies, but that doesn't work.
6 REPLIES 6

mycroes
Champ in-the-making
Champ in-the-making
Hi,

Coincidentally I've just created my first Share extension in a JAR yesterday, which also contains a client-side javascript file. It didn't work at once because I didn't use the correct url to the script file, because there's an extra /res/ in the path compared to when the files would be in the deployed WAR directory.

In short, files in META-INF in the JAR will be reachable at [host]:[port]/share/res/[filename].

I guess that means that if you want to change client reachable files, you'll have to change the files that reference them to point to copies in your JAR.
Regards,

Michael

loftux
Star Contributor
Star Contributor
Hi,

wonder if that is intentional?
For my particular purpose, I need to add language javascript files to [host]:[port]/share/modules/editors/tiny_mce and subdirs. And that path is given by the existing tinyMCE core files.
But I can also see that one would like to modify existing javascripts, and that would not work then.

hkır
Champ in-the-making
Champ in-the-making
Hi, I am tring to implement the sample given in "Alfresco Share 3.3 Extensions and SpringSurf" (http://blogs.alfresco.com/wp/kevinr/2010/01/28/alfresco-share-33-extensions-and-springsurf/). When I tried the given sample extension (http://www.kevs3d.co.uk/dev/share-sample-page-extension-3.3.jar) everything goes fine. But if I import sample into eclipse and export back to jar (without doing any modification) alfresco can't load the webscripts (sitedetails). Both jars looks same (directory structure, file sizes).
Is there another way of generating jar for this purpose?

Solved: Here is the missing ant file : http://blogs.alfresco.com/wp/wabson/2010/02/22/share-extensions-build-script/

loftux
Star Contributor
Star Contributor
Coming back to this thread again.
I wanted to package a custom theme in an extension jar
I have this file structure that I create a jar from:
alfresco/site-data/themes/loftux.xml
META-INF/themes/loftux/<all the theme files>

Packaging this into a jar, and you can select the custom theme.
But it cant find its resources, as said previously in thread, there is a /res/ added to the path, so files are available under
/share/res/themes/loftux/ (I tried, they are there).

But the theme mechanism expects it to be in /share/themes/loftux/

Is there a way for files to be added to the jar and read from /share/ root?
It seems odd if not, since so many things are expected to be available in root of share.

kevinr
Star Contributor
Star Contributor
Currently you can package up pages, components, component assets etc. in a JAR for 3.3 - but themes have to be manually applied (exploded a ZIP is probably easiest) as you are correct, they will not work due to the /res servlet issue. It is something we will look improving for a future version.

Kev

beemoon
Champ in-the-making
Champ in-the-making
You can use AMP as me