Francisco | 11 Mar 2007 15:59
Picon
Favicon

How to write or reconfigure values of variables in o:xml?

Dear Martin,
 
How have  you been recently? Since I got your kind help weeks ago, I have been working on the project and it seems there is another problem arise when I come into the setVariableValue() methods which are defined into the o:xml.
 
In the example you provided, the method "plus" just read the values and sum them together, it is mainly a "read" process, however, we also need "write" process in the project, which means, the defined method setVariableValue() should be able to reconfigure the values of the variables whenever needed. As we know,  Java could "read" and "write" xml files via DOM tree, but I don't know how o:xml achieve this goal and couldn't find an example of it from all the currently available documents. I sincerely hope you can help me out. I appreciate your help very much always.
 
Looking forward to hearing from you.
 
Kind regards,
Francisco 
 
 
 


Martin Klang <martin-LWu8nV7rPErYtjvyW6yDsg@public.gmane.org> wrote:
Francisco,

You need to match the function name and signature, in the same way as
when you call Class.getMethod(String, Class[]) in Java.

For example, if your function definition looks like this:








ie you've defined the function 'plus(Number, Number)', then you can
look up the function like this:

Function func = program.getResolver().getFunction(new Name("plus"),
new Type[]{NumberNode.TYPE, NumberNode.TYPE});

I have put together a couple of working examples that you can
download from here:
http://mars.pingdynasty.com/CallObjectboxExamples.zip

You need to have the latest objectbox.jar on your classpath to
compile and run the Java program.

best of luck, I look forward to hearing of your success!

/m


On 26 Feb 2007, at 16:16, Francisco wrote:

> Dear Martin,
>
> Sorry to bother you again. I have the difficulty in following your
> example to call the functions. The problem is mainly on this line
> -----
>
> Function func = program.getResolver().getFunction
> (functionName,signature);
>
> I always get "null" as return, I don't know how to solve it. I
> checked the API but couldn't find more details on how to pass the
> arguments or signatures for designated functions? I tried to put
> signatures inside. But still not succeed. Could you please kindly
> give a further explaination on this? Thank you very much for your
> help.
>
> Looking forward to your email.
>
> Kind regards,
> Francisco
>

Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. Do it now...
_______________________________________________
o-xml mailing list
o-xml@...
http://lists.pingdynasty.com/mailman/listinfo/o-xml
Martin Klang | 14 Mar 2007 20:21

ObjectBox v1.1.6

The documentation for the new ObjectBox v1.1.6 is now up on the  
website [1].
Notably the Database Extensions [2] have been revamped and got a  
couple of new features.

The release includes: Added functionality to provide alternative SQL  
commands for different SQL dialects. Updated db:result parameters to  
use SQL type mappings. Added generated nodes() function for Element  
subtypes for quick, automatic object serialisation. Updated o:for- 
each to maintain the context position during iteration. Improved  
support for SML and SML macros. Bugfixes and improvements to  
performance and useability.

The full change log is available here [3].

have fun!

/m

[1] http://www.o-xml.org/
[2] http://www.o-xml.org/documentation/obox-db-extensions.html
[3] http://www.o-xml.org/objectbox/changes.txt
Martin Klang | 16 Mar 2007 12:51

Re: How to write or reconfigure values of variables in o:xml?

Hi Francisco,

you could perhaps try returning an object of a user-defined type from  
the o:XML program, then calling functions on that object from Java.
As I don't know the context it's a little bit difficult for me to  
offer more advice. Maybe you could try to explain  how your different  
Java and o:XML components fit together, and how they are called.

best regards,

/m

On 11 Mar 2007, at 14:59, Francisco wrote:

> Dear Martin,
>
> How have  you been recently? Since I got your kind help weeks ago,  
> I have been working on the project and it seems there is another  
> problem arise when I come into the setVariableValue() methods which  
> are defined into the o:xml.
>
> In the example you provided, the method "plus" just read the values  
> and sum them together, it is mainly a "read" process, however, we  
> also need "write" process in the project, which means, the defined  
> method setVariableValue() should be able to reconfigure the values  
> of the variables whenever needed. As we know,  Java could "read"  
> and "write" xml files via DOM tree, but I don't know how o:xml  
> achieve this goal and couldn't find an example of it from all the  
> currently available documents. I sincerely hope you can help me  
> out. I appreciate your help very much always.
>
> Looking forward to hearing from you.
>
> Kind regards,
> Francisco
>
>
>
>
>
> Martin Klang <martin@...> wrote:
> Francisco,
>
> You need to match the function name and signature, in the same way as
> when you call Class.getMethod(String, Class[]) in Java.
>
> For example, if your function definition looks like this:
>
>
>
>
>
>
>
>
> ie you've defined the function 'plus(Number, Number)', then you can
> look up the function like this:
>
> Function func = program.getResolver().getFunction(new Name("plus"),
> new Type[]{NumberNode.TYPE, NumberNode.TYPE});
>
> I have put together a couple of working examples that you can
> download from here:
> http://mars.pingdynasty.com/CallObjectboxExamples.zip
>
> You need to have the latest objectbox.jar on your classpath to
> compile and run the Java program.
>
> best of luck, I look forward to hearing of your success!
>
> /m
>
>
> On 26 Feb 2007, at 16:16, Francisco wrote:
>
> > Dear Martin,
> >
> > Sorry to bother you again. I have the difficulty in following your
> > example to call the functions. The problem is mainly on this line
> > -----
> >
> > Function func = program.getResolver().getFunction
> > (functionName,signature);
> >
> > I always get "null" as return, I don't know how to solve it. I
> > checked the API but couldn't find more details on how to pass the
> > arguments or signatures for designated functions? I tried to put
> > signatures inside. But still not succeed. Could you please kindly
> > give a further explaination on this? Thank you very much for your
> > help.
> >
> > Looking forward to your email.
> >
> > Kind regards,
> > Francisco
> >
>
>
> Copy addresses and emails from any email account to Yahoo! Mail -  
> quick, easy and free. Do it now...
> _______________________________________________
> o-xml mailing list
> o-xml@...
> http://lists.pingdynasty.com/mailman/listinfo/o-xml
Martin Klang | 26 Mar 2007 02:24

ObjectBox v1.1.7 : Spring Integration


Finally in a public release, the new ObjectBox v1.1.7 now offers  
complete Spring 2.0 integration.

As usual you can get the release from the download page [1].

There's a new article [2] in the documentation describing how to  
create and use o:XML beans in Spring. It also has ideas for use  
cases, scenarios where delegating to o:XML beans can make a big  
difference in your application.

enjoy!

/m

[1] http://www.o-xml.org/download/
[2] http://www.o-xml.org/documentation/obox-spring.html

Gmane