Author: kien_nguyen
Date: 2010-04-06 06:30:22 -0400 (Tue, 06 Apr 2010)
New Revision: 2488
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java
Log:
Fixed GTNPORTAL-966 with changing validator of FirstName, LastName in Register Portlet
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 2010-04-06
10:11:02 UTC (rev 2487)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2010-04-06
10:30:22 UTC (rev 2488)
@@ -20,6 +20,7 @@
import javax.portlet.PortletPreferences;
+import org.exoplatform.portal.pom.config.Utils;
import org.exoplatform.portal.webui.CaptchaValidator;
import org.exoplatform.portal.webui.UICaptcha;
import org.exoplatform.services.organization.Query;
@@ -73,14 +74,12 @@
.addValidator(MandatoryValidator.class).addValidator(PasswordStringLengthValidator.class,
6, 30));
addUIFormInput(new UIFormStringInput(FIRST_NAME, FIRST_NAME,
null).addValidator(StringLengthValidator.class, 3,
-
45).addValidator(MandatoryValidator.class).addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{ASCII}]+$",
-
"FirstCharacterNameValidator.msg").addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{L}._\\- \\d]+$",
- "ResourceValidator.msg.Invalid-char"));
+
45).addValidator(MandatoryValidator.class).addValidator(ExpressionValidator.class,
Utils.FIRST_CHARACTER_NAME_VALIDATOR_REGEX,
+ "FirstCharacterNameValidator.msg"));
addUIFormInput(new UIFormStringInput(LAST_NAME, LAST_NAME,
null).addValidator(StringLengthValidator.class, 3,
-
45).addValidator(MandatoryValidator.class).addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{ASCII}]+$",
-
"FirstCharacterNameValidator.msg").addValidator(ExpressionValidator.class,
"^[\\p{L}][\\p{L}._\\- \\d]+$",
- "ResourceValidator.msg.Invalid-char"));
+
45).addValidator(MandatoryValidator.class).addValidator(ExpressionValidator.class,
Utils.FIRST_CHARACTER_NAME_VALIDATOR_REGEX,
+ "FirstCharacterNameValidator.msg"));
addUIFormInput(new UIFormStringInput(EMAIL_ADDRESS, EMAIL_ADDRESS,
null).addValidator(MandatoryValidator.class).addValidator(
EmailAddressValidator.class));
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-04-06
10:11:02 UTC (rev 2487)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-04-06
10:30:22 UTC (rev 2488)
@@ -222,7 +222,8 @@
#{0}=input field name
NameValidator.msg.Invalid-char=Only alpha, digit, dot, dash and underscore characters are
allowed for the field "{0}".
-FirstCharacterNameValidator.msg=The "{0}" field must start with a character and
must not contains special characters.
+FirstCharacterNameValidator.msg=The "{0}" field must start with a character.
+FirstAndSpecialCharacterNameValidator.msg=The "{0}" field must start with a
character and must not contain special characters."
#############################################################################
# Message Info #
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java 2010-04-06
10:11:02 UTC (rev 2487)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java 2010-04-06
10:30:22 UTC (rev 2488)
@@ -58,7 +58,7 @@
if (Character.isDigit(s.charAt(0)) || s.charAt(0) == '-')
{
Object[] args = {label, uiInput.getBindingField()};
- throw new MessageException(new
ApplicationMessage("FirstCharacterNameValidator.msg", args,
+ throw new MessageException(new
ApplicationMessage("FirstAndSpecialCharacterNameValidator.msg", args,
ApplicationMessage.WARNING));
}
for (int i = 0; i < s.length(); i++)
Show replies by date