objectscript-users Mailing List for ObjectScript (Page 7)
Brought to you by:
rob_d_clark
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(12) |
Oct
(13) |
Nov
(8) |
Dec
(7) |
2006 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
(13) |
Nov
(15) |
Dec
(7) |
2007 |
Jan
(2) |
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(5) |
Nov
(3) |
Dec
(2) |
2008 |
Jan
(5) |
Feb
(8) |
Mar
(22) |
Apr
(28) |
May
(13) |
Jun
(10) |
Jul
(22) |
Aug
(11) |
Sep
(19) |
Oct
(11) |
Nov
(47) |
Dec
(39) |
From: Rob C. <ro...@ti...> - 2005-10-07 15:04:47
|
A couple things... first, mounting it just makes it available within the abstract filesystem. So you could then, for example, use pkg.fs.File() to access files within the jar (ie "/jar/xstream-SNAPSHOT/foo/bar.os"). And of course if you have script files within the jar, they could be imported or accessed thru pkg. But it does not add the jar to the classpath. (Although I think this could be implemented, and it is an interesting idea... I'll have to look into it.) second, you will probably need to use pkg.system.declareJavaPackage() for any java package that is first accessed from the script environment, otherwise the JavaPackage object has no way to know that the package actually exists, and so it will throw a NoSuchMemberException. On Oct 6, 2005, at 6:10 PM, Lysander David wrote: > Hi, > > How does one use pkg.system.mountJarFile ? > > I am attempting to instantiate an object of > class com.thoughtworks.xstream.XStream. > The class exists in this jar: > > xstream-SNAPSHOT.jar > > When I execute these commands: > > import "reflection.os"; > var file = new pkg.fs.File ( "xstream-SNAPSHOT.jar" ); > pkg.system.mountJarFile ( file ); > var com = new JavaPackage ("com" ); > var x = new com.thoughtworks.xstream.XStream(); > > > I get this error: > > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: no such member: JavaPackage: > thoughtworks > > > What must be done to mount xstream-SNAPSHOT.jar > and instantiate com.thoughtworks.xstream.XStream ? > > Thanks > -- Rob ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber |
From: Lysander D. <sa...@sb...> - 2005-10-07 01:11:00
|
Hi, How does one use pkg.system.mountJarFile ? I am attempting to instantiate an object of class com.thoughtworks.xstream.XStream. The class exists in this jar: xstream-SNAPSHOT.jar When I execute these commands: import "reflection.os"; var file = new pkg.fs.File ( "xstream-SNAPSHOT.jar" ); pkg.system.mountJarFile ( file ); var com = new JavaPackage ("com" ); var x = new com.thoughtworks.xstream.XStream(); I get this error: oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: no such member: JavaPackage: thoughtworks What must be done to mount xstream-SNAPSHOT.jar and instantiate com.thoughtworks.xstream.XStream ? Thanks |
From: Rob C. <ro...@ti...> - 2005-09-25 17:02:11
|
Hi Arjen, it is possible, despite no "super" keyword... since functions are just objects, you can save a private reference to the overridden function before you override it, like: private var super_someMethod = someMethod; public function someMethod( a, b, c ) { super_someMethod( a, b, c ); ... } if you make the saved "super_someMethod" a private variable, it will not conflict with a same named variable in a parent or derived class. If it were public/protected, it could be overriding a "super_someMethod" from a parent class, or be overridden by a derived class. -- Rob On Sep 25, 2005, at 6:14 AM, Arjen wrote: > Hi, > > Is it possible to explicitly call a function from an "inherited" > object like > the usage of the keyword "super" in Java? > I can't find any documentation about this particular issue. > > Thanks for your help. > > /Arjen > > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or > your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/ > geronimo.php > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber desk: 1 858 552 2946 cell: 1 619 300 9661 |
From: Arjen <ar...@va...> - 2005-09-25 13:14:23
|
Hi, Is it possible to explicitly call a function from an "inherited" object like the usage of the keyword "super" in Java? I can't find any documentation about this particular issue. Thanks for your help. /Arjen |
From: Rob C. <ro...@ti...> - 2005-09-13 05:18:13
|
I think you need the two declareJavaPackage() line's uncommented... or, from java you can just call oscript.data.JavaPackageWrapper.declarePackage("com.novatecnologias") or you can just create an initialize.os where you dump all the needed declareJavaPackage() calls, and then eval() this file at startup... it would be faster to put stuff in a .os file that gets loaded at startup, since the file will get compiled to a java classfile the first time it is executed, so the parser does not need to run each subsequent time. -- Rob On Sep 12, 2005, at 12:09 PM, Sergio Szychowski wrote: > Hi, > > I trying to embed some scripts files but I have some errors and I > can't > figure how to fix them. > > > Some examples. > > > Scope a = new BasicScope( OscriptInterpreter.getGlobalScope() ); > > //OscriptInterpreter.eval("pkg.system.declareJavaPackage > (\"com.novatecnologias\");",a); > > //OscriptInterpreter.eval("pkg.system.declareJavaPackage > (\"com.novatecnologias.xf\");",a); > > OscriptInterpreter.eval("var com = new JavaPackage(\"com\");", a); > > > OscriptInterpreter.eval("var > owner=com.novatecnologias.xf.pruabmBsh();",a); > //I hate netscape > > AbstractFile file =OscriptInterpreter.resolve("javax/ > abm_cli.os",false); > > OscriptInterpreter.eval( file, a ); > > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: > no such member: JavaPackage: novatecnologias > at var owner = com.novatecnologias.xf.pruabmBsh(); > (/.tmp/0.2654966460115943/string-input.os:1) > > Greetings > > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > -- Rob ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber desk: 1 858 552 2946 cell: 1 619 300 9661 |
From: Rob C. <ro...@ti...> - 2005-09-13 05:17:40
|
There are a couple caveats with dealing with java packages... 1) pkg.system.declareJavaPackage() is a bit simplistic... if you declare "a.b.c" this does not automatically declare the existence of "a.b"... one of these days, maybe I'll fix this... or maybe Sun will come up with a more reliable way to detect the existence of some java package so there would be no need for this ugly hack in the first place. So you would (potentially) need to have something like: pkg.system.declareJavaPackage("com.novatechnolgias"); pkg.system.declareJavaPackage("com.novatechnolgias.xf"); If someone out there knows any reliable way to detect the existence of a package, please let me know... unfortunately it seems that java.lang.Package.getPackage() only works if some java class from that package has already been accessed from the java environment. 2) being in the system classpath is different from an "import"... ie. you still need to use a fully qualified package name, or an import, ie: var pp = new com.novatechnolgias.xf.pruabmBsh(); or: mixin(com.novatechnolgias.xf); var pp = new pruabmBsh(); 3) is xf.javax.swing.JMenuItem the full package + classname? Or is it com.novatechnolgias .xf.javax.swing.JMenuItem? If the former, then you will need to create a new JavaPackage object for the "xf" package root: const var xf = new JavaPackage("xf"); if the later, you will need something like: const var xf = com.novatechnolgias.xf; (after the necessary pkg.system.declareJavaPackage stuff) -- Rob On Sep 12, 2005, at 11:32 AM, Sergio Szychowski wrote: > Hi, > > I trying to embed some scripts files but I have some errors and I > can't > figure how to fix them. > > > Some examples. > > > > var pp = new pruabmBsh(); /* pruabmBsh belongs to > com.novatecnologias.xf > package, and is in the system classpath */ > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: > no such member: (global): pruabmBsh > at /u/jbproject/NovaTecnologiasXForms/javax/abm_cli.os:3 > > var jmi_nuevo=new xf.javax.swing.JMenuItem(); > > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: > no such member: (global): xf > at /u/jbproject/NovaTecnologiasXForms/javax/abm_cli.os:22 > > > I trying with JavaPackage() and pk.system.declareJavaPackage > but always the same error, or similar ( xf no such member, javax no > such member, novatecnologias no such member, etc). > > > Greetings > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > |
From: Sergio S. <su...@in...> - 2005-09-12 23:09:29
|
Hi, I trying to embed some scripts files but I have some errors and I can't figure how to fix them. Some examples. Scope a = new BasicScope( OscriptInterpreter.getGlobalScope() ); //OscriptInterpreter.eval("pkg.system.declareJavaPackage(\"com.novatecnologias\");",a); //OscriptInterpreter.eval("pkg.system.declareJavaPackage(\"com.novatecnologias.xf\");",a); OscriptInterpreter.eval("var com = new JavaPackage(\"com\");", a); OscriptInterpreter.eval("var owner=com.novatecnologias.xf.pruabmBsh();",a); //I hate netscape AbstractFile file =OscriptInterpreter.resolve("javax/abm_cli.os",false); OscriptInterpreter.eval( file, a ); oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: no such member: JavaPackage: novatecnologias at var owner = com.novatecnologias.xf.pruabmBsh(); (/.tmp/0.2654966460115943/string-input.os:1) Greetings |
From: Sergio S. <su...@in...> - 2005-09-12 22:33:00
|
Hi, I trying to embed some scripts files but I have some errors and I can't figure how to fix them. Some examples. var pp = new pruabmBsh(); /* pruabmBsh belongs to com.novatecnologias.xf package, and is in the system classpath */ oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: no such member: (global): pruabmBsh at /u/jbproject/NovaTecnologiasXForms/javax/abm_cli.os:3 var jmi_nuevo=new xf.javax.swing.JMenuItem(); oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: no such member: (global): xf at /u/jbproject/NovaTecnologiasXForms/javax/abm_cli.os:22 I trying with JavaPackage() and pk.system.declareJavaPackage but always the same error, or similar ( xf no such member, javax no such member, novatecnologias no such member, etc). Greetings |
From: Rob C. <ro...@ti...> - 2005-09-07 16:06:41
|
Hi Sergio, I think you end up with val being the value of foo, rather than the reference to foo. So what ends up happening is something like "5 = 101;". Try this instead: a.lookupInScope("foo").opAssign(...) What you are trying used to work long ago, but then I realized that it had the result that someone could do something like "someFxn() = 3;", which could let the caller modify private members of an object accessed thru an accessor function, which isn't good. I need to update the embedder's guide... it is a bit out of date in this respect. -- Rob On Sep 7, 2005, at 4:53 AM, Sergio Szychowski wrote: > > Hi, > when you want to assign a new value to a Value object, un exception is > thrown. > > > Scope b = new BasicScope( OscriptInterpreter.getGlobalScope() ); > > try { > Value val = OscriptInterpreter.eval("var foo = 1;", a); > System.out.println("val= " + val ); // prints (null) > val = OscriptInterpreter.eval("foo = 1 + 4;", a); > System.out.println("val= " + val ); // prints 5 > > val.opAssign(JavaBridge.convertToScriptObject(101)); > //throws exception > //oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: no such member: ExactNumber: = > > .... > } > .... > > Greetings. > > |
From: Sergio S. <su...@in...> - 2005-09-07 15:53:34
|
Hi, when you want to assign a new value to a Value object, un exception is thrown. Scope b = new BasicScope( OscriptInterpreter.getGlobalScope() ); try { Value val = OscriptInterpreter.eval("var foo = 1;", a); System.out.println("val= " + val ); // prints (null) val = OscriptInterpreter.eval("foo = 1 + 4;", a); System.out.println("val= " + val ); // prints 5 val.opAssign(JavaBridge.convertToScriptObject(101)); //throws exception //oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: no such member: ExactNumber: = .... } .... Greetings. |
From: Rob C. <ro...@ti...> - 2005-09-06 23:02:49
|
it is for the same reason that you can't do: a = var foo = 1; "var foo" is a declaration rather than an expression. If you want something that returns a value, and declares a variable, you can do something like: OscriptInterpreter.eval("var foo = 1; foo;"); the second statement after the ";" is an expression... the eval() should return the result of the last statement. -- Rob On Sep 6, 2005, at 11:49 AM, Sergio Szychowski wrote: > > Hi, > > in the examples of embedding some things not work, but may wasn't > errors > > > > ------------------------------------------------------------------- > Value val = OscriptInterpreter.eval("var foo = 1;", a); > System.out.println("val= " + val ); > //this example returns NULL, when you done > OscriptInterpreter.eval("var ...") always returns NULL > > > val = OscriptInterpreter.eval("foo = 1 + 4;", a); > System.out.println("val= " + val ); > //here returns val= 5 > > > ------------------------------------------------------------------- > > > Greetings. > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber desk: 1 858 552 2946 cell: 1 619 300 9661 |
From: Sergio S. <su...@in...> - 2005-09-06 22:49:56
|
Hi, in the examples of embedding some things not work, but may wasn't errors ------------------------------------------------------------------- Value val = OscriptInterpreter.eval("var foo = 1;", a); System.out.println("val= " + val ); //this example returns NULL, when you done OscriptInterpreter.eval("var ...") always returns NULL val = OscriptInterpreter.eval("foo = 1 + 4;", a); System.out.println("val= " + val ); //here returns val= 5 ------------------------------------------------------------------- Greetings. |
From: Rob C. <ro...@ti...> - 2005-09-04 23:25:12
|
hmm, it is because the interpreter exits after the .os file is executed. Try instead running the interpreter with no args to get a read-eval-print loop, and type: os> import "curve.os" On Sep 3, 2005, at 12:55 PM, Sergio Szychowski wrote: > When running awttest.os or curve.os, the execution finalize > instantly, > just display the window and exit. > > > I have oscript-2.8.1 running in Suse 9.2 ( kernel 2.6.8), java > 1.5.0 rel 03 > > > java -jar oscript.jar awttest.os > > and > > > java -jar oscript.jar curve.os > > > both execution finalize just after display the window, you not need to > press any button to close & exit. > > > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Objectscript-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectscript-users > ____________________ CONTACT INFORMATION: email: ro...@ti... IM: rob@sandjabber desk: 1 858 552 2946 cell: 1 619 300 9661 |
From: Sergio S. <su...@in...> - 2005-09-03 23:55:20
|
When running awttest.os or curve.os, the execution finalize instantly, just display the window and exit. I have oscript-2.8.1 running in Suse 9.2 ( kernel 2.6.8), java 1.5.0 rel 03 java -jar oscript.jar awttest.os and java -jar oscript.jar curve.os both execution finalize just after display the window, you not need to press any button to close & exit. |
From: Rob C. <ro...@ti...> - 2004-09-13 17:27:48
|
On Sep 13, 2004, at 4:12 AM, Josef JAHN wrote: > Hello list, > > Since I can't acces the list archives (which appear to be completely > non-functional by the way), I'm posting this directly to this list. > > I have a script file that extends a java class and overloads a java > function in that class, "generateAtis(MetarData metarData)" > > Suppose you have this java snippet: > > MetarData myMetarData = MetarInput.readMetarXML(inputXML); > Scope outputScope = new > BasicScope(OscriptInterpreter.getGlobalScope()); > OscriptInterpreter.eval( > readScriptFile("scripts/AtisOutput.os"), outputScope ); > OscriptInterpreter.eval("metarData;", > outputScope).opAssign(JavaBridge.convertToScriptObject(myMetarData)); > Value oScript = OscriptInterpreter.eval("(new > ScriptedAtisOutput()).generateAtis(metarData)", outputScope); > > Also suppose that "var metarData;" is set in the script file that is > evaluated. The eval of "metarData" that I use to convert (or wrap) the > java object myMetarData to the script object metarData fails. > > The error message: > oscript.exceptions.PackagedScriptObjectException: > NoSuchMemberException: no such member: (undefined): = Hmm, try using lookupInScope instead: outputScope.lookupInScope("metarData").opAssign(...); or, if you want to also create metarData from java: outputScope.createMember( "metarData", 0 ).opAssign(...); The problem, I think, is that the eval() is returning the value of metarData, rather than a reference to metarData > Any ideas? I have a very hard time digging through the documentation > as there are near zero actual java integration examples. Most of the > examples deal with script code, and writing whole applications in > script. yeah, I apologize... I will try to find some time to update and enhance the java integration docs ---------------------- Rob Clark Texas Instruments, Inc. (858)552-2946 ro...@ti... ---------------------- |
From: Josef J. <Jos...@fr...> - 2004-09-13 11:13:09
|
Hello list, Since I can't acces the list archives (which appear to be completely = non-functional by the way), I'm posting this directly to this list. I have a script file that extends a java class and overloads a java = function in that class, "generateAtis(MetarData metarData)" Suppose you have this java snippet: MetarData myMetarData =3D MetarInput.readMetarXML(inputXML); Scope outputScope =3D new BasicScope(OscriptInterpreter.getGlobalS= cope()); OscriptInterpreter.eval( readScriptFile("scripts/AtisOutput.os"), = outputScope ); OscriptInterpreter.eval("metarData;", outputScope).opAssign(JavaBr= idge.convertToScriptObject(myMetarData)); Value oScript =3D OscriptInterpreter.eval("(new ScriptedAtisOutput= ()).generateAtis(metarData)", outputScope); Also suppose that "var metarData;" is set in the script file that is = evaluated. The eval of "metarData" that I use to convert (or wrap) the = java object myMetarData to the script object metarData fails. The error message: oscript.exceptions.PackagedScriptObjectException: NoSuchMemberException: = no such member: (undefined): =3D Any ideas? I have a very hard time digging through the documentation as = there are near zero actual java integration examples. Most of the examples = deal with script code, and writing whole applications in script. I'm grateful for any and all help or pointers you could give me. regards, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DI (FH) Josef Jahn Product Development Expert smartStrips Tower and Airport Solutions FREQUENTIS GmbH Wolfganggasse 58-60 A-1120 Vienna, Austria Tel.: (+43) - 1 - 811 50 - 3222 e-mail: Jos...@fr...=20 home page: www.taptools.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D |