[gatein-commits] gatein SVN: r4638 - in portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main: webapp/WEB-INF and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Oct 12 08:03:16 EDT 2010


Author: phuong_vu
Date: 2010-10-12 08:03:15 -0400 (Tue, 12 Oct 2010)
New Revision: 4638

Modified:
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
   portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
GTNPORTAL-1517 Always keep old search result in after search user in User management

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java	2010-10-12 12:03:15 UTC (rev 4638)
@@ -110,26 +110,23 @@
       WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
       UIApplication uiApp = context.getUIApplication();
       String username = getUIStringInput(USERNAME).getValue();
-      User user = service.getUserHandler().findUserByName(username);
-      String oldEmail = user.getEmail();
+      User user = service.getUserHandler().findUserByName(username);      
       if (user == null)
       {
          uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null, ApplicationMessage.WARNING));
          UIUserInfo userInfo = getParent();
          if (userInfo != null)
          {
-            UIUserManagement userManagement = userInfo.getParent();
-            UIListUsers listUser = userManagement.getChild(UIListUsers.class);
             UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
             UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
             userInfo.setRenderSibling(UIListUsers.class);
-            listUser.search(new Query());
             accountInput.reset();
             userProfile.reset();
             context.setProcessRender(true);
          }
          return false;
       }
+      String oldEmail = user.getEmail();
       invokeSetBindingField(user);
       if (isChangePassword())
       {

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java	2010-10-12 12:03:15 UTC (rev 4638)
@@ -91,7 +91,6 @@
       grid_.configure(USER_NAME, USER_BEAN_FIELD, USER_ACTION);
       grid_.getUIPageIterator().setId("UIListUsersIterator");
       grid_.getUIPageIterator().setParent(this);
-      search(new Query());
    }
 
    /**
@@ -117,18 +116,12 @@
    public String getUserSelected()
    {
       return userSelected_;
-   }
+   }      
 
    public void search(Query query) throws Exception
    {
       lastQuery_ = query;
-      grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));
-      UIPageIterator pageIterator = grid_.getUIPageIterator();
-      if (pageIterator.getAvailable() == 0)
-      {
-         UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
-         uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
-      }
+      grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));      
    }
 
    public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
@@ -137,29 +130,33 @@
       UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
       UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
       String name = input.getValue();
-      if (name == null || name.equals(""))
+      if (name != null && !name.equals(""))
       {
-         search(new Query());
-         return;
-      }
-      if (name.indexOf("*") < 0)
+         if (name.indexOf("*") < 0)
+         {
+            if (name.charAt(0) != '*')
+               name = "*" + name;
+            if (name.charAt(name.length() - 1) != '*')
+               name += "*";
+         }
+         name = name.replace('?', '_');
+         String selectBoxValue = select.getValue();
+         if (selectBoxValue.equals(USER_NAME))
+            query.setUserName(name);
+         if (selectBoxValue.equals(LAST_NAME))
+            query.setLastName(name);
+         if (selectBoxValue.equals(FIRST_NAME))
+            query.setFirstName(name);
+         if (selectBoxValue.equals(EMAIL))
+            query.setEmail(name);                 
+      }      
+      search(query);
+      
+      if (getChild(UIGrid.class).getUIPageIterator().getAvailable() == 0)
       {
-         if (name.charAt(0) != '*')
-            name = "*" + name;
-         if (name.charAt(name.length() - 1) != '*')
-            name += "*";
+         UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+         uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
       }
-      name = name.replace('?', '_');
-      String selectBoxValue = select.getValue();
-      if (selectBoxValue.equals(USER_NAME))
-         query.setUserName(name);
-      if (selectBoxValue.equals(LAST_NAME))
-         query.setLastName(name);
-      if (selectBoxValue.equals(FIRST_NAME))
-         query.setFirstName(name);
-      if (selectBoxValue.equals(EMAIL))
-         query.setEmail(name);
-      search(query);
    }
 
    @SuppressWarnings("unused")
@@ -176,7 +173,9 @@
          OrganizationService service = uiListUsers.getApplicationComponent(OrganizationService.class);
          if (service.getUserHandler().findUserByName(username) == null)
          {
-            uiListUsers.search(new Query());
+            UIApplication uiApplication = event.getRequestContext().getUIApplication();
+            uiApplication.addMessage(new ApplicationMessage("UIListUsers.msg.user-is-deleted", 
+               null, ApplicationMessage.WARNING));
             return;
          }
          uiListUsers.setRendered(false);

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java	2010-10-12 12:03:15 UTC (rev 4638)
@@ -70,8 +70,10 @@
    {
       public void execute(Event<UIOrganizationPortlet> event) throws Exception
       {
-         UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
-         uiListUsers.search(new Query());
+         //Actually we don't need to do anything here 
+         //UIListUsers will have the lasteast data in it's processRender method
+//         UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
+//         uiListUsers.search(new Query());
       }
    }
 }
\ No newline at end of file

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java	2010-10-12 12:03:15 UTC (rev 4638)
@@ -143,12 +143,9 @@
             Util.getPortalRequestContext().setFullRender(true);
          }
          
-         UIUserManagement userManagement = uiUserInfo.getParent();
-         UIListUsers listUser = userManagement.getChild(UIListUsers.class);
          UIAccountEditInputSet accountInput = uiUserInfo.getChild(UIAccountEditInputSet.class);
          UIUserProfileInputSet userProfile = uiUserInfo.getChild(UIUserProfileInputSet.class);
          uiUserInfo.setRenderSibling(UIListUsers.class);
-         listUser.search(new Query());
          accountInput.reset();
          userProfile.reset();
          event.getRequestContext().setProcessRender(true);
@@ -160,12 +157,9 @@
       public void execute(Event<UIUserInfo> event) throws Exception
       {
          UIUserInfo userInfo = event.getSource();
-         UIUserManagement userManagement = userInfo.getParent();
-         UIListUsers listUser = userManagement.getChild(UIListUsers.class);
          UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
          UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
          userInfo.setRenderSibling(UIListUsers.class);
-         listUser.search(new Query());
          accountInput.reset();
          userProfile.reset();
          event.getRequestContext().setProcessRender(true);

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties	2010-10-12 12:03:15 UTC (rev 4638)
@@ -79,7 +79,8 @@
 UIListUsers.label.option.lastName=#{word.lastName}
 UIListUsers.label.option.email=#{word.email}
 UIListUsers.msg.DeleteSuperUser={0} is Super User, it can not be deleted
-UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.msg.user-is-deleted=This user may be deleted.
 
 UIListMembershipType.deleteMemberShip=Are you sure you want to delete this membership?
 

Modified: portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml	2010-10-12 10:14:07 UTC (rev 4637)
+++ portal/branches/branch-GTNPORTAL-1537/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml	2010-10-12 12:03:15 UTC (rev 4638)
@@ -79,6 +79,9 @@
          <short-title>Account Portlet</short-title>
          <keywords>Administration</keywords>
       </portlet-info>
+      <supported-publishing-event>
+      	<name>NewAccountAdded</name>
+      </supported-publishing-event>
    </portlet>
 
    <portlet>



More information about the gatein-commits mailing list