<?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 Re: Executing a batch from a script in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130991#M92025</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That is exactly what I have done, and it worked perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good day,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shlomi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 16:19:52 GMT</pubDate>
    <dc:creator>shlomi</dc:creator>
    <dc:date>2008-01-22T16:19:52Z</dc:date>
    <item>
      <title>Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130987#M92021</link>
      <description>Hello,My alfresco is installed on windows, and I have created a space called incoming. There is a rule on this space, that distribute the files from it to their respective space. In a specific situation, I want to execute a batch file (.bat), that loads the content of the file into the DB (oracle),</description>
      <pubDate>Wed, 14 Nov 2007 10:14:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130987#M92021</guid>
      <dc:creator>shlomi</dc:creator>
      <dc:date>2007-11-14T10:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130988#M92022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As you said your javascript "runs on the server-side" - it does not have access to any Browser related objects or Browser JavaScript APIs such as ActiveXObject.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Nov 2007 22:50:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130988#M92022</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-11-25T22:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130989#M92023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, Thank you for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;As you said your javascript "runs on the server-side" - it does not have access to any Browser related objects or Browser JavaScript APIs such as ActiveXObject.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I see, in that case, what are my options with integrating a third party application (on the server side) that needs to execute by a rule on a specific file? (say when the file arrives, and have a certain extension to its name, run a third party application, that uploads this file to our database).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shlomi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2007 08:51:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130989#M92023</guid>
      <dc:creator>shlomi</dc:creator>
      <dc:date>2007-11-26T08:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130990#M92024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A Rule executes a Repository Action object - these objects are Java code (usefully they can also be called via the JavaScript API) - and as such can make use of any Java features such as executing external processes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Nov 2007 12:42:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130990#M92024</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2007-11-26T12:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130991#M92025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That is exactly what I have done, and it worked perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Good day,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shlomi&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:19:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130991#M92025</guid>
      <dc:creator>shlomi</dc:creator>
      <dc:date>2008-01-22T16:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130992#M92026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to perform the same task (run .bat file), but&amp;nbsp; don't have much experiences with Java and JavaScript and from above text I didn't get it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please write some short example how to achieve it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ales&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2009 15:18:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130992#M92026</guid>
      <dc:creator>anovotny</dc:creator>
      <dc:date>2009-11-26T15:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130993#M92027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi foilks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;uncle Gyro's 2 ct for the weekend:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Usually (say in 9 out of 10 cases) it is bad idea to call out to external processes from Java, especially on the server side: you have to take care of OS pecularities, blocking behaviour, security and the like. In an EJB environment this isn't even allowed for that reasons (usually in a non-strict sense, all application servers i know dont thwart that…).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In most cases, Java offers a more "javaish", more straight way to perform task - for the SQLLDR case it would be to open a straight JDBC connection and feed the database!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Said that, of you absolute must, Runtime.exec() or class ProcessBuilder are your friends. But beware: when using exec(), you have to take care to spawn two consumer threads to gobble the subprocess' output streams, otherwise your exec() call may block. I suppose there are some helper classes out there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gyro&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2009 14:39:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130993#M92027</guid>
      <dc:creator>gyro_gearless</dc:creator>
      <dc:date>2009-11-27T14:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130994#M92028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;maybe I am missing some important part of knowledge…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to execute this very short script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var r = Runtime.getRuntime();&lt;BR /&gt;r.exec("calc.exe");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And received the error &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;org.alfresco.error.AlfrescoRuntimeException: 10300137 Error during command servlet processing: 10300136 Failed to execute script 'workspace://SpacesStore/866c3275-531c-4823-8ad2-14f2a622baac': 10300135 ReferenceError: "Runtime" is not defined. (workspace://SpacesStore/866c3275-531c-4823-8ad2-14f2a622baac#13)&lt;BR /&gt;caused by:&lt;BR /&gt;org.alfresco.scripts.ScriptException: 10300136 Failed to execute script 'workspace://SpacesStore/866c3275-531c-4823-8ad2-14f2a622baac': 10300135 ReferenceError: "Runtime" is not defined. (workspace://SpacesStore/866c3275-531c-4823-8ad2-14f2a622baac#13)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ales&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 12:37:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130994#M92028</guid>
      <dc:creator>anovotny</dc:creator>
      <dc:date>2009-11-30T12:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130995#M92029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I assume that is JavaScript? For security reason, you cannot execute raw Java code within our Rhino JavaScript integration - to prevent some extremely unpleasant possibilities! See my post above: &lt;/SPAN&gt;&lt;A href="http://forums.alfresco.com/en/viewtopic.php?p=32386#p32386" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/en/viewtopic.php?p=32386#p32386&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;you need to wrap your Java code into an Alfresco "action" bean that you can then call from the JavaScript code via the "actions" object - that is exactly what the other user above did to get it working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kev&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Nov 2009 15:48:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130995#M92029</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2009-11-30T15:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Executing a batch from a script</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130996#M92030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it is javascript and I got your point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So I try to follow this &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Custom_Actions" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Custom_Actions&lt;/A&gt;&lt;SPAN&gt; and this &lt;/SPAN&gt;&lt;A href="http://www.ecmarchitect.com/images/articles/alfresco-actions/actions-article.pdf" rel="nofollow noopener noreferrer"&gt;http://www.ecmarchitect.com/images/articles/alfresco-actions/actions-article.pdf&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;But I don’t understand where should be placed the code with class definitions. Maybe I am missing some basic knowledge…&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please write some short step-by-step procedure like for idiots?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ales&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 15:24:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/executing-a-batch-from-a-script/m-p/130996#M92030</guid>
      <dc:creator>anovotny</dc:creator>
      <dc:date>2009-12-01T15:24:40Z</dc:date>
    </item>
  </channel>
</rss>

