RE: Re: RE: Re: Re: Re: Orbeon Form Builder/Form Runner for a regular web site?

Posted by darrencruse on
URL: https://discuss.orbeon.com/Orbeon-Form-Builder-Form-Runner-for-a-regular-web-site-tp2552615p3001307.html

Hi Stian,

I saw your reply this morning but I wanted to go back and look at my notes from when I tried the separate deployment approach to refresh my memory on the problems I'd had.  I was wondering how you got it to work because I'd seen your exchange with Erik in the other thread and I'd known about not using JSPs - I hadn't I'd only read the xform xml directly from a file like you said.  But it still hadn't worked for me.  Or I should say it hadn't worked for me for anything but the simplest hello world kind of example.

Are you saying you've even gotten it to work with Form Builder created/Form Runner forms?  That would be awesome if so.

OTOH I just noticed someone (I assume Erik) had updated the wiki page at:  xforms-separate-deployment-with-portlets

I hadn't seen that till now I guess I should double check what I'd done against the example code he's got there.  And I guess you're saying this example code matches what you're doing?  I wasn't sure at first reading your description above - but I guess so?

I should confess btw that I'm still pretty new both to XForms and to Portlet programming so maybe I'm not doing something right or not understanding something I need to do - e.g. you mentioned inter-portlet communication I was confused that's not a part of the solution described on the wiki page so I'm not 100% sure it's what you were describing or not...

Also you called out that you were using the "Orbeon xForms processor (e.g. only the standards compliant aspect of Orbeon and not their page flow technology)".

I honestly don't know what that means (I haven't dug deep enough yet to know about their "page flow technology" :).  Does this basically mean you're focusing on simpler hand coded XForms and not trying to use the Form Builder/Form Runner XForms?

Also the wiki page mentions the idea of submitting back to the portlet.  I think maybe I'd overlooked that the first time I'd read that.  Is the idea that we'd write our own portlet method to receive the POSTed xml and store it ourselves rather than like with Form Runner it automatically storing that into eXist?  But that section near the end says "The filter also intercepts action requests. For requests targeted at Orbeon, namely for a form post to /xforms-server-submit [...]" which makes it sound like maybe you can leave the handling to Orbeon still if you want.

Actually I should compliment you that you sound like you've got a handle on this I'm still feeling confused - and a little dumbfounded that you've gotten things to work and that the wiki page now indicates that "it's been tested under LifeRay 6.0.5".  Looking at my notes here's some of what I'd run into when I tried this weekend before last:

-----------------------------

*  Got class loader errors in the provided OrbeonXFormsProxyServlet.  Moved the orbeon-xforms-servlet.jar file into the Tomcat ext (extensions library) folder and out of the WEB-INF/lib for my portlet and they went away.

* Ultimately using complicated forms (like our "auto" form) was giving errors and seemed too ambitious for a first step.  Saved the Orbeon hello world example for a first effort.

* I could see the XForm was being translated to html, but Firefox showed the urls back to get the CSS and javascript files were breaking.  I put everything behind Apache and added proxy pass rules to pass these back to "/orbeon".  

(maybe this was my big mistake?  did this make it so the ProxyServlet missed doing it's magic on these files?  But that doesn't actually modify the contents of javascript files or does it?  But I shouldn't have had to do this right so I guess I had something wrong that these urls weren't automatically being resolved)

* This got the hello world working but even something as simple as the bookshelf tutorial portlet still has problems (it doesn't save and the "Add One" doesn't work).

* Regarding the form runner forms, those don't even get as far as the bookshelf.  They have errors saying there's references to undefined xforms variables e.g. $form-resources" and "$fr-resources".  Apparently these are normally defined outside the form itself, e.g. it appears $form-resources is set to point at the proper language resources (french, english, etc).  

I tried an experiment to set those variables explicitly myself in the form, but that didn't seem to be a good idea it was still giving errors.

-----------------------------
 
Maybe I should give this one more shot looking at the example code on the updated wiki page.  Otherwise Stian if your approach is different than what they've posted there would you consider sharing a stripped down version of the basic approach you've followed?

Thanks a lot for your help/thoughts,

Darren