View Full Version : What is your serverside architecture?
TripleToe
05-10-2004, 01:57 PM
I'm wanting to put Laszlo into action, but I just can't seem to decide on the best backend architecture to feed dynamic XML to my Laszlo frontend.
I'm primarily a J2EE guy so I was thinking about creating a servlet to generate XML from my database, but I might also try using an XML publishing framework like Cocoon. The only problem is that the Cocoon webapp is huge and combined with a Laszlo webapp, the deployment is massive. (too many dependent jars to be deployed!)
So my question is: What are others using to create dynamic XML to feed to their Laszlo apps?
I'm not talking about creating dynamic LZX files, but rather creating dynamic XML datasources so Laszlo can rendering information from a datasource like a MySQL database.
What have you found that works the best?
Any suggestions are MUCH appreciated!
:)
TripleToe
05-11-2004, 07:53 AM
I also wanted to ask if anyone had used JAX binding to produce Laszlo content. I'm curious to know if speed is an issue with this?
Thanks
vfunshteyn
05-17-2004, 04:35 PM
If you are going to use MySQL, it has a built-in XML output feature, whereby it can format results of an SQL query as an XML data structure.
TripleToe
05-18-2004, 06:14 AM
I've managed to integrate Cocoon 2.1.4 for XML publishing and Hibernate as my persistence layer. It actually seems to work pretty well. I like the idea of getting XML data from MySQL directly, but I would still want the data to flow through a servlet rather than directly being retrieved by the Laszlo component. This way I can implement all of my business logic on the middletier and have the front-end be as light as possible.
turgayz
12-06-2004, 09:31 AM
Here is what I am doing: I use Spring framework and Hibernate. After I have the data to be sent to LAszlo view in my servlet(actually a Spring Controller), I use XStream to convert it to XML string.
This worked good until now, when we had this problem that XStream represents repeating nodes in the XML file as "references", like:
<Department>
<description>Engineering</description>
<parentDepartment reference=".."/>
<Department>
I don't know if this representation is good for Laszlo (or XPath?) but the following does not work:
<text name="parentDepartmentDescText" datapath="parentDepartment/description/text()" />
Any ideas?
-Turgay
lzx <-> phpservlet <-> PHP 5 <-> mySQL
but this entails XML generation, compilation then execution.
this paper (http://osteele.com/archives/2004/12/serving-clients) is an interesting read.
sounddesignz
12-07-2004, 03:15 PM
i use the keel framework which supports exposure of controllers/models via axis webservice. keel is designed to support many client technologies (views) in parallel, if wanted.
if you are a j2ee guy, you can probably bear the learning curve. this is no offense, just a warning :)
nils
rollatwork
02-03-2005, 08:03 AM
We have a heavily layered J2EE middle-tier. At the heart is a very rich set of POJO domain objects. Our data layer utilizes DAO pattern and Hibernate. We utilize the SpringFramework and expose our service in EJB and non-EJB implementations.
Our Spring controller serves up XML datasets via XStream to be consumed by our Laszlo presentation-tier.
Our laszlo applications run as standalone web applications or as JSR-168 compliant portlets. We currently deploy only to Liferay.
TripleToe
02-03-2005, 09:21 AM
Originally posted by rollatwork
...We utilize the SpringFramework and expose our service in EJB and non-EJB implementations....
RollatWork: I've search around several times for information on integrating Spring with Laszlo and I've come across your posts many times. I'd be very interested in getting more technical details on how you've managed to get them to work together. Currently I'm using Spring along with its MVC presentation layer to generate XML. When I specify no XSLT stylesheet, it just returns the XML which is consumed by my Laszlo front end. I'm also using JavaRPC to directly call service objects running in Spring. The big puzzle I would like to solve is how to get Spring Injected objects into the Laszlo web session. I would like for anyone who uses my web app to have a session with a servicelocator object that is injected into the session by Spring. Do you have any thoughts on this? Also, any other Spring+Laszlo information you could share would be fantastic. And do you have any 'demos' out there that I could look at to see your results?
Thanks so much!
rollatwork
02-03-2005, 09:35 AM
Hiya TripleToe,
I currently am not using JavaRPC. When I was first turned onto Laszlo it just so happened I was responding to a request for a demo.
Hurriedly, I spent a small amount of time getting Laszlo to talk to my Spring service layer via JavaRPC, but never managed to successfully do so. So, the short answer is no. I don't think I can answer your question.
I'm still interested in doing so, but in hinesight I rather like the separation. Although they currently run in the same web container in the same JVM my client has requirements for datasets being served up from PHP, .NET as well as J2EE middle-tiers. Having said that, I'm very happy with the way our Laszlo presentation-tier is middle-tier agnostic.
The client didn't have any in-house Java expertise either. Having them ramp up on Laszlo syntax was easier since I didn't have to worry about communicating our Java back end and how to properly invoke methods, etc.
I have one application in production for a sports television network and I cannot demo it unfortunatley.
HTH.
TripleToe
02-03-2005, 10:22 AM
Originally posted by rollatwork
...I'm still interested in doing so, but in hinesight I rather like the separation. Although they currently run in the same web container in the same JVM my client has requirements for datasets being served up from PHP, .NET as well as J2EE middle-tiers. Having said that, I'm very happy with the way our Laszlo presentation-tier is middle-tier agnostic.
Yes, I do agree. I like having a generic XML representation of my data which can be displayed using a variety of formats. In fact, this is why I initially used Cocoon for getting my XML. However, Cocoon is quite hefty so you really have to know what you're doing.
I have one application in production for a sports television network and I cannot demo it unfortunatley.
No problem. I completely understand.
FYI: Spring 1.1.4 has a new feature named ServletContextAttributeBeanFactoryBean which seems to solve my problem of getting Spring bean injected into web sessions. If I get it working smoothly, I'll post the code.
:)
ftroop
02-04-2005, 09:00 AM
I'm using Perl DBI. For me this is most excellent.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.