summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-01-22 09:35:20 (EST)
committerSven Rottstock2013-01-22 09:35:20 (EST)
commit5e2fecee9d0eef27f94dcd253c20669e33227bcb (patch)
treeaa9526b00d5a82a0302087c1bdf4b13d8eae389e
parent194a70e3617867a85a477f0dfaac79083ed13cdd (diff)
downloadorg.eclipse.stardust.ui.web-5e2fecee9d0eef27f94dcd253c20669e33227bcb.zip
org.eclipse.stardust.ui.web-5e2fecee9d0eef27f94dcd253c20669e33227bcb.tar.gz
org.eclipse.stardust.ui.web-5e2fecee9d0eef27f94dcd253c20669e33227bcb.tar.bz2
Jira-ID: CRNT-27174
Added UserDetailsPolicy while retrieving users using UserQuery.findAll() and UserQuery.findActive() git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@62298 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/UserManagementBean.java12
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java4
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/jsf/UserItem.java5
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java9
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java4
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java8
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/CaseDelegateProvider.java8
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/DefaultDelegatesProvider.java8
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/ParticipantsDataProvider.java8
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java26
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/chat/ChatViewBean.java7
11 files changed, 90 insertions, 9 deletions
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/UserManagementBean.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/UserManagementBean.java
index 8f4b9e7..4d746b8 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/UserManagementBean.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/UserManagementBean.java
@@ -24,6 +24,7 @@ import org.eclipse.stardust.common.error.AccessForbiddenException;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
import org.eclipse.stardust.engine.api.dto.UserDetails;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
import org.eclipse.stardust.engine.api.query.ActivityInstanceQuery;
import org.eclipse.stardust.engine.api.query.ActivityInstances;
import org.eclipse.stardust.engine.api.query.FilterAndTerm;
@@ -32,6 +33,7 @@ import org.eclipse.stardust.engine.api.query.FilterTerm;
import org.eclipse.stardust.engine.api.query.PerformingUserFilter;
import org.eclipse.stardust.engine.api.query.Query;
import org.eclipse.stardust.engine.api.query.QueryResult;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
import org.eclipse.stardust.engine.api.runtime.QueryService;
@@ -44,22 +46,22 @@ import org.eclipse.stardust.ui.web.admin.common.configuration.UserPreferencesEnt
import org.eclipse.stardust.ui.web.admin.messages.AdminMessagesPropertiesBean;
import org.eclipse.stardust.ui.web.common.PopupUIComponentBean;
import org.eclipse.stardust.ui.web.common.column.ColumnPreference;
+import org.eclipse.stardust.ui.web.common.column.ColumnPreference.ColumnDataType;
import org.eclipse.stardust.ui.web.common.column.DefaultColumnModel;
import org.eclipse.stardust.ui.web.common.column.IColumnModel;
-import org.eclipse.stardust.ui.web.common.column.ColumnPreference.ColumnDataType;
import org.eclipse.stardust.ui.web.common.columnSelector.TableColumnSelectorPopup;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog;
-import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialogHandler;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogActionType;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogContentType;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogStyle;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogType;
+import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialogHandler;
import org.eclipse.stardust.ui.web.common.filter.ITableDataFilter;
+import org.eclipse.stardust.ui.web.common.filter.ITableDataFilter.DataType;
import org.eclipse.stardust.ui.web.common.filter.ITableDataFilterBetween;
import org.eclipse.stardust.ui.web.common.filter.TableDataFilterDate;
import org.eclipse.stardust.ui.web.common.filter.TableDataFilterPopup;
import org.eclipse.stardust.ui.web.common.filter.TableDataFilterSearch;
-import org.eclipse.stardust.ui.web.common.filter.ITableDataFilter.DataType;
import org.eclipse.stardust.ui.web.common.table.DataTableRowSelector;
import org.eclipse.stardust.ui.web.common.table.DataTableSortModel;
import org.eclipse.stardust.ui.web.common.table.IUserObjectBuilder;
@@ -661,6 +663,10 @@ public class UserManagementBean extends PopupUIComponentBean
{
UserQuery query = UserQuery.findAll();
applyTableLevelFilters(query);
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Full);
+ userPolicy
+ .setPreferenceModules(org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
return query;
}
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java
index ea2428d..df08507 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java
@@ -562,6 +562,10 @@ public class WorkflowFacade implements Resetable
private void setFullUserDetails(List<UserItem> userItems)
{
UserQuery query = UserQuery.findAll();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Full);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
+
Iterator uIter = userItems.iterator();
FilterOrTerm filter = query.getFilter().addOrTerm();
Map lookupMap = new HashMap();
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/jsf/UserItem.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/jsf/UserItem.java
index 743cf3a..316a952 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/jsf/UserItem.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/jsf/UserItem.java
@@ -17,9 +17,11 @@ import java.io.Serializable;
import java.util.Iterator;
import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.User;
import org.eclipse.stardust.ui.web.bcc.WorkflowFacade;
+import org.eclipse.stardust.ui.web.bcc.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.utils.UserUtils;
@@ -200,6 +202,9 @@ public class UserItem implements Serializable
{
WorkflowFacade facade = WorkflowFacade.getWorkflowFacade();
UserQuery query = UserQuery.findAll();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Full);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
query.getFilter().add(UserQuery.OID.isEqual(user.getOID()));
Iterator iter = facade.getAllUsers(query).iterator();
if(iter.hasNext())
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java
index 2cbde2c..b50c3a1 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java
@@ -343,7 +343,9 @@ public class RoleManagerDetailBean extends UIComponentBean
{
UserQuery query = UserQuery.findAll();
query.getFilter().add(ParticipantAssociationFilter.forParticipant(roleItem.getRole(), false));
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
assignedUserList = facade.getAllUsersAsUserItems(query);
return filterUserList(assignedUserList, onlyLoggedInUserVisibleOnAssigned);
}
@@ -378,7 +380,10 @@ public class RoleManagerDetailBean extends UIComponentBean
filter.add(UserQuery.OID.notEqual(userItem.getUser().getOID()));
}
}
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
+
return filterUserList(facade.getAllUsersAsUserItems(query), onlyLoggedInUserVisibleOnAssignable);
}
catch (InvalidServiceException e)
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java
index 73d6ed7..c4314d4 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java
@@ -28,6 +28,7 @@ import org.eclipse.stardust.engine.api.query.PerformingUserFilter;
import org.eclipse.stardust.engine.api.query.Query;
import org.eclipse.stardust.engine.api.query.QueryResult;
import org.eclipse.stardust.engine.api.query.RawQueryResult;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
import org.eclipse.stardust.engine.api.runtime.ActivityInstanceState;
@@ -327,6 +328,9 @@ public class UserManagerDetailBean extends UIComponentBean
if (userItem != null && !UserDetailsLevel.Full.equals(userItem.getUser().getDetailsLevel()))
{
UserQuery query = UserQuery.findAll();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Full);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
query.getFilter().add(UserQuery.OID.isEqual(userItem.getUser().getOID()));
try
{
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
index f012981..d988df7 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/common/PPUtils.java
@@ -28,6 +28,7 @@ import org.eclipse.stardust.common.error.InternalException;
import org.eclipse.stardust.common.error.PublicException;
import org.eclipse.stardust.common.log.LogManager;
import org.eclipse.stardust.common.log.Logger;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
import org.eclipse.stardust.engine.api.model.Activity;
import org.eclipse.stardust.engine.api.model.Participant;
import org.eclipse.stardust.engine.api.model.ParticipantInfo;
@@ -44,6 +45,7 @@ import org.eclipse.stardust.engine.api.query.PerformingParticipantFilter;
import org.eclipse.stardust.engine.api.query.PerformingUserFilter;
import org.eclipse.stardust.engine.api.query.Query;
import org.eclipse.stardust.engine.api.query.SubsetPolicy;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.query.Users;
import org.eclipse.stardust.engine.api.query.Worklist;
@@ -59,6 +61,7 @@ import org.eclipse.stardust.ui.event.ActivityEvent;
import org.eclipse.stardust.ui.event.WorklistSelectionEvent;
import org.eclipse.stardust.ui.web.common.app.PortalApplication;
import org.eclipse.stardust.ui.web.common.util.MessagePropertiesBean;
+import org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.common.spi.IFilterProvider;
import org.eclipse.stardust.ui.web.viewscommon.utils.ClientContextBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.ExceptionHandler;
@@ -111,6 +114,11 @@ public class PPUtils
public static Users getUsers_anyLike(String firstName, String lastName)
{
UserQuery query = UserQuery.findAll();
+ String[] prefModules = {UserPreferencesEntries.M_ADMIN_PORTAL};
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(prefModules);
+ query.setPolicy(userPolicy);
+
FilterAndTerm and = query.getFilter().addAndTerm();
if (!isEmpty(firstName))
{
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/CaseDelegateProvider.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/CaseDelegateProvider.java
index 8a13abf..6961b6b 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/CaseDelegateProvider.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/CaseDelegateProvider.java
@@ -11,6 +11,7 @@ import java.util.Map;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
import org.eclipse.stardust.engine.api.model.ModelParticipantInfo;
import org.eclipse.stardust.engine.api.model.Organization;
import org.eclipse.stardust.engine.api.model.OrganizationInfo;
@@ -20,11 +21,13 @@ import org.eclipse.stardust.engine.api.model.PredefinedConstants;
import org.eclipse.stardust.engine.api.model.Role;
import org.eclipse.stardust.engine.api.model.RoleInfo;
import org.eclipse.stardust.engine.api.query.FilterOrTerm;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
import org.eclipse.stardust.engine.api.runtime.Department;
import org.eclipse.stardust.engine.api.runtime.DeployedModel;
import org.eclipse.stardust.engine.api.runtime.PerformerType;
+import org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.utils.ModelCache;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.RegExUtils;
@@ -84,7 +87,10 @@ public class CaseDelegateProvider implements IDelegatesProvider, Serializable
if (options.getPerformerTypes().contains(USER_TYPE))
{
UserQuery userQuery = UserQuery.findActive();
-
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL, UserPreferencesEntries.M_VIEWS_COMMON);
+ userQuery.setPolicy(userPolicy);
+
// filter for user names if selected
if (!StringUtils.isEmpty(options.getNameFilter()))
{
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/DefaultDelegatesProvider.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/DefaultDelegatesProvider.java
index eff49f7..89d0d89 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/DefaultDelegatesProvider.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/dialogs/DefaultDelegatesProvider.java
@@ -21,6 +21,7 @@ import java.util.Set;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.CompareHelper;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
import org.eclipse.stardust.engine.api.model.ConditionalPerformer;
import org.eclipse.stardust.engine.api.model.ModelParticipant;
import org.eclipse.stardust.engine.api.model.ModelParticipantInfo;
@@ -35,6 +36,7 @@ import org.eclipse.stardust.engine.api.query.FilterAndTerm;
import org.eclipse.stardust.engine.api.query.FilterOrTerm;
import org.eclipse.stardust.engine.api.query.FilterTerm;
import org.eclipse.stardust.engine.api.query.ParticipantAssociationFilter;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
import org.eclipse.stardust.engine.api.runtime.ActivityInstanceState;
@@ -46,6 +48,7 @@ import org.eclipse.stardust.engine.api.runtime.PerformerType;
import org.eclipse.stardust.engine.api.runtime.QueryService;
import org.eclipse.stardust.engine.api.runtime.QualityAssuranceUtils.QualityAssuranceState;
import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
+import org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.utils.ModelCache;
import org.eclipse.stardust.ui.web.viewscommon.utils.ModelUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
@@ -94,6 +97,10 @@ public class DefaultDelegatesProvider implements IDelegatesProvider, Serializabl
UserQuery userQuery = (options.isStrictSearch()) ? buildStrictUserQuery(activityInstances) : UserQuery
.findActive();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Full);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL, UserPreferencesEntries.M_VIEWS_COMMON);
+ userQuery.setPolicy(userPolicy);
+
// filter for user names if selected
if (!StringUtils.isEmpty(options.getNameFilter()))
{
@@ -301,7 +308,6 @@ public class DefaultDelegatesProvider implements IDelegatesProvider, Serializabl
private static UserQuery buildStrictUserQuery(List<ActivityInstance> ais)
{
UserQuery userQuery = UserQuery.findActive();
-
FilterAndTerm userAndTerm = userQuery.getFilter();
if (!CollectionUtils.isEmpty(ais))
{
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/ParticipantsDataProvider.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/ParticipantsDataProvider.java
index 9e67499..0c8906e 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/ParticipantsDataProvider.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/ParticipantsDataProvider.java
@@ -12,7 +12,6 @@ package org.eclipse.stardust.ui.web.viewscommon.user;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -20,15 +19,18 @@ import javax.faces.model.SelectItem;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
import org.eclipse.stardust.engine.api.model.Organization;
import org.eclipse.stardust.engine.api.model.Participant;
import org.eclipse.stardust.engine.api.query.FilterOrTerm;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.query.Users;
import org.eclipse.stardust.engine.api.runtime.Department;
import org.eclipse.stardust.engine.api.runtime.DepartmentInfo;
import org.eclipse.stardust.engine.api.runtime.QueryService;
import org.eclipse.stardust.ui.web.common.autocomplete.IAutocompleteDataProvider;
+import org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.utils.ServiceFactoryUtils;
@@ -53,6 +55,10 @@ public class ParticipantsDataProvider implements IAutocompleteDataProvider
QueryService service = ServiceFactoryUtils.getQueryService();
UserQuery userQuery = UserQuery.findActive();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL, UserPreferencesEntries.M_VIEWS_COMMON);
+ userQuery.setPolicy(userPolicy);
+
if (!StringUtils.isEmpty(searchValue))
{
String name = searchValue.replaceAll("\\*", "%") + "%";
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java
index a01373c..8a1594e 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java
@@ -40,6 +40,7 @@ import org.eclipse.stardust.engine.core.preferences.PreferenceScope;
import org.eclipse.stardust.engine.core.preferences.Preferences;
import org.eclipse.stardust.engine.core.runtime.beans.removethis.SecurityProperties;
import org.eclipse.stardust.ui.web.common.PopupUIComponentBean;
+import org.eclipse.stardust.ui.web.common.configuration.UserPreferencesHelper;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogActionType;
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogContentType;
@@ -75,6 +76,7 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
{
private static final long serialVersionUID = 1L;
private static final String BEAN_NAME = "userProfileBean";
+ private static final String PREFERENCE_ID = "preference";
private static enum OperationType {
MODIFY_PROFILE_CONFIGURATION, CREATE_USER, MODIFY_USER, COPY_USER
}
@@ -343,6 +345,10 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
validTo = user.getValidTo();
description = user.getDescription();
qaOverride = user.getQualityAssuranceProbability();
+ if (null != user.getProperty(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID))
+ {
+ initUserDisplayPreference();
+ }
if (isModifyProfileConfiguration())
{
myPicturePreference = new MyPicturePreferenceBean(user);
@@ -351,6 +357,25 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
initDisplayFormats();
}
+
+ /**
+ * Read the user display format preference
+ */
+ private void initUserDisplayPreference()
+ {
+ Serializable value = null;
+ QueryService queryService = SessionContext.findSessionContext().getServiceFactory().getQueryService();
+ List<Preferences> prefs = queryService.getAllPreferences(PreferenceQuery.findPreferencesForUsers(user.getRealm()
+ .getId(), user.getId(), UserPreferencesEntries.M_ADMIN_PORTAL, PREFERENCE_ID));
+ for (Preferences userPref : prefs)
+ {
+ value = userPref.getPreferences().get(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID);
+ }
+ if (value != null)
+ {
+ user.setProperty(UserUtils.USER_NAME_DISPLAY_FORMAT_PREF_ID, value);
+ }
+ }
/**
* sets Default realm id
@@ -834,7 +859,6 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
*/
private void updateUserDisplayFormatProperty(User userToModify)
{
- final String PREFERENCE_ID = "preference";
QueryService qService = SessionContext.findSessionContext().getServiceFactory().getQueryService();
List<Preferences> prefs = qService.getAllPreferences(PreferenceQuery.findPreferencesForUsers(userToModify
.getRealm().getId(), userToModify.getId(), UserPreferencesEntries.M_ADMIN_PORTAL, PREFERENCE_ID));
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/chat/ChatViewBean.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/chat/ChatViewBean.java
index 060d5fb..a7b5519 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/chat/ChatViewBean.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/views/chat/ChatViewBean.java
@@ -18,6 +18,8 @@ import javax.faces.event.ActionEvent;
import javax.swing.tree.DefaultMutableTreeNode;
import org.eclipse.stardust.common.StringUtils;
+import org.eclipse.stardust.engine.api.dto.UserDetailsLevel;
+import org.eclipse.stardust.engine.api.query.UserDetailsPolicy;
import org.eclipse.stardust.engine.api.query.UserQuery;
import org.eclipse.stardust.engine.api.runtime.Document;
import org.eclipse.stardust.engine.api.runtime.ProcessInstance;
@@ -31,6 +33,7 @@ import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogConte
import org.eclipse.stardust.ui.web.common.dialogs.ConfirmationDialog.DialogStyle;
import org.eclipse.stardust.ui.web.common.event.ViewEvent;
import org.eclipse.stardust.ui.web.common.event.ViewEventHandler;
+import org.eclipse.stardust.ui.web.viewscommon.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.viewscommon.docmgmt.DocumentViewUtil;
import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.services.ContextPortalServices;
@@ -113,6 +116,10 @@ public class ChatViewBean extends UIComponentBean implements ViewEventHandler, C
searchResult = new ArrayList<User>();
userSearchKey = userSearchKey.toLowerCase();
UserQuery userQuery = UserQuery.findActive();
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL, UserPreferencesEntries.M_VIEWS_COMMON);
+ userQuery.setPolicy(userPolicy);
+
List<User> allUserList = ContextPortalServices.getQueryService().getAllUsers(userQuery);
for (User user : allUserList)