Posted by
darrencruse on
URL: https://discuss.orbeon.com/Orbeon-Form-Builder-Form-Runner-for-a-regular-web-site-tp2552615p2991841.html
Tried some things this past weekend including using the LifeRay Web Proxy with Orbeon as well as writing my own portlet to use with the "separate deployment" approach. Had various degrees of success but nothing 100% so this morning I went back to try the simple Orbeon bundled portlet approach once again with the latest nightly build (noticed there's been a change to the orbeon servlet filter). But I'm getting exactly the same exceptions as before as reported by Stian above. Where a null pointer exception results from the calls to setContentType getting passed null apparently because getContentType is returning null in this code:
public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
try {
final Portlet2ExternalContext.BufferedResponse bufferedResponse
= (Portlet2ExternalContext.BufferedResponse) request.getPortletSession().getAttribute(OXF_PORTLET_OUTPUT);
final Map bufferedResponseParameters
= (Map) request.getPortletSession().getAttribute(OXF_PORTLET_OUTPUT_PARAMS);
// NOTE: Compare for deep equality as it seems that portlet containers may copy/update the parameter Map
if (bufferedResponse != null && deepEquals(request.getParameterMap(), bufferedResponseParameters)) {
// The result of an action with the current parameters was a
// stream that we cached. Replay that stream and replace URLs.
// CHECK: what about mode / state? If they change, we ignore them totally.
response.setContentType(bufferedResponse.getContentType()); response.setTitle(bufferedResponse.getTitle() != null ? bufferedResponse.getTitle() : getTitle(request));
bufferedResponse.write(response);
} else {
final // Call service
PipelineContext pipelineContext = new PipelineContext();
pipelineContext.setAttribute(PORTLET_CONFIG, getPortletConfig());
final ExternalContext externalContext = new Portlet2ExternalContext(processorService, pipelineContext, getPortletContext(), contextInitParameters, request, response);
processorService.service(externalContext, pipelineContext);
// TEMP: The response is also buffered, because our
// rewriting algorithm only operates on Strings for now.
final Portlet2ExternalContext.DirectResponseTemp directResponse
= (Portlet2ExternalContext.DirectResponseTemp) externalContext.getResponse();
response.setContentType(directResponse.getContentType()); response.setTitle(directResponse.getTitle() != null ? directResponse.getTitle() : getTitle(request));
directResponse.write(response);
}
} catch (Exception e) {
throw new PortletException(OXFException.getRootThrowable(e));
}
}
Maybe it's wishful thinking but I remembered reading setContentType is no longer required under the JSR 286 portlet standard,
as noted in this articleSo I actually tried to patch my orbeon.jar with a version of Orbeon2Portlet.java where I'd commented the two lines I bolded above. Unfortunately I think I goofed something up in building my patch though (maybe I used the wrong version of java?) - as the portlet would not even deploy when I did that (or do you think me removing those lines really did break it that badly?).
I don't know Erik maybe you're thinking these exceptions are just a symptom of that other problem you were talking about with getting content i.e. that bug you said you reported on the LifeRay forums...