<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Calling javascript from a DocLib action in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/calling-javascript-from-a-doclib-action/m-p/28496#M12167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;Managed to create a script which is executed on a folder level. Basically, the script takes the custom properties of the selected folder and updates all the child objects with the property values.&lt;/P&gt;&lt;P&gt;Currently the use is obliged to use the Run Action DocLib action and select the right JS file. I would like to simplify this to create a DocLib action displayed in folder-details and folder-browe views.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Added the following code to the share-config-custom.xml&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;config evaluator="string-compare" condition="DocLibActions"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;actions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;action id="updatedocuments" type="javascript" label="Update" icon="folder-move-to"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;param name="function"&amp;gt;onActionUpdateDocuments&amp;lt;/param&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/action&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/actions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;actionGroups&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;actionGroup id="folder-browse"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;action index="500" id="updatedocuments" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/actionGroup&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;actionGroup id="folder-details"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;action index="500" id="updatedocuments" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/actionGroup&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/actionGroups&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/config&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do I have to copy the JS file into the \tomcat\webapps\share\js folder?&lt;/LI&gt;&lt;LI&gt;How can I tell to the action definiton to which JS file it should talk to?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zsolt Putnoky&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 May 2017 12:56:42 GMT</pubDate>
    <dc:creator>zputnoky</dc:creator>
    <dc:date>2017-05-31T12:56:42Z</dc:date>
    <item>
      <title>Calling javascript from a DocLib action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/calling-javascript-from-a-doclib-action/m-p/28496#M12167</link>
      <description>Dear All,Managed to create a script which is executed on a folder level. Basically, the script takes the custom properties of the selected folder and updates all the child objects with the property values.Currently the use is obliged to use the Run Action DocLib action and select the right JS file.</description>
      <pubDate>Wed, 31 May 2017 12:56:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/calling-javascript-from-a-doclib-action/m-p/28496#M12167</guid>
      <dc:creator>zputnoky</dc:creator>
      <dc:date>2017-05-31T12:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calling javascript from a DocLib action</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/calling-javascript-from-a-doclib-action/m-p/28497#M12168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;!! SOLVED !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We solved the above question by following the discussion in the following thread:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.alfresco.com/thread/205795-custom-action-using-server-side-javascript" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/thread/205795-custom-action-using-server-side-javascript&lt;/A&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;You need to modify the share-custom-config.xml file to include the menu item&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;create and save the JS file into ./tomcat/shared/classes/alfresco/extension/scripts folder&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;create and save a context file into ./tomcat/shared/classes/alfresco/extension/ folder&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;find and save a 16x16 PNG icon for your new action into ./tomcat/webapps/share/components/documentlibrary/actions&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Zsolt Putnoky&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jun 2017 07:41:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/calling-javascript-from-a-doclib-action/m-p/28497#M12168</guid>
      <dc:creator>zputnoky</dc:creator>
      <dc:date>2017-06-06T07:41:09Z</dc:date>
    </item>
  </channel>
</rss>

