summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-07-30 05:23:53 (EDT)
committerStephan Born2013-09-23 04:56:35 (EDT)
commit55a674213e901e81c89568a5beebf8a086ab9229 (patch)
tree747bd8405df5d25e4c2f1ae24c59928b3aaf7911
parent77cfdb36ce58850cddf8b4da253df082c1b03f5d (diff)
downloadorg.eclipse.stardust.ui.web-55a674213e901e81c89568a5beebf8a086ab9229.zip
org.eclipse.stardust.ui.web-55a674213e901e81c89568a5beebf8a086ab9229.tar.gz
org.eclipse.stardust.ui.web-55a674213e901e81c89568a5beebf8a086ab9229.tar.bz2
Jira-ID: CRNT-29691
Added a fix to WorklistsTreeModel to check if participantInfo is instanceOf User, before forming root node. REfactored the code for worklist Tree to use User QuailifierId instead of userId while creating participant tree. git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66352 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/OverviewBean.java6
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeModel.java11
-rw-r--r--process-portal/src/main/java/org/eclipse/stardust/ui/web/processportal/launchpad/WorklistsTreeUserObject.java2
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/ParticipantWorklistCacheManager.java11
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/WorklistUtils.java8
5 files changed, 20 insertions, 18 deletions
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 9353d3e..36b8160 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
@@ -210,7 +210,7 @@ public class OverviewBean extends AbstractLaunchPanel implements InitializingBea
ParticipantInfo participantInfo = SessionContext.findSessionContext().getUser();
Map<String, Object> params = CollectionUtils.newTreeMap();
- params.put(Query.class.getName(), ParticipantWorklistCacheManager.getInstance().getWorklistQuery(participantInfo,participantInfo.getId()));
+ params.put(Query.class.getName(), ParticipantWorklistCacheManager.getInstance().getWorklistQuery(participantInfo,participantInfo.getQualifiedId()));
params.put("participantInfo", participantInfo);
params.put("id", participantInfo.getId());
String name = I18nUtils.getParticipantName(ParticipantUtils.getParticipant(participantInfo));
@@ -305,9 +305,9 @@ public class OverviewBean extends AbstractLaunchPanel implements InitializingBea
{
User user=SessionContext.findSessionContext().getUser();
Long totalCount = ParticipantWorklistCacheManager.getInstance().getWorklistCount(
- user,user.getId());
+ user,user.getQualifiedId());
Long totalCountThreshold = ParticipantWorklistCacheManager.getInstance().getWorklistCountThreshold(
- user,user.getId());
+ user,user.getQualifiedId());
if (totalCount < Long.MAX_VALUE)
return totalCount.toString();
else
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 6ffcf65..11b7278 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
@@ -20,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel;
import org.eclipse.stardust.common.CollectionUtils;
import org.eclipse.stardust.engine.api.model.ParticipantInfo;
+import org.eclipse.stardust.engine.api.runtime.UserInfo;
import org.eclipse.stardust.ui.web.processportal.common.MessagePropertiesBean;
import org.eclipse.stardust.ui.web.viewscommon.common.ModelHelper;
import org.eclipse.stardust.ui.web.viewscommon.common.ParticipantLabel;
@@ -113,13 +114,13 @@ public class WorklistsTreeModel extends DefaultTreeModel
for (ParticipantInfo participantInfo : participants)
{
boolean assemblyNodeCreated = false;
- if (participantInfo.getId().equals(entry.getKey()))
+ if (participantInfo.getQualifiedId().equals(entry.getKey()) && (participantInfo instanceof UserInfo))
{
tempRootNode = addChild(participantInfo, false, root);
}
if (assemblyLineUserObject.isAssemblyLineMode()
- && assemblyLineUserObject.getAssemblyLineParticipants().contains(participantInfo.getId()))
+ && assemblyLineUserObject.getAssemblyLineParticipants().contains(participantInfo.getQualifiedId()))
{
if (!assemblyNodeCreated)
{
@@ -133,7 +134,7 @@ public class WorklistsTreeModel extends DefaultTreeModel
{
continue;
}
- if(entry.getKey().equals(participantInfo.getId()))
+ if(entry.getKey().equals(participantInfo.getQualifiedId()) && (participantInfo instanceof UserInfo))
{
((WorklistsTreeUserObject)childNode.getUserObject()).setText(MessagePropertiesBean.getInstance().getString("launchPanels.worklists.personalWorklist")+ " :");
}
@@ -172,11 +173,11 @@ public class WorklistsTreeModel extends DefaultTreeModel
String userParticipantId =null;
if(isLeaf)
{
- userParticipantId =((WorklistsTreeUserObject) rootNode.getUserObject()).getParticipantInfo().getId();
+ userParticipantId =((WorklistsTreeUserObject) rootNode.getUserObject()).getParticipantInfo().getQualifiedId();
}
else
{
- userParticipantId = participantInfo.getId();
+ userParticipantId = participantInfo.getQualifiedId();
}
if (showEmptyWorklist
|| (ParticipantWorklistCacheManager.getInstance().getWorklistCount(participantInfo, userParticipantId) > 0 || !isLeaf))
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 9906e08..fc13ed1 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
@@ -82,7 +82,7 @@ public class WorklistsTreeUserObject extends IceUserObject
User user = (User) ParticipantUtils.getParticipant(participantInfo);
or.add(new PerformingUserFilter(user.getOID()));
Set<ParticipantInfo> partInfo = ParticipantWorklistCacheManager.getInstance().getWorklistParticipants()
- .get(participantInfo.getId());
+ .get(participantInfo.getQualifiedId());
for (ParticipantInfo participantInfo1 : partInfo)
{
if (!(participantInfo1 instanceof UserInfo))
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 62ef1c1..2b7075a 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
@@ -23,6 +23,7 @@ import org.eclipse.stardust.engine.api.query.ActivityInstanceQuery;
import org.eclipse.stardust.engine.api.query.Worklist;
import org.eclipse.stardust.engine.api.query.WorklistQuery;
import org.eclipse.stardust.engine.api.runtime.ActivityInstance;
+import org.eclipse.stardust.engine.api.runtime.UserInfo;
import org.eclipse.stardust.ui.event.ActivityEvent;
import org.eclipse.stardust.ui.web.common.log.LogManager;
import org.eclipse.stardust.ui.web.common.log.Logger;
@@ -75,7 +76,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
for (Worklist worklist : entry.getValue())
{
worklistOwner = worklist.getOwner();
- if(entry.getKey().equals(worklistOwner.getQualifiedId()))
+ if(entry.getKey().equals(worklistOwner.getQualifiedId()) && (worklistOwner instanceof UserInfo))
{
// Using the userParticipantId i.e entry.getKey() along with
// worklistOwner- ParticipantInfo
@@ -243,7 +244,7 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
if (null != oldAi) // oldAi can be null if AI is ACTIVATED
{
ParticipantWorklistCacheEntry oldEntry = participantWorklists.get(new ParticipantInfoWrapper(oldAi
- .getCurrentPerformer(),oldAi.getCurrentPerformer().getId()));
+ .getCurrentPerformer(),oldAi.getCurrentPerformer().getQualifiedId()));
if (null != oldEntry && (oldEntry.getCount() > 0 && oldEntry.getCount() < oldEntry.getTotalCountThreshold()))
{
oldEntry.setCount(oldEntry.getCount() - 1);
@@ -253,10 +254,10 @@ public class ParticipantWorklistCacheManager implements InitializingBean, Serial
ActivityInstance newAi = event.getActivityInstance();
if (null != newAi) // Safety Check
{
- String userParticipantId = null != newAi.getUserPerformer() ? newAi.getUserPerformer().getId() : oldAi
- .getCurrentPerformer().getId();
+ String userParticipantQualifierId = null != newAi.getUserPerformer() ? newAi.getUserPerformer().getQualifiedId() : oldAi
+ .getCurrentPerformer().getQualifiedId();
ParticipantWorklistCacheEntry newEntry = participantWorklists.get(new ParticipantInfoWrapper(newAi
- .getCurrentPerformer(),userParticipantId));
+ .getCurrentPerformer(),userParticipantQualifierId));
if (null != newEntry && newEntry.getCount() < Long.MAX_VALUE)
{
newEntry.setCount(newEntry.getCount() + 1);
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/WorklistUtils.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/WorklistUtils.java
index e320355..739bbce 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/WorklistUtils.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/WorklistUtils.java
@@ -345,7 +345,7 @@ public class WorklistUtils
Worklist worklist = ServiceFactoryUtils.getWorkflowService().getWorklist(query);
// Worklist map is used for maintaining relation of 'Worklist Owner-worklist Set', used while
// creating worklist tree
- worklistMap.put(worklist.getOwnerID(), worklists);
+ worklistMap.put(worklist.getOwner().getQualifiedId(), worklists);
worklists.add(worklist);
getSubWorklist(worklist, worklistMap,worklists);
return worklistMap;
@@ -376,17 +376,17 @@ public class WorklistUtils
if (!(subws.getOwner() instanceof UserInfo))
{
// For Participant worklist new <key,value> is not created,
- worklists = worklistMap.get(worklist.getOwner().getId());
+ worklists = worklistMap.get(worklist.getOwner().getQualifiedId());
}
else
{
// For user worklist, create new map entry
- worklists = worklistMap.get(subws.getOwnerID());
+ worklists = worklistMap.get(subws.getOwner().getQualifiedId());
}
if (CollectionUtils.isEmpty(worklists))
{
worklists = CollectionUtils.newArrayList();
- worklistMap.put(subws.getOwnerID(), worklists);
+ worklistMap.put(subws.getOwner().getQualifiedId(), worklists);
}
worklists.add(subws);
if (subws.getSubWorklists().hasNext()) // If additional Sub-Worklist are present