Author: mposolda
Date: 2012-02-14 08:18:59 -0500 (Tue, 14 Feb 2012)
New Revision: 8425
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
Log:
JBEPP-1401 Fixing bug with "no results found" popup, which can sometimes be
shown even if results exist.
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2012-02-14
13:18:59 UTC (rev 8425)
@@ -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:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java 2012-02-14
13:18:59 UTC (rev 8425)
@@ -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 = name.trim()).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:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java 2012-02-14
13:18:59 UTC (rev 8425)
@@ -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:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2012-02-14
13:18:59 UTC (rev 8425)
@@ -143,12 +143,9 @@
Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(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:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2012-02-14
13:18:59 UTC (rev 8425)
@@ -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:
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2012-02-13
21:48:05 UTC (rev 8424)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2012-02-14
13:18:59 UTC (rev 8425)
@@ -80,6 +80,9 @@
<short-title>Account Portlet</short-title>
<keywords>Administration</keywords>
</portlet-info>
+ <supported-publishing-event>
+ <name>NewAccountAdded</name>
+ </supported-publishing-event>
</portlet>
<portlet>