gatein SVN: r8603 - epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 20:19:43 -0400 (Wed, 14 Mar 2012)
New Revision: 8603
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
Log:
- Removed NumberRangeValidator references that don't exist in EPP.
Modified: epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java 2012-03-14 17:21:09 UTC (rev 8602)
+++ epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java 2012-03-15 00:19:43 UTC (rev 8603)
@@ -27,7 +27,6 @@
import org.exoplatform.webui.form.validator.IdentifierValidator;
import org.exoplatform.webui.form.validator.NameValidator;
import org.exoplatform.webui.form.validator.NumberFormatValidator;
-import org.exoplatform.webui.form.validator.NumberRangeValidator;
import org.exoplatform.webui.form.validator.PositiveNumberFormatValidator;
import org.exoplatform.webui.form.validator.ResourceValidator;
import org.exoplatform.webui.form.validator.SpecialCharacterValidator;
@@ -178,21 +177,6 @@
assertFalse(expected(validator, "-01"));
}
- public void testNumberRangeValidator()
- {
- Validator validator = new NumberRangeValidator(-5, 5);
- assertTrue(expected(validator, "-5"));
- assertTrue(expected(validator, "-1"));
- assertTrue(expected(validator, "0"));
- assertTrue(expected(validator, "1"));
- assertTrue(expected(validator, "5"));
-
- assertFalse(expected(validator, "-10"));
- assertFalse(expected(validator, "-6"));
- assertFalse(expected(validator, "6"));
- assertFalse(expected(validator, "10"));
- }
-
public void testSpecialCharacterValidator()
{
Validator validator = new SpecialCharacterValidator();
12 years, 10 months
gatein SVN: r8602 - in portal/trunk/webui/core/src: test/java/org/exoplatform/webui/test/validator and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 13:21:09 -0400 (Wed, 14 Mar 2012)
New Revision: 8602
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java
portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
Log:
- GTNPORTAL-2378: Improved group membership regular expression, added test cases.
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java 2012-03-14 17:19:38 UTC (rev 8601)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java 2012-03-14 17:21:09 UTC (rev 8602)
@@ -67,7 +67,8 @@
public static final String USERNAME = "username";
public static final String GROUPMEMBERSHIP = "groupmembership";
public static final String DEFAULT_LOCALIZATION_KEY = "ExpressionValidator.msg.value-invalid";
- public static final String GROUP_MEMBERSHIP_VALIDATION_REGEX = "^\\p{L}[\\p{L}\\d._\\-\\s*,\\s*]+$";
+ /** Note that this regular expression should actually validate comma-separated usernames. This is not the case as some constraints (consecutive symbols for examples) are not taken into account. */
+ public static final String GROUP_MEMBERSHIP_VALIDATION_REGEX = "^(\\p{Lower}[\\p{Lower}\\d\\._]+)(\\s*,\\s*(\\p{Lower}[\\p{Lower}\\d\\._]+))*$";
public static final String GROUP_MEMBERSHIP_LOCALIZATION_KEY = "UIGroupMembershipForm.msg.Invalid-char";
private static Map<String, ValidatorConfiguration> configurations = new HashMap<String, ValidatorConfiguration>(3);
Modified: portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
===================================================================
--- portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java 2012-03-14 17:19:38 UTC (rev 8601)
+++ portal/trunk/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java 2012-03-14 17:21:09 UTC (rev 8602)
@@ -41,7 +41,6 @@
/**
* @author <a href="mailto:haint@exoplatform.com">Nguyen Thanh Hai</a>
- *
* @datSep 26, 2011
*/
public class TestWebuiValidator extends TestCase
@@ -115,6 +114,26 @@
assertFalse(expected(validator, "Root"));
}
+ public void validateUsernamesInGroupMembership()
+ {
+ final UserConfigurableValidator validator = new UserConfigurableValidator(UserConfigurableValidator.GROUPMEMBERSHIP);
+ assertTrue(expected(validator, "root.gtn"));
+ assertTrue(expected(validator, "root_gtn"));
+ assertTrue(expected(validator, "root_gtn.01"));
+ assertTrue(expected(validator, "a1,foo,bar"));
+ assertTrue(expected(validator, "a1 ,\tfoo,\nbar \r"));
+ assertFalse(expected(validator, "a1 ,\tfoo,\nbar \ra"));
+ assertFalse(expected(validator, "a1 ,\tfoo,\nbar \r,a"));
+ assertFalse(expected(validator, "root_gtn_"));
+ assertFalse(expected(validator, "_root_gtn"));
+// assertFalse(expected(validator, "root__gtn")); // not taken into account yet
+// assertFalse(expected(validator, "root._gtn")); // not taken into account yet
+ assertFalse(expected(validator, "root--gtn"));
+ assertFalse(expected(validator, "root*gtn"));
+ assertFalse(expected(validator, "Root"));
+ assertFalse(expected(validator, "a"));
+ }
+
public void testEmailValidator()
{
Validator validator = new EmailAddressValidator();
@@ -158,7 +177,7 @@
assertFalse(expected(validator, "01"));
assertFalse(expected(validator, "-01"));
}
-
+
public void testNumberRangeValidator()
{
Validator validator = new NumberRangeValidator(-5, 5);
@@ -167,28 +186,28 @@
assertTrue(expected(validator, "0"));
assertTrue(expected(validator, "1"));
assertTrue(expected(validator, "5"));
-
+
assertFalse(expected(validator, "-10"));
assertFalse(expected(validator, "-6"));
assertFalse(expected(validator, "6"));
assertFalse(expected(validator, "10"));
}
-
+
public void testSpecialCharacterValidator()
{
- Validator validator= new SpecialCharacterValidator();
- assertTrue(expected(validator,"aAzZ caffé"));
- assertFalse(expected(validator,"aAzZ\tcaffé"));
- assertFalse(expected(validator,"aAzZ\ncaffé"));
- assertFalse(expected(validator,"aAzZ \rcaffé"));
- assertFalse(expected(validator,"\tcaffé"));
- assertFalse(expected(validator,"\ncaffé"));
- assertFalse(expected(validator,"\rcaffé"));
- assertTrue(expected(validator,"\n"));
+ Validator validator = new SpecialCharacterValidator();
+ assertTrue(expected(validator, "aAzZ caffé"));
+ assertFalse(expected(validator, "aAzZ\tcaffé"));
+ assertFalse(expected(validator, "aAzZ\ncaffé"));
+ assertFalse(expected(validator, "aAzZ \rcaffé"));
+ assertFalse(expected(validator, "\tcaffé"));
+ assertFalse(expected(validator, "\ncaffé"));
+ assertFalse(expected(validator, "\rcaffé"));
+ assertTrue(expected(validator, "\n"));
assertTrue(expected(validator, "\t"));
assertTrue(expected(validator, "\n"));
}
-
+
public void testResourceValidator()
{
Validator validator = new ResourceValidator();
@@ -196,7 +215,7 @@
assertFalse(expected(validator, "_caffé"));
assertFalse(expected(validator, "0caffé"));
}
-
+
public void testNameValidator()
{
Validator validator = new NameValidator();
@@ -204,7 +223,7 @@
assertTrue(expected(validator, "*caffé"));
assertTrue(expected(validator, "0caffé"));
}
-
+
public void testIdentifierValidator()
{
Validator validator = new IdentifierValidator();
12 years, 10 months
gatein SVN: r8601 - portal/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 13:19:38 -0400 (Wed, 14 Mar 2012)
New Revision: 8601
Modified:
portal/trunk/pom.xml
Log:
- Reverted improper change.
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2012-03-14 17:16:44 UTC (rev 8600)
+++ portal/trunk/pom.xml 2012-03-14 17:19:38 UTC (rev 8601)
@@ -47,7 +47,7 @@
<org.gatein.wci.version>2.1.1-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.3.1-GA</org.gatein.pc.version>
<org.picketlink.idm>1.3.1.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.2.0-Alpha01-SNAPSHOT</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.1.1-CR02</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.1-GA</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.1-GA</org.gatein.mgmt.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
12 years, 10 months
gatein SVN: r8600 - in epp/portal/branches/EPP_5_2_Branch/webui/core/src: test/java/org/exoplatform/webui/test and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 13:16:44 -0400 (Wed, 14 Mar 2012)
New Revision: 8600
Added:
epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/
epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/MockRequestContext.java
epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java
Log:
bz 801207 GTNPORTAL-2378: Improved group membership regular expression, added test cases.
Modified: epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java 2012-03-14 16:24:13 UTC (rev 8599)
+++ epp/portal/branches/EPP_5_2_Branch/webui/core/src/main/java/org/exoplatform/webui/form/validator/UserConfigurableValidator.java 2012-03-14 17:16:44 UTC (rev 8600)
@@ -67,7 +67,8 @@
public static final String USERNAME = "username";
public static final String GROUPMEMBERSHIP = "groupmembership";
public static final String DEFAULT_LOCALIZATION_KEY = "ExpressionValidator.msg.value-invalid";
- public static final String GROUP_MEMBERSHIP_VALIDATION_REGEX = "^\\p{L}[\\p{L}\\d._\\-\\s*,\\s*]+$";
+ /** Note that this regular expression should actually validate comma-separated usernames. This is not the case as some constraints (consecutive symbols for examples) are not taken into account. */
+ public static final String GROUP_MEMBERSHIP_VALIDATION_REGEX = "^(\\p{Lower}[\\p{Lower}\\d\\._]+)(\\s*,\\s*(\\p{Lower}[\\p{Lower}\\d\\._]+))*$";
public static final String GROUP_MEMBERSHIP_LOCALIZATION_KEY = "UIGroupMembershipForm.msg.Invalid-char";
private static Map<String, ValidatorConfiguration> configurations = new HashMap<String, ValidatorConfiguration>(3);
Added: epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/MockRequestContext.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/MockRequestContext.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/MockRequestContext.java 2012-03-14 17:16:44 UTC (rev 8600)
@@ -0,0 +1,127 @@
+/**
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.webui.test.validator;
+
+import java.util.Locale;
+
+import org.exoplatform.portal.mop.user.UserPortal;
+import org.exoplatform.services.resources.Orientation;
+import org.exoplatform.web.application.URLBuilder;
+import org.exoplatform.web.url.PortalURL;
+import org.exoplatform.web.url.ResourceType;
+import org.exoplatform.web.url.URLFactory;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.core.UIComponent;
+
+/**
+ * @author <a href="mailto:haint@exoplatform.com">Nguyen Thanh Hai</a>
+ *
+ * @datSep 28, 2011
+ */
+public class MockRequestContext extends WebuiRequestContext
+{
+ private Locale locale;
+
+ public MockRequestContext(Locale locale)
+ {
+ super(null);
+ this.locale = locale;
+ }
+
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ @Override
+ public URLBuilder<UIComponent> getURLBuilder()
+ {
+ return null;
+ }
+
+ @Override
+ public String getRequestContextPath()
+ {
+ return null;
+ }
+
+ @Override
+ public String getPortalContextPath()
+ {
+ return null;
+ }
+
+ @Override
+ public <T> T getRequest() throws Exception
+ {
+ return null;
+ }
+
+ @Override
+ public <T> T getResponse() throws Exception
+ {
+ return null;
+ }
+
+ @Override
+ public void sendRedirect(String url) throws Exception
+ {
+
+ }
+
+ @Override
+ public URLFactory getURLFactory()
+ {
+ return null;
+ }
+
+ @Override
+ public <R, U extends PortalURL<R, U>> U newURL(ResourceType<R, U> resourceType, URLFactory urlFactory)
+ {
+ return null;
+ }
+
+ @Override
+ public Orientation getOrientation()
+ {
+ return null;
+ }
+
+ @Override
+ public String getRequestParameter(String name)
+ {
+ return null;
+ }
+
+ @Override
+ public String[] getRequestParameterValues(String name)
+ {
+ return null;
+ }
+
+ @Override
+ public boolean useAjax()
+ {
+ return false;
+ }
+
+ @Override
+ public UserPortal getUserPortal()
+ {
+ return null;
+ }
+}
Added: epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java (rev 0)
+++ epp/portal/branches/EPP_5_2_Branch/webui/core/src/test/java/org/exoplatform/webui/test/validator/TestWebuiValidator.java 2012-03-14 17:16:44 UTC (rev 8600)
@@ -0,0 +1,306 @@
+/**
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.webui.test.validator;
+
+import junit.framework.TestCase;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.exception.MessageException;
+import org.exoplatform.webui.form.UIFormDateTimeInput;
+import org.exoplatform.webui.form.UIFormInput;
+import org.exoplatform.webui.form.validator.DateTimeValidator;
+import org.exoplatform.webui.form.validator.EmailAddressValidator;
+import org.exoplatform.webui.form.validator.IdentifierValidator;
+import org.exoplatform.webui.form.validator.NameValidator;
+import org.exoplatform.webui.form.validator.NumberFormatValidator;
+import org.exoplatform.webui.form.validator.NumberRangeValidator;
+import org.exoplatform.webui.form.validator.PositiveNumberFormatValidator;
+import org.exoplatform.webui.form.validator.ResourceValidator;
+import org.exoplatform.webui.form.validator.SpecialCharacterValidator;
+import org.exoplatform.webui.form.validator.URLValidator;
+import org.exoplatform.webui.form.validator.UserConfigurableValidator;
+import org.exoplatform.webui.form.validator.UsernameValidator;
+import org.exoplatform.webui.form.validator.Validator;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:haint@exoplatform.com">Nguyen Thanh Hai</a>
+ * @datSep 26, 2011
+ */
+public class TestWebuiValidator extends TestCase
+{
+ public void testUrlValidator()
+ {
+ Validator validator = new URLValidator();
+ // Test ip address and invalidate subnet masks ip
+ assertTrue(expected(validator, "https://192.168.1.1"));
+ assertTrue(expected(validator, "ftp://255.255.255.1"));
+ assertTrue(expected(validator, "ftps://255.255.0.1"));
+ assertTrue(expected(validator, "ftp://0.0.0.0"));
+ assertTrue(expected(validator, "http://127.0.0.1"));
+ assertTrue(expected(validator, "https://192.168.4.90"));
+ assertTrue(expected(validator, "https://192.168.4.90:8080"));
+ assertTrue(expected(validator, "http://127.0.0.1:8080"));
+ assertFalse(expected(validator, "http://127.0.0.01"));
+ assertFalse(expected(validator, "ftp://255.255.255.255"));
+
+ // Test domain name and uri
+ assertTrue(expected(validator, "https://www.exoplatform.com"));
+ assertTrue(expected(validator, "ftps://root:gtn@exoplatform.com"));
+ assertTrue(expected(validator, "ftps://root@exoplatform.com"));
+ assertTrue(expected(validator, "https://www.dev.exoplatform.com"));
+ assertTrue(expected(validator, "https://www.dev.exoplatform.com:8888"));
+ assertFalse(expected(validator, "https://www.dev.exoplatform.com:8888?arg=value"));
+ assertTrue(expected(validator, "https://www.dev.exoplatform.com:8888/path?arg=value"));
+ assertTrue(expected(validator, "https://www.dev.exoplatform.com:8888/path?arg=value#"));
+ }
+
+ public void testDateTimeValidator()
+ {
+ Validator validator = new DateTimeValidator();
+ WebuiRequestContext.setCurrentInstance(new MockRequestContext(new Locale("fr")));
+ UIFormDateTimeInput uiInput = new UIFormDateTimeInput("currentDate", "currentDate", null);
+ uiInput.setValue("28/09/2011 10:59:59");
+ assertTrue(expected(validator, uiInput));
+ uiInput.setValue("09/28/2011 10:59:59");
+ assertFalse(expected(validator, uiInput));
+
+ WebuiRequestContext.setCurrentInstance(new MockRequestContext(new Locale("en")));
+ uiInput = new UIFormDateTimeInput("currentDate", "currentDate", null);
+ uiInput.setValue("09/28/2011 10:59:59");
+ assertTrue(expected(validator, uiInput));
+ uiInput.setValue("09-28-2011 10:59:59");
+ assertFalse(expected(validator, uiInput));
+ uiInput.setValue("28/09/2011 10:59:59");
+ assertFalse(expected(validator, uiInput));
+ }
+
+ public void testUsernameValidator()
+ {
+ Validator validator = new UsernameValidator(3, 30);
+ validateUsernames(validator);
+
+ validator = new UserConfigurableValidator(UserConfigurableValidator.USERNAME);
+ validateUsernames(validator);
+ }
+
+ private void validateUsernames(Validator validator)
+ {
+ assertTrue(expected(validator, "root.gtn"));
+ assertTrue(expected(validator, "root_gtn"));
+ assertTrue(expected(validator, "root_gtn.01"));
+ assertFalse(expected(validator, "root_gtn_"));
+ assertFalse(expected(validator, "_root_gtn"));
+ assertFalse(expected(validator, "root__gtn"));
+ assertFalse(expected(validator, "root._gtn"));
+ assertFalse(expected(validator, "root--gtn"));
+ assertFalse(expected(validator, "root*gtn"));
+ assertFalse(expected(validator, "Root"));
+ }
+
+ public void validateUsernamesInGroupMembership()
+ {
+ final UserConfigurableValidator validator = new UserConfigurableValidator(UserConfigurableValidator.GROUPMEMBERSHIP);
+ assertTrue(expected(validator, "root.gtn"));
+ assertTrue(expected(validator, "root_gtn"));
+ assertTrue(expected(validator, "root_gtn.01"));
+ assertTrue(expected(validator, "a1,foo,bar"));
+ assertTrue(expected(validator, "a1 ,\tfoo,\nbar \r"));
+ assertFalse(expected(validator, "a1 ,\tfoo,\nbar \ra"));
+ assertFalse(expected(validator, "a1 ,\tfoo,\nbar \r,a"));
+ assertFalse(expected(validator, "root_gtn_"));
+ assertFalse(expected(validator, "_root_gtn"));
+// assertFalse(expected(validator, "root__gtn")); // not taken into account yet
+// assertFalse(expected(validator, "root._gtn")); // not taken into account yet
+ assertFalse(expected(validator, "root--gtn"));
+ assertFalse(expected(validator, "root*gtn"));
+ assertFalse(expected(validator, "Root"));
+ assertFalse(expected(validator, "a"));
+ }
+
+ public void testEmailValidator()
+ {
+ Validator validator = new EmailAddressValidator();
+ assertFalse(expected(validator, "root"));
+ assertTrue(expected(validator, "root.gtn(a)exoplatform.com"));
+ assertTrue(expected(validator, "root.exo.gtn.portal(a)explatform.biz.edu.vn"));
+ assertTrue(expected(validator, "root_exo_gtn_portal(a)explatform-edu.biz.vn"));
+ assertFalse(expected(validator, "root_exo_gtn_portal(a)explatform-edu.biz-vn"));
+ assertFalse(expected(validator, "root_exo_gtn_portal(a)explatform-edu.biz9vn"));
+ assertFalse(expected(validator, "root_exo_gtn_portal(a)explatform--edu.biz.vn"));
+ assertFalse(expected(validator, "root_exo_gtn_portal(a)-explatform.biz"));
+ assertFalse(expected(validator, "root_exo_gtn_portal(a)explatform_biz_edu.vn"));
+ assertFalse(expected(validator, "root_exo_gtn_portal@explatform_biz_edu_vn"));
+ assertFalse(expected(validator, "root_gtn--(a)portal.org"));
+ assertFalse(expected(validator, "root__gtn(a)portal.org"));
+ assertFalse(expected(validator, "root_.gtn(a)portal.org"));
+ assertFalse(expected(validator, "--root.gtn(a)portal.org"));
+ assertFalse(expected(validator, "root.gtn@.portal.org"));
+ }
+
+ public void testNumberValidator()
+ {
+ Validator validator = new NumberFormatValidator();
+ assertTrue(expected(validator, "1001"));
+ assertTrue(expected(validator, "0"));
+ assertFalse(expected(validator, "01"));
+ assertFalse(expected(validator, "-01"));
+ assertFalse(expected(validator, "-0"));
+ assertFalse(expected(validator, "000"));
+ assertFalse(expected(validator, "-01"));
+ assertFalse(expected(validator, "1,5"));
+ assertFalse(expected(validator, "1.5"));
+ }
+
+ public void testPositiveNumberValidator()
+ {
+ Validator validator = new PositiveNumberFormatValidator();
+ assertTrue(expected(validator, "1"));
+ assertTrue(expected(validator, "0"));
+ assertFalse(expected(validator, "-1"));
+ assertFalse(expected(validator, "01"));
+ assertFalse(expected(validator, "-01"));
+ }
+
+ public void testNumberRangeValidator()
+ {
+ Validator validator = new NumberRangeValidator(-5, 5);
+ assertTrue(expected(validator, "-5"));
+ assertTrue(expected(validator, "-1"));
+ assertTrue(expected(validator, "0"));
+ assertTrue(expected(validator, "1"));
+ assertTrue(expected(validator, "5"));
+
+ assertFalse(expected(validator, "-10"));
+ assertFalse(expected(validator, "-6"));
+ assertFalse(expected(validator, "6"));
+ assertFalse(expected(validator, "10"));
+ }
+
+ public void testSpecialCharacterValidator()
+ {
+ Validator validator = new SpecialCharacterValidator();
+ assertTrue(expected(validator, "aAzZ caffé"));
+ assertFalse(expected(validator, "aAzZ\tcaffé"));
+ assertFalse(expected(validator, "aAzZ\ncaffé"));
+ assertFalse(expected(validator, "aAzZ \rcaffé"));
+ assertFalse(expected(validator, "\tcaffé"));
+ assertFalse(expected(validator, "\ncaffé"));
+ assertFalse(expected(validator, "\rcaffé"));
+ assertTrue(expected(validator, "\n"));
+ assertTrue(expected(validator, "\t"));
+ assertTrue(expected(validator, "\n"));
+ }
+
+ public void testResourceValidator()
+ {
+ Validator validator = new ResourceValidator();
+ assertTrue(expected(validator, "caffé_-.--"));
+ assertFalse(expected(validator, "_caffé"));
+ assertFalse(expected(validator, "0caffé"));
+ }
+
+ public void testNameValidator()
+ {
+ Validator validator = new NameValidator();
+ assertTrue(expected(validator, "caffé_-.*"));
+ assertTrue(expected(validator, "*caffé"));
+ assertTrue(expected(validator, "0caffé"));
+ }
+
+ public void testIdentifierValidator()
+ {
+ Validator validator = new IdentifierValidator();
+ assertTrue(expected(validator, "caffé-_"));
+ assertTrue(expected(validator, "caffé01"));
+ assertFalse(expected(validator, "-caffé"));
+ assertFalse(expected(validator, "01caffé"));
+ }
+
+ public boolean expected(Validator validator, final String input)
+ {
+ UIFormInput uiInput = new MockUIFormImput()
+ {
+ public Object getValue() throws Exception
+ {
+ return input;
+ }
+ };
+ return expected(validator, uiInput);
+ }
+
+ public boolean expected(Validator validator, UIFormInput uiInput)
+ {
+ try
+ {
+ validator.validate(uiInput);
+ return true;
+ }
+ catch (MessageException e)
+ {
+ return false;
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static class MockUIFormImput extends UIComponent implements UIFormInput
+ {
+ public String getBindingField()
+ {
+ return null;
+ }
+
+ public String getLabel()
+ {
+ return null;
+ }
+
+ public UIFormInput addValidator(Class clazz, Object... params) throws Exception
+ {
+ return null;
+ }
+
+ public List getValidators()
+ {
+ return null;
+ }
+
+ public Object getValue() throws Exception
+ {
+ return null;
+ }
+
+ public UIFormInput setValue(Object value) throws Exception
+ {
+ return null;
+ }
+
+ public Class getTypeValue()
+ {
+ return null;
+ }
+
+ public void reset()
+ {
+ }
+ }
+}
12 years, 10 months
gatein SVN: r8599 - portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 12:24:13 -0400 (Wed, 14 Mar 2012)
New Revision: 8599
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_fr.properties
Log:
- GTNPORTAL-2377:
+ Only output one message of each type in CompoundApplicationMessage
+ Fixed UsernameValidator and improved IdentifierValidator and ResourceValidator to fail fast when we have an error condition in a loop
+ Fixed improper/missing localization in EN and FR properties, would need to be done for other languages as well
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 2012-03-14 16:19:24 UTC (rev 8598)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2012-03-14 16:24:13 UTC (rev 8599)
@@ -230,16 +230,17 @@
#{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.
+FirstCharacterNameValidator.msg=The "{0}" field must start with a letter.
FirstAndSpecialCharacterNameValidator.msg=The "{0}" field must start with a character and must not contain special characters."
##############################################################################
# Username Validator
##############################################################################
-LastCharacterUsernameValidator.msg=The field "{0}" must end with a character or digit.
-ConsecutiveSymbolValidator.msg=The field "{0}" cannot contain consecutive "{1}" and "{2}" symbols.
-UsernameValidator.msg.Invalid-char=Only alpha lower, digit, dot and underscore characters are allowed for the field "{0}".
+LastCharacterUsernameValidator.msg=The field "{0}" must end with a character or digit instead of "{1}".
+ConsecutiveSymbolValidator.msg=The field "{0}" cannot contain consecutive symbols. Allowed symbols are: {1}.
+UsernameValidator.msg.Invalid-char=Only alpha lower, digit, dot and underscore lowercase characters are allowed for the field "{0}".
+FirstCharacterUsernameValidator.msg=The "{0}" field must start with a lowercase letter.
##############################################################################
# Natural language Validator
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-03-14 16:19:24 UTC (rev 8598)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-03-14 16:24:13 UTC (rev 8599)
@@ -203,6 +203,12 @@
NameValidator.msg.Invalid-char=Seuls les caractères "a..z", "A..Z","0..9", ".", "-" et "_" sont autorisés dans le champ "{0}".
FirstCharacterNameValidator.msg=Le champ "{0}" doit commencer par une lettre.
+# Username validator
+ConsecutiveSymbolValidator.msg=Le champ "{0}" ne peut pas contenir des symboles consécutifs. Les symboles autorisés sont: {1}.
+UsernameValidator.msg.Invalid-char=Seuls les caractères "a..z", "0..9", "." et "_" sont autorisés dans le champ "{0}".
+FirstCharacterUsernameValidator.msg=Le champ "{0}" doit commencer par une lettre minuscule.
+LastCharacterUsernameValidator.msg=Le champ "{0}" doit se terminer par une lettre minuscule ou un chiffre au lieu de "{1}".
+
#############################################################################
# Message Info #
#############################################################################
12 years, 10 months
gatein SVN: r8598 - portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 12:19:24 -0400 (Wed, 14 Mar 2012)
New Revision: 8598
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/ResourceValidator.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UsernameValidator.java
Log:
- GTNPORTAL-2377:
+ Only output one message of each type in CompoundApplicationMessage
+ Fixed UsernameValidator and improved IdentifierValidator and ResourceValidator to fail fast when we have an error condition in a loop
+ Fixed improper/missing localization in EN and FR properties, would need to be done for other languages as well
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 2012-03-14 16:19:17 UTC (rev 8597)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/IdentifierValidator.java 2012-03-14 16:19:24 UTC (rev 8598)
@@ -46,11 +46,11 @@
for (int i = 0; i < value.length(); i++)
{
char c = value.charAt(i);
- if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c == '-')
+ if (!Character.isLetter(c) && !Character.isDigit(c) && c != '_' && c != '-')
{
- continue;
+ messages.addMessage("IdentifierValidator.msg.Invalid-char", new Object[]{label});
+ break;
}
- messages.addMessage("IdentifierValidator.msg.Invalid-char", new Object[]{label});
}
}
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java 2012-03-14 16:19:17 UTC (rev 8597)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/ResourceValidator.java 2012-03-14 16:19:24 UTC (rev 8598)
@@ -38,7 +38,7 @@
protected void validate(String value, String label, CompoundApplicationMessage messages, UIFormInput uiInput)
{
char firstChar = value.charAt(0);
- if (Character.isDigit(firstChar) || firstChar == '-' || firstChar == '.' || firstChar == '_')
+ if (!Character.isLetter(firstChar))
{
Object[] args = {label, uiInput.getBindingField()};
messages.addMessage("FirstCharacterNameValidator.msg", args);
@@ -46,12 +46,12 @@
for (int i = 0; i < value.length(); i++)
{
char c = value.charAt(i);
- if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c == '-' || c == '.')
+ if (!Character.isLetter(c) && !Character.isDigit(c) && c != '_' && c != '-' && c != '.')
{
- continue;
+ Object[] args = {label};
+ messages.addMessage("ResourceValidator.msg.Invalid-char", args);
+ break;
}
- Object[] args = {label};
- messages.addMessage("ResourceValidator.msg.Invalid-char", args);
}
}
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UsernameValidator.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UsernameValidator.java 2012-03-14 16:19:17 UTC (rev 8597)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/validator/UsernameValidator.java 2012-03-14 16:19:24 UTC (rev 8598)
@@ -35,6 +35,7 @@
protected static final int DEFAULT_MAX_LENGTH = 30;
protected Integer min = DEFAULT_MIN_LENGTH;
protected Integer max = DEFAULT_MAX_LENGTH;
+ public static final String ALLOWED_SYMBOLS = "'_', '.'";
// required by @Serialized
public UsernameValidator()
@@ -62,19 +63,22 @@
if (!Character.isLowerCase(buff[0]))
{
- messages.addMessage("FirstCharacterNameValidator.msg", new Object[]{label});
+ messages.addMessage("FirstCharacterUsernameValidator.msg", new Object[]{label});
}
- if (!Character.isLetterOrDigit(buff[buff.length - 1]))
+ char c = buff[buff.length - 1];
+ if (!isLowerCaseLetterOrDigit(c))
{
- messages.addMessage("LastCharacterUsernameValidator.msg", new Object[]{label, buff[buff.length - 1]});
+ messages.addMessage("LastCharacterUsernameValidator.msg", new Object[]{label, c});
}
+ boolean hasConsecutive = false;
+ boolean hasInvalid = false;
for (int i = 1; i < buff.length - 1; i++)
{
- char c = buff[i];
+ c = buff[i];
- if (Character.isLetterOrDigit(c))
+ if (isLowerCaseLetterOrDigit(c))
{
continue;
}
@@ -84,20 +88,43 @@
char next = buff[i + 1];
if (isSymbol(next))
{
- messages.addMessage("ConsecutiveSymbolValidator.msg", new Object[]{label, buff[i], buff[i + 1]});
+ if (!hasConsecutive)
+ {
+ messages.addMessage("ConsecutiveSymbolValidator.msg", new Object[]{label, ALLOWED_SYMBOLS});
+ hasConsecutive = true;
+ }
}
else if (!Character.isLetterOrDigit(next))
{
- messages.addMessage("UsernameValidator.msg.Invalid-char", new Object[]{label});
+ if (!hasInvalid)
+ {
+ messages.addMessage("UsernameValidator.msg.Invalid-char", new Object[]{label});
+ hasInvalid = true;
+ }
}
}
else
{
- messages.addMessage("UsernameValidator.msg.Invalid-char", new Object[]{label});
+ if (!hasInvalid)
+ {
+ messages.addMessage("UsernameValidator.msg.Invalid-char", new Object[]{label});
+ hasInvalid = true;
+ }
}
+
+ // if we have both error conditions, fail "fast" instead of going on
+ if (hasConsecutive && hasInvalid)
+ {
+ break;
+ }
}
}
+ private static boolean isLowerCaseLetterOrDigit(char character)
+ {
+ return Character.isDigit(character) || (character >= 'a' && character <= 'z');
+ }
+
private static boolean isSymbol(char c)
{
return c == '_' || c == '.';
12 years, 10 months
gatein SVN: r8597 - portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 12:19:17 -0400 (Wed, 14 Mar 2012)
New Revision: 8597
Modified:
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/AbstractApplicationMessage.java
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/CompoundApplicationMessage.java
Log:
- GTNPORTAL-2377:
+ Only output one message of each type in CompoundApplicationMessage
+ Fixed UsernameValidator and improved IdentifierValidator and ResourceValidator to fail fast when we have an error condition in a loop
+ Fixed improper/missing localization in EN and FR properties, would need to be done for other languages as well
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/AbstractApplicationMessage.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/AbstractApplicationMessage.java 2012-03-14 16:19:07 UTC (rev 8596)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/AbstractApplicationMessage.java 2012-03-14 16:19:17 UTC (rev 8597)
@@ -1,16 +1,16 @@
/**
* Copyright (C) 2009 eXo Platform SAS.
- *
+ *
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
- *
+ *
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -30,23 +30,23 @@
/**
* Created by The eXo Platform SARL
* Author : Dang Van Minh
- * minhdv81(a)yahoo.com
+ * minhdv81(a)yahoo.com
* Jun 7, 2006
*/
public abstract class AbstractApplicationMessage implements Serializable
{
private static Log log = ExoLogger.getLogger(ApplicationMessage.class);
-
+
final public static int ERROR = 0, WARNING = 1, INFO = 2;
private int type_ = INFO;
-
+
private transient ResourceBundle resourceBundle;
private boolean argsLocalized = true;
public abstract String getMessage();
-
+
public void setResourceBundle(ResourceBundle resourceBundle)
{
this.resourceBundle = resourceBundle;
@@ -83,19 +83,19 @@
{
return key;
}
-
+
String value;
try
- {
- value = resourceBundle.getString(key);
+ {
+ value = resourceBundle.getString(key);
}
catch (MissingResourceException ex)
{
if (PropertyManager.isDevelopping())
{
- log.warn("Can not find resource bundle for key : " + key);
+ log.warn("Can not find resource bundle for key : " + key);
}
- value = key.substring(key.lastIndexOf('.') + 1);
+ value = key.substring(key.lastIndexOf('.') + 1);
}
return value;
}
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2012-03-14 16:19:07 UTC (rev 8596)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/ApplicationMessage.java 2012-03-14 16:19:17 UTC (rev 8597)
@@ -23,6 +23,7 @@
package org.exoplatform.web.application;
import java.io.Serializable;
+import java.util.Arrays;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class ApplicationMessage extends AbstractApplicationMessage implements Serializable
@@ -36,6 +37,40 @@
this.messageArgs_ = args;
}
+ @Override
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ ApplicationMessage that = (ApplicationMessage)o;
+
+ if (!Arrays.equals(messageArgs_, that.messageArgs_))
+ {
+ return false;
+ }
+ if (!messageKey_.equals(that.messageKey_))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = messageKey_.hashCode();
+ result = 31 * result + (messageArgs_ != null ? Arrays.hashCode(messageArgs_) : 0);
+ return result;
+ }
+
public ApplicationMessage(String key, Object[] args, int type)
{
this.messageKey_ = key;
Modified: portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/CompoundApplicationMessage.java
===================================================================
--- portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/CompoundApplicationMessage.java 2012-03-14 16:19:07 UTC (rev 8596)
+++ portal/trunk/component/web/controller/src/main/java/org/exoplatform/web/application/CompoundApplicationMessage.java 2012-03-14 16:19:17 UTC (rev 8597)
@@ -24,13 +24,15 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.ResourceBundle;
+import java.util.Set;
/** @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a> */
public class CompoundApplicationMessage extends AbstractApplicationMessage implements Serializable
{
- private List<AbstractApplicationMessage> messages = new ArrayList<AbstractApplicationMessage>(5);
+ private Set<AbstractApplicationMessage> messages = new HashSet<AbstractApplicationMessage>(5);
public CompoundApplicationMessage()
{
@@ -70,7 +72,9 @@
public void addMessage(String messageKey, Object[] args)
{
- messages.add(new ApplicationMessage(messageKey, args, AbstractApplicationMessage.WARNING));
+ final ApplicationMessage message = new ApplicationMessage(messageKey, args, AbstractApplicationMessage.WARNING);
+ message.setArgsLocalized(false);
+ messages.add(message);
}
public boolean isEmpty()
12 years, 10 months
gatein SVN: r8596 - portal/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 12:19:07 -0400 (Wed, 14 Mar 2012)
New Revision: 8596
Modified:
portal/trunk/pom.xml
Log:
- GTNPORTAL-2377:
+ Only output one message of each type in CompoundApplicationMessage
+ Fixed UsernameValidator and improved IdentifierValidator and ResourceValidator to fail fast when we have an error condition in a loop
+ Fixed improper/missing localization in EN and FR properties, would need to be done for other languages as well
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2012-03-14 16:18:37 UTC (rev 8595)
+++ portal/trunk/pom.xml 2012-03-14 16:19:07 UTC (rev 8596)
@@ -47,7 +47,7 @@
<org.gatein.wci.version>2.1.1-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.3.1-GA</org.gatein.pc.version>
<org.picketlink.idm>1.3.1.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.1.1-CR02</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.2.0-Alpha01-SNAPSHOT</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.1-GA</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.1-GA</org.gatein.mgmt.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
12 years, 10 months
gatein SVN: r8595 - in epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src: main/resources/eap and 1 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2012-03-14 12:18:37 -0400 (Wed, 14 Mar 2012)
New Revision: 8595
Added:
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/main/resources/eap/CVE-2011-4610/
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/main/resources/eap/CVE-2011-4610/jbossweb.jar
Modified:
epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/build.xml
Log:
Bug 794382 - (JBEPP-1426) Security issues have been identified in jboss web that impact EPP, BZ#741401 BZ#720948
Modified: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/build.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/build.xml 2012-03-14 16:16:37 UTC (rev 8594)
+++ epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/build.xml 2012-03-14 16:18:37 UTC (rev 8595)
@@ -78,8 +78,9 @@
</zip>
</target>
- <target name="finalTasks" depends="modifyStartupMessage,jbossws-native-PATCH,patch-RESTEasy-CVE-2012-081">
+ <target name="finalTasks" depends="modifyStartupMessage,jbossws-native-PATCH,patch-RESTEasy-CVE-2012-081,patch-JBossWeb-CVE-2011-4610">
</target>
+
<!-- Patching startup message in log when starting portal -->
<target name="modifyStartupMessage">
@@ -140,4 +141,12 @@
<copy overwrite="true" file="${resteasy_resource_jar}/resteasy-jaxrs.jar" tofile="${epp.path}/seam/lib/resteasy-jaxrs.jar"/>
<copy overwrite="true" file="${resteasy_resource_jar}/resteasy-jettison-provider.jar" tofile="${epp.path}/seam/lib/resteasy-jettison-provider.jar"/>
</target>
+
+ <target name="patch-JBossWeb-CVE-2011-4610">
+ <echo>Patch for CVE-2012-081</echo>
+ <property name="jbossweb_resource_jar" value="${basedir}/src/main/resources/eap/CVE-2011-4610/jbossweb.jar" />
+ <copy overwrite="true" file="${jbossweb_resource_jar}" tofile="${epp.path}/jboss-as/server/default/deploy/jbossweb.sar/jbossweb.jar"/>
+ <copy overwrite="true" file="${jbossweb_resource_jar}" tofile="${epp.path}/jboss-as/server/production/deploy/jbossweb.sar/jbossweb.jar"/>
+ <copy overwrite="true" file="${jbossweb_resource_jar}" tofile="${epp.path}/jboss-as/server/all/deploy/jbossweb.sar/jbossweb.jar"/>
+ </target>
</project>
\ No newline at end of file
Added: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/main/resources/eap/CVE-2011-4610/jbossweb.jar
===================================================================
(Binary files differ)
Property changes on: epp/portal/branches/EPP_5_2_Branch/distribution/jboss-epp/src/main/resources/eap/CVE-2011-4610/jbossweb.jar
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
12 years, 10 months
gatein SVN: r8594 - epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2012-03-14 12:16:37 -0400 (Wed, 14 Mar 2012)
New Revision: 8594
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
Log:
bz 801207 GTNPORTAL-2377:
+ Only output one message of each type in CompoundApplicationMessage
+ Fixed UsernameValidator and improved IdentifierValidator and ResourceValidator to fail fast when we have an error condition in a loop
+ Fixed improper/missing localization in EN and FR properties, would need to be done for other languages as well
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2012-03-14 16:16:29 UTC (rev 8593)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2012-03-14 16:16:37 UTC (rev 8594)
@@ -228,9 +228,15 @@
#{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.
+FirstCharacterNameValidator.msg=The "{0}" field must start with a letter.
FirstAndSpecialCharacterNameValidator.msg=The "{0}" field must start with a character and must not contain special characters."
+# Username validator
+LastCharacterUsernameValidator.msg=The field "{0}" must end with a character or digit instead of "{1}".
+ConsecutiveSymbolValidator.msg=The field "{0}" cannot contain consecutive symbols. Allowed symbols are: {1}.
+UsernameValidator.msg.Invalid-char=Only alpha lower, digit, dot and underscore lowercase characters are allowed for the field "{0}".
+FirstCharacterUsernameValidator.msg=The "{0}" field must start with a lowercase letter.
+
#############################################################################
# Message Info #
#############################################################################
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-03-14 16:16:29 UTC (rev 8593)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-03-14 16:16:37 UTC (rev 8594)
@@ -1,4 +1,3 @@
-
###################################################################
# WARNING THIS FILE MUST BE ENCODED IN UTF-8 FORMAT #
###################################################################
@@ -203,6 +202,12 @@
NameValidator.msg.Invalid-char=Seuls les caractères "a..z", "A..Z","0..9", ".", "-" et "_" sont autorisés dans le champ "{0}".
FirstCharacterNameValidator.msg=Le champ "{0}" doit commencer par une lettre.
+# Username validator
+ConsecutiveSymbolValidator.msg=Le champ "{0}" ne peut pas contenir des symboles consécutifs. Les symboles autorisés sont: {1}.
+UsernameValidator.msg.Invalid-char=Seuls les caractères "a..z", "0..9", "." et "_" sont autorisés dans le champ "{0}".
+FirstCharacterUsernameValidator.msg=Le champ "{0}" doit commencer par une lettre minuscule.
+LastCharacterUsernameValidator.msg=Le champ "{0}" doit se terminer par une lettre minuscule ou un chiffre au lieu de "{1}".
+
#############################################################################
# Message Info #
#############################################################################
12 years, 10 months