JBoss Portal SVN: r13414 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-26 07:48:45 -0400 (Tue, 26 May 2009)
New Revision: 13414
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java
Log:
[selenium] - portal wizard portalname fix
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java 2009-05-25 16:40:32 UTC (rev 13413)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/AdminPortalWizardTestCase.java 2009-05-26 11:48:45 UTC (rev 13414)
@@ -55,7 +55,7 @@
@Test(enabled = true, description = "Creates a new portal")
public void testSimpleWizard() {
- String portalName = "TestPortal";
+ String portalName = "TestWizPortal";
String pageName = "PageToWizard";
String portletType = "local";
String portletName = "Counter Portlet";
@@ -103,7 +103,7 @@
selenium.click(SUB_SUB);
selenium.waitForPageToLoad(PAGE_LOAD);
- openAndWait("/portal/auth/portal/TestPortal/PageToWizard");
+ openAndWait("/portal/auth/portal/"+portalName+"/"+pageName);
Assert.assertTrue(selenium.isTextPresent("Counter portlet"));
}
14 years, 11 months
JBoss Portal SVN: r13413 - in branches/JBoss_Portal_Branch_2_7: core-identity/src/main/org/jboss/portal/core/identity/ui/actions and 5 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-25 12:40:32 -0400 (Mon, 25 May 2009)
New Revision: 13413
Added:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
Log:
- JBEPP-90:
+ Added XSS validation to username validator
+ Added JSF validator for user profile attributes to detect XSS attempts
+ PropertyValidator can now specify which validation pattern to use
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,14 +22,13 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui;
-import java.util.HashMap;
-
-import javax.faces.context.FacesContext;
-
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import javax.faces.context.FacesContext;
+import java.util.HashMap;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -42,16 +41,16 @@
/** The managed user bean */
private IdentityUserBean identityUserBean;
-
+
/** The hash map contains all the user attributes */
private HashMap map;
-
+
public DynamicUserAttribute()
{
this.map = new HashMap();
FacesContext ctx = FacesContext.getCurrentInstance();
- this.identityUserBean = (IdentityUserBean) ctx.getApplication().createValueBinding(("#{identityusermgr}"))
- .getValue(ctx);
+ this.identityUserBean = (IdentityUserBean)ctx.getApplication().createValueBinding(("#{identityusermgr}"))
+ .getValue(ctx);
}
public DynamicUserAttribute(String username)
@@ -64,7 +63,7 @@
{
try
{
- return identityUserBean.getPropertyType((String) propertyName);
+ return identityUserBean.getPropertyType((String)propertyName);
}
catch (Exception e)
{
@@ -75,30 +74,34 @@
public PropertyValue getValue(Object propertyName)
{
- Object propertyValue = map.get((String) propertyName);
+ Object propertyValue = map.get(propertyName);
// Trying to fetch user property
if (propertyValue == null)
{
try
{
- propertyValue = identityUserBean.getUserProperty(this.username, (String) propertyName);
+ propertyValue = identityUserBean.getUserProperty(this.username, (String)propertyName);
}
catch (Exception e)
{
// ok on user register
}
}
-
+
return new PropertyValue(identityUserBean.getLocalizedValue((String)propertyName, propertyValue));
}
public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
{
if (value != null && value instanceof String && ((String)value).trim().length() == 0)
- map.put((String) propertyName, null);
+ {
+ map.put(propertyName, null);
+ }
else
- map.put((String)propertyName, value);
+ {
+ map.put(propertyName, value);
+ }
return true;
}
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,18 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
@@ -48,6 +36,17 @@
import org.jboss.portlet.JBossActionRequest;
import org.jboss.portlet.JBossActionResponse;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -57,7 +56,7 @@
/** . */
private List roles = new ArrayList();
-
+
/** . */
private List defaultRoles = null;
@@ -131,7 +130,7 @@
{
this.metaDataService = metaDataService;
}
-
+
public String cancelRegistration()
{
this.uiUser = new IdentityUIUser();
@@ -143,9 +142,11 @@
{
String registrationStatus = "failed";
FacesContext ctx = FacesContext.getCurrentInstance();
- String adminSubscription = (String) ev.getComponent().getId();
+ String adminSubscription = ev.getComponent().getId();
ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", ctx.getViewRoot().getLocale());
- if (uiUser.getUsername() != null && uiUser.getPassword() != null)
+ String wUsername = uiUser.getUsername();
+ String wPassword = uiUser.getPassword();
+ if (wUsername != null && wPassword != null)
{
try
{
@@ -162,12 +163,10 @@
else
{
log.warn(User.INFO_USER_REGISTRATION_DATE + " property is mapped in not supported type: "
- + registrationDateClass.toString());
+ + registrationDateClass.toString());
}
// Variables for RegisterService
- String wUsername = uiUser.getUsername();
- String wPassword = uiUser.getPassword();
List wRoles = roles;
Map wProfileMap = this.identityUserBean.getProfileMap(uiUser.getAttribute().getProfileAttributes());
Locale wLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
@@ -177,16 +176,16 @@
if (adminSubscription != null && adminSubscription.equals("admin"))
{
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
- wLocale, true);
+ wLocale, true);
}
else
{
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
- wLocale, false);
+ wLocale, false);
}
}
- catch(CoreIdentityConfigurationException e)
+ catch (CoreIdentityConfigurationException e)
{
registrationStatus = IdentityConstants.REGISTRATION_FAILED;
log.error("", e);
@@ -195,32 +194,32 @@
// cleaning up the user
this.uiUser = new IdentityUIUser();
-
+
if (IdentityConstants.REGISTRATION_PENDING.equals(registrationStatus) && !adminSubscription.equals("admin"))
{
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_PENDING_TITLE")));
}
else if (IdentityConstants.REGISTRATION_REGISTERED.equals(registrationStatus) && !adminSubscription.equals("admin"))
{
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
}
- else if (adminSubscription.equals("admin") && ! IdentityConstants.REGISTRATION_FAILED.equals(registrationStatus))
+ else if (adminSubscription.equals("admin") && !IdentityConstants.REGISTRATION_FAILED.equals(registrationStatus))
{
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_MANAGEMENT_CREATE_USER_CREATED")));
}
else
{
FacesContext.getCurrentInstance().addMessage("status", new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
}
}
private String getPortalURL()
{
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
- JBossActionRequest request = (JBossActionRequest) ectx.getRequest();
- JBossActionResponse response = (JBossActionResponse) ectx.getResponse();
+ JBossActionRequest request = (JBossActionRequest)ectx.getRequest();
+ JBossActionResponse response = (JBossActionResponse)ectx.getResponse();
ServerInvocationContext invocationContext = request.getControllerContext().getServerInvocation().getServerContext();
PortalNode n = request.getPortalNode();
PortalNodeURL url = response.createRenderURL(n);
Added: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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 *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.core.identity.ui.validators;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class UserAttributeValidator implements Validator
+{
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", context.getViewRoot().getLocale());
+ ParameterValidation.sanitizeFromPatternWithHandler((String)value, ParameterValidation.XSS_CHECK,
+ new ValidatorExceptionErrorHandler("", bundle));
+ }
+
+ private class ValidatorExceptionErrorHandler extends ParameterValidation.ValidationErrorHandler
+ {
+ private ResourceBundle bundle;
+
+ ValidatorExceptionErrorHandler(String defaultValue, ResourceBundle bundle)
+ {
+ super(defaultValue);
+ this.bundle = bundle;
+ }
+
+ protected String internalValidationErrorHandling(String value)
+ {
+ String message = bundle.getString("INVALID_VALUE_ERROR");
+ message = MessageFormat.format(message, value);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
+ }
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -22,21 +22,24 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.validators;
-import java.util.ResourceBundle;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.core.identity.services.metadata.CoreIdentityConfigurationException;
+import org.jboss.portal.core.identity.services.workflow.RegistrationService;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.portlet.PortletContext;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.regex.Pattern;
-import org.jboss.portal.core.identity.services.metadata.CoreIdentityConfigurationException;
-import org.jboss.portal.core.identity.services.workflow.RegistrationService;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -46,7 +49,7 @@
{
/** The username regex */
// private static final String NICKNAME_VALIDATION = "^[a-zA-Z]([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)";
-
+
/** The user module */
private UserModule userModule;
@@ -56,14 +59,20 @@
/** The logger */
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(UsernameValidator.class);
+ // same as ParameterValidation.XSS_CHECK but with \ allowed for directory access...
+ private final Pattern USER_NAME_XSS_CHECK = Pattern.compile("([^<>(\\)=\\\\](?<!%5C))*", Pattern.CASE_INSENSITIVE);
+
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
- String username = (String) value;
ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", context.getViewRoot().getLocale());
- PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
- userModule = (UserModule) portletContext.getAttribute("UserModule");
- registrationService = (RegistrationService) portletContext.getAttribute("RegistrationService");
+ String username = ParameterValidation.sanitizeFromPatternWithHandler((String)value, USER_NAME_XSS_CHECK,
+ new ValidatorExceptionErrorHandler("", bundle));
+ PortletContext portletContext = (PortletContext)context.getExternalContext().getContext();
+ userModule = (UserModule)portletContext.getAttribute("UserModule");
+ registrationService = (RegistrationService)portletContext.getAttribute("RegistrationService");
+
+
// if (username.length() >= 5 && (Pattern.matches(NICKNAME_VALIDATION, username)))
try
{
@@ -71,15 +80,15 @@
if (registrationService.checkUsername(username))
{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
}
User u = userModule.findUserByUserName(username);
// User found so this nickname is already taken
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
}
catch (NoSuchUserException e)
{
@@ -88,22 +97,41 @@
catch (IllegalArgumentException e)
{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
catch (IdentityException e)
{
log.error("Error validation username", e);
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
catch (CoreIdentityConfigurationException e)
{
log.error("Error validation username", e);
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
}
+
+ private class ValidatorExceptionErrorHandler extends ParameterValidation.ValidationErrorHandler
+ {
+ private ResourceBundle bundle;
+
+ ValidatorExceptionErrorHandler(String defaultValue, ResourceBundle bundle)
+ {
+ super(defaultValue);
+ this.bundle = bundle;
+ }
+
+ protected String internalValidationErrorHandling(String s)
+ {
+ String message = bundle.getString("IDENTITY_VALIDATION_ERROR_INVALID_USERNAME");
+ message = MessageFormat.format(message, s);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
+ }
+ }
+
}
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -170,6 +170,7 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=Failed to register user.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=This username is already taken.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Error while validating the username.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' is an invalid username: Cannot be null, empty or contain '<', '>', '(', ')', '=' or '%5c'
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=The passwords doesn't match.
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Error while validating password.
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Invalid E-Mail address.
@@ -179,6 +180,7 @@
ROLE_TYPE=role
ROLE_DISPLAY_TYPE=role display
INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
# Example usage for dynamic values
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -262,6 +262,7 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION = Erreur lors de l'enregistrement du compte.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR = Erreur lors de la validation du nom d'utilisateur.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' est un nom d'utilisateur invalide : Ne peut pas \u00eatre null, vide ou contenir '<', '>', '(', ')', '=' ou '%5c'
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN = Ce nom d'utilisateur est d\u00e9j\u00e0 utilis\u00e9.
@@ -300,3 +301,4 @@
ROLE_DISPLAY_TYPE=affichage r\u00f4le
DUPLICATE_ERROR=Un {1} nomm\u00e9 ''{0}'' existe d\u00e9j\u00e0!
INVALID_NAME_ERROR=''{0}'' est un nom invalide pour un {1} : Ne peut pas \u00eatre null, vide ou contenir '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_VALUE_ERROR=''{0}'' est une valeut invalide : Ne peut pas \u00eatre null, vide ou contenir '\\', '<', '>', '(', ')', '=' ou '%5c'
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -170,6 +170,7 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=Fallita la registrazione dell'utente.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Il nome utente esiste gi\u00e0.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Errore durante la validazione del nome utente.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' non \u00e8 un nome utente valido : Non \u00f2 essere null, vuoto o contenere '<', '>', '(', ')', '=' o '%5c'
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=Le passwords non coincidono.
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Errore durante la validazione della password.
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Indirizzo e-mail non valido.
@@ -187,4 +188,5 @@
ROLE_TYPE=ruolo
INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido di {1} : Non \u00f2 essere null, vuoto o contenere '/', '.', '\\', '<', '>', '(', ')', '=' o '%5c'
+INVALID_VALUE_ERROR=''{0}'' non \u00e8 un nome valido : Non \u00f2 essere null, vuoto o contenere '\\', '<', '>', '(', ')', '=' o '%5c'
DUPLICATE_ERROR=Un valore {1} con nome ''{0}'' esiste gi\u00e0!
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -183,4 +183,5 @@
javax.faces.component.UIInput.REQUIRED=\u5fc5\u9808\u5024\u3067\u3059
-ROLE_TYPE=\u30ed\u30fc\u30eb\u306e
\ No newline at end of file
+ROLE_TYPE=\u30ed\u30fc\u30eb\u306e
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -170,6 +170,7 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=Falha no registro do usu\u00e1rio.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Esse usu\u00e1rio j\u00e1 est\u00e1 em uso.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Erro ao validar o usu\u00e1rio.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' \u00e9 um nome do usu\u00e1rio inv\u00e1lido\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '<', '>', '(', ')', '=' ou '%5c'
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=As senhas n\u00e3o conferem.
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Erro durante a valida\u00e7\u00e3o de senha.
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=E-mail inv\u00e1lido.
@@ -187,4 +188,5 @@
ROLE_TYPE=perfil
INVALID_NAME_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido para {1}\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_VALUE_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '\\', '<', '>', '(', ')', '=' ou '%5c'
DUPLICATE_ERROR=Um {1} denominado ''{0}'' j\u00e1 existe\!
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties 2009-05-25 16:40:32 UTC (rev 13413)
@@ -176,4 +176,5 @@
IDENTITY_DYNAMIC_VALUE_TEST=test label
IDENTITY_DYNAMIC_VALUE_TEST2=test label2
-ROLE_TYPE=\u0440\u043e\u043b\u044c
\ No newline at end of file
+ROLE_TYPE=\u0440\u043e\u043b\u044c
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2009-05-25 16:40:32 UTC (rev 13413)
@@ -230,6 +230,10 @@
<validator-class>org.jboss.portal.core.identity.ui.validators.EmailValidator</validator-class>
</validator>
<validator>
+ <validator-id>AttributeValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.UserAttributeValidator</validator-class>
+ </validator>
+ <validator>
<validator-id>UsernameValidator</validator-id>
<validator-class>org.jboss.portal.core.identity.ui.validators.UsernameValidator</validator-class>
</validator>
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml 2009-05-25 16:40:32 UTC (rev 13413)
@@ -5,199 +5,253 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
- <!-- User Profile -->
- <h:panelGrid columns="2" cellpadding="3">
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_GENERAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_TIMEZONE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.timezone.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="timezone" value="#{manager.uiUser.attribute.timezone}" required="#{metadataservice.timezone.required}">
- <f:selectItems value="#{metadataservice.timezone.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="timezone" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<!-- User Profile -->
+<h:panelGrid columns="2" cellpadding="3">
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_GENERAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_THEME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.theme.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="theme" value="#{manager.uiUser.attribute.theme}" required="#{metadataservice.theme.required}">
- <f:selectItems value="#{metadataservice.theme.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="theme" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_TIMEZONE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.timezone.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="timezone" value="#{manager.uiUser.attribute.timezone}"
+ required="#{metadataservice.timezone.required}">
+ <f:selectItems value="#{metadataservice.timezone.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="timezone" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_THEME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.theme.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="theme" value="#{manager.uiUser.attribute.theme}" required="#{metadataservice.theme.required}">
+ <f:selectItems value="#{metadataservice.theme.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="theme" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_LOCALE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.locale.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="locale" value="#{manager.uiUser.attribute.locale}" required="#{metadataservice.locale.required}">
- <f:selectItems value="#{metadataservice.locale.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="locale" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_PERSONAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.givenname.required}" />
- </h:panelGroup>
- <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}" required="#{metadataservice.givenname.required}"/>
- <h:panelGroup />
- <h:message for="givenname" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_LOCALE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.locale.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="locale" value="#{manager.uiUser.attribute.locale}"
+ required="#{metadataservice.locale.required}">
+ <f:selectItems value="#{metadataservice.locale.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="locale" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.familyname.required}" />
- </h:panelGroup>
- <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}" required="#{metadataservice.familyname.required}"/>
- <h:panelGroup />
- <h:message for="lastname" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_PERSONAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_LOCATION}"/>
- <h:outputText value=" *" rendered="#{metadataservice.location.required}" />
- </h:panelGroup>
- <h:inputText id="location" value="#{manager.uiUser.attribute.location}" required="#{metadataservice.location.required}"/>
- <h:panelGroup />
- <h:message for="location" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_INSTANT}" />
- </li>
- </ul>
- </h:panelGroup>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.givenname.required}"/>
+</h:panelGroup>
+<h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"
+ required="#{metadataservice.givenname.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="givenname" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_SKYPE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.skype.required}" />
- </h:panelGroup>
- <h:inputText id="skype" value="#{manager.uiUser.attribute.skype}" required="#{metadataservice.skype.required}"/>
- <h:panelGroup />
- <h:message for="skype" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.familyname.required}"/>
+</h:panelGroup>
+<h:inputText id="familyname" value="#{manager.uiUser.attribute.familyname}"
+ required="#{metadataservice.familyname.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="familyname" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_ICQ}"/>
- <h:outputText value=" *" rendered="#{metadataservice.icq.required}" />
- </h:panelGroup>
- <h:inputText id="icq" value="#{manager.uiUser.attribute.icq}" required="#{metadataservice.icq.required}"/>
- <h:panelGroup />
- <h:message for="icq" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_AIM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.aim.required}" />
- </h:panelGroup>
- <h:inputText id="aim" value="#{manager.uiUser.attribute.aim}" required="#{metadataservice.aim.required}"/>
- <h:panelGroup />
- <h:message for="aim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_MSNM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.msnm.required}" />
- </h:panelGroup>
- <h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}" required="#{metadataservice.msnm.required}"/>
- <h:panelGroup />
- <h:message for="msnm" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_LOCATION}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.location.required}"/>
+</h:panelGroup>
+<h:inputText id="location" value="#{manager.uiUser.attribute.location}" required="#{metadataservice.location.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="location" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_YIM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.yim.required}" />
- </h:panelGroup>
- <h:inputText id="yim" value="#{manager.uiUser.attribute.yim}" required="#{metadataservice.yim.required}"/>
- <h:panelGroup />
- <h:message for="yim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_INSTANT}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_XMMP}"/>
- <h:outputText value=" *" rendered="#{metadataservice.xmmp.required}" />
- </h:panelGroup>
- <h:inputText id="xmmp" value="#{manager.uiUser.attribute.xmmp}" required="#{metadataservice.xmmp.required}"/>
- <h:panelGroup />
- <h:message for="xmmp" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_HOMEPAGE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.homepage.required}" />
- </h:panelGroup>
- <h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}" required="#{metadataservice.homepage.required}"/>
- <h:panelGroup />
- <h:message for="homepage" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_OCCUPATION}"/>
- <h:outputText value=" *" rendered="#{metadataservice.occupation.required}" />
- </h:panelGroup>
- <h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}" required="#{metadataservice.occupation.required}"/>
- <h:panelGroup />
- <h:message for="occupation" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
- <h:outputText value=" *" rendered="#{metadataservice.interests.required}" />
- </h:panelGroup>
- <h:inputText id="interests" value="#{manager.uiUser.attribute.interests}" required="#{metadataservice.interests.required}"/>
- <h:panelGroup />
- <h:message for="interests" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_SIGNATURE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.signature.required}" />
- </h:panelGroup>
- <h:panelGroup>
- <h:inputTextarea id="signature" value="#{manager.uiUser.attribute.signature}" cols="50" rows="5" required="#{metadataservice.signature.required}"/><br/>
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE}" />
- </h:panelGroup>
- <h:panelGroup />
- <h:message for="signature" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_SKYPE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.skype.required}"/>
+</h:panelGroup>
+<h:inputText id="skype" value="#{manager.uiUser.attribute.skype}" required="#{metadataservice.skype.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="skype" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_EXTRA}"/>
- <h:outputText value=" *" rendered="#{metadataservice.extra.required}" />
- </h:panelGroup>
- <h:panelGroup>
- <h:inputTextarea id="extra" value="#{manager.uiUser.attribute.extra}" cols="50" rows="5" required="#{metadataservice.extra.required}"/><br/>
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_EXTRA}" />
- </h:panelGroup>
- <h:panelGroup />
- <h:message for="extra" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- </h:panelGrid>
-
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_ICQ}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.icq.required}"/>
+</h:panelGroup>
+<h:inputText id="icq" value="#{manager.uiUser.attribute.icq}" required="#{metadataservice.icq.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="icq" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_AIM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.aim.required}"/>
+</h:panelGroup>
+<h:inputText id="aim" value="#{manager.uiUser.attribute.aim}" required="#{metadataservice.aim.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="aim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_MSNM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.msnm.required}"/>
+</h:panelGroup>
+<h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}" required="#{metadataservice.msnm.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="msnm" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_YIM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.yim.required}"/>
+</h:panelGroup>
+<h:inputText id="yim" value="#{manager.uiUser.attribute.yim}" required="#{metadataservice.yim.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="yim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_XMMP}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.xmmp.required}"/>
+</h:panelGroup>
+<h:inputText id="xmmp" value="#{manager.uiUser.attribute.xmmp}" required="#{metadataservice.xmmp.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="xmmp" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_HOMEPAGE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.homepage.required}"/>
+</h:panelGroup>
+<h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}"
+ required="#{metadataservice.homepage.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="homepage" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_OCCUPATION}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.occupation.required}"/>
+</h:panelGroup>
+<h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}"
+ required="#{metadataservice.occupation.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="occupation" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.interests.required}"/>
+</h:panelGroup>
+<h:inputText id="interests" value="#{manager.uiUser.attribute.interests}"
+ required="#{metadataservice.interests.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="interests" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_SIGNATURE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.signature.required}"/>
+</h:panelGroup>
+<h:panelGroup>
+ <h:inputTextarea id="signature" value="#{manager.uiUser.attribute.signature}" cols="50" rows="5"
+ required="#{metadataservice.signature.required}">
+ <f:validator validatorId="AttributeValidator"/>
+ </h:inputTextarea><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE}"/>
+</h:panelGroup>
+<h:panelGroup/>
+<h:message for="signature" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_EXTRA}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.extra.required}"/>
+</h:panelGroup>
+<h:panelGroup>
+ <h:inputTextarea id="extra" value="#{manager.uiUser.attribute.extra}" cols="50" rows="5"
+ required="#{metadataservice.extra.required}">
+ <f:validator validatorId="AttributeValidator"/>
+ </h:inputTextarea><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_EXTRA}"/>
+</h:panelGroup>
+<h:panelGroup/>
+<h:message for="extra" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+</h:panelGrid>
+
</div>
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -62,6 +62,11 @@
protected void createMessage(String target, String message, Object severity)
{
+ outputMessage(target, message, severity);
+ }
+
+ public static void outputMessage(String target, String message, Object severity)
+ {
if (ParameterValidation.isNullOrEmpty(target))
{
target = STATUS;
@@ -95,6 +100,16 @@
facesContext.addMessage(target, msg);
}
+ public static void outputLocalizedMessage(String target, String localizationKey, Object severity, String resourceName, Object... params)
+ {
+ if(severity == null)
+ {
+ severity = FacesMessage.SEVERITY_ERROR;
+ }
+
+ outputMessage(target, getLocalizedMessage(localizationKey, getRequestLocale(), resourceName, params), severity);
+ }
+
protected Object getErrorSeverity()
{
return FacesMessage.SEVERITY_ERROR;
@@ -107,6 +122,11 @@
protected Locale getLocale()
{
+ return getRequestLocale();
+ }
+
+ public static Locale getRequestLocale()
+ {
return FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
}
}
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-25 15:27:14 UTC (rev 13412)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-25 16:40:32 UTC (rev 13413)
@@ -26,7 +26,9 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.ParameterValidation;
+import java.util.regex.Pattern;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -52,6 +54,8 @@
String doSimpleChecks(String name);
ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage);
+
+ Pattern getValidationPattern();
}
private PropertyValidator validator = new DefaultPropertyValidator();
@@ -97,7 +101,7 @@
name = name.trim();
// "sanitize" name: if it's invalid, return null and output message
- name = ParameterValidation.sanitizeFromPatternWithHandler(name, ParameterValidation.XSS_CHECK,
+ name = ParameterValidation.sanitizeFromPatternWithHandler(name, validator.getValidationPattern(),
validator.getValidationErrorHandler(name, targetForErrorMessage));
// we got an invalid name, fail!
@@ -227,5 +231,10 @@
{
return new MessageValidationHandler(null, targetForErrorMessage, name, getObjectTypeName());
}
+
+ public Pattern getValidationPattern()
+ {
+ return ParameterValidation.XSS_CHECK;
+ }
}
}
14 years, 11 months
JBoss Portal SVN: r13412 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: test_files and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-25 11:27:14 -0400 (Mon, 25 May 2009)
New Revision: 13412
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFileDeny.txt
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFilePrev.txt
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
Log:
[JBPORTAL-2311] - new tests added
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java 2009-05-25 13:51:00 UTC (rev 13411)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java 2009-05-25 15:27:14 UTC (rev 13412)
@@ -13,7 +13,7 @@
*
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-
+//TODO refactoring needed
@Test(groups = { "cms_file_upload" }, enabled = true)
public class CMSFileWorkflowUploadTestCase extends JBossPortalSeleniumTestCase {
/*
@@ -104,7 +104,7 @@
* directory is asserted.
*/
@Test(enabled = true, description = "File upload test")
- public void testFileUpload() {
+ public void testFileApproveUpload() {
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -141,5 +141,88 @@
Assert.assertEquals(selenium.getText("link=testFile.txt"), "testFile.txt");
}
+
+ /**
+ * File upload test. The form for uploading file is filled with relevant
+ * values and the file located in "test_files/testFileDeny.txt" is chosen for
+ * uploading into the root directory. Submit button is pressed and the
+ * upload should take the action and afterwards the file is denied. The non-existence of the file in root
+ * directory is asserted.
+ */
+ @Test(enabled = true, description = "File upload test")
+ public void testFileDenyUpload() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("description", "myFile");
+ selenium.type("title", "file to deny upload");
+ selenium.select("language", "label=Afar");
+ selenium.type("response", TEST_FILES_DIR + "testFileDeny.txt");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
+
+ selenium.click(LNK_DENY);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent("testFileDeny.txt"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isElementPresent("link=testFileDeny.txt"));
+ }
+
+ /**
+ * Selenium doesn't support file downloading, therefore the test is disabled. The form for uploading file is filled with relevant
+ * values and the file located in "test_files/testFilePrev.txt" is chosen for
+ * uploading into the root directory. Submit button is pressed and the
+ * upload should take the action and afterwards the file is previewed and denied. non-existence of the file in root
+ * directory is asserted.
+ */
+ @Test(enabled = false, description = "File upload test")
+ public void testFilePreviewUpload() {
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("description", "myFile");
+ selenium.type("title", "file to deny upload");
+ selenium.select("language", "label=Afar");
+ selenium.type("response", TEST_FILES_DIR + "testFilePrev.txt");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
+
+ selenium.click(LNK_PREVIEW);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LNK_DENY);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isTextPresent("testFileDenyPrev.txt"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isElementPresent("link=testFilePrev.txt"));
+ }
+
}
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFileDeny.txt
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFileDeny.txt (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFileDeny.txt 2009-05-25 15:27:14 UTC (rev 13412)
@@ -0,0 +1 @@
+i'm the test file!
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFilePrev.txt
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFilePrev.txt (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/test_files/testFilePrev.txt 2009-05-25 15:27:14 UTC (rev 13412)
@@ -0,0 +1 @@
+i'm the test file!
14 years, 11 months
JBoss Portal SVN: r13411 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests: src/org/jboss/portal/test/selenium/cms and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-25 09:51:00 -0400 (Mon, 25 May 2009)
New Revision: 13411
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng-cms-wf.xml
Log:
[JBPORTAL-2311] - file upload tests, archive longer timeout
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-05-25 10:25:51 UTC (rev 13410)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSArchiveUploadTestCase.java 2009-05-25 13:51:00 UTC (rev 13411)
@@ -20,7 +20,7 @@
/** The constant defining the wait time (in ms) between attempts when checking if the file was uploaded. */
- public static final int ARCHIVE_WAITING = 7000;
+ public static final int ARCHIVE_WAITING = 5000;
/** The constant defining the the number of attempts when checking if the file was uploaded. */
public static final int ATTEMPTS = 50;
@@ -51,7 +51,7 @@
logoutIfPossible();
login("admin", "admin");
// timeout hack
- selenium.setSpeed("1000");
+ selenium.setSpeed("3000");
}
@AfterMethod(groups = { "log" })
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java 2009-05-25 13:51:00 UTC (rev 13411)
@@ -0,0 +1,145 @@
+package org.jboss.portal.test.selenium.cms;
+
+import java.io.File;
+
+import org.jboss.portal.test.selenium.JBossPortalSeleniumTestCase;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * CMSFileUploadTestCase is responsible for testing of file uploading.
+ *
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+
+@Test(groups = { "cms_file_upload" }, enabled = true)
+public class CMSFileWorkflowUploadTestCase extends JBossPortalSeleniumTestCase {
+ /*
+ * uncomment following lines and set the right path to the workspace in the
+ * case you want to use this test case locally from eclipse
+ */
+ /*
+ * {
+ * System.setProperty("workspace","/home/vrockai/workspace/selenium-2.7/"
+ * ); }
+ */
+
+ /** prefix for locator properties = cms.file.up. */
+ private final String casePfx = "cms.file.up.";
+ private final String LNK_DENY = getLoc(casePfx + "lnk.deny", "link=Deny");
+ private final String LNK_PREVIEW = getLoc(casePfx + "lnk.preview", "link=Preview");
+ private final String LNK_APPROVE = getLoc(casePfx + "lnk.approve", "link=Approve");
+ private final String CMS_FILE_TABLE = getLoc(casePfx + "cms.file.table", "//div[@id='center']/div/div/div[3]/table");
+ private final String WORKSPACE = System.getProperty("workspace");
+ private final String TEST_FILES_DIR = WORKSPACE + File.separatorChar + "test_files" + File.separatorChar;
+
+ @BeforeMethod(groups = { "log" })
+ protected void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ protected void logoutAfterTest() {
+
+ }
+
+ /**
+ * Canceling of file upload. The form for uploading file is filled with
+ * relevant values and the file located in "test_files/testFile.txt" is
+ * chosen for uploading into the default directory. Instead of submit
+ * button, the cancel button is pressed. The assertion are made to count the
+ * number of rows in file tables asserting the number of rows didn't change
+ * after canceling of upload.
+ */
+ @Test(enabled = true, description = "canceling of file upload")
+ public void testFileUploadCancel() {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int rc_m_before = countTableRows(CMS_FILE_TABLE);
+
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int rc_d_before = countTableRows(CMS_FILE_TABLE);
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("description", "myFile");
+ selenium.type("title", "file to upload");
+ selenium.select("language", "label=Afar");
+ selenium.type("response", WORKSPACE + "/test_files/testFile.txt");
+ selenium.click("link=default");
+ selenium.click("cancel");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int rc_m_after = countTableRows(CMS_FILE_TABLE);
+
+ selenium.click("link=default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ int rc_d_after = countTableRows(CMS_FILE_TABLE);
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(rc_m_after, rc_m_before, "The row count in CMS file table has changes after canceling the upload of file in the root dir.");
+ Assert.assertEquals(rc_d_after, rc_d_before, "The row count in CMS file table has changes after canceling the upload of file in the default dir.");
+ }
+
+ /**
+ * File upload test. The form for uploading file is filled with relevant
+ * values and the file located in "test_files/testFile.txt" is chosen for
+ * uploading into the root directory. Submit button is pressed and the
+ * upload should take the action and afterwards the file is approved. The existence of the file in root
+ * directory is asserted.
+ */
+ @Test(enabled = true, description = "File upload test")
+ public void testFileUpload() {
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.click("link=CMS");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.waitForPopUp("_top", PAGE_LOAD);
+ selenium.type("description", "myFile");
+ selenium.type("title", "file to upload");
+ selenium.select("language", "label=Afar");
+ selenium.type("response", TEST_FILES_DIR + "testFile.txt");
+ selenium.click("submit");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
+ Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
+ Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
+
+ selenium.click(LNK_APPROVE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getText("//div[@id='center']/div/div/ul/li[3]"), "testFile.txt");
+ Assert.assertTrue(selenium.isElementPresent("link=text/plain"));
+ Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
+ Assert.assertEquals(selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"), "file to upload");
+
+ Assert.assertTrue(selenium.isElementPresent("link=Afar"));
+ Assert.assertTrue(selenium.isTextPresent("testFile.txt"));
+
+ selenium.click("link=Home");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertEquals(selenium.getText("link=testFile.txt"), "testFile.txt");
+ }
+
+}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng-cms-wf.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng-cms-wf.xml 2009-05-25 10:25:51 UTC (rev 13410)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/testng-cms-wf.xml 2009-05-25 13:51:00 UTC (rev 13411)
@@ -19,10 +19,10 @@
<class name="org.jboss.portal.test.selenium.cms.CMSDirectoryTestCase"></class></classes>
</test>
- <test name="org.jboss.portal.test.selenium.cms.CMSFileUploadTestCase"
+ <test name="org.jboss.portal.test.selenium.cms.CMSFileWorkflowUploadTestCase"
verbose="2" annotations="JDK">
<classes>
- <class name="org.jboss.portal.test.selenium.cms.CMSFileUploadTestCase"></class></classes>
+ <class name="org.jboss.portal.test.selenium.cms.CMSFileWorkflowUploadTestCase"></class></classes>
</test>
<test name="org.jboss.portal.test.selenium.cms.CMSArchiveUploadTestCase"
14 years, 11 months
JBoss Portal SVN: r13410 - branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-05-25 06:25:51 -0400 (Mon, 25 May 2009)
New Revision: 13410
Modified:
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
Log:
JBEPP-91: identity-ui-configuration schema isn't correct
Using all instead of sequence which is ore appropriate and will work with the embedded XML file
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 10:24:16 UTC (rev 13409)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 10:25:51 UTC (rev 13410)
@@ -34,7 +34,7 @@
</xsd:appinfo>
</xsd:annotation>
- <xsd:sequence>
+ <xsd:all>
<!-- User portlet and user management portlet preferences -->
<xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
<xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
@@ -58,7 +58,7 @@
</xsd:complexType>
</xsd:element>
<!-- end: user interface components -->
- </xsd:sequence>
+ </xsd:all>
</xsd:complexType>
</xsd:element>
@@ -124,7 +124,7 @@
<jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
</xsd:appinfo>
</xsd:annotation>
- <xsd:sequence>
+ <xsd:all>
<xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
<xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="validators" type="validators" />
@@ -138,7 +138,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- </xsd:sequence>
+ </xsd:all>
<!-- attribute name -->
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
14 years, 11 months
JBoss Portal SVN: r13409 - branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-05-25 06:24:16 -0400 (Mon, 25 May 2009)
New Revision: 13409
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
Log:
JBPORTAL-2401: identity-ui-configuration schema isn't correct
Using all instead of sequence which is ore appropriate and will work with the embedded XML file
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 09:22:12 UTC (rev 13408)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 10:24:16 UTC (rev 13409)
@@ -34,7 +34,7 @@
</xsd:appinfo>
</xsd:annotation>
- <xsd:sequence>
+ <xsd:all>
<!-- User portlet and user management portlet preferences -->
<xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
<xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
@@ -58,7 +58,7 @@
</xsd:complexType>
</xsd:element>
<!-- end: user interface components -->
- </xsd:sequence>
+ </xsd:all>
</xsd:complexType>
</xsd:element>
@@ -124,7 +124,7 @@
<jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
</xsd:appinfo>
</xsd:annotation>
- <xsd:sequence>
+ <xsd:all>
<xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
<xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="validators" type="validators" />
@@ -138,7 +138,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- </xsd:sequence>
+ </xsd:all>
<!-- attribute name -->
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
14 years, 11 months
JBoss Portal SVN: r13408 - in branches/JBoss_Portal_Branch_2_7: core-admin/src/resources/portal-admin-war/WEB-INF and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-25 05:22:12 -0400 (Mon, 25 May 2009)
New Revision: 13408
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
Log:
- JBEPP-83:
+ Added forgotten bean context to dashboardmgr instance
+ MessageValidationHandler instances can choose which error message to use
+ PropertyValidator implementations can provide their own ValidationErrorHandler for more flexibility
+ ControlPropertyBean now provides better error message
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2009-05-25 08:10:28 UTC (rev 13407)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2009-05-25 09:22:12 UTC (rev 13408)
@@ -24,6 +24,8 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.faces.gui.ManagedBean;
import javax.faces.event.ValueChangeEvent;
@@ -51,6 +53,12 @@
{
return name; // no-op as we want to allow / and . in paths
}
+
+ @Override
+ public ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage)
+ {
+ return new MessageValidationHandler(null, targetForErrorMessage, name, getObjectTypeName(), ManagedBean.INVALID_PATH);
+ }
});
}
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-05-25 08:10:28 UTC (rev 13407)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-05-25 09:22:12 UTC (rev 13408)
@@ -326,6 +326,7 @@
COORDINATION_ALIAS=alias binding
INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_PATH_ERROR=''{0}'' is an invalid {1} path: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
NO_SELECTED_PORTLET_ERROR=No portlet was selected!
DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
bean_support_unexpected_error=Unexpected error:
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2009-05-25 08:10:28 UTC (rev 13407)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2009-05-25 09:22:12 UTC (rev 13408)
@@ -187,6 +187,11 @@
<property-name>domainConfigurator</property-name>
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
</managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.faces.gui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
</managed-bean>
<!-- The instance manager managed bean -->
Modified: branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-25 08:10:28 UTC (rev 13407)
+++ branches/JBoss_Portal_Branch_2_7/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-25 09:22:12 UTC (rev 13408)
@@ -38,6 +38,7 @@
protected BeanContext beanContext;
public static final String INVALID_NAME = "INVALID_NAME_ERROR";
+ public static final String INVALID_PATH = "INVALID_PATH_ERROR";
public static final String DUPLICATE = "DUPLICATE_ERROR";
public static interface PropertyValidator
@@ -49,6 +50,8 @@
boolean isAlreadyExisting(String propertyName);
String doSimpleChecks(String name);
+
+ ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage);
}
private PropertyValidator validator = new DefaultPropertyValidator();
@@ -95,7 +98,7 @@
// "sanitize" name: if it's invalid, return null and output message
name = ParameterValidation.sanitizeFromPatternWithHandler(name, ParameterValidation.XSS_CHECK,
- new MessageValidationHandler(null, targetForErrorMessage, name, objectTypeName));
+ validator.getValidationErrorHandler(name, targetForErrorMessage));
// we got an invalid name, fail!
if (name == null)
@@ -169,23 +172,30 @@
}
}
- private class MessageValidationHandler extends ParameterValidation.ValidationErrorHandler
+ protected class MessageValidationHandler extends ParameterValidation.ValidationErrorHandler
{
private String targetForErrorMessage;
private String validatedName;
private String objectTypeName;
+ private String errorMessageKey;
- private MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName, String objectTypeName)
+ public MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName, String objectTypeName)
{
+ this(defaultValue, targetForErrorMessage, validatedName, objectTypeName, INVALID_NAME);
+ }
+
+ public MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName, String objectTypeName, String errorMessageKey)
+ {
super(defaultValue);
this.targetForErrorMessage = targetForErrorMessage;
this.validatedName = validatedName;
this.objectTypeName = objectTypeName;
+ this.errorMessageKey = errorMessageKey;
}
protected String internalValidationErrorHandling(String s)
{
- beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, validatedName, getLocalizedType(objectTypeName));
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, errorMessageKey, validatedName, getLocalizedType(objectTypeName));
return null;
}
}
@@ -212,5 +222,10 @@
// if name contains . or /, it's invalid for a Portal object
return (name.indexOf('.') != -1 || name.indexOf('/') != -1) ? null : name;
}
+
+ public ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage)
+ {
+ return new MessageValidationHandler(null, targetForErrorMessage, name, getObjectTypeName());
+ }
}
}
14 years, 11 months
JBoss Portal SVN: r13407 - branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-05-25 04:10:28 -0400 (Mon, 25 May 2009)
New Revision: 13407
Modified:
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
Log:
JBEPP-91: identity-ui-configuration schema isn't correct
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 08:00:41 UTC (rev 13406)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 08:10:28 UTC (rev 13407)
@@ -34,7 +34,7 @@
</xsd:appinfo>
</xsd:annotation>
- <xsd:choice>
+ <xsd:sequence>
<!-- User portlet and user management portlet preferences -->
<xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
<xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
@@ -58,7 +58,7 @@
</xsd:complexType>
</xsd:element>
<!-- end: user interface components -->
- </xsd:choice>
+ </xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -124,7 +124,7 @@
<jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
</xsd:appinfo>
</xsd:annotation>
- <xsd:choice>
+ <xsd:sequence>
<xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
<xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="validators" type="validators" />
@@ -138,7 +138,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- </xsd:choice>
+ </xsd:sequence>
<!-- attribute name -->
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
14 years, 11 months
JBoss Portal SVN: r13406 - branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-05-25 04:00:41 -0400 (Mon, 25 May 2009)
New Revision: 13406
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
Log:
JBPORTAL-2401: identity-ui-configuration schema isn't correct
Modified: branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-24 01:45:06 UTC (rev 13405)
+++ branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/conf/schema/identity-ui-configuration.xsd 2009-05-25 08:00:41 UTC (rev 13406)
@@ -34,7 +34,7 @@
</xsd:appinfo>
</xsd:annotation>
- <xsd:choice>
+ <xsd:sequence>
<!-- User portlet and user management portlet preferences -->
<xsd:element name="subscription-mode" type="subscriptionMode" default="jbp_identity_validation_workflow"/>
<xsd:element name="admin-subscription-mode" type="subscriptionMode" default="automatic"/>
@@ -58,7 +58,7 @@
</xsd:complexType>
</xsd:element>
<!-- end: user interface components -->
- </xsd:choice>
+ </xsd:sequence>
</xsd:complexType>
</xsd:element>
@@ -124,7 +124,7 @@
<jbxb:mapEntry impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration" getKeyMethod="getName" setKeyMethod="setName" />
</xsd:appinfo>
</xsd:annotation>
- <xsd:choice>
+ <xsd:sequence>
<xsd:element name="property-ref" maxOccurs="1" minOccurs="1" type="xsd:string" />
<xsd:element name="localization-bundle" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="validators" type="validators" />
@@ -138,7 +138,7 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
- </xsd:choice>
+ </xsd:sequence>
<!-- attribute name -->
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
14 years, 11 months
JBoss Portal SVN: r13405 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api.
by portal-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2009-05-23 21:45:06 -0400 (Sat, 23 May 2009)
New Revision: 13405
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
Log:
[JBPORTAL-2386] - Fixed jsr168 ext-*cache test case failures
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2009-05-24 01:33:15 UTC (rev 13404)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2009-05-24 01:45:06 UTC (rev 13405)
@@ -217,7 +217,7 @@
return ResourceURLImpl.createResourceURL(invocation, preq);
}
- public void addProperty(String key, String value) throws IllegalArgumentException
+ private void setCache(String key, String value)
{
if (MimeResponse.EXPIRATION_CACHE.equals(key))
{
@@ -250,12 +250,37 @@
getCacheControl().setUseCachedContent(true);
}
}
+ }
+
+ public void addProperty(String key, String value) throws IllegalArgumentException
+ {
+ if (MimeResponse.EXPIRATION_CACHE.equals(key)
+ || MimeResponse.ETAG.equals(key)
+ || MimeResponse.USE_CACHED_CONTENT.equals(key))
+ {
+ setCache(key, value);
+ }
else
{
super.addProperty(key, value);
}
}
+
+ public void setProperty(String key, String value) throws IllegalArgumentException
+ {
+ if (MimeResponse.EXPIRATION_CACHE.equals(key)
+ || MimeResponse.ETAG.equals(key)
+ || MimeResponse.USE_CACHED_CONTENT.equals(key))
+ {
+ setCache(key, value);
+ }
+ else
+ {
+ super.setProperty(key, value);
+ }
+ }
+
public CacheControl getCacheControl()
{
if (cacheControl == null)
14 years, 11 months