cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript for Custom Action in Share

joshijimit
Champ on-the-rise
Champ on-the-rise
Hi,

I have just created custom actions in alfresco share by following below topic.

http://forums.alfresco.com/en/viewtopic.php?f=47&t=37518

I have updated below JS files to make it works as mentioned in the same topic.

\tomcat\weabpps\share\components\document-details\document-actions.js
\tomcat\webapps\share\js\documentlibrary-actions.js

My question here is, Is there any scope that I can put these files under \tomcat\shared folder? So that I can separate it from share.war and make it a extension js.

I think I need to change the below line in document-actions.get.head.ftl but what would be the URL if I placed my JS inder shared folder.

<@script type="text/javascript" src="${page.url.context}/res/components/document-details/document-actions.js"></@script>

Any suggestion on this front would be of grt help.

Thanks & regards,
Jimit
4 REPLIES 4

mikeh
Star Contributor
Star Contributor
Yes, use the META-INF folder within an extension JAR and they'll get picked up by the /res/ servlet.

Check Kevin Roast's Alfresco blog, or any of Will Abson's "Share extras" extensions for examples.

Thanks,
Mike

joshijimit
Champ on-the-rise
Champ on-the-rise
Hi Mike,

I got a sample-dashlet project from below link and I understood how I can make my js as extension.
http://code.google.com/p/share-extras/downloads/list

But another question arise in my mind is..

Should I place META-INf folder under \tomcat\shared\lib and place my custom js file under the path shown below.

\tomcat\shared\lib\META-INf\mycompany\components\customjs\mycustomjs.js

and use it in document-actions.get.head.ftl like….

<@script type="text/javascript" src="${page.url.context}/res/mycompany/components\customjs\mycustomjs.js"></@script>

Or

I need to compulsory packed all JS into a jar file and need to place that JAR under \tomcat\shared\lib to access my JS.

Regards,
Jimit

mikeh
Star Contributor
Star Contributor
Or

I need to compulsory packed all JS into a jar file and need to place that JAR under \tomcat\shared\lib to access my JS.
This one  Smiley Happy

Mike

joshijimit
Champ on-the-rise
Champ on-the-rise
Thanks Mike.. for your quick and straight answer..  Smiley Very Happy