String remoteUser = prContext.getRemoteUser();
String portalName = prContext.getPortalOwner();
PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(editPortal);
DataStorage dataStorage = getApplicationComponent(DataStorage.class);
UserACL acl = getApplicationComponent(UserACL.class);
if (!isPortalExist(editPortal)) {
return;
}
SkinService skinService = getApplicationComponent(SkinService.class);
skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
try {
dataStorage.save(portalConfig);
} catch (StaleModelException ex) {
// Temporary solution for concurrency-related issue. The StaleModelException should be
// caught in the ApplicationLifecycle
rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
}
prContext.getUserPortalConfig().setPortalConfig(portalConfig);
PortalConfig pConfig = dataStorage.getPortalConfig(portalName);
if (pConfig != null) {
editPortal.setModifiable(acl.hasEditPermission(pConfig));
} else {
editPortal.setModifiable(false);
}
LocaleConfigService localeConfigService = uiPortalApp.getApplicationComponent(LocaleConfigService.class);
LocaleConfig localeConfig = localeConfigService.getLocaleConfig(portalConfig.getLocale());