Javascript for Custom Action in Share

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2011 01:08 AM
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
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
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2011 04:06 AM
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
Check Kevin Roast's Alfresco blog, or any of Will Abson's "Share extras" extensions for examples.
Thanks,
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2011 09:02 AM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2011 10:13 AM
OrThis one
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.

Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2011 12:33 AM
Thanks Mike.. for your quick and straight answer..

