Problem retrieving the Orbeon form answer

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

Problem retrieving the Orbeon form answer

Loceka
Hello, I've finally managed to integrate an Orbeon form in one of our webapp page, thanks to some java trick that I'll post later but I cannot get that form answer : when I set a in my XForm, it's submission doesn't work in my page. Here's how my webapps are set : - Orbeon is in tomcat webapps dir under "orbeon" directory - my webapp is in tomcat webapps dir under "myapp" directory (for example) Here's what I added to my web.xml file in myapp :
<filter>
	<filter-name>ops-xforms-filter</filter-name>
	<filter-class>org.orbeon.oxf.servlet.OPSXFormsFilter</filter-class>
	<init-param>
		<param-name>oxf.xforms.renderer.context</param-name>
		<param-value>/orbeon</param-value>
	</init-param>
</filter>

<!-- Any web resource under /xforms-jsp is processed by the XForms engine -->
<filter-mapping>
	<filter-name>ops-xforms-filter</filter-name>
	<!--url-pattern>/jsp/site/*</url-pattern-->
	<url-pattern>/xforms-jsp/*</url-pattern>
</filter-mapping>
<!-- This is necessary so that XForms engine resources can be served appropriately -->
<filter-mapping>
	<filter-name>ops-xforms-filter</filter-name>
	<url-pattern>/orbeon/*</url-pattern>
</filter-mapping>
When myapp starts, it loads a jsp file : /jsp/site/index.jsp I've added an orbeon form as an XPage so that it can be accessed from /jsp/site/index.jsp?page=xforms In order to do that, I've written a custom ResponseWrapper from which I can retrieve the response stream (the generated HTML code for the given XForm) :
String ops ="/orbeon";
String srv="/xforms-renderer";
ServletContext opsContext = config.getServletContext().getContext(ops);
if (opsContext == null) throw new RuntimeException("can't find Orbeon context; tomcat /MYWEBAPP webapp is missing <Context crossContext='true' />");
RequestDispatcher dispatcher = opsContext.getRequestDispatcher(srv);
if (dispatcher == null) throw new RuntimeException("can't find Orbeon request dispatcher");

ReadableResponseWrapper wrapper = new ReadableResponseWrapper(response);
dispatcher.forward(request, wrapper);

BufferedReader reader = new BufferedReader( new InputStreamReader ( wrapper.getInputStream() ) );
Thus I can put the generated HTML code in myapp page. The problem, as you may see is that /jsp/site/ isn't filtered by Orbeon (or else it doesn't let me have my site pages displayed) and hence I cannot use any submission (GET/POST/PUT answers) from the generated form, which make them a bit useless, if not completely... However if the form is in a filtered directory, the submission works well but the display lost (which is not acceptable). Of course a way around would be to use iframes but it is not a solution at all as it would be an issue for accessibility. Any idea in how to handle orbeon properly would be welcome... Thanks, Loceka.
Reply | Threaded
Open this post in threaded view
|

Re: Problem retrieving the Orbeon form answer

Loceka
Is there really no way around or don't you know any way to have the submission to work even if there is no filter on it ?

I am a bit desperate there, I have struggled to integrate orbeon forms in our webapp pages, mostly by nosing around on google and on forums though there were not many threads on that very subject and now I can find nothing for that issue.

It was really painful having orbeon to "work" on my webapp and I wouldn't have spent so much time in vain, being so close to the end.

If you don't know any answer, is there any other orbeon support forum/chat/newsgroup ?

Regards,
Loceka.