public void execute(Event<UISiteManagement> event) throws Exception
{
UISiteManagement uicomp = event.getSource();
String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
UserPortalConfigService service = event.getSource().getApplicationComponent(UserPortalConfigService.class);
String defaultPortalName = service.getDefaultPortal();
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()}));;