}
@Override
protected void buildWidgetOutput(IPage page, String[] showletOutput) throws JspException {
HttpServletRequest req = (HttpServletRequest) this.pageContext.getRequest();
RequestContext reqCtx = (RequestContext) req.getAttribute(RequestContext.REQCTX);
try {
IPageUserConfigManager pageUserConfigManager = (IPageUserConfigManager) ApsWebApplicationUtils.getBean(JpmyportalplusSystemConstants.PAGE_USER_CONFIG_MANAGER, pageContext);
CustomPageConfig customPageConfig = null;
UserDetails currentUser = (UserDetails) this.pageContext.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
if (currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) {
customPageConfig = pageUserConfigManager.getGuestPageConfig(page, req);
} else {
PageUserConfigBean userConfigBean = (PageUserConfigBean) req.getSession().getAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_USER_PAGE_CONFIG);
if (null != userConfigBean) {
customPageConfig = userConfigBean.getConfig().get(page.getCode());
}
}
if (null == customPageConfig || customPageConfig.getConfig() == null || !customPageConfig.getPageCode().equals(page.getCode())) {
req.getSession().removeAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_PAGE_CONFIG);
super.buildWidgetOutput(page, showletOutput);
return;
}
req.getSession().setAttribute(JpmyportalplusSystemConstants.SESSIONPARAM_CURRENT_CUSTOM_PAGE_CONFIG, customPageConfig);
Widget[] customShowlets = customPageConfig.getConfig();
Widget[] showletsToRender = pageUserConfigManager.getShowletsToRender(page, customShowlets);
List<IFrameDecoratorContainer> decorators = this.extractDecorators();
BodyContent body = this.pageContext.pushBody();
for (int scan = 0; scan < showletsToRender.length; scan++) {
reqCtx.addExtraParam(SystemConstants.EXTRAPAR_CURRENT_FRAME, new Integer(scan));
body.clearBody();
this.includeWidget(reqCtx, showletsToRender[scan], decorators);
showletOutput[scan] = body.getString();
}
} catch (Throwable t) {