Author: chris.laprun(a)jboss.com
Date: 2012-02-09 14:04:37 -0500 (Thu, 09 Feb 2012)
New Revision: 8416
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java
Log:
- GTNPORTAL-1673: Use UserConfigurableValidator where appropriate.
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2012-02-08
21:46:22 UTC (rev 8415)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2012-02-09
19:04:37 UTC (rev 8416)
@@ -18,9 +18,6 @@
*/
package org.exoplatform.account.webui.component;
-import javax.portlet.PortletPreferences;
-
-import org.exoplatform.portal.pom.config.Utils;
import org.exoplatform.portal.webui.CaptchaValidator;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
@@ -32,14 +29,14 @@
import org.exoplatform.webui.form.UIFormInputWithActions;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.EmailAddressValidator;
-import org.exoplatform.webui.form.validator.ExpressionValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.NaturalLanguageValidator;
import org.exoplatform.webui.form.validator.PasswordStringLengthValidator;
-import org.exoplatform.webui.form.validator.ResourceValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
-import org.exoplatform.webui.form.validator.UsernameValidator;
+import org.exoplatform.webui.form.validator.UserConfigurableValidator;
+import javax.portlet.PortletPreferences;
+
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
* @version $Id$
@@ -66,8 +63,10 @@
public UIRegisterInputSet(String name) throws Exception{
super(name);
+ /*addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class)
+ .addValidator(UsernameValidator.class, 3, 30));*/
addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class)
- .addValidator(UsernameValidator.class, 3, 30));
+ .addValidator(UserConfigurableValidator.class,
UserConfigurableValidator.USERNAME));
addUIFormInput(new UIFormStringInput(PASSWORD, PASSWORD,
null).setType(UIFormStringInput.PASSWORD_TYPE)
.addValidator(MandatoryValidator.class).addValidator(PasswordStringLengthValidator.class,
6, 30));
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2012-02-08
21:46:22 UTC (rev 8415)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupMembershipForm.java 2012-02-09
19:04:37 UTC (rev 8416)
@@ -19,6 +19,7 @@
package org.exoplatform.organization.webui.component;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.services.organization.Group;
import org.exoplatform.services.organization.Membership;
import org.exoplatform.services.organization.MembershipHandler;
@@ -26,7 +27,6 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.ComponentConfigs;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -36,13 +36,12 @@
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.core.model.SelectItemOption;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormSelectBox;
import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.ExpressionValidator;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.exoplatform.webui.form.validator.UserConfigurableValidator;
import org.exoplatform.webui.organization.account.UIUserSelector;
import java.util.ArrayList;
@@ -77,9 +76,10 @@
public UIGroupMembershipForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class)
+ /*addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(MandatoryValidator.class)
.addValidator(ExpressionValidator.class,
"^\\p{L}[\\p{L}\\d._\\-\\s*,\\s*]+$",
- "UIGroupMembershipForm.msg.Invalid-char"));
+ "UIGroupMembershipForm.msg.Invalid-char"));*/
+ addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME,
null).addValidator(UserConfigurableValidator.class,
UserConfigurableValidator.GROUPMEMBERSHIP,
UserConfigurableValidator.GROUP_MEMBERSHIP_LOCALIZATION_KEY));
addUIFormInput(new UIFormSelectBox("membership", "membership",
listOption).setSize(1));
UIPopupWindow searchUserPopup = addChild(UIPopupWindow.class,
"SearchUser", "SearchUser");
searchUserPopup.setWindowSize(640, 0);
Modified:
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java
===================================================================
---
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java 2012-02-08
21:46:22 UTC (rev 8415)
+++
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java 2012-02-09
19:04:37 UTC (rev 8416)
@@ -20,7 +20,6 @@
package org.exoplatform.webui.organization;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
-import org.exoplatform.portal.pom.config.Utils;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
@@ -30,13 +29,11 @@
import org.exoplatform.webui.form.UIFormInputWithActions;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.validator.EmailAddressValidator;
-import org.exoplatform.webui.form.validator.ExpressionValidator;
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.NaturalLanguageValidator;
import org.exoplatform.webui.form.validator.PasswordStringLengthValidator;
-import org.exoplatform.webui.form.validator.ResourceValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
-import org.exoplatform.webui.form.validator.UsernameValidator;
+import org.exoplatform.webui.form.validator.UserConfigurableValidator;
/**
* Created by The eXo Platform SARL
@@ -62,7 +59,7 @@
{
super(name);
addUIFormInput(new UIFormStringInput(USERNAME, "userName",
null).addValidator(MandatoryValidator.class)
- .addValidator(UsernameValidator.class, 3, 30));
+ .addValidator(UserConfigurableValidator.class,
UserConfigurableValidator.USERNAME));
addUIFormInput(new UIFormStringInput(PASSWORD1X, "password",
null).setType(UIFormStringInput.PASSWORD_TYPE)
.addValidator(MandatoryValidator.class).addValidator(PasswordStringLengthValidator.class,
6, 30));