<?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 Using ajax in a rule in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/using-ajax-in-a-rule/m-p/263485#M216615</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to setup a rule to add information to a file and copy it to a proper location in alfresco 3.4.d.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically users are going to be scanning a document to the share and will have limited interaction.&amp;nbsp; Based on the filename they give I'm going to look up other information from a database.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I would prefer to do is make an ajax call from a rule on the folder to a php script that returns the necessary information.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm familiar with dojo and the dojo.io.bind function as shown on the wiki here &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/AJAX_Support" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/AJAX_Support&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;But it's not clear to me if/how these can be used in a script when creating a rule.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried making a dojo build with the needed files, uploaded it to the scripts directory, and attempted :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;import resource="/Company Home/Data Dictionary/Scripts/dojo.js"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which i found in the wiki here &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I get an syntax error when trying to execute my script with that import line in there&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;15:28:32,301 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 04099633 Failed to execute script 'workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df': syntax error (workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df#12)&lt;BR /&gt;org.alfresco.scripts.ScriptException: 04099633 Failed to execute script 'workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df': syntax error (workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df#12)&lt;BR /&gt;&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;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 May 2011 19:56:30 GMT</pubDate>
    <dc:creator>jsolan</dc:creator>
    <dc:date>2011-05-09T19:56:30Z</dc:date>
    <item>
      <title>Using ajax in a rule</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-ajax-in-a-rule/m-p/263485#M216615</link>
      <description>I'm trying to setup a rule to add information to a file and copy it to a proper location in alfresco 3.4.d.Basically users are going to be scanning a document to the share and will have limited interaction.&amp;nbsp; Based on the filename they give I'm going to look up other information from a database.What</description>
      <pubDate>Mon, 09 May 2011 19:56:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-ajax-in-a-rule/m-p/263485#M216615</guid>
      <dc:creator>jsolan</dc:creator>
      <dc:date>2011-05-09T19:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using ajax in a rule</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-ajax-in-a-rule/m-p/263486#M216616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So I realized that the import statement was not the very first thing in my script which is why I was getting a syntax error.&amp;nbsp; After that I started getting a java is undefined message.&amp;nbsp; This is using the dojo build profile for rhino.&amp;nbsp; I'm really flying blind with this though as I've never used rhino before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;13:02:56,978 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 04130973 Failed to execute script 'workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df': 04130972 ReferenceError: "java" is not defined. (workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df#14)&lt;BR /&gt;org.alfresco.scripts.ScriptException: 04130973 Failed to execute script 'workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df': 04130972 ReferenceError: "java" is not defined. (workspace://SpacesStore/a5ea6262-1062-4892-b200-922a9b6659df#14)&lt;SPAN class="line-numbers-rows"&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;Is it just not possible to use ajax in a rule?&amp;nbsp; Are there any options for doing realtime validation for files?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the things we liked about alfresco is that we thought we could cleanse data without having to write our own interfaces.&amp;nbsp; Now it's looking more like that isn't the case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 May 2011 15:43:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-ajax-in-a-rule/m-p/263486#M216616</guid>
      <dc:creator>jsolan</dc:creator>
      <dc:date>2011-05-16T15:43:09Z</dc:date>
    </item>
  </channel>
</rss>

