Processors and database

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Processors and database

hodack
Hi,

I'm using a mysql database to store different kind of data such as
dates, int, string...
I've been using the SQL processor to perform simple queries such as
insert, update...
Now I'm looking for the best solution to retrieve some of those datas
and process them (such as complex dates calculations), and then display
the result.
Basically, Java would be a good solution to perform those complex
operations, since it might be limited only in xml or sql.

I've been trying the Java processor, but it deals in input and ouput
with xml files, which is not, in my opinion not the best way to maintain
code/optimize effort because of having an xml input containing data,
parse then process them, then create an xml ouput to have it rendered on
a web page.

I've also been looking at the Delegation processor to call a JavaBean
(which would be a simple java class in my case) but in the doc :
http://www.orbeon.com/ops/doc/processors-delegation#d201e173
There are some limitations : only string and double can be passed as
parameters in the method. So that would imply more effort just to
process with dates for example.
I wonder if this issue has changed since version 3.5 or is subject to
change.

Any other advices or suggestions about those issues are welcome, since
it might become very complex to deal with xml and mapping them to
external components such as databases.

Thanks.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Processors and database

Alessandro Vernet
Administrator
On 8/7/07, Kim-Vân Ho-Dac <[hidden email]> wrote:
> I've been using the SQL processor to perform simple queries such as
> insert, update...
> Now I'm looking for the best solution to retrieve some of those datas
> and process them (such as complex dates calculations), and then display
> the result.
> Basically, Java would be a good solution to perform those complex
> operations, since it might be limited only in xml or sql.

I used XSLT for this in most of the cases I encountered. Whether you
want to use XSLT or Java depends on the your level of familiarity with
XSLT and Java, how complex the calculations are, and if you already
have existing code you want to reuse in one of the two languages.

> I've also been looking at the Delegation processor to call a JavaBean
> (which would be a simple java class in my case) but in the doc :
> http://www.orbeon.com/ops/doc/processors-delegation#d201e173
> There are some limitations : only string and double can be passed as
> parameters in the method. So that would imply more effort just to
> process with dates for example.
> I wonder if this issue has changed since version 3.5 or is subject to
> change.

I wouldn't use the Delegation processor for this. We are also not
planning to enhance the Delegation processor in the short term. It
seems that calling web services is not better done from XForms, and
using Java with the Java processor. So I would stick with either Java
(through the Java processor), or XSLT. A way which is in the middle is
to implement computations in Java in static methods and call those
methods from XSLT. This way you keep XML handling in XSLT, and the
computation logic in Java. See:

http://www.saxonica.com/documentation/extensibility/functions/staticmethods.html

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws