From the documentation I see by default classes from java.util.* available for vCO Java Script Engine.
I am using vCO 5.1 appliance version.
Can any one post an example on how to use HashMap or ArrayList directly from vCO java script.
I tried this kind of pattern. But no use.
var aList = new ArrayList();
aList.add('Hello');
Appreciate any help.
var aList = new Array();
aList.push('Hello');
for (var idx in aList ) {
var item = aList[idx];
System.log(" " + idx + " is " +item);
}
Yes, I am aware of Array() Class.
But I am trying to see if I can directly use any class from java.util.* package. From the documentation that seems to be possible. But there is no sign of any simple example.
You can check following post https://communities.vmware.com/message/1808053
Rhino engine was updated in the vCO 5.5 but i believe it is still valid.
You can check here http://stackoverflow.com/questions/17592274/java-object-as-prototype-in-rhino
unfortunately I am not able to test it now...
Thanks, that does help.
Is there any limitation on the classes which we can use (or) we can use any class which is available in java.util.*
Beside limitations introduced by Rhino engine itself there is specific configuration file controlling access to Java classes..You can find more details here vSphere Documentation Center
....By default, Orchestrator restricts JavaScript access to a limited set of Java classes. If you require JavaScript access to a wider range of Java classes, you must set an Orchestrator system property to allow this access.