[gatein-commits] gatein SVN: r2072 - in portal/trunk: web/portal/src/main/webapp/WEB-INF/classes/locale/portal and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Mar 9 22:17:34 EST 2010


Author: liem_nguyen
Date: 2010-03-09 22:17:33 -0500 (Tue, 09 Mar 2010)
New Revision: 2072

Modified:
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
   portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
GTNPORTAL-850 Should not allow to delete the default portal even to root user

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java	2010-03-10 03:01:58 UTC (rev 2071)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java	2010-03-10 03:17:33 UTC (rev 2072)
@@ -199,9 +199,18 @@
          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())
          {
@@ -284,8 +293,8 @@
 
          UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
          PortalDataMapper.toUIPortal(editPortal, userConfig);
-         uiEditWS.setUIComponent(editPortal);         
-         
+         uiEditWS.setUIComponent(editPortal);
+
          if (uiPortal.getName().equals(editPortal.getName()))
          {
             editPortal.setSelectedNode(uiPortal.getSelectedNode());
@@ -341,7 +350,7 @@
          PageNavigation navi = dataService.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
          //Filter the navigation
          navi = PageNavigationUtils.filterNavigation(navi, context.getRemoteUser(), true);
-         
+
          uicomp.setSelectedNavigation(navi);
          UINavigationNodeSelector selector = naviManager.getChild(UINavigationNodeSelector.class);
          ArrayList<PageNavigation> list = new ArrayList<PageNavigation>();

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties	2010-03-10 03:01:58 UTC (rev 2071)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties	2010-03-10 03:17:33 UTC (rev 2072)
@@ -1339,6 +1339,7 @@
   #		           org.exoplatform.navigation.webui.component.UISiteManagement #
   ############################################################################
   
+UISiteManagement.msg.delete-default-portal=Default portal can not be deleted
 UISiteManagement.msg.Invalid-deletePermission=This user doesn't have permission to delete this portal
 UISiteManagement.msg.portal-not-exist=The portal is not existed or may be deleted 
 UISiteManagement.msg.Invalid-editPermission=This user doesn't have permission to edit this portal



More information about the gatein-commits mailing list