<?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: Run shell commands from scripts in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164797#M118520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't if the following can be useful to you… but…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that you could use the Java Runtime class ( &lt;/SPAN&gt;&lt;A href="http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html&lt;/A&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;as a wrapper, passing your shell commands through strings…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could refer to the source code of the RuntimeExecutableContentTransformer class ( &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Content_Transformations" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Content_Transformations&lt;/A&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which is embedded in Alfresco…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Mar 2008 02:18:39 GMT</pubDate>
    <dc:creator>mir4ge</dc:creator>
    <dc:date>2008-03-16T02:18:39Z</dc:date>
    <item>
      <title>Run shell commands from scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164794#M118517</link>
      <description>I was searching the alfresco wiki and forums, but didnt find anything about this.Is it possible to run shell commands from scripts? I mean from the scripts that are in "Company Home &amp;gt; Data Dictionary &amp;gt; Scripts". I know its a javascript but as I am looking on the examples there looks like its a</description>
      <pubDate>Fri, 14 Mar 2008 13:26:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164794#M118517</guid>
      <dc:creator>janco</dc:creator>
      <dc:date>2008-03-14T13:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Run shell commands from scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164795#M118518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would guess not (with about 60% confidence level).&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We use Rhino as an engine for server-side JavaScript.&amp;nbsp; The way it works is that you need explicitly expose certain Java objects as Java.&amp;nbsp; I don't believe low-level functionality of Java is exposed. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even if it is possible, then it should not be, since that would introduce a security problem - people could then upload a script that starts interacting with the server file system - not a good idea.&amp;nbsp;&amp;nbsp; I thought i saw some checkins recently around improving security of these scripts.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the other hand, the scripts that are deployed on a file system don't have the same security problem, but I am not sure if you could write to the filesystem from there.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 14:29:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164795#M118518</guid>
      <dc:creator>jbarmash</dc:creator>
      <dc:date>2008-03-14T14:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Run shell commands from scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164796#M118519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're spot on Jean.&amp;nbsp; Scripts stored in the repository run in a sandbox that prevents the code from doing anything dangerous (including things like calling Java APIs and, by extension, invoking OS commands / scripts) - this is to prevent users from uploading and running scripts that inadvertently or maliciously damage the system (or worse!).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That said, Alfresco v2.1.3 and above include a change that enables scripts &lt;/SPAN&gt;&lt;STRONG&gt;stored wholely within the classpath&lt;/STRONG&gt;&lt;SPAN&gt; to access native Java APIs (which allows all sorts of logic, including invocation of OS level commands / scripts).&amp;nbsp; The reasoning here is that if a developer has sufficient privileges to manipulate the Alfresco classpath, there's not a lot Alfresco can do to prevent inadvertent / malicious damage to the system by that person (since they have direct filesystem access to the server).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 20:49:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164796#M118519</guid>
      <dc:creator>pmonks</dc:creator>
      <dc:date>2008-03-14T20:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Run shell commands from scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164797#M118520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Don't if the following can be useful to you… but…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that you could use the Java Runtime class ( &lt;/SPAN&gt;&lt;A href="http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html" rel="nofollow noopener noreferrer"&gt;http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html&lt;/A&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;as a wrapper, passing your shell commands through strings…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could refer to the source code of the RuntimeExecutableContentTransformer class ( &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Content_Transformations" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Content_Transformations&lt;/A&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which is embedded in Alfresco…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2008 02:18:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/run-shell-commands-from-scripts/m-p/164797#M118520</guid>
      <dc:creator>mir4ge</dc:creator>
      <dc:date>2008-03-16T02:18:39Z</dc:date>
    </item>
  </channel>
</rss>

