*/
private UIPage getUIPage(UserNode pageNode, UIPortal uiPortal, WebuiRequestContext context) throws Exception {
PageContext pageContext = null;
String pageReference = null;
ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
UserPortalConfigService userPortalConfigService = (UserPortalConfigService) appContainer
.getComponentInstanceOfType(UserPortalConfigService.class);
if (pageNode != null && pageNode.getPageRef() != null) {
pageReference = pageNode.getPageRef().format();
pageContext = userPortalConfigService.getPage(pageNode.getPageRef());
}
// The page has been deleted
if (pageContext == null) {
// Clear the UIPage from cache in UIPortal
uiPortal.clearUIPage(pageReference);
return null;
}
UIPage uiPage = uiPortal.getUIPage(pageReference);
if (uiPage != null) {
return uiPage;
}
try {
UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
uiPage = clazz.createUIPage(context);
Page page = userPortalConfigService.getDataStorage().getPage(pageReference);
pageContext.update(page);
PortalDataMapper.toUIPage(uiPage, page);
uiPortal.setUIPage(pageReference, uiPage);
} catch (Exception e) {
if (log.isDebugEnabled()) {