summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-12-27 01:08:24 (EST)
committer Stephan Born2013-01-25 12:39:46 (EST)
commit54f131f7b86d1f932184c73fe5488c7283a1ab53 (patch)
tree9e71695929faeb8224fd9ad1b9e6ce19432f7263
parentf9bd764773eec09da43b49c055dee7cc0a584581 (diff)
downloadorg.eclipse.stardust.ui.web-54f131f7b86d1f932184c73fe5488c7283a1ab53.zip
org.eclipse.stardust.ui.web-54f131f7b86d1f932184c73fe5488c7283a1ab53.tar.gz
org.eclipse.stardust.ui.web-54f131f7b86d1f932184c73fe5488c7283a1ab53.tar.bz2
Jira-ID: CRNT-27372
Used UserDetailsPolicy.setPreferenceModules wherever UserDetailsPolicy.Core is used to retrieve UserPreference in BCC and views-common project. Added M_ADMIN_PORTAL constant in UserPreferencesEntries.java in BCC project. git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@61705 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/WorkflowFacade.java5
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/common/configuration/UserPreferencesEntries.java3
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CompletedActivitiesBean.java5
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/LoginTimeBean.java5
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PerformanceTeamLeaderBean.java4
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PostponedActivitiesBean.java5
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/ProcessResourceMgmtBean.java4
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java6
8 files changed, 29 insertions, 8 deletions
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 4741d9a..ea2428d 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
@@ -69,6 +69,7 @@ import org.eclipse.stardust.engine.core.query.statistics.api.WorklistStatistics.
import org.eclipse.stardust.engine.core.query.statistics.api.WorklistStatistics.UserStatistics;
import org.eclipse.stardust.engine.core.query.statistics.api.WorklistStatisticsQuery;
import org.eclipse.stardust.engine.core.runtime.beans.AbortScope;
+import org.eclipse.stardust.ui.web.bcc.common.configuration.UserPreferencesEntries;
import org.eclipse.stardust.ui.web.bcc.jsf.BusinessControlCenterLocalizerKey;
import org.eclipse.stardust.ui.web.bcc.jsf.InvalidServiceException;
import org.eclipse.stardust.ui.web.bcc.jsf.PageMessage;
@@ -215,7 +216,9 @@ public class WorkflowFacade implements Resetable
}
UserQuery query = UserQuery.findActive();
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
List<User> users = getQueryService().getAllUsers(query);
Pair/* <Map<String, RoleItem>, Map<Long, UserItem>> */pair = getWorklistStatistics(roles, users);
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/common/configuration/UserPreferencesEntries.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/common/configuration/UserPreferencesEntries.java
index a8091aa..ffc919a 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/common/configuration/UserPreferencesEntries.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/common/configuration/UserPreferencesEntries.java
@@ -13,7 +13,8 @@ package org.eclipse.stardust.ui.web.bcc.common.configuration;
public interface UserPreferencesEntries
{
public static final String M_BCC = "ipp-business-control-center";
-
+ // Admin Module is used for fetching User Preference
+ public static final String M_ADMIN_PORTAL = "ipp-admin-portal";
public static final String V_PRIORITY_VIEW = "priorityView";
public static final String V_COMPLETED_ACTIVITY = "CompletedActivity";
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CompletedActivitiesBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CompletedActivitiesBean.java
index efa0f9b..98a8bab 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CompletedActivitiesBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/CompletedActivitiesBean.java
@@ -245,7 +245,10 @@ public class CompletedActivitiesBean extends UIComponentBean implements Resource
{
WorkflowFacade facade = WorkflowFacade.getWorkflowFacade();
UserQuery query = WorkflowFacade.getWorkflowFacade().getTeamQuery(true);
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
+
userStatistics = (UserPerformanceStatistics) facade.getAllUsers(UserPerformanceStatisticsQuery.forAllUsers());
if (queryExtender != null)
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/LoginTimeBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/LoginTimeBean.java
index 2ab7774..2fcd778 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/LoginTimeBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/LoginTimeBean.java
@@ -271,7 +271,10 @@ public class LoginTimeBean extends UIComponentBean
statistics = (UserLoginStatistics) facade.getAllUsers(UserLoginStatisticsQuery
.forAllUsers());
UserQuery query = WorkflowFacade.getWorkflowFacade().getTeamQuery(true);
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
+
if (queryExtender != null)
{
queryExtender.extendQuery(query);
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PerformanceTeamLeaderBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PerformanceTeamLeaderBean.java
index ea61373..deb9f3a 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PerformanceTeamLeaderBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PerformanceTeamLeaderBean.java
@@ -455,7 +455,9 @@ public class PerformanceTeamLeaderBean extends UIComponentBean implements Resour
UserQuery query = UserQuery.findAll();
query.getFilter().add(
ParticipantAssociationFilter.forTeamLeader(tl.getTeamleaderRole()));
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
WorkflowFacade facade = WorkflowFacade.getWorkflowFacade();
return facade.getAllUsers(query);
}
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PostponedActivitiesBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PostponedActivitiesBean.java
index 0406e84..652983f 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PostponedActivitiesBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/PostponedActivitiesBean.java
@@ -288,7 +288,10 @@ public class PostponedActivitiesBean extends UIComponentBean implements Resource
Constants.getCriticalDurationThreshold(ProcessInstancePriority.HIGH, 1.0f)));
pStat = (PostponedActivitiesStatistics) facade.getAllUsers(query);
UserQuery uQuery = WorkflowFacade.getWorkflowFacade().getTeamQuery(true);
- uQuery.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ uQuery.setPolicy(userPolicy);
+
if (queryExtender != null)
{
queryExtender.extendQuery(uQuery);
diff --git a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/ProcessResourceMgmtBean.java b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/ProcessResourceMgmtBean.java
index 1a86fdc..f390c89 100644
--- a/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/ProcessResourceMgmtBean.java
+++ b/business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/ProcessResourceMgmtBean.java
@@ -342,7 +342,9 @@ public class ProcessResourceMgmtBean extends UIComponentBean implements Resource
public Query createQuery()
{
UserQuery query = UserQuery.findActive();
- query.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(UserPreferencesEntries.M_ADMIN_PORTAL);
+ query.setPolicy(userPolicy);
if (queryExtender != null)
{
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
index eec0fc4..b115fa7 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java
@@ -101,8 +101,12 @@ public class UserUtils
public static List<User> searchUsers(String searchValue, boolean onlyActive, int maxMatches)
{
UserQuery userQuery = onlyActive ? UserQuery.findActive() : UserQuery.findAll();
+
+ String[] prefModules = {UserPreferencesEntries.M_ADMIN_PORTAL,UserPreferencesEntries.M_VIEWS_COMMON};
+ UserDetailsPolicy userPolicy = new UserDetailsPolicy(UserDetailsLevel.Core);
+ userPolicy.setPreferenceModules(prefModules);
+ userQuery.setPolicy(userPolicy);
- userQuery.setPolicy(new UserDetailsPolicy(UserDetailsLevel.Core));
userQuery.setPolicy(new SubsetPolicy(maxMatches, false));
FilterOrTerm filter = userQuery.getFilter().addOrTerm();