summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-03-01 07:33:36 (EST)
committer Sven Rottstock2013-03-11 06:38:17 (EDT)
commita6b91d4892e0359f514ff7711741b00038e381ba (patch)
tree93a2f971a6d1dc56022abe53f6bbd37a4d8d73ea
parent1b73014c8cadd7b796fab6c89327c2d627abe9f9 (diff)
downloadorg.eclipse.stardust.ui.web-a6b91d4892e0359f514ff7711741b00038e381ba.zip
org.eclipse.stardust.ui.web-a6b91d4892e0359f514ff7711741b00038e381ba.tar.gz
org.eclipse.stardust.ui.web-a6b91d4892e0359f514ff7711741b00038e381ba.tar.bz2
Jira-ID: CRNT-28039
Added totalCountThreshold field in ProcessWorklistCacheEntry and ParticipantWorklistCacheEntry Passed worklists.getTotalCountThreshold() while initializing the ParticipantWorklistCacheEntry Added code to return "More than" totalCountThreshold, when totalCount value is LONG.MAX_VALUE git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@63395 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/MyProcessesModel.java9
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java32
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeAssemblyLineUserObject.java4
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java2
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java13
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheEntry.java21
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java18
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheEntry.java22
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java22
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java15
-rw-r--r--views-common/src/main/resources/views-common-messages_en.properties1
11 files changed, 142 insertions, 17 deletions
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/MyProcessesModel.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/MyProcessesModel.java
index f1d36b8..0ca73aa 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/MyProcessesModel.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/MyProcessesModel.java
@@ -17,6 +17,7 @@ import org.eclipse.stardust.common.StringUtils;
import org.eclipse.stardust.engine.api.model.ProcessDefinition;
import org.eclipse.stardust.engine.api.query.Query;
import org.eclipse.stardust.ui.web.processportal.common.PPUtils;
+import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.I18nUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ProcessWorklistCacheManager;
@@ -59,7 +60,13 @@ public class MyProcessesModel
public String getTotalCount()
{
- return Long.toString(ProcessWorklistCacheManager.getInstance().getWorklistCount(processDefinition));
+ Long totalCount = ProcessWorklistCacheManager.getInstance().getWorklistCount(processDefinition);
+ Long totalCountThreshold = ProcessWorklistCacheManager.getInstance().getWorklistCountThreshold(processDefinition);
+ if (totalCount < Long.MAX_VALUE)
+ return totalCount.toString();
+ else
+ return MessagesViewsCommonBean.getInstance().getParamString("common.notification.worklistCountThreshold",
+ totalCountThreshold.toString());
}
public String getName()
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java
index ef4e858..4e8b2e9 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java
@@ -29,6 +29,7 @@ import org.eclipse.stardust.ui.web.common.app.PortalApplication;
import org.eclipse.stardust.ui.web.common.uielement.AbstractLaunchPanel;
import org.eclipse.stardust.ui.web.processportal.common.PPUtils;
import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
+import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.I18nUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantWorklistCacheManager;
@@ -237,14 +238,26 @@ public class OverviewBean extends AbstractLaunchPanel implements InitializingBea
SpecialWorklistCacheManager.getInstance().reset();
}
- public long getAllAssignedActivitiesCount()
+ public String getAllAssignedActivitiesCount()
{
- return SpecialWorklistCacheManager.getInstance().getWorklistCount(SpecialWorklistCacheManager.ALL_ACTVITIES);
+ Long totalCount = SpecialWorklistCacheManager.getInstance().getWorklistCount(SpecialWorklistCacheManager.ALL_ACTVITIES);
+ Long totalCountThreshold = SpecialWorklistCacheManager.getInstance().getWorklistCountThreshold(SpecialWorklistCacheManager.ALL_ACTVITIES);
+ if(totalCount < Long.MAX_VALUE)
+ return totalCount.toString();
+ else
+ return MessagesViewsCommonBean.getInstance().getParamString("common.notification.worklistCountThreshold",
+ totalCountThreshold.toString());
}
- public long getCriticalActivitiesCount()
+ public String getCriticalActivitiesCount()
{
- return SpecialWorklistCacheManager.getInstance().getWorklistCount(SpecialWorklistCacheManager.CRITICAL_ACTVITIES);
+ Long totalCount = SpecialWorklistCacheManager.getInstance().getWorklistCount(SpecialWorklistCacheManager.CRITICAL_ACTVITIES);
+ Long totalCountThreshold = SpecialWorklistCacheManager.getInstance().getWorklistCountThreshold(SpecialWorklistCacheManager.CRITICAL_ACTVITIES);
+ if(totalCount < Long.MAX_VALUE)
+ return totalCount.toString();
+ else
+ return MessagesViewsCommonBean.getInstance().getParamString("common.notification.worklistCountThreshold",
+ totalCountThreshold.toString());
}
private void openWorklist(String id, Object activityInstanceQuery)
@@ -287,10 +300,17 @@ public class OverviewBean extends AbstractLaunchPanel implements InitializingBea
PPUtils.selectWorklist(null);
}
- public long getDirectUserWorkCount()
+ public String getDirectUserWorkCount()
{
- return ParticipantWorklistCacheManager.getInstance().getWorklistCount(
+ Long totalCount = ParticipantWorklistCacheManager.getInstance().getWorklistCount(
SessionContext.findSessionContext().getUser());
+ Long totalCountThreshold = ParticipantWorklistCacheManager.getInstance().getWorklistCountThreshold(
+ SessionContext.findSessionContext().getUser());
+ if(totalCount < Long.MAX_VALUE)
+ return totalCount.toString();
+ else
+ return MessagesViewsCommonBean.getInstance().getParamString("common.notification.worklistCountThreshold",
+ totalCountThreshold.toString());
}
public long getPriorityActivityInstancesCount()
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeAssemblyLineUserObject.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeAssemblyLineUserObject.java
index b30a5d3..d706a7b 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeAssemblyLineUserObject.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeAssemblyLineUserObject.java
@@ -88,8 +88,8 @@ public class WorklistsTreeAssemblyLineUserObject extends WorklistsTreeUserObject
return worklistsBean.isAssemblyLineMode();
}
- public long getActivityCount()
+ public String getActivityCount()
{
- return activityCount;
+ return Long.valueOf(activityCount).toString();
}
}
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java
index fd257fa..15e28cf 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java
@@ -145,7 +145,7 @@ public class WorklistsTreeModel extends DefaultTreeModel
if(assemblyLineUserObject.isAssemblyLineMode())
{
- if (showEmptyWorklist || assemblyLineUserObject.getActivityCount() > 0)
+ if (showEmptyWorklist || Long.valueOf(assemblyLineUserObject.getActivityCount()) > 0)
{
child.setUserObject(assemblyLineUserObject);
root.add(child);
diff --git a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java
index 95d98a5..5378830 100644
--- a/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java
+++ b/process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java
@@ -22,6 +22,7 @@ import org.eclipse.stardust.engine.api.query.Query;
import org.eclipse.stardust.ui.web.processportal.common.PPUtils;
import org.eclipse.stardust.ui.web.viewscommon.common.ModelHelper;
import org.eclipse.stardust.ui.web.viewscommon.common.ParticipantLabel;
+import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.ParticipantWorklistCacheManager;
@@ -101,9 +102,17 @@ public class WorklistsTreeUserObject extends IceUserObject
return style;
}
- public long getActivityCount()
+ public String getActivityCount()
{
- return ParticipantWorklistCacheManager.getInstance().getWorklistCount(participantInfo);
+ Long totalCount = ParticipantWorklistCacheManager.getInstance().getWorklistCount(participantInfo);
+ Long totalCountThreshold = ParticipantWorklistCacheManager.getInstance().getWorklistCountThreshold(
+ participantInfo);
+ if (totalCount < Long.MAX_VALUE)
+ return totalCount.toString();
+ else
+ return MessagesViewsCommonBean.getInstance().getParamString("common.notification.worklistCountThreshold",
+ totalCountThreshold.toString());
+
}
public boolean isDisabled()
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheEntry.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheEntry.java
index b7c2953..2d29962 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheEntry.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheEntry.java
@@ -22,6 +22,7 @@ public class ParticipantWorklistCacheEntry implements Serializable
{
private static final long serialVersionUID = 7571234851632442390L;
private long count;
+ private long totalCountThreshold;
private WorklistQuery worklistQuery;
/**
@@ -33,6 +34,16 @@ public class ParticipantWorklistCacheEntry implements Serializable
this.count = count;
this.worklistQuery = worklistQuery;
}
+
+ /**
+ * @param count
+ * @param worklistQuery
+ */
+ public ParticipantWorklistCacheEntry(long count, WorklistQuery worklistQuery, long totalCountThreshold)
+ {
+ this(count,worklistQuery);
+ this.totalCountThreshold = totalCountThreshold;
+ }
public long getCount()
{
@@ -44,6 +55,16 @@ public class ParticipantWorklistCacheEntry implements Serializable
this.count = count;
}
+ public long getTotalCountThreshold()
+ {
+ return totalCountThreshold;
+ }
+
+ public void setTotalCountThreshold(long totalCountThreshold)
+ {
+ this.totalCountThreshold = totalCountThreshold;
+ }
+
public WorklistQuery getWorklistQuery()
{
return worklistQuery;
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
index da0edcb..6648e82 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java
@@ -74,7 +74,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
worklistOwner = worklist.getOwner();
participantWorklists.put(new ParticipantInfoWrapper(worklistOwner), new ParticipantWorklistCacheEntry(
- worklist.getTotalCount(), WorklistUtils.createWorklistQuery(worklistOwner)));
+ worklist.getTotalCount(), WorklistUtils.createWorklistQuery(worklistOwner),worklist.getTotalCountThreshold()));
}
}
@@ -96,8 +96,24 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
{
return cacheEntry.getCount();
}
+
return 0;
}
+
+ /**
+ * @param participantInfo
+ * @return
+ */
+ public long getWorklistCountThreshold(ParticipantInfo participantInfo)
+ {
+ ParticipantWorklistCacheEntry cacheEntry = participantWorklists.get(new ParticipantInfoWrapper(participantInfo));
+ if (null != cacheEntry)
+ {
+ return cacheEntry.getTotalCountThreshold();
+ }
+
+ return Long.MAX_VALUE;
+ }
/**
* @return
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheEntry.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheEntry.java
index 88903fe..5c4874b 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheEntry.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheEntry.java
@@ -18,7 +18,9 @@ import org.eclipse.stardust.engine.api.query.ActivityInstanceQuery;
public class ProcessWorklistCacheEntry
{
private long count;
+ private long totalCountThreshold;
private ActivityInstanceQuery activityInstanceQuery;
+
/**
* @param count
@@ -29,6 +31,16 @@ public class ProcessWorklistCacheEntry
this.count = count;
this.activityInstanceQuery = activityInstanceQuery;
}
+
+ /**
+ * @param count
+ * @param activityInstanceQuery
+ */
+ public ProcessWorklistCacheEntry(long count, ActivityInstanceQuery activityInstanceQuery,long totalCountThreshold)
+ {
+ this(count, activityInstanceQuery);
+ this.totalCountThreshold = totalCountThreshold;
+ }
/**
* @return
@@ -46,6 +58,16 @@ public class ProcessWorklistCacheEntry
this.count = count;
}
+ public long getTotalCountThreshold()
+ {
+ return totalCountThreshold;
+ }
+
+ public void setTotalCountThreshold(long totalCountThreshold)
+ {
+ this.totalCountThreshold = totalCountThreshold;
+ }
+
/**
* @return
*/
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
index a69ba30..c3b2ce0 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ProcessWorklistCacheManager.java
@@ -83,9 +83,9 @@ public class ProcessWorklistCacheManager implements InitializingBean
for (ProcessDefinition processDefinition : processDefs)
{
ais = WorklistUtils.getActivityInstances_anyActivatableByProcess(processDefinition);
-
+
processDefinitions.put(processDefinition.getQualifiedId(), processDefinition);
- processWorklists.put(processDefinition, new ProcessWorklistCacheEntry(ais.getTotalCount(), ais.getQuery()));
+ processWorklists.put(processDefinition, new ProcessWorklistCacheEntry(ais.getTotalCount(), ais.getQuery(), ais.getTotalCountThreshold()));
}
// printCache("reset()");
@@ -108,6 +108,24 @@ public class ProcessWorklistCacheManager implements InitializingBean
return 0;
}
+
+ /**
+ * @param processDefinition
+ * @return
+ */
+ public long getWorklistCountThreshold(ProcessDefinition processDefinition)
+ {
+ // Get the Process Definition object from the first Map (using id) since
+ // ProcessDefinition does not implement equals()
+ ProcessDefinition processDefinitionKey = processDefinitions.get(processDefinition.getQualifiedId());
+ ProcessWorklistCacheEntry processWorklistCacheEntry = processWorklists.get(processDefinitionKey);
+ if (null != processWorklistCacheEntry)
+ {
+ return processWorklistCacheEntry.getTotalCountThreshold();
+ }
+
+ return Long.MAX_VALUE;
+ }
/**
* @return
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
index 55a0f7f..a5bfc44 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/SpecialWorklistCacheManager.java
@@ -73,11 +73,13 @@ public class SpecialWorklistCacheManager implements InitializingBean, Serializab
{
worklists = new LinkedHashMap<String, ProcessWorklistCacheEntry>();
ActivityInstances result = WorklistUtils.getAllAssignedActivities();
- worklists.put(ALL_ACTVITIES, new ProcessWorklistCacheEntry(result.getTotalCount(), result.getQuery()));
+ worklists.put(ALL_ACTVITIES,
+ new ProcessWorklistCacheEntry(result.getTotalCount(), result.getQuery(), result.getTotalCountThreshold()));
definedHighCriticality = CriticalityConfigurationHelper.getInstance().getCriticality(
CriticalityConfigurationUtil.PORTAL_CRITICALITY_MAX);
result = WorklistUtils.getCriticalActivities(definedHighCriticality);
- worklists.put(CRITICAL_ACTVITIES, new ProcessWorklistCacheEntry(result.getTotalCount(), result.getQuery()));
+ worklists.put(CRITICAL_ACTVITIES,
+ new ProcessWorklistCacheEntry(result.getTotalCount(), result.getQuery(), result.getTotalCountThreshold()));
initialized = true;
}
@@ -89,6 +91,15 @@ public class SpecialWorklistCacheManager implements InitializingBean, Serializab
{
return worklists.get(worklistName).getCount();
}
+
+ /**
+ * @param worklistName
+ * @return
+ */
+ public long getWorklistCountThreshold(String worklistName)
+ {
+ return worklists.get(worklistName).getTotalCountThreshold();
+ }
/**
* @param worklistName
diff --git a/views-common/src/main/resources/views-common-messages_en.properties b/views-common/src/main/resources/views-common-messages_en.properties
index 4b82c57..33ffc86 100644
--- a/views-common/src/main/resources/views-common-messages_en.properties
+++ b/views-common/src/main/resources/views-common-messages_en.properties
@@ -502,6 +502,7 @@ common.wizard.previous=Back
common.notification.selectedItems = Selected Items
common.notification.actionStatus = Action Status
common.notification.worklistRetrievalFailure = Error occurred while retrieving worklist.
+common.notification.worklistCountThreshold = More than {0}
#Toolbar
toolbar.notes.save= Save