summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-07-26 08:00:46 (EDT)
committerStephan Born2013-09-23 04:56:18 (EDT)
commitc25aae3b951fe2d8f90a83f8c5e61d6c39010625 (patch)
tree73df430f12dd7073ee04dc263f05477064b723e8
parentb0115aecd91c864712dc4c5bcbb44a7681be8713 (diff)
downloadorg.eclipse.stardust.ui.web-c25aae3b951fe2d8f90a83f8c5e61d6c39010625.zip
org.eclipse.stardust.ui.web-c25aae3b951fe2d8f90a83f8c5e61d6c39010625.tar.gz
org.eclipse.stardust.ui.web-c25aae3b951fe2d8f90a83f8c5e61d6c39010625.tar.bz2
Jira-ID: CRNT-29413
Added code to show infoPanelBean in RoleManagerDetailBean and UserManagerDetailBean git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66311 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/RoleManagerDetailBean.java40
-rw-r--r--business-control-center/src/main/java/org/eclipse/stardust/ui/web/bcc/views/UserManagerDetailBean.java46
-rw-r--r--business-control-center/src/main/resources/META-INF/xhtml/views/roleManagerDetailView.xhtml6
-rw-r--r--business-control-center/src/main/resources/META-INF/xhtml/views/userManagerDetailView.xhtml7
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantTree.java18
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/utils/UserUtils.java15
6 files changed, 112 insertions, 20 deletions
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 b50c3a1..34e81ad 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
@@ -68,11 +68,13 @@ import org.eclipse.stardust.ui.web.common.table.PaginatorDataTable;
import org.eclipse.stardust.ui.web.common.table.SortCriterion;
import org.eclipse.stardust.ui.web.common.table.SortableTableComparator;
import org.eclipse.stardust.ui.web.common.util.FacesUtils;
+import org.eclipse.stardust.ui.web.viewscommon.common.InfoPanelBean;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppQueryResult;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppSearchHandler;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppSortHandler;
import org.eclipse.stardust.ui.web.viewscommon.dialogs.ICallbackHandler;
import org.eclipse.stardust.ui.web.viewscommon.helper.activityTable.ActivityTableHelper;
+import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.AuthorizationUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.DefaultColumnModelEventHandler;
import org.eclipse.stardust.ui.web.viewscommon.utils.ModelCache;
@@ -136,7 +138,10 @@ public class RoleManagerDetailBean extends UIComponentBean
private WorkflowFacade facade;
private int selectedTabIndex = 0;
-
+
+ private InfoPanelBean infoPanelBean;
+
+ private boolean infoPanelVisible;
private QualifiedModelParticipantInfo modelParticipantInfo;
private View thisView;
@@ -159,6 +164,7 @@ public class RoleManagerDetailBean extends UIComponentBean
this.thisView = event.getView();
propsBean = MessagesBCCBean.getInstance();
facade = WorkflowFacade.getWorkflowFacade();
+ infoPanelBean = new InfoPanelBean();
createAssignedUsersTable();
createAssignableUsersTable();
}
@@ -179,6 +185,17 @@ public class RoleManagerDetailBean extends UIComponentBean
}
}
+ public void notifyRoleUpdate()
+ {
+ // If alert message is alread visible, no need to recreate the notify message
+ if (!infoPanelVisible)
+ {
+ infoPanelBean.setNotificationMsg(MessagesViewsCommonBean.getInstance().getString(
+ "views.participantTree.toolbar.highlightUsers.alertMsg"));
+ infoPanelVisible = true;
+ }
+ }
+
/**
* Used to Initialize the Role Assigned and Assignable Table
*/
@@ -568,13 +585,15 @@ public class RoleManagerDetailBean extends UIComponentBean
{
List<UserItem> users = CollectionUtils.newArrayList();
List<RoleManagerDetailUserObject> rolesList = userAssignableTable.getList();
+ UserItem userItem = null;
for (Iterator<RoleManagerDetailUserObject> iterator = rolesList.iterator(); iterator.hasNext();)
{
RoleManagerDetailUserObject roleManagerDetailUserObject = (RoleManagerDetailUserObject) iterator.next();
if (roleManagerDetailUserObject.isSelect())
{
- users.add(facade.getUserItem(Long.parseLong(roleManagerDetailUserObject.getUserOid().toString())));
+ userItem = facade.getUserItem(Long.parseLong(roleManagerDetailUserObject.getUserOid().toString()));
+ users.add(userItem);
}
}
@@ -584,6 +603,10 @@ public class RoleManagerDetailBean extends UIComponentBean
{
items = Integer.toString(getAssignedUser().size());
initialize();
+ if (userItem != null && UserUtils.isLoggedInUser(userItem.getUser()))
+ {
+ notifyRoleUpdate();
+ }
}
}
catch (InvalidServiceException e)
@@ -616,8 +639,9 @@ public class RoleManagerDetailBean extends UIComponentBean
{
List<UserItem> users = CollectionUtils.newArrayList();
UserItem userItem = null;
+ boolean showInfoDialog =false;
List<RoleManagerDetailUserObject> rolesList = userAssignedTable.getList();
-
+
for (Iterator<RoleManagerDetailUserObject> iterator = rolesList.iterator(); iterator.hasNext();)
{
RoleManagerDetailUserObject roleManagerDetailUserObject = (RoleManagerDetailUserObject) iterator.next();
@@ -640,6 +664,7 @@ public class RoleManagerDetailBean extends UIComponentBean
if (userItem != null)
{
users.add(userItem);
+ showInfoDialog = true;
}
try
@@ -648,6 +673,10 @@ public class RoleManagerDetailBean extends UIComponentBean
{
items = Integer.toString(getAssignedUser().size());
initialize();
+ if (showInfoDialog && UserUtils.isLoggedInUser(userItem.getUser()))
+ {
+ notifyRoleUpdate();
+ }
}
}
catch (InvalidServiceException e)
@@ -834,6 +863,11 @@ public class RoleManagerDetailBean extends UIComponentBean
return activityHelper;
}
+ public InfoPanelBean getInfoPanelBean()
+ {
+ return infoPanelBean;
+ }
+
/**
* @returns the currently selected tab index (User Assignment / Activity List)
*/
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 c4314d4..f4cd20b 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
@@ -64,11 +64,13 @@ import org.eclipse.stardust.ui.web.common.table.PaginatorDataTable;
import org.eclipse.stardust.ui.web.common.table.SortCriterion;
import org.eclipse.stardust.ui.web.common.table.SortableTableComparator;
import org.eclipse.stardust.ui.web.viewscommon.beans.SessionContext;
+import org.eclipse.stardust.ui.web.viewscommon.common.InfoPanelBean;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppQueryResult;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppSearchHandler;
import org.eclipse.stardust.ui.web.viewscommon.common.table.IppSortHandler;
import org.eclipse.stardust.ui.web.viewscommon.dialogs.ICallbackHandler;
import org.eclipse.stardust.ui.web.viewscommon.helper.activityTable.ActivityTableHelper;
+import org.eclipse.stardust.ui.web.viewscommon.messages.MessagesViewsCommonBean;
import org.eclipse.stardust.ui.web.viewscommon.utils.AuthorizationUtils;
import org.eclipse.stardust.ui.web.viewscommon.utils.DefaultColumnModelEventHandler;
import org.eclipse.stardust.ui.web.viewscommon.utils.I18nUtils;
@@ -128,7 +130,11 @@ public class UserManagerDetailBean extends UIComponentBean
private Map<Long, ProcessInstance> processInstances;
+ private InfoPanelBean infoPanelBean;
+
private boolean canManageAuthorization = false;
+
+ private boolean infoPanelVisible;
/**
*
@@ -136,6 +142,7 @@ public class UserManagerDetailBean extends UIComponentBean
public UserManagerDetailBean()
{
super(V_userManagerDetailView);
+ infoPanelBean = new InfoPanelBean();
}
/**
@@ -281,6 +288,17 @@ public class UserManagerDetailBean extends UIComponentBean
refreshActivityTab();
}
+ public void notifyUserRoleUpdate()
+ {
+ // If alert message is alread visible, no need to recreate the notify message
+ if (!infoPanelVisible)
+ {
+ infoPanelBean.setNotificationMsg(MessagesViewsCommonBean.getInstance().getString(
+ "views.participantTree.toolbar.highlightUsers.alertMsg"));
+ infoPanelVisible = true;
+ }
+ }
+
/**
*
*/
@@ -512,6 +530,10 @@ public class UserManagerDetailBean extends UIComponentBean
{
roleCount = Integer.toString(getAssignedRoles(user).size());
initialize();
+ if (UserUtils.isLoggedInUser(user.getUser()))
+ {
+ notifyUserRoleUpdate();
+ }
}
}
else
@@ -523,6 +545,10 @@ public class UserManagerDetailBean extends UIComponentBean
{
roleCount = Integer.toString(getAssignedRoles(user).size());
initialize();
+ if (UserUtils.isLoggedInUser(user.getUser()))
+ {
+ notifyUserRoleUpdate();
+ }
}
}
}
@@ -562,6 +588,10 @@ public class UserManagerDetailBean extends UIComponentBean
{
roleCount = Integer.toString(getAssignedRoles(user).size());
initialize();
+ if (UserUtils.isLoggedInUser(user.getUser()))
+ {
+ notifyUserRoleUpdate();
+ }
}
}
else
@@ -573,6 +603,10 @@ public class UserManagerDetailBean extends UIComponentBean
{
roleCount = Integer.toString(getAssignedRoles(user).size());
initialize();
+ if (UserUtils.isLoggedInUser(user.getUser()))
+ {
+ notifyUserRoleUpdate();
+ }
}
}
}
@@ -810,6 +844,18 @@ public class UserManagerDetailBean extends UIComponentBean
return (UserManagerRoleAssignmentUserObject)resultRow;
}
+ public InfoPanelBean getInfoPanelBean()
+ {
+ return infoPanelBean;
+ }
+
+ public boolean isInfoPanelVisible()
+ {
+ return infoPanelVisible;
+ }
+
+
+
/**
*
* @author Vikas.Mishra
diff --git a/business-control-center/src/main/resources/META-INF/xhtml/views/roleManagerDetailView.xhtml b/business-control-center/src/main/resources/META-INF/xhtml/views/roleManagerDetailView.xhtml
index a61d80e..804431d 100644
--- a/business-control-center/src/main/resources/META-INF/xhtml/views/roleManagerDetailView.xhtml
+++ b/business-control-center/src/main/resources/META-INF/xhtml/views/roleManagerDetailView.xhtml
@@ -6,6 +6,12 @@
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:pc="http://www.sungard.de/carnot/web/portal-plugin/portalcommon">
+ <ice:panelGroup>
+ <ui:include src="/plugins/views-common/common/infoPanelView.xhtml">
+ <ui:param name="infoPanelBean"
+ value="#{roleManagerDetail.infoPanelBean}" />
+ </ui:include>
+ </ice:panelGroup>
<ice:panelGroup width="100%">
<ice:panelGroup>
<ice:panelGroup styleClass="clearing" />
diff --git a/business-control-center/src/main/resources/META-INF/xhtml/views/userManagerDetailView.xhtml b/business-control-center/src/main/resources/META-INF/xhtml/views/userManagerDetailView.xhtml
index 1b3f1c7..ead2ec2 100644
--- a/business-control-center/src/main/resources/META-INF/xhtml/views/userManagerDetailView.xhtml
+++ b/business-control-center/src/main/resources/META-INF/xhtml/views/userManagerDetailView.xhtml
@@ -6,7 +6,12 @@
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:pc="http://www.sungard.de/carnot/web/portal-plugin/portalcommon">
-
+ <ice:panelGroup>
+ <ui:include src="/plugins/views-common/common/infoPanelView.xhtml">
+ <ui:param name="infoPanelBean"
+ value="#{userManagerDetail.infoPanelBean}" />
+ </ui:include>
+ </ice:panelGroup>
<ice:panelGroup width="100%">
<ice:panelGroup>
<ice:panelGroup styleClass="clearing" />
diff --git a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantTree.java b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantTree.java
index aaec871..beac8e2 100644
--- a/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantTree.java
+++ b/views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/participantManagement/ParticipantTree.java
@@ -827,7 +827,7 @@ public class ParticipantTree
}
participantUserObject.setExpanded(true);
refreshParticipantNode(participantNode, NODE_TYPE.USER);
- if(userGrantsChanged && isLoggedInUser(user))
+ if(userGrantsChanged && UserUtils.isLoggedInUser(user))
{
notifyParticipantTreeUpdate();
}
@@ -912,7 +912,7 @@ public class ParticipantTree
}
refreshParticipantNode(parentNode, NODE_TYPE.USER);
// If user is currently logged in User, notify to re-login
- if (isLoggedInUser(user))
+ if (UserUtils.isLoggedInUser(user))
{
notifyParticipantTreeUpdate();
}
@@ -921,20 +921,6 @@ public class ParticipantTree
}
/**
- *
- * @param user
- * @return
- */
- private boolean isLoggedInUser(User user)
- {
- User loggedInUser = SessionContext.findSessionContext().getUser();
- if (null != loggedInUser && user.getQualifiedId().equals(loggedInUser.getQualifiedId()))
- {
- return true;
- }
- return false;
- }
- /**
* @param user
* @param qualifiedParticipantInfo
*/
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 df39c48..50dd7e0 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
@@ -552,6 +552,21 @@ public class UserUtils
}
/**
+ *
+ * @param user
+ * @return
+ */
+ public static boolean isLoggedInUser(User user)
+ {
+ User loggedInUser = SessionContext.findSessionContext().getUser();
+ if (null != loggedInUser && user.getQualifiedId().equals(loggedInUser.getQualifiedId()))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* @return
*/
public static String getPartitionID()