tuankhac / share-extras

Automatically exported from code.google.com/p/share-extras
0 stars 0 forks source link

[Javascript Console] Script with imports does not work #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to execute a script which use another script (import ressource)

What is the expected output? 
Script result.

What do you see instead?
An error.

00060004 Wrapped Exception (with status template): 00060063 Failed to execute 
script 
'classpath*:alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js': 
00060062 SyntaxError: illegally formed XML syntax 
(jar:file:/home/alfresco/alfresco345/tomcat/shared/lib/javascript-console-0.4.2.
jar!/alfresco/templates/webscripts/de/fme/jsconsole/execute.post.js#216(eval)#4)

What version of the add-on are you using? Please provide version of the
downloaded package, or Subversion revision number.
Javascript Console 0.4.2 (javascript-console-0.4.2.jar)

What version of Alfresco are you using? On what application server?
Alfresco Enterprise 3.4.6

What web browser are you using? Please supply browser name and version.
Firefox 8.0.1

Please provide any additional information below.
Script examples :
<import resource="/Company Home/Data Dictionary/Scripts/backup.js">
logger.log("test");

<import resource="classpath:alfresco/module/test/scripts/my.lib.js">
logger.log("test");

Original issue reported on code.google.com by Bertrand...@gmail.com on 6 Jan 2012 at 8:44

Attachments:

GoogleCodeExporter commented 8 years ago
The only solution I see, is to use "script action" :

   var actionScript = actions.create("script");
   actionScript.parameters['script-ref'] = scriptRef;
   actionScript.execute(document);

See attachment, it can help you to solve problem.

Original comment by Bertrand...@gmail.com on 6 Jan 2012 at 10:36

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for your patch, Bertrand. Using action the execute the code does not 
allow output to the output window, does it? My current idea for a permanent fix 
is to reimplement the execute webscript in Java, then it would be possible to 
make the import statement work.

Original comment by Florian....@gmail.com on 31 Jan 2012 at 9:50

GoogleCodeExporter commented 8 years ago

Original comment by Florian....@gmail.com on 31 Jan 2012 at 10:20

GoogleCodeExporter commented 8 years ago
Imports using <import> are now possible in 0.4.3.

Original comment by Florian....@gmail.com on 7 Feb 2012 at 4:32