DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
UserACL acl = uiForm.getApplicationComponent(UserACL.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
UIPortalApplication uiPortalApp = (UIPortalApplication) prContext.getUIApplication();
PortalConfig pConfig = dataService.getPortalConfig(uiForm.getPortalOwner());
if (pConfig != null && acl.hasPermission(pConfig)) {
UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
PortalDataMapper.toUIPortal(uiPortal, pConfig);
uiForm.invokeSetBindingBean(uiPortal);
// uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE) {
PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(uiPortal);
dataService.save(portalConfig);
UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
if (prContext.getPortalOwner().equals(uiForm.getPortalOwner())) {
prContext.setUserPortalConfig(service.getUserPortalConfig(uiForm.getPortalOwner(),
prContext.getRemoteUser(), PortalRequestContext.USER_PORTAL_CONTEXT));