cancel
Showing results for 
Search instead for 
Did you mean: 

importPackage and importClass aren't defined in JavaScript

vladimir_kovaly
Champ in-the-making
Champ in-the-making
importPackage() and importClass() aren't defined in JavaScript. Since they aren't provided by default, they should have been configured in Alfresco' Rhino integration appropriately.
5 REPLIES 5

davidc
Star Contributor
Star Contributor
They were once configured in, but we removed them again as they open the doors to security issues.

At some point we may re-introduce once we're happy there are no security holes.

mabayona
Champ on-the-rise
Champ on-the-rise
Please, consider putting them back…   Or put some other method of importing and using a library of js functions inside an advanced workflow. This is needed to include non trivial business code inside an advanced workflow.

The way it is now, since it cannot be factoriced or stored in a library o package, leads very much to repetitive and hence unmaintainable code.

pmonks
Star Contributor
Star Contributor
Are you able to use the direct (non-import) method described at http://www.mozilla.org/rhino/ScriptingJava.html?  ie. accessing the Java class directly via "Packages.my.java.package.Classname"?

mabayona
Champ on-the-rise
Champ on-the-rise
Probably there is a misunderstunding. I mean importing javascripts libraries/functions in workflow actions. Probably I should use a different thread for it.

mabayona
Champ on-the-rise
Champ on-the-rise
The solution to my question is here:

http://forums.alfresco.com/viewtopic.php?t=7339