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;
+ }
}
}