PortalRequestContext prContext = Util.getPortalRequestContext();
UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
if (defaultPortalName.equals(portalName))
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.delete-default-portal",
new String[]{defaultPortalName}, ApplicationMessage.WARNING));
return;
}
UserPortalConfig config = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
if (config != null && config.getPortalConfig().isModifiable())
{
service.removeUserPortalConfig(portalName);
}
else if (config != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
new String[]{config.getPortalConfig().getName()}));;
return;
}
else
{
if (uicomp.stillKeptInPageList(portalName))
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
new String[]{portalName}));
}
return;
}
if (config == null && !Util.getUIPortal().getName().equals(portalName))
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
new String[]{portalName}));
return;
}
if (config == null || Util.getUIPortal().getName().equals(portalName))