cancel
Showing results for 
Search instead for 
Did you mean: 

Where should I put my dashlet's .css & .js files?

jordiv
Champ on-the-rise
Champ on-the-rise
Hi,

I've done a little dashlet and I've placed it in:
<ALF_HOME>/tomcat/shared/classes/alfresco/web-extension/site-webscripts/com/jordiv/

I've seen some dashlets that put their custom CSS & JS files inside the share webapp, specifically:
<ALF_HOME>/tomcat/webapps/share/components/dashlets/

Should I put my files there? Or there is any path inside the tomcat shared directory where I can place them?


Thanks,
Jordi.
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
Build a jar file instead (take a look at the "Share extras" project on Google Code). Then you can reference your client-side files using the "/res" servlet and they can remain outside the share.war.

Thanks,
Mike

jordiv
Champ on-the-rise
Champ on-the-rise
Thanks Mike, I've tried that and it works!  Smiley Happy

Just one question. Until now, when I uploaded a new version of my webscript to Alfresco, I was refreshing it using the "Refresh Web Scripts" button (http://<server>:8080/share/page/index).

Now, when I upload my new .jar file to Alfresco, I can't refresh it using that method. I've tried it but it doesn't work. Is there any other way to refresh it without restarting Alfresco?

Thanks,
Jordi.

mikeh
Star Contributor
Star Contributor
No, I think Tomcat's shared classloader hangs onto the old files. At Alfresco, we tend to deploy Share to a separate Tomcat instance on port 8081 so a Share restart only takes about 10 seconds.

Thanks,
Mike

jordiv
Champ on-the-rise
Champ on-the-rise
Ok, thanks for the tip.

Cheers,
Jordi.