renderInvocation.setMode(Mode.create(PortletMode.EDIT.toString()));
renderInvocation.setWindowState(org.gatein.pc.api.WindowState.create(uiPortlet_.getCurrentWindowState()
.toString()));
PortletInvocationResponse portletResponse = uiPortlet_.invoke(renderInvocation);
String content;
if (portletResponse instanceof FragmentResponse)
{
FragmentResponse fragmentResponse = (FragmentResponse)portletResponse;
content = fragmentResponse.getContent();
}
else
{
PortletContainerException pcException;
if (portletResponse instanceof ErrorResponse)
{
ErrorResponse errorResponse = (ErrorResponse)portletResponse;
pcException = new PortletContainerException(errorResponse.getMessage(), errorResponse.getCause());
}
else
{
pcException =
new PortletContainerException("Unknown invocation response type [" + portletResponse.getClass()
+ "]. Expected a FragmentResponse or an ErrorResponse");
}
PortletExceptionHandleService portletExceptionService =
(PortletExceptionHandleService)uiPortlet_.getApplicationComponent(PortletExceptionHandleService.class);