summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-03-21 08:30:36 (EDT)
committer Manik Kishore2012-06-19 07:22:36 (EDT)
commit8f6f37d483828ee2156651b1cf897cf9367f5528 (patch)
treec2fe825d3c11164f76e0e21b14f0e2e41245d578
parent35d90f8bd202084fc2fe44489d2423415fecf485 (diff)
downloadorg.eclipse.stardust.ui.web-8f6f37d483828ee2156651b1cf897cf9367f5528.zip
org.eclipse.stardust.ui.web-8f6f37d483828ee2156651b1cf897cf9367f5528.tar.gz
org.eclipse.stardust.ui.web-8f6f37d483828ee2156651b1cf897cf9367f5528.tar.bz2
Jira-ID: CRNT-24136
1)Added validationMessage for From Date , to Date validation in CreateOrModifyUserGroupBean.java and UserProfileBean.java 2)Added validation message for userGroup already exist in CreateOrModifyUserGroupBean.java git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@54744 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyUserGroupBean.java20
-rw-r--r--admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyUserGroup.xhtml1
-rw-r--r--admin-portal/src/main/resources/admin-portal-messages.properties1
-rw-r--r--admin-portal/src/main/resources/admin-portal-messages_de.properties1
-rw-r--r--admin-portal/src/main/resources/admin-portal-messages_ja.properties1
-rw-r--r--admin-portal/src/main/resources/admin-portal-messages_zh_CN.properties1
-rw-r--r--views-common/src/main/java/org/eclipse/stardust/ui/web/viewscommon/user/UserProfileBean.java9
7 files changed, 24 insertions, 10 deletions
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyUserGroupBean.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyUserGroupBean.java
index ed98632..dfa8671 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyUserGroupBean.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyUserGroupBean.java
@@ -19,6 +19,7 @@ import javax.faces.event.ActionEvent;
import org.eclipse.stardust.common.error.AccessForbiddenException;
import org.eclipse.stardust.engine.api.runtime.UserGroup;
+import org.eclipse.stardust.engine.api.runtime.UserGroupExistsException;
import org.eclipse.stardust.engine.api.runtime.UserService;
import org.eclipse.stardust.ui.web.admin.AdminportalConstants;
import org.eclipse.stardust.ui.web.admin.WorkflowFacade;
@@ -61,6 +62,8 @@ public class CreateOrModifyUserGroupBean extends PopupUIComponentBean
private ICallbackHandler iCallbackHandler;
private AdminMessagesPropertiesBean propsBean;
+
+ private String validationMessage;
/**
*
@@ -85,7 +88,8 @@ public class CreateOrModifyUserGroupBean extends PopupUIComponentBean
if (!DateValidator.validInputDate(userGroup.getValidFrom(), userGroup
.getValidTo()))
{
- throw new Exception(propsBean.getString("views.userGroupMgmt.invalidDate"));
+ validationMessage = propsBean.getString("views.userGroupMgmt.invalidDate");
+ return;
}
UserService service = workflowFacade.getServiceFactory().getUserService();
if (!modifyMode)
@@ -119,6 +123,11 @@ public class CreateOrModifyUserGroupBean extends PopupUIComponentBean
MessageDialog.addErrorMessage(fs.getDetail());
}
+ catch (UserGroupExistsException e)
+ {
+ validationMessage = propsBean.getParamString("views.userGroupMgmt.notifyUserGroupExistMsg", userGroup.getId());
+ return;
+ }
catch (Exception e)
{
ExceptionHandler.handleException(e);
@@ -151,6 +160,7 @@ public class CreateOrModifyUserGroupBean extends PopupUIComponentBean
modifyMode = false;
this.userGroup = new UserGroupBean();
}
+ validationMessage = null;
super.openPopup();
}
@@ -222,12 +232,14 @@ public class CreateOrModifyUserGroupBean extends PopupUIComponentBean
@Override
public void initialize()
+ {}
+
+ public String getValidationMessage()
{
- // TODO Auto-generated method stub
-
+ return validationMessage;
}
- @Override
+ @Override
public void closePopup() {
FacesUtils.refreshPage();
super.closePopup();
diff --git a/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyUserGroup.xhtml b/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyUserGroup.xhtml
index 80c0f42..7111673 100644
--- a/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyUserGroup.xhtml
+++ b/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyUserGroup.xhtml
@@ -30,6 +30,7 @@
<ice:panelGroup>
<ice:panelGroup styleClass="msgError">
<ice:message for="applyUserGroup" />
+ <ice:outputText value="#{createOrModifyUserGroupBean.validationMessage}" styleClass="msgError" />
</ice:panelGroup>
<ice:panelGrid columns="2" headerClass="heading">
<ice:outputLabel
diff --git a/admin-portal/src/main/resources/admin-portal-messages.properties b/admin-portal/src/main/resources/admin-portal-messages.properties
index 7dd0fda..2cfa56c 100644
--- a/admin-portal/src/main/resources/admin-portal-messages.properties
+++ b/admin-portal/src/main/resources/admin-portal-messages.properties
@@ -209,6 +209,7 @@ views.userGroupMgmt.notifySuccessMsg=Success in Invalidating User Groups
views.userGroupMgmt.notifyUserGroupInvalidate=Invalidated User Group
views.userGroupMgmt.notifyNonValidateMsg=Failure in Invalidating User Groups
views.userGroupMgmt.notifyUserGroupNotValidateMsg=User Group is already invalidated
+views.userGroupMgmt.notifyUserGroupExistMsg=User group with ID '{0}' already exists
#Realm Management view
views.realmMgmt.label=Realm Management
diff --git a/admin-portal/src/main/resources/admin-portal-messages_de.properties b/admin-portal/src/main/resources/admin-portal-messages_de.properties
index 8231ec7..5d6911c 100644
--- a/admin-portal/src/main/resources/admin-portal-messages_de.properties
+++ b/admin-portal/src/main/resources/admin-portal-messages_de.properties
@@ -208,6 +208,7 @@ views.userGroupMgmt.notifySuccessMsg = Erfolgreiche Annullierung der Benutzergru
views.userGroupMgmt.notifyUserGroupInvalidate = Benutzergruppe annulliert
views.userGroupMgmt.notifyNonValidateMsg = Annullierung der Benutzergruppe fehlgeschlagen.
views.userGroupMgmt.notifyUserGroupNotValidateMsg = Benutzergruppe ist bereits ung\u00FCltig.
+views.userGroupMgmt.notifyUserGroupExistMsg=+User group with ID '{0}' already exists
#Realm Management view
views.realmMgmt.label = Realm Verwaltung
diff --git a/admin-portal/src/main/resources/admin-portal-messages_ja.properties b/admin-portal/src/main/resources/admin-portal-messages_ja.properties
index 8fc79f7..05d454d 100644
--- a/admin-portal/src/main/resources/admin-portal-messages_ja.properties
+++ b/admin-portal/src/main/resources/admin-portal-messages_ja.properties
@@ -208,6 +208,7 @@ views.userGroupMgmt.notifySuccessMsg = \u30E6\u30FC\u30B6\u30B0\u30EB\u30FC\u30D
views.userGroupMgmt.notifyUserGroupInvalidate = \u7121\u52B9\u5316\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30B0\u30EB\u30FC\u30D7
views.userGroupMgmt.notifyNonValidateMsg = \u30E6\u30FC\u30B6\u30B0\u30EB\u30FC\u30D7\u306E\u7121\u52B9\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F
views.userGroupMgmt.notifyUserGroupNotValidateMsg = \u3059\u3067\u306B\u30E6\u30FC\u30B6\u30B0\u30EB\u30FC\u30D7\u304C\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u3059
+views.userGroupMgmt.notifyUserGroupExistMsg=+User group with ID '{0}' already exists
#Realm Management view
views.realmMgmt.label = \u30EC\u30EB\u30E0\u7BA1\u7406
diff --git a/admin-portal/src/main/resources/admin-portal-messages_zh_CN.properties b/admin-portal/src/main/resources/admin-portal-messages_zh_CN.properties
index b89852b..ed2cc92 100644
--- a/admin-portal/src/main/resources/admin-portal-messages_zh_CN.properties
+++ b/admin-portal/src/main/resources/admin-portal-messages_zh_CN.properties
@@ -208,6 +208,7 @@ views.userGroupMgmt.notifySuccessMsg = \u6CE8\u9500\u7528\u6237\u7EC4\u6210\u529
views.userGroupMgmt.notifyUserGroupInvalidate = \u6CE8\u9500\u7528\u6237\u7EC4
views.userGroupMgmt.notifyNonValidateMsg = \u6CE8\u9500\u7528\u6237\u7EC4\u5931\u8D25
views.userGroupMgmt.notifyUserGroupNotValidateMsg = \u7528\u6237\u7EC4\u5DF2\u6CE8\u9500
+views.userGroupMgmt.notifyUserGroupExistMsg=+User group with ID '{0}' already exists
#Realm Management view
views.realmMgmt.label = \u57DF\u7BA1\u7406
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 2052ccf..a01373c 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
@@ -174,6 +174,7 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
{
boolean success = true;
passwordValidationMsg = null;
+ validationMsg = null;
MessagesViewsCommonBean propsBean = MessagesViewsCommonBean.getInstance();
User newUser = null;
if (FacesContext.getCurrentInstance().getMessages().hasNext())
@@ -182,7 +183,8 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
{
if (!DateValidator.validInputDate(getValidFrom(), getValidTo()))
{
- throw new UserDefinedException(propsBean.getString("views.createUser.invalidDate"), "");//TODO:avoid this Exception type
+ validationMsg = propsBean.getString("views.createUser.invalidDate");
+ return;
}
if (!validatePassword(getPassword()))
{
@@ -263,11 +265,6 @@ public class UserProfileBean extends PopupUIComponentBean implements Confirmatio
success = false;
validationMsg = ExceptionHandler.getExceptionMessage(e);
}
- catch (UserDefinedException e)
- {
- success = false;
- ExceptionHandler.handleException(e);
- }
if (success)
{