PDA

View Full Version : backend integration


Blackdalhia
03-19-2010, 05:53 PM
Hi


for the time being my OL application communicates with backend with php program : is there any better way to do that ? I mean quicker and simpler ?

d~l
03-20-2010, 01:49 AM
I see from other threads that you are a Quercus user.

So you could try integrating OpenLaszlo + Quercus so that you can run PHP/MySQL from within Tomcat (or caucho resin) server.

In fact I have Quercus deployed as (a) a tomcat webapp and (b) integrated into openlaszlo WEB-INF web.xml. Drupal can run in Quercus.

...

Another option is to use an embedded XML database such as eXist (http://www.exist-db.org/) to run on tomcat.

There is a good tutorial in this forum on using eXist.

search "eXist" and "native XML database".

...

There are other options such as JDBC.

...

I suggest that you also explore haXe and neko.

http://haxe.org/doc/neko/mysql

haXe separately compiled movies can be imported into OpenLaszlo as assets so you could build a number of haXe compiled modules to import into OpenLaszlo to exploit the haXe API.

Much depends on the scale of your application. You give no clues on this.

...

p.s. re: Quercus .. I also would like to see the 'DOMDocument class not recognised' problem resolved. You posted a bug in Quercus forum.

Blackdalhia
03-21-2010, 06:36 AM
Hi

thanks a lot for your answer !

In fact today I ve got quercus and OL as webapps of glassfish and i don't know if that's the best solution (see my other post on instability ...) so I m looking for other solutions. I m not an expert so it takes more time.

Maybe i ll try with tomcat to see if it works better : I need to find a tutorial on how to deploy OL and quercus on tomcat : do you think it will be quicker and more stable than glassfish ?

thanks for the other options, i ll investigate this.

PS : it is solved zith the new version of quercus i need to post my answer on their forum

PPS : now i m struggling with UTF8 character and do not know if that s due to glassfish, mySQL or quercus ...lots of fun ahead :-)

d~l
03-21-2010, 07:55 AM
It's fairly simple deploying openlaszlo on caucho resin server instead of tomcat. Or alternatively deploying quercus on tomcat server.

Just deploy the openlaszlo-4.7.1.war into (for example)
c:\resin-4.0.2\webapps\openlaszlo-4.7.1.war

You can also deploy eXist.war (native XML database) into same webapps.

If you intend running caucho resin on a different port to tomcat (both use 8080 by default) you need to change port preference in resin.xml in c:\resin-4.0.2\conf\resin.xml

<server-default> ..

..

re: integrating OL with Quercus there are some ideas posted here .. integrating openlaszlo and Quercus (http://forum.openlaszlo.org/showthread.php?t=14103) with an example of the "merged" web.xml you need to place in openlaszlo-4.7.1\WEB-INF\web.xml.

Also you need to copy quercus.jar and resin-util.jar (from quercus) into openlaszlo-4.7.1\WEB-INF\lib\ directory.

Then you can either run php scripts or "preprocess" openlaszlo code (*.plz) generated in php.

Search "pre-processing" in openlaszlo docs.

The final extension needed is *.php.lzx (preprocessing also works with *.jsp.lzx if you look at the hello.jsp example in openlaszlo-4.7.1\examples\ folder).

Remember to add the content header to php scripts to deliver XML content (lzx code) back to openlaszlo


<?php

// header for xml output expected by openlaszlo
header("Content-Type: text/xml");

print '<canvas>';
print '<text>Hello Laszlo!</text>';
print '<text>does this hybrid work and compile in openlaszlo?</text>' ;
print '</canvas>';

?>


..

I'll try the new version of quercus to see if the DOMDocument class is recognised.

..

re: character encoding read here .. character encoding in Quercus (http://caucho.com/resin-4.0/doc/quercus.xtp)

..