JBoss Rich Faces SVN: r20025 - in branches/RF-8742-1/ui/validator: impl/src/main/java/org/richfaces/validator and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-10 17:36:12 -0500 (Wed, 10 Nov 2010)
New Revision: 20025
Added:
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/application/
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/el/
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidator.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterServiceImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanValidator.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServiceBase.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/MessageFactory.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/NullValidator.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ObjectValidator.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/model/
branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/services/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/model/
branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/validator/
branches/RF-8742-1/ui/validator/ui/src/test/resources/badcsv.xml
branches/RF-8742-1/ui/validator/ui/src/test/resources/csv.xml
branches/RF-8742-1/ui/validator/ui/src/test/resources/test.html
Removed:
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/application/
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/el/
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidator.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterServiceImpl.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesBeanValidator.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesServiceBase.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/MessageFactory.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/NullValidator.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ObjectValidator.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/model/
branches/RF-8742-1/ui/validator/impl/src/main/resources/META-INF/services/
branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ELTestBase.java
branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/TestCaptureEL.java
branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/model/
branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/validator/
branches/RF-8742-1/ui/validator/impl/src/test/resources/badcsv.xml
branches/RF-8742-1/ui/validator/impl/src/test/resources/csv.xml
branches/RF-8742-1/ui/validator/impl/src/test/resources/test.html
Log:
CODING IN PROGRESS - issue RF-9799: CSV code review
https://jira.jboss.org/browse/RF-9799
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,42 +0,0 @@
-package org.richfaces.validator;
-
-import java.util.Map;
-
-import javax.faces.application.FacesMessage;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-
-public class BaseFacesObjectDescriptor<T> {
-
- private final Class<? extends T> converterClass;
- private Map<String, Object> parameters = Maps.newHashMap();
- private final FacesMessage message;
-
-
- public BaseFacesObjectDescriptor(Class<? extends T> converterClass, FacesMessage message) {
- this.converterClass = converterClass;
- this.message = message;
- }
-
- public Class<?> getImplementationClass() {
- return converterClass;
- }
-
- public Map<String, ? extends Object> getAdditionalParameters() {
- return parameters;
- }
-
- public FacesMessage getMessage() {
- return message;
- }
-
- protected void addParameter(String name, Object value) {
- parameters.put(name, value);
- }
-
- protected void makeImmutable() {
- parameters = ImmutableMap.copyOf(parameters);
- }
-
-}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidator.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidator.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,110 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Set;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.validation.ConstraintViolation;
-import javax.validation.Validator;
-import javax.validation.groups.Default;
-
-/**
- * @author asmirnov
- *
- */
-public class BeanValidator extends ObjectValidator {
-
- private static final Class<?>[] DEFAULT_PROFILE = new Class[] {Default.class};
- private final BeanValidatorFactory validatorFactory;
-
-
- public BeanValidator(BeanValidatorFactory validatorFactory) {
- this.validatorFactory = validatorFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ObjectValidator#validate(java.lang.Object, java.lang.String, java.lang.Object,
- * java.util.Locale)
- */
- @Override
- protected Collection<String> validate(FacesContext facesContext, Object base, String property, Object value,
- Set<String> profiles) {
- Class beanType = base.getClass();
- Set<ConstraintViolation<Object>> constrains =
- getValidator(facesContext).validateValue(beanType, property, value, getGroups(profiles));
- return extractMessages(constrains);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ObjectValidator#validateGraph(javax.faces.context .FacesContext, java.lang.Object,
- * java.util.Set)
- */
- @Override
- public Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles) {
- Class<?>[] groups = getGroups(profiles);
- Set<ConstraintViolation<Object>> violations = getValidator(context).validate(value, groups);
- Collection<String> messages = extractMessages(violations);
- if (null != parent) {
- Collection<String> parentMessages = parent.validateGraph(context, value, profiles);
- if (null != messages) {
- if (null != parentMessages) {
- messages.addAll(parentMessages);
- }
- } else {
- messages = parentMessages;
- }
- }
- return messages;
- }
-
- private Class<?>[] getGroups(Set<String> profiles) {
- Class<?>[] groups = null;
- if (null != profiles) {
- groups = new Class<?>[profiles.size()];
- int i = 0;
- for (String group : profiles) {
- try {
- groups[i] = Class.forName(group, false, Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException e) {
- try {
- groups[i] = Class.forName(group);
- } catch (ClassNotFoundException e1) {
- throw new FacesException("Bean validation group not found " + group, e1);
- }
- }
- i++;
- }
-
- } else {
- groups = DEFAULT_PROFILE;
- }
- return groups;
- }
-
- private Collection<String> extractMessages(Set<ConstraintViolation<Object>> violations) {
- Collection<String> messages = null;
- if (null != violations && violations.size() > 0) {
- messages = new ArrayList<String>(violations.size());
- for (ConstraintViolation<? extends Object> constraintViolation : violations) {
- messages.add(constraintViolation.getMessage());
- }
-
- }
- return messages;
- }
-
- protected Validator getValidator(FacesContext facesContext) {
- Validator beanValidator = validatorFactory.getValidator(facesContext);
- return beanValidator;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,13 +0,0 @@
-package org.richfaces.validator;
-
-import java.lang.annotation.Annotation;
-
-import javax.faces.application.FacesMessage;
-
-public class BeanValidatorDescriptor extends BaseFacesObjectDescriptor<Annotation> implements ValidatorDescriptor {
-
- public BeanValidatorDescriptor(Class<? extends Annotation> validatorClass, FacesMessage message) {
- super(validatorClass, message);
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,100 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.lang.annotation.Annotation;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.validation.Validator;
-import javax.validation.metadata.ConstraintDescriptor;
-import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
-import javax.validation.metadata.PropertyDescriptor;
-
-import org.richfaces.el.ValueDescriptor;
-import org.richfaces.el.ValueExpressionAnalayser;
-
-/**
- * @author asmirnov
- *
- */
-public class BeanValidatorServiceImpl implements BeanValidatorService {
-
- private final ValueExpressionAnalayser analayser;
- private final BeanValidatorFactory validatorFactory;
-
- public BeanValidatorServiceImpl(ValueExpressionAnalayser analayser, BeanValidatorFactory validatorFactory) {
- this.analayser = analayser;
- this.validatorFactory = validatorFactory;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.BeanValidatorService#getConstrains(javax.faces.context.FacesContext,
- * javax.el.ValueExpression, java.lang.Class<?>[])
- */
- public Collection<ValidatorDescriptor> getConstrains(FacesContext context, ValueExpression expression,
- Class<?>... groups) {
- try {
- ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(context, expression);
- return processBeanAttribute(context, propertyDescriptor, groups);
- } catch (ELException e) {
- return Collections.emptySet();
- }
- }
-
- private Validator getValidator(FacesContext context) {
- return validatorFactory.getValidator(context);
- }
-
- Collection<ValidatorDescriptor> processBeanAttribute(FacesContext context, ValueDescriptor descriptor,
- Class<?>... groups) {
- PropertyDescriptor constraintsForProperty =
- getValidator(context).getConstraintsForClass(descriptor.getBeanType()).getConstraintsForProperty(
- descriptor.getName());
- if (null != constraintsForProperty) {
- ConstraintFinder propertyConstraints = constraintsForProperty.findConstraints();
- if (null != groups && groups.length > 0) {
- // Filter groups, if required
- propertyConstraints = propertyConstraints.unorderedAndMatchingGroups(groups);
- }
- Set<ConstraintDescriptor<?>> constraints = propertyConstraints // or the requested list of groups)
- .getConstraintDescriptors();
-
- // ContextHolder is an arbitrary object, it will depend on the implementation
- Set<ValidatorDescriptor> descriptors = new HashSet<ValidatorDescriptor>(constraints.size());
- processConstraints(context, constraints, descriptors);
- return descriptors;
-
- } else {
- return Collections.emptySet();
- }
- }
-
- void processConstraints(FacesContext context, Set<ConstraintDescriptor<?>> constraints,
- Collection<ValidatorDescriptor> descriptors) {
- for (ConstraintDescriptor<?> cd : constraints) {
- Annotation a = cd.getAnnotation();
- Map<String, Object> parameters = cd.getAttributes();
- // TODO if cd.isReportedAsSingleConstraint() make sure than only the root constraint raises an error message
- // if one or several of the composing constraints are invalid)
- FacesMessage message = validatorFactory.interpolateMessage(context, cd);
- BeanValidatorDescriptor beanValidatorDescriptor = new BeanValidatorDescriptor(a.getClass(), message);
- for (Map.Entry<String, Object> entry : parameters.entrySet()) {
- beanValidatorDescriptor.addParameter(entry.getKey(), entry.getValue());
- }
- beanValidatorDescriptor.makeImmutable();
- descriptors.add(beanValidatorDescriptor);
- processConstraints(context, cd.getComposingConstraints(), descriptors); // process the composing constraints
- }
- }
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,74 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.Map;
-
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.component.util.Strings;
-
-/**
- * @author asmirnov
- *
- */
-public class ClientScriptServiceImpl implements ClientScriptService {
-
- private static final String TEXT_JAVASCRIPT = "text/javascript";
-
- private static final String ORG_RICHFACES_CSV = "org.richfaces.csv";
-
- private final Map<Class<?>, LibraryFunction> defaultMapping;
-
- public ClientScriptServiceImpl(Map<Class<?>, LibraryFunction> defaultMapping) {
- this.defaultMapping = defaultMapping;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ClientScriptService#getScript(java.lang.Class)
- */
- public LibraryFunction getScript(FacesContext facesContext, Class<?> javaClass) throws ScriptNotFoundException {
- if (null == facesContext || null == javaClass) {
- throw new NullPointerException();
- }
- LibraryFunction function;
- try {
- function = getScriptResource(facesContext, javaClass);
- } catch (ScriptNotFoundException e) {
- if (defaultMapping.containsKey(javaClass)) {
- function = defaultMapping.get(javaClass);
- } else {
- function = getScriptFromAnnotation(javaClass);
- }
- }
- return function;
- }
-
- private LibraryFunction getScriptFromAnnotation(Class<?> javaClass) throws ScriptNotFoundException {
- if (javaClass.isAnnotationPresent(ClientSideScript.class)) {
- ClientSideScript clientSideScript = javaClass.getAnnotation(ClientSideScript.class);
- return new LibraryFunctionImplementation(clientSideScript.library(), clientSideScript.resource(), clientSideScript.function());
- } else {
- throw new ScriptNotFoundException();
- }
- }
-
- private LibraryFunction getScriptResource(FacesContext facesContext, Class<?> javaClass)
- throws ScriptNotFoundException {
- ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
- String resourceName = javaClass.getSimpleName() + ".js";
- Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
- if (null != facesResource) {
- final String functionName = Strings.firstToLowerCase(javaClass.getSimpleName());
- return new LibraryFunctionImplementation(ORG_RICHFACES_CSV,resourceName, functionName);
- } else {
- throw new ScriptNotFoundException();
- }
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,67 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-
-import javax.faces.FacesException;
-import javax.xml.bind.JAXB;
-
-import org.richfaces.validator.model.ClientSideScripts;
-import org.richfaces.validator.model.Component;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import com.google.common.collect.Maps;
-
-/**
- * @author asmirnov
- *
- */
-public final class ClientServiceConfigParser {
-
- private ClientServiceConfigParser() {
- }
-
- public static Map<Class<?>, LibraryFunction> parseConfig(String name) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (null == loader) {
- loader = ClientServiceConfigParser.class.getClassLoader();
- }
- Builder<Class<?>, LibraryFunction> resultBuilder = ImmutableMap.builder();
- try {
- Enumeration<URL> resources = loader.getResources(name);
- while (resources.hasMoreElements()) {
- URL url = (URL) resources.nextElement();
- resultBuilder.putAll(parse(loader, url));
- }
- } catch (IOException e) {
- return Collections.emptyMap();
- }
- return resultBuilder.build();
- }
-
- static Map<Class<?>, LibraryFunction> parse(ClassLoader loader, URL url) {
- Map<Class<?>, LibraryFunction> result = Maps.newHashMap();
- try {
- ClientSideScripts clientSideScripts = JAXB.unmarshal(url, ClientSideScripts.class);
- for (Component component : clientSideScripts.getComponent()) {
- Class<?> componentClass = loader.loadClass(component.getType());
- LibraryFunctionImplementation function = new LibraryFunctionImplementation(component.getLibrary(),
- component.getResource(), component.getFunction());
- result.put(componentClass, function);
- }
- } catch (ClassNotFoundException e) {
- throw new FacesException("Class for component not found",e);
- } catch (Exception e) {
- throw new FacesException("Error parsing config file "+url,e);
- }
- return result;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClonedObjectResolver.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClonedObjectResolver.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,110 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.faces.context.FacesContext;
-
-
-
-/**
- * @author asmirnov
- *
- */
-public class ClonedObjectResolver extends ELResolver {
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- // Do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- // do nothing
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Class<?> getType(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if (null != cloned) {
- context.setPropertyResolved(true);
- return cloned.getClass();
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public Object getValue(ELContext context, Object base, Object property) {
- Object cloned = resolveCloned(context, base, property);
- if (null != cloned) {
- context.setPropertyResolved(true);
- }
- return cloned;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
- */
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value) {
- // TODO Auto-generated method stub
-
- }
-
- public static Object resolveCloned(ELContext context, Object base, Object property) {
- if (null != base || null != property) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
- for (String key : requestMap.keySet()) {
- if (null != key && key.startsWith(GraphValidatorState.STATE_ATTRIBUTE_PREFIX)) {
- GraphValidatorState state = (GraphValidatorState) requestMap.get(key);
- if (state.isSame(base, property)) {
- return state.getCloned();
- }
- }
- }
- }
- return null;
- }
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,22 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-
-import javax.faces.application.FacesMessage;
-import javax.faces.convert.Converter;
-
-
-/**
- * @author asmirnov
- *
- */
-public class ConverterDescriptorImpl extends BaseFacesObjectDescriptor<Converter> implements ConverterDescriptor {
-
-
- ConverterDescriptorImpl(Class<? extends Converter> converterClass,FacesMessage message) {
- super(converterClass,message);
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterServiceImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterServiceImpl.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,86 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.BigDecimalConverter;
-import javax.faces.convert.BigIntegerConverter;
-import javax.faces.convert.BooleanConverter;
-import javax.faces.convert.ByteConverter;
-import javax.faces.convert.CharacterConverter;
-import javax.faces.convert.Converter;
-import javax.faces.convert.DateTimeConverter;
-import javax.faces.convert.DoubleConverter;
-import javax.faces.convert.EnumConverter;
-import javax.faces.convert.FloatConverter;
-import javax.faces.convert.IntegerConverter;
-import javax.faces.convert.LongConverter;
-import javax.faces.convert.NumberConverter;
-import javax.faces.convert.ShortConverter;
-
-
-/**
- * @author asmirnov
- *
- */
-public class ConverterServiceImpl extends FacesServiceBase<Converter> implements FacesConverterService {
-
- private static final String DEFAULT_CONVERTER_MESSAGE_ID = UIInput.CONVERSION_MESSAGE_ID;
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.FacesConverterService#getConverterDescription(javax.faces.context.FacesContext,
- * javax.faces.convert.Converter)
- */
- public ConverterDescriptor getConverterDescription(FacesContext context, Converter converter) {
- // determine converter message.
- FacesMessage message = getMessage(context, converter);
- ConverterDescriptorImpl descriptor = new ConverterDescriptorImpl(converter.getClass(), message);
- fillParameters(descriptor, converter);
- descriptor.makeImmutable();
- return descriptor;
- }
-
- @Override
- protected String getMessageId(Converter converter) {
- String messageId;
- if (converter instanceof BigDecimalConverter) {
- messageId = BigDecimalConverter.DECIMAL_ID;
- } else if (converter instanceof BigIntegerConverter) {
- messageId = BigIntegerConverter.BIGINTEGER_ID;
- } else if (converter instanceof BooleanConverter) {
- messageId = BooleanConverter.BOOLEAN_ID;
- } else if (converter instanceof ByteConverter) {
- messageId = ByteConverter.BYTE_ID;
- } else if (converter instanceof CharacterConverter) {
- messageId = CharacterConverter.CHARACTER_ID;
- } else if (converter instanceof DateTimeConverter) {
- // TODO - distinguish Date, Time, and DateTime.
- messageId = DateTimeConverter.DATETIME_ID;
- } else if (converter instanceof DoubleConverter) {
- messageId = DoubleConverter.DOUBLE_ID;
- } else if (converter instanceof EnumConverter) {
- messageId = EnumConverter.ENUM_ID;
- } else if (converter instanceof FloatConverter) {
- messageId = FloatConverter.FLOAT_ID;
- } else if (converter instanceof IntegerConverter) {
- messageId = IntegerConverter.INTEGER_ID;
- } else if (converter instanceof LongConverter) {
- messageId = LongConverter.LONG_ID;
- } else if (converter instanceof NumberConverter) {
- // TODO - detect case ( currency, percent etc ).
- messageId = NumberConverter.NUMBER_ID;
- } else if (converter instanceof ShortConverter) {
- messageId = ShortConverter.SHORT_ID;
- } else {
- messageId = DEFAULT_CONVERTER_MESSAGE_ID;
- }
- return messageId;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,26 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-
-/**
- * @author asmirnov
- *
- */
-public class DummyBeanValidatorService implements BeanValidatorService {
-
- /* (non-Javadoc)
- * @see org.richfaces.validator.BeanValidatorService#getConstrains(javax.faces.context.FacesContext, javax.el.ValueExpression, java.lang.Class<?>[])
- */
- public Collection<ValidatorDescriptor> getConstrains(FacesContext context, ValueExpression expression,
- Class<?>... groups) {
- return Collections.emptySet();
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesBeanValidator.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesBeanValidator.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesBeanValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,178 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.validator;
-
-import java.io.Serializable;
-import java.text.MessageFormat;
-import java.util.Collection;
-import java.util.Locale;
-import java.util.Set;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.FacesMessage;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-
-/**
- * Implementation of the JSF validator to use with Bean Validation / Hibernate validator
- *
- * @author asmirnov
- *
- */
-public class FacesBeanValidator implements Serializable, Validator, GraphValidator {
-
- public static final String BEAN_VALIDATOR_TYPE = "org.richfaces.BeanValidator";
- /**
- *
- */
- private static final long serialVersionUID = -264568176252121853L;
- private ValueExpression summaryExpression = null;
-
- private String summary = null;
-
- private ValueExpression profilesExpression = null;
-
- private Set<String> profiles = null;
-
- /**
- * @return the summary
- */
- public String getSummary() {
- String summaryString = null;
- if (null != summaryExpression) {
- summaryString = (String) summaryExpression.getValue(FacesContext.getCurrentInstance().getELContext());
- } else {
- summaryString = this.summary;
- }
- return summaryString;
- }
-
- /**
- * @param summary
- * the summary to set
- */
- public void setSummary(ValueExpression summary) {
- this.summaryExpression = summary;
- }
-
- /**
- * @param summary
- * the summary to set
- */
- public void setSummary(String summary) {
- this.summary = summary;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent, java.lang.Object)
- */
- public void validate(FacesContext context, UIComponent component, Object convertedValue) throws ValidatorException {
- if (component instanceof EditableValueHolder) {
- // Validate input component
- EditableValueHolder input = (EditableValueHolder) component;
- try {
- ValueExpression valueExpression = component.getValueExpression("value");
- if (null != valueExpression) {
- Collection<String> messages =
- ObjectValidator.getInstance(context).validate(context, valueExpression, convertedValue,
- getProfiles());
- if (null != messages) {
- input.setValid(false);
- Object label = getLabel(context, component);
- Locale locale = context.getViewRoot().getLocale();
- // send all validation messages.
- for (String msg : messages) {
- // https://jira.jboss.org/jira/browse/RF-7636 -
- // format values.
- String formattedMessage = formatMessage(msg, locale, label, convertedValue); // create Summary message ?
- String summaryString = getSummary() != null ? getSummary() : formattedMessage;
- summaryString = formatMessage(summaryString, locale, label, convertedValue);
- context.addMessage(component.getClientId(context), new FacesMessage(
- FacesMessage.SEVERITY_ERROR, summaryString, formattedMessage));
- }
- }
- }
- } catch (ELException e) {
- throw new FacesException(e);
- }
- }
- }
-
- static String formatMessage(String msg, Locale locale, Object... messageParams) {
- if (msg.contains("{")) {
- try {
- MessageFormat messageFormat = new MessageFormat(msg, locale);
- msg = messageFormat.format(messageParams);
- } catch (IllegalArgumentException e) {
- // Do nothing, use original string unchanged.
- }
- }
- return msg;
- }
-
- static Object getLabel(FacesContext context, UIComponent component) {
- Object label = component.getAttributes().get("label");
- if (null == label || 0 == label.toString().length()) {
- label = component.getClientId(context);
- }
- return label;
- }
-
- public Collection<String> validateGraph(FacesContext context, UIComponent component, Object value,
- Set<String> profiles) throws ValidatorException {
- ObjectValidator beanValidator = ObjectValidator.getInstance(context);
- Collection<String> messages = beanValidator.validateGraph(context, value, profiles);
- return messages;
- }
-
- /**
- * @return the profiles
- */
- public Set<String> getProfiles() {
- Set<String> profiles;
- if (null != profilesExpression) {
- profiles = (Set<String>) profilesExpression.getValue(FacesContext.getCurrentInstance().getELContext());
- } else {
- profiles = this.profiles;
- }
- return profiles;
- }
-
- /**
- * @param profiles
- * the profiles to set
- */
- public void setProfiles(Set<String> profiles) {
- this.profiles = profiles;
- }
-
- public void setProfiles(ValueExpression profilesExpression) {
- this.profilesExpression = profilesExpression;
- }
-}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesServiceBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesServiceBase.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesServiceBase.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,60 +0,0 @@
-package org.richfaces.validator;
-
-import java.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.lang.reflect.InvocationTargetException;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-import com.google.common.collect.ImmutableSet;
-
-public abstract class FacesServiceBase<T> {
-
- private static final ImmutableSet<String> HIDDEN_PROPERTIES = ImmutableSet.of("class", "transient");
-
- protected abstract String getMessageId(T component);
-
-
- protected void fillParameters(BaseFacesObjectDescriptor<T> descriptor, T component) {
- // get bean attributes for converter, put them into parameters.
- try {
- BeanInfo beanInfo = Introspector.getBeanInfo(component.getClass());
- PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
- for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
- String name = propertyDescriptor.getName();
- if (!HIDDEN_PROPERTIES.contains(name)) {
- try {
- Object value = propertyDescriptor.getReadMethod().invoke(component);
- if (null != value) {
- descriptor.addParameter(name, value);
- }
- } catch (IllegalArgumentException e) {
- // Ignore
- } catch (IllegalAccessException e) {
- // Ignore
- } catch (InvocationTargetException e) {
- // Ignore
- }
- }
- }
- } catch (IntrospectionException e) {
- // Ignore.
- }
- }
-
- /**
- * Creates message for converter, using current locale.
- *
- * @param context
- * @param component
- * @return
- */
- protected FacesMessage getMessage(FacesContext context, T component) {
- String messageId = getMessageId(component);
- return MessageFactory.createMessage(context, messageId);
- }
-
-}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,12 +0,0 @@
-package org.richfaces.validator;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.validator.Validator;
-
-public class FacesValidatorDescriptor extends BaseFacesObjectDescriptor<Validator> implements ValidatorDescriptor {
-
- public FacesValidatorDescriptor(Class<? extends Validator> validatorClass, FacesMessage message) {
- super(validatorClass, message);
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,55 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.DoubleRangeValidator;
-import javax.faces.validator.LengthValidator;
-import javax.faces.validator.LongRangeValidator;
-import javax.faces.validator.RegexValidator;
-import javax.faces.validator.RequiredValidator;
-import javax.faces.validator.Validator;
-
-/**
- * @author asmirnov
- *
- */
-public class FacesValidatorServiceImpl extends FacesServiceBase<Validator> implements FacesValidatorService {
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.FacesValidatorService#getValidatorDescription(javax.faces.context.FacesContext,
- * javax.faces.validator.Validator)
- */
- public ValidatorDescriptor getValidatorDescription(FacesContext context, Validator validator) {
- FacesMessage message = getMessage(context, validator);
- FacesValidatorDescriptor descriptor = new FacesValidatorDescriptor(validator.getClass(), message);
- fillParameters(descriptor, validator);
- descriptor.makeImmutable();
- return descriptor;
- }
-
- @Override
- protected String getMessageId(Validator component) {
- String messageId;
- if (component instanceof DoubleRangeValidator) {
- messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
- } else if (component instanceof LengthValidator) {
- messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
- } else if (component instanceof LongRangeValidator) {
- messageId = LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
- } else if (component instanceof RegexValidator) {
- messageId = RegexValidator.NOT_MATCHED_MESSAGE_ID;
- } else if (component instanceof RequiredValidator) {
- messageId = UIInput.REQUIRED_MESSAGE_ID;
- } else {
- messageId = UIInput.UPDATE_MESSAGE_ID;
- }
- return messageId;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,24 +0,0 @@
-package org.richfaces.validator;
-
-final class LibraryFunctionImplementation implements LibraryFunction {
- private final LibraryResource library;
- private final String functionName;
-
- LibraryFunctionImplementation(LibraryResource library, String functionName) {
- this.library = library;
- this.functionName = functionName;
- }
-
- LibraryFunctionImplementation(String library, String resource, String functionName) {
- this.library = new LibraryResource(library, resource);
- this.functionName = functionName;
- }
-
- public LibraryResource getResource() {
- return library;
- }
-
- public String getName() {
- return functionName;
- }
-}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/MessageFactory.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/MessageFactory.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/MessageFactory.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,75 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-
-/**
- * @author asmirnov
- *
- */
-public final class MessageFactory {
-
- private MessageFactory(){}
-
- public static FacesMessage createMessage(FacesContext context, String messageId) {
- Locale locale = getCurrentLocale(context);
- String messageBundle = context.getApplication().getMessageBundle();
- FacesMessage message;
- try {
- if (null != messageBundle) {
- try {
- message = getMessageFromBundle(locale, messageBundle, messageId);
- } catch (MissingResourceException e) {
- message = getMessageFromBundle(locale, FacesMessage.FACES_MESSAGES, messageId);
- }
- } else {
- message = getMessageFromBundle(locale, FacesMessage.FACES_MESSAGES, messageId);
- }
- } catch (MissingResourceException e) {
- // No bundles at all, fall back message.
- return new FacesMessage("conversion error");
- }
- return message;
- }
-
- private static FacesMessage getMessageFromBundle(Locale locale, String messageBundle, String messageId)
- throws MissingResourceException {
- ResourceBundle bundle = ResourceBundle.getBundle(messageBundle, locale, getCurrentLoader(messageId));
- String summary = bundle.getString(messageId);
- String detail;
- try {
- detail = bundle.getString(messageId + "_detail");
- } catch (MissingResourceException e) {
- return new FacesMessage(summary);
- }
- return new FacesMessage(summary, detail);
- }
-
- public static Locale getCurrentLocale(FacesContext context) {
- UIViewRoot viewRoot = context.getViewRoot();
- Locale locale;
- if (null == viewRoot) {
- locale = Locale.getDefault();
- } else {
- locale = viewRoot.getLocale();
- }
- return locale;
- }
-
- private static ClassLoader getCurrentLoader(Object fallbackClass) {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- if (loader == null) {
- loader = fallbackClass.getClass().getClassLoader();
- }
- return loader;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/NullValidator.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/NullValidator.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/NullValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,42 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.util.Collection;
-import java.util.Set;
-
-import javax.faces.context.FacesContext;
-
-/**
- * @author asmirnov
- *
- */
-public class NullValidator extends ObjectValidator {
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ObjectValidator#validate(java.lang.Object, java.lang.String, java.lang.Object,
- * java.util.Locale)
- */
- @Override
- protected Collection<String> validate(FacesContext facesContext, Object base, String property, Object value,
- Set<String> profiles) {
- // do nothing.
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.validator.ObjectValidator#validateGraph(javax.faces.context.FacesContext, java.lang.Object,
- * java.util.Set)
- */
- @Override
- public Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles) {
- // do nothing
- return null;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ObjectValidator.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,420 +0,0 @@
-package org.richfaces.validator;
-
-import java.beans.FeatureDescriptor;
-import java.util.Collection;
-import java.util.EmptyStackException;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.Stack;
-
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ELResolver;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.context.FacesContext;
-
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.el.ELContextWrapper;
-
-public abstract class ObjectValidator {
-
- private static final String RESOURCE_BUNDLE_IS_NOT_REGISTERED_FOR_CURRENT_LOCALE =
- "Resource bundle is not registered for current locale";
-
- private static final String FACES_CONTEXT_IS_NULL = "Faces context is null";
- private static final String INPUT_PARAMETERS_IS_NOT_CORRECT = "Input parameters is not correct.";
- private static final String LOCALE_IS_NOT_SET = "Locale is not set";
- private static final String VIEW_ROOT_IS_NOT_INITIALIZED = "ViewRoot is not initialized";
-
- protected final ObjectValidator parent;
-
- ObjectValidator() {
- this.parent = null;
- }
-
- ObjectValidator(ObjectValidator parent) {
- this.parent = parent;
- }
-
- /**
- * Return BeanValidator object from a ServletContext attribute. Create new instance if none is defined.
- *
- * @param context
- * @return
- */
- public static ObjectValidator getInstance(FacesContext context) {
- return ServiceTracker.getService(context, ObjectValidator.class);
- }
-
- public abstract Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles);
-
- /**
- * Perform Validation for a new value.
- *
- * @param context
- * current faces context.
- * @param target
- * {@link ValueExpression} for a value assignment.
- * @param value
- * new value for validation
- * @param profiles
- * TODO
- * @return null if no validation errors. Array of the validation messages otherwise.
- * @throws FacesException
- * if locale or context not properly initialized
- */
- public Collection<String> validate(FacesContext context, ValueExpression target, Object value, Set<String> profiles) {
- if (null == context) {
- throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
- }
- Collection<String> validationMessages = null;
- if (null != target) {
- ELContext elContext = context.getELContext();
- ValidationResolver validationResolver =
- createValidationResolver(context, elContext.getELResolver(), profiles);
- ELContextWrapper wrappedElContext = new ELContextWrapper(elContext, validationResolver);
- try {
- target.setValue(wrappedElContext, value);
- } catch (ELException e) {
- throw new FacesException(e);
- }
- if (!validationResolver.isValid()) {
- validationMessages = validationResolver.getValidationMessages();
- }
- if (null != parent) {
- Collection<String> parentMessages = parent.validate(context, target, value, profiles);
- if (null != validationMessages) {
- if (null != parentMessages) {
- validationMessages.addAll(parentMessages);
- }
- } else {
- validationMessages = parentMessages;
- }
- }
-
- }
- return validationMessages;
- }
-
- /**
- * Validate bean property for a new value.
- *
- * @param facesContext
- * TODO
- * @param base
- * - bean
- * @param property
- * - bean property name.
- * @param value
- * new value.
- * @param profiles
- * TODO
- *
- * @return null for a valid value, array of the validation messages othervise.
- */
- protected abstract Collection<String> validate(FacesContext facesContext, Object base, String property,
- Object value, Set<String> profiles);
-
- static Locale calculateLocale(FacesContext context) {
- if (null == context.getViewRoot()) {
- throw new FacesException(VIEW_ROOT_IS_NOT_INITIALIZED);
- } else if (null == context.getViewRoot().getLocale()) {
- throw new FacesException(LOCALE_IS_NOT_SET);
- }
- Locale locale = context.getViewRoot().getLocale();
- return locale;
- }
-
- static ResourceBundle getResourceBundle(FacesContext facesContext, String name) {
- ResourceBundle bundle = null;
- if (null != facesContext) {
- Application application = facesContext.getApplication();
- try {
- bundle = application.getResourceBundle(facesContext, name);
-
- } catch (Exception e) {
- // Let one more attempt to load resource
- }
- }
- if (null == bundle) {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- if (null == classLoader) {
- classLoader = ObjectValidator.class.getClassLoader();
- }
- try {
- bundle = ResourceBundle.getBundle(name, calculateLocale(facesContext), classLoader);
-
- } catch (MissingResourceException e) {
- // Do nothing, use default bundle.
- }
- }
- return bundle;
- }
-
- protected ValidationResolver createValidationResolver(FacesContext context, ELResolver parent, Set<String> profiles) {
- return new ValidationResolver(parent, context, profiles);
- }
-
- /**
- * @author asmirnov
- *
- */
- protected static class BasePropertyPair {
- private final Object base;
- private final Object property;
-
- /**
- * @param base
- * @param property
- */
- public BasePropertyPair(Object base, Object property) {
- this.base = base;
- this.property = property;
- }
-
- /**
- * @return the base
- */
- public Object getBase() {
- return base;
- }
-
- /**
- * @return the property
- */
- public Object getProperty() {
- return property;
- }
-
- }
-
- /**
- * Class for identify validator instance by locale
- *
- * @author amarkhel
- *
- */
- protected static class ValidatorKey {
- private final Class<? extends Object> validatableClass;
- private final Locale locale;
-
- /**
- * Constructor for ValidatorKey object
- *
- * @param validatableClass
- * - class to validate
- * @param locale
- * - User locale to determine Resource bundle, used during validation process
- */
- public ValidatorKey(Class<? extends Object> validatableClass, Locale locale) {
- this.validatableClass = validatableClass;
- this.locale = locale;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((this.locale == null) ? 0 : this.locale.hashCode());
- result = prime * result + ((this.validatableClass == null) ? 0 : this.validatableClass.hashCode());
- return result;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ValidatorKey other = (ValidatorKey) obj;
- if (this.locale == null) {
- if (other.locale != null) {
- return false;
- }
- } else if (!this.locale.equals(other.locale)) {
- return false;
- }
- if (this.validatableClass == null) {
- if (other.validatableClass != null) {
- return false;
- }
- } else if (!this.validatableClass.equals(other.validatableClass)) {
- return false;
- }
- return true;
- }
-
-
-
- }
-
- /**
- * Wrapper class for a {@link ELResolver}. For a setValue method, perform validation instead of real assignment.
- *
- * @author asmirnov
- *
- */
- final class ValidationResolver extends ELResolver {
-
- /**
- * Original resolver.
- */
- private final ELResolver parent;
-
- private boolean valid = true;
-
- private Collection<String> validationMessages = null;
-
- private Stack<BasePropertyPair> valuesStack;
-
- private Set<String> profiles;
-
- private FacesContext facesContext;
-
- private boolean clonedObject = false;
-
- /**
- * @param parent
- * @param context
- */
- public ValidationResolver(ELResolver parent, FacesContext context, Set<String> profiles) {
- this.parent = parent;
- this.valuesStack = new Stack<BasePropertyPair>();
- this.profiles = profiles;
- this.facesContext = context;
- }
-
- public boolean isValid() {
- return valid;
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
- */
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- return parent.getCommonPropertyType(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @return
- * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
- */
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- return parent.getFeatureDescriptors(context, base);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public Class<?> getType(ELContext context, Object base, Object property) {
- return parent.getType(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public Object getValue(ELContext context, Object base, Object property) {
- Object value = ClonedObjectResolver.resolveCloned(context, base, property);
- if (null != value) {
- this.clonedObject = true;
- context.setPropertyResolved(true);
- } else {
- value = parent.getValue(context, base, property);
- }
- valuesStack.push(new BasePropertyPair(base, property));
- return value;
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @return
- * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
- */
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- return parent.isReadOnly(context, base, property);
- }
-
- /**
- * @param context
- * @param base
- * @param property
- * @param value
- * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
- */
- public void setValue(ELContext context, Object base, Object property, Object value) {
- if (null != base && null != property) {
- // TODO - detect value object from inderect references ( e.g. data table variables ).
- if (this.clonedObject) {
- parent.setValue(context, base, property, value);
- }
- context.setPropertyResolved(true);
- // For Arrays, Collection or Map use parent base and property.
- BasePropertyPair basePropertyPair = lookupBeanProperty(new BasePropertyPair(base, property));
- base = basePropertyPair.getBase();
- property = basePropertyPair.getProperty();
- if (null != base && null != property) {
- // https://jira.jboss.org/jira/browse/RF-4034
- // apache el looses locale information during value
- // resolution,
- // so we use our own
- validationMessages = validate(facesContext, base, property.toString(), value, profiles);
- valid = null == validationMessages || 0 == validationMessages.size();
-
- }
- }
- }
-
- private BasePropertyPair lookupBeanProperty(BasePropertyPair pair) {
- Object base = pair.getBase();
- if (null != base && (base instanceof Collection || base instanceof Map || base.getClass().isArray())) {
- try {
- pair = lookupBeanProperty(valuesStack.pop());
- } catch (EmptyStackException e) {
- // Do nothing, this is a first item.
- }
- }
- return pair;
- }
-
- /**
- * @return the validationMessages
- */
- public Collection<String> getValidationMessages() {
- return validationMessages;
- }
-
- }
-
-}
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,97 +0,0 @@
-/**
- *
- */
-package org.richfaces.validator;
-
-import java.lang.annotation.Annotation;
-import java.util.Locale;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
-import javax.validation.MessageInterpolator;
-import javax.validation.MessageInterpolator.Context;
-import javax.validation.Validation;
-import javax.validation.Validator;
-import javax.validation.ValidatorContext;
-import javax.validation.ValidatorFactory;
-import javax.validation.metadata.ConstraintDescriptor;
-
-/**
- * @author asmirnov
- *
- */
-public class RichFacesBeanValidatorFactory implements BeanValidatorFactory {
-
- private ValidatorFactory validatorFactory;
- private ValidatorContext validatorContext;
-
- public RichFacesBeanValidatorFactory() {
- // Enforce class to load
- ValidatorFactory.class.getName();
- // Check Factory, to avoid instantiation errors
- // https://jira.jboss.org/jira/browse/RF-7226
- validatorFactory = Validation.buildDefaultValidatorFactory();
- validatorContext = validatorFactory.usingContext();
- MessageInterpolator jsfMessageInterpolator =
- new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
- validatorContext.messageInterpolator(jsfMessageInterpolator);
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.validator.BeanValidatorFactory#getValidator(javax.faces.context.FacesContext)
- */
- public Validator getValidator(FacesContext context) {
- return validatorContext.getValidator();
- }
-
- public FacesMessage interpolateMessage(FacesContext context,final ConstraintDescriptor<? extends Annotation> constrain){
- if(constrain.getAttributes().containsKey("message")){
- Object object = constrain.getAttributes().get("message");
- String interpolatedMessage;
- interpolatedMessage = validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
-
- public Object getValidatedValue() {
- return "{0}";
- }
-
- public ConstraintDescriptor<?> getConstraintDescriptor() {
- return constrain;
- }
- }, MessageFactory.getCurrentLocale(context));
- return new FacesMessage(interpolatedMessage);
- } else {
- return MessageFactory.createMessage(context, UIInput.UPDATE_MESSAGE_ID);
- }
- }
-
- private static final class JsfMessageInterpolator implements MessageInterpolator {
-
- private MessageInterpolator delegate;
-
- public JsfMessageInterpolator(MessageInterpolator delegate) {
- this.delegate = delegate;
- }
-
- public String interpolate(String messageTemplate, Context context) {
-
- Locale locale = MessageFactory.getCurrentLocale(FacesContext.getCurrentInstance());
- if (null != locale) {
- return delegate.interpolate(messageTemplate, context, locale);
- } else {
- return delegate.interpolate(messageTemplate, context);
- }
- }
-
- public String interpolate(String messageTemplate, Context context, Locale locale) {
- Locale faceslocale = MessageFactory.getCurrentLocale(FacesContext.getCurrentInstance());
- if (null != faceslocale) {
- return delegate.interpolate(messageTemplate, context, faceslocale);
- } else {
- return delegate.interpolate(messageTemplate, context, locale);
- }
- }
-
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ELTestBase.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ELTestBase.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ELTestBase.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,143 +0,0 @@
-package org.richfaces.el;
-
-import java.beans.FeatureDescriptor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.el.BeanELResolver;
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.FunctionMapper;
-import javax.el.ListELResolver;
-import javax.el.MapELResolver;
-import javax.el.ValueExpression;
-import javax.el.VariableMapper;
-
-import org.jboss.el.ExpressionFactoryImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.richfaces.el.model.Bean;
-import org.richfaces.el.model.Person;
-
-import com.google.common.collect.Iterators;
-
-public class ELTestBase {
-
- class DummyELResolver extends ELResolver {
-
- private final ELResolver beanResolver = new BeanELResolver();
- private final ELResolver mapResolver = new MapELResolver();
- private final ELResolver listResolver = new ListELResolver();
-
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base) {
- return String.class;
- }
-
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- return Iterators.emptyIterator();
- }
-
- @Override
- public Class<?> getType(ELContext context, Object base, Object property) {
- if (null == base) {
- if ("bean".equals(property)) {
- return Bean.class;
- } else if ("person".equals(property)) {
- return Person.class;
- }
- } else if (base instanceof List) {
- return listResolver.getType(context, base, property);
- } else if (base instanceof Map) {
- return mapResolver.getType(context, base, property);
- }
- return beanResolver.getType(context, base, property);
- }
-
- @Override
- public Object getValue(ELContext context, Object base, Object property) {
- if (null == base) {
- if ("bean".equals(property)) {
- return bean;
- } else if ("person".equals(property)) {
- return person;
- }
- } else if (base instanceof List) {
- return listResolver.getValue(context, base, property);
- } else if (base instanceof Map) {
- return mapResolver.getValue(context, base, property);
- }
- return beanResolver.getValue(context, base, property);
- }
-
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- return true;
- }
-
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value) {
- // do nothing
-
- }
-
- }
-
- class DummyELContext extends ELContext {
-
- @Override
- public ELResolver getELResolver() {
- return elResolver;
- }
-
- @Override
- public FunctionMapper getFunctionMapper() {
- return null;
- }
-
- @Override
- public VariableMapper getVariableMapper() {
- return null;
- }
-
- }
-
- protected ExpressionFactoryImpl expressionFactory;
- protected Bean bean;
- protected ELResolver elResolver;
- protected ELContext elContext;
- protected CapturingELContext capturingELContext;
- protected Person person;
-
- @Before
- public void setUp() throws Exception {
- expressionFactory = new ExpressionFactoryImpl();
- bean = new Bean();
- person = new Person();
- bean.setString("foo");
- ArrayList<String> list = new ArrayList<String>(1);
- list.add("bar");
- bean.setList(list);
- HashMap<String, String> map = new HashMap<String, String>();
- map.put("boo", "baz");
- bean.setMap(map);
- elResolver = new DummyELResolver();
- elContext = new DummyELContext();
- capturingELContext = new CapturingELContext(elContext);
- }
-
- @After
- public void tearDown() throws Exception {
- expressionFactory = null;
- }
-
- protected ValueExpression parse(String expressionString) {
- ValueExpression expression = expressionFactory.createValueExpression(elContext, expressionString, String.class);
- return expression;
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/TestCaptureEL.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/TestCaptureEL.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/TestCaptureEL.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,61 +0,0 @@
-package org.richfaces.el;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
-import javax.el.ValueExpression;
-
-import org.jboss.test.faces.mock.MockTestRunner;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-(a)RunWith(MockTestRunner.class)
-public class TestCaptureEL extends ELTestBase {
-
- @Test
- public void testDummyResolverString() throws Exception {
- ValueExpression expression = parse("#{bean.string}");
- assertEquals("foo", expression.getValue(elContext));
- }
-
- @Test
- public void testDummyResolverList() throws Exception {
- ValueExpression expression = parse("#{bean.list[0]}");
- assertEquals("bar", expression.getValue(elContext));
- }
-
- @Test
- public void testDummyResolverMap() throws Exception {
- ValueExpression expression = parse("#{bean.map['boo']}");
- assertEquals("baz", expression.getValue(elContext));
- }
-
- @Test
- public void captureString() throws Exception {
- ValueExpression expression = parse("#{bean.string}");
- expression.getType(capturingELContext);
- ValueReference reference = capturingELContext.getReference();
- assertEquals("string", reference.getProperty());
- assertSame(bean, reference.getBase());
- reference = reference.next();
- assertNotNull(reference);
- assertEquals("bean", reference.getProperty());
- assertNull(reference.getBase());
- assertNull(reference.next());
- }
-
- @Test
- public void captureMap() throws Exception {
- ValueExpression expression = parse("#{bean.map['boo']}");
- expression.getType(capturingELContext);
- ValueReference reference = capturingELContext.getReference();
- assertEquals("boo", reference.getProperty());
- assertSame(bean.getMap(), reference.getBase());
- reference = reference.next();
- assertNotNull(reference);
- assertEquals("map", reference.getProperty());
- }
-
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,57 +0,0 @@
-package org.richfaces.el;
-
-
-import static org.easymock.EasyMock.expect;
-import static org.junit.Assert.*;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-
-import org.jboss.test.faces.mock.FacesMock;
-import org.jboss.test.faces.mock.Mock;
-import org.jboss.test.faces.mock.MockTestRunner;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.richfaces.el.model.Bean;
-
-(a)RunWith(MockTestRunner.class)
-public class ValueExpressionAnalayserTest extends ELTestBase {
-
-
- private ValueExpressionAnalayser analayser;
-
- @Mock
- private FacesContext facesContext;
-
- @Before
- public void setUpAnalayser() throws Exception {
- analayser = new ValueExpressionAnalayserImpl();
- }
-
- @After
- public void tearDownAnalayser() throws Exception {
- analayser = null;
- }
- @Test
- public void testGetDescriptionPositive() throws Exception {
- ValueExpression expression = parse("#{bean.string}");
- expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
- ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
- assertEquals(Bean.class, propertyDescriptor.getBeanType());
- assertEquals("string", propertyDescriptor.getName());
- assertEquals(String.class,propertyDescriptor.getPropertyType());
- FacesMock.verify(facesContext);
- }
-
- @Test(expected=ELException.class)
- public void testGetDescriptionNegative() throws Exception {
- ValueExpression expression = parse("#{bean}");
- expect(facesContext.getELContext()).andReturn(elContext);
- FacesMock.replay(facesContext);
- ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
- }
-}
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/resources/badcsv.xml
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/resources/badcsv.xml 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/resources/badcsv.xml 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scripts>
- <component>
- <type>non.existed.Class</type>
- <library>org.richfaces</library>
- <resource>csv.js</resource>
- <function>stringConverter</function>
- </component>
-</scripts>
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/resources/csv.xml
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/resources/csv.xml 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/resources/csv.xml 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scripts>
- <component>
- <type>java.lang.String</type>
- <library>org.richfaces</library>
- <resource>csv.js</resource>
- <function>stringConverter</function>
- </component>
- <component>
- <type>java.lang.Integer</type>
- <library>org.richfaces</library>
- <resource>csv.js</resource>
- <function>intConverter</function>
- </component>
-</scripts>
\ No newline at end of file
Deleted: branches/RF-8742-1/ui/validator/impl/src/test/resources/test.html
===================================================================
--- branches/RF-8742-1/ui/validator/impl/src/test/resources/test.html 2010-11-10 21:22:24 UTC (rev 20024)
+++ branches/RF-8742-1/ui/validator/impl/src/test/resources/test.html 2010-11-10 22:36:12 UTC (rev 20025)
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
-
-<html>
-<head>
- <title>Untitled</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Test Page</title>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="richfaces.js"></script>
- <script type="text/javascript" src="length.js"></script>
-
-</head>
-
-<body style="margin : 30px">
-<form id="myForm">
-<input id="myInput" type="text" value="aaa"/>
-<input type="button" onclick="v();" value="validate length"/>
-<input type="button" onclick="v({'LengthValidator.MINIMUM':'CustomMessage: length of the {1} is smaller then {0} chars', 'LengthValidator.MAXIMUM':'CustomMessage: length of the {1} is bigger then {0} chars'});" value="validate length (custom message)"/>
-</form>
-<script>
-RichFaces.csv.addMessage({'LengthValidator.MINIMUM':'Hello, length of the "{1}" is smaller then {0} chars', 'LengthValidator.MAXIMUM':'Hello, length of the "{1}" is bigger then {0} chars'});
-var v = function (customMessages) {
- RichFaces.csv.validate(null, 'myInput', {'length':{min:1, max:5, customMessages:customMessages}}, null, null);
-};
-</script>
-</body>
-<html>
\ No newline at end of file
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/application (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/application)
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/el (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/el)
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,42 @@
+package org.richfaces.validator;
+
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+
+public class BaseFacesObjectDescriptor<T> {
+
+ private final Class<? extends T> converterClass;
+ private Map<String, Object> parameters = Maps.newHashMap();
+ private final FacesMessage message;
+
+
+ public BaseFacesObjectDescriptor(Class<? extends T> converterClass, FacesMessage message) {
+ this.converterClass = converterClass;
+ this.message = message;
+ }
+
+ public Class<?> getImplementationClass() {
+ return converterClass;
+ }
+
+ public Map<String, ? extends Object> getAdditionalParameters() {
+ return parameters;
+ }
+
+ public FacesMessage getMessage() {
+ return message;
+ }
+
+ protected void addParameter(String name, Object value) {
+ parameters.put(name, value);
+ }
+
+ protected void makeImmutable() {
+ parameters = ImmutableMap.copyOf(parameters);
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BaseFacesObjectDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidator.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidator.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidator.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,110 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.validation.ConstraintViolation;
+import javax.validation.Validator;
+import javax.validation.groups.Default;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class BeanValidator extends ObjectValidator {
+
+ private static final Class<?>[] DEFAULT_PROFILE = new Class[] {Default.class};
+ private final BeanValidatorFactory validatorFactory;
+
+
+ public BeanValidator(BeanValidatorFactory validatorFactory) {
+ this.validatorFactory = validatorFactory;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.ObjectValidator#validate(java.lang.Object, java.lang.String, java.lang.Object,
+ * java.util.Locale)
+ */
+ @Override
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property, Object value,
+ Set<String> profiles) {
+ Class beanType = base.getClass();
+ Set<ConstraintViolation<Object>> constrains =
+ getValidator(facesContext).validateValue(beanType, property, value, getGroups(profiles));
+ return extractMessages(constrains);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.ObjectValidator#validateGraph(javax.faces.context .FacesContext, java.lang.Object,
+ * java.util.Set)
+ */
+ @Override
+ public Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles) {
+ Class<?>[] groups = getGroups(profiles);
+ Set<ConstraintViolation<Object>> violations = getValidator(context).validate(value, groups);
+ Collection<String> messages = extractMessages(violations);
+ if (null != parent) {
+ Collection<String> parentMessages = parent.validateGraph(context, value, profiles);
+ if (null != messages) {
+ if (null != parentMessages) {
+ messages.addAll(parentMessages);
+ }
+ } else {
+ messages = parentMessages;
+ }
+ }
+ return messages;
+ }
+
+ private Class<?>[] getGroups(Set<String> profiles) {
+ Class<?>[] groups = null;
+ if (null != profiles) {
+ groups = new Class<?>[profiles.size()];
+ int i = 0;
+ for (String group : profiles) {
+ try {
+ groups[i] = Class.forName(group, false, Thread.currentThread().getContextClassLoader());
+ } catch (ClassNotFoundException e) {
+ try {
+ groups[i] = Class.forName(group);
+ } catch (ClassNotFoundException e1) {
+ throw new FacesException("Bean validation group not found " + group, e1);
+ }
+ }
+ i++;
+ }
+
+ } else {
+ groups = DEFAULT_PROFILE;
+ }
+ return groups;
+ }
+
+ private Collection<String> extractMessages(Set<ConstraintViolation<Object>> violations) {
+ Collection<String> messages = null;
+ if (null != violations && violations.size() > 0) {
+ messages = new ArrayList<String>(violations.size());
+ for (ConstraintViolation<? extends Object> constraintViolation : violations) {
+ messages.add(constraintViolation.getMessage());
+ }
+
+ }
+ return messages;
+ }
+
+ protected Validator getValidator(FacesContext facesContext) {
+ Validator beanValidator = validatorFactory.getValidator(facesContext);
+ return beanValidator;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,13 @@
+package org.richfaces.validator;
+
+import java.lang.annotation.Annotation;
+
+import javax.faces.application.FacesMessage;
+
+public class BeanValidatorDescriptor extends BaseFacesObjectDescriptor<Annotation> implements ValidatorDescriptor {
+
+ public BeanValidatorDescriptor(Class<? extends Annotation> validatorClass, FacesMessage message) {
+ super(validatorClass, message);
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,100 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.validation.Validator;
+import javax.validation.metadata.ConstraintDescriptor;
+import javax.validation.metadata.ElementDescriptor.ConstraintFinder;
+import javax.validation.metadata.PropertyDescriptor;
+
+import org.richfaces.el.ValueDescriptor;
+import org.richfaces.el.ValueExpressionAnalayser;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class BeanValidatorServiceImpl implements BeanValidatorService {
+
+ private final ValueExpressionAnalayser analayser;
+ private final BeanValidatorFactory validatorFactory;
+
+ public BeanValidatorServiceImpl(ValueExpressionAnalayser analayser, BeanValidatorFactory validatorFactory) {
+ this.analayser = analayser;
+ this.validatorFactory = validatorFactory;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.BeanValidatorService#getConstrains(javax.faces.context.FacesContext,
+ * javax.el.ValueExpression, java.lang.Class<?>[])
+ */
+ public Collection<ValidatorDescriptor> getConstrains(FacesContext context, ValueExpression expression,
+ Class<?>... groups) {
+ try {
+ ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(context, expression);
+ return processBeanAttribute(context, propertyDescriptor, groups);
+ } catch (ELException e) {
+ return Collections.emptySet();
+ }
+ }
+
+ private Validator getValidator(FacesContext context) {
+ return validatorFactory.getValidator(context);
+ }
+
+ Collection<ValidatorDescriptor> processBeanAttribute(FacesContext context, ValueDescriptor descriptor,
+ Class<?>... groups) {
+ PropertyDescriptor constraintsForProperty =
+ getValidator(context).getConstraintsForClass(descriptor.getBeanType()).getConstraintsForProperty(
+ descriptor.getName());
+ if (null != constraintsForProperty) {
+ ConstraintFinder propertyConstraints = constraintsForProperty.findConstraints();
+ if (null != groups && groups.length > 0) {
+ // Filter groups, if required
+ propertyConstraints = propertyConstraints.unorderedAndMatchingGroups(groups);
+ }
+ Set<ConstraintDescriptor<?>> constraints = propertyConstraints // or the requested list of groups)
+ .getConstraintDescriptors();
+
+ // ContextHolder is an arbitrary object, it will depend on the implementation
+ Set<ValidatorDescriptor> descriptors = new HashSet<ValidatorDescriptor>(constraints.size());
+ processConstraints(context, constraints, descriptors);
+ return descriptors;
+
+ } else {
+ return Collections.emptySet();
+ }
+ }
+
+ void processConstraints(FacesContext context, Set<ConstraintDescriptor<?>> constraints,
+ Collection<ValidatorDescriptor> descriptors) {
+ for (ConstraintDescriptor<?> cd : constraints) {
+ Annotation a = cd.getAnnotation();
+ Map<String, Object> parameters = cd.getAttributes();
+ // TODO if cd.isReportedAsSingleConstraint() make sure than only the root constraint raises an error message
+ // if one or several of the composing constraints are invalid)
+ FacesMessage message = validatorFactory.interpolateMessage(context, cd);
+ BeanValidatorDescriptor beanValidatorDescriptor = new BeanValidatorDescriptor(a.getClass(), message);
+ for (Map.Entry<String, Object> entry : parameters.entrySet()) {
+ beanValidatorDescriptor.addParameter(entry.getKey(), entry.getValue());
+ }
+ beanValidatorDescriptor.makeImmutable();
+ descriptors.add(beanValidatorDescriptor);
+ processConstraints(context, cd.getComposingConstraints(), descriptors); // process the composing constraints
+ }
+ }
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/BeanValidatorServiceImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,74 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.util.Map;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.component.util.Strings;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ClientScriptServiceImpl implements ClientScriptService {
+
+ private static final String TEXT_JAVASCRIPT = "text/javascript";
+
+ private static final String ORG_RICHFACES_CSV = "org.richfaces.csv";
+
+ private final Map<Class<?>, LibraryFunction> defaultMapping;
+
+ public ClientScriptServiceImpl(Map<Class<?>, LibraryFunction> defaultMapping) {
+ this.defaultMapping = defaultMapping;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.ClientScriptService#getScript(java.lang.Class)
+ */
+ public LibraryFunction getScript(FacesContext facesContext, Class<?> javaClass) throws ScriptNotFoundException {
+ if (null == facesContext || null == javaClass) {
+ throw new NullPointerException();
+ }
+ LibraryFunction function;
+ try {
+ function = getScriptResource(facesContext, javaClass);
+ } catch (ScriptNotFoundException e) {
+ if (defaultMapping.containsKey(javaClass)) {
+ function = defaultMapping.get(javaClass);
+ } else {
+ function = getScriptFromAnnotation(javaClass);
+ }
+ }
+ return function;
+ }
+
+ private LibraryFunction getScriptFromAnnotation(Class<?> javaClass) throws ScriptNotFoundException {
+ if (javaClass.isAnnotationPresent(ClientSideScript.class)) {
+ ClientSideScript clientSideScript = javaClass.getAnnotation(ClientSideScript.class);
+ return new LibraryFunctionImplementation(clientSideScript.library(), clientSideScript.resource(), clientSideScript.function());
+ } else {
+ throw new ScriptNotFoundException();
+ }
+ }
+
+ private LibraryFunction getScriptResource(FacesContext facesContext, Class<?> javaClass)
+ throws ScriptNotFoundException {
+ ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
+ String resourceName = javaClass.getSimpleName() + ".js";
+ Resource facesResource = resourceHandler.createResource(resourceName, ORG_RICHFACES_CSV, TEXT_JAVASCRIPT);
+ if (null != facesResource) {
+ final String functionName = Strings.firstToLowerCase(javaClass.getSimpleName());
+ return new LibraryFunctionImplementation(ORG_RICHFACES_CSV,resourceName, functionName);
+ } else {
+ throw new ScriptNotFoundException();
+ }
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientScriptServiceImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Map;
+
+import javax.faces.FacesException;
+import javax.xml.bind.JAXB;
+
+import org.richfaces.validator.model.ClientSideScripts;
+import org.richfaces.validator.model.Component;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import com.google.common.collect.Maps;
+
+/**
+ * @author asmirnov
+ *
+ */
+public final class ClientServiceConfigParser {
+
+ private ClientServiceConfigParser() {
+ }
+
+ public static Map<Class<?>, LibraryFunction> parseConfig(String name) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (null == loader) {
+ loader = ClientServiceConfigParser.class.getClassLoader();
+ }
+ Builder<Class<?>, LibraryFunction> resultBuilder = ImmutableMap.builder();
+ try {
+ Enumeration<URL> resources = loader.getResources(name);
+ while (resources.hasMoreElements()) {
+ URL url = (URL) resources.nextElement();
+ resultBuilder.putAll(parse(loader, url));
+ }
+ } catch (IOException e) {
+ return Collections.emptyMap();
+ }
+ return resultBuilder.build();
+ }
+
+ static Map<Class<?>, LibraryFunction> parse(ClassLoader loader, URL url) {
+ Map<Class<?>, LibraryFunction> result = Maps.newHashMap();
+ try {
+ ClientSideScripts clientSideScripts = JAXB.unmarshal(url, ClientSideScripts.class);
+ for (Component component : clientSideScripts.getComponent()) {
+ Class<?> componentClass = loader.loadClass(component.getType());
+ LibraryFunctionImplementation function = new LibraryFunctionImplementation(component.getLibrary(),
+ component.getResource(), component.getFunction());
+ result.put(componentClass, function);
+ }
+ } catch (ClassNotFoundException e) {
+ throw new FacesException("Class for component not found",e);
+ } catch (Exception e) {
+ throw new FacesException("Error parsing config file "+url,e);
+ }
+ return result;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClientServiceConfigParser.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ClonedObjectResolver.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,110 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.faces.context.FacesContext;
+
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ClonedObjectResolver extends ELResolver {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ // Do nothing
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
+ */
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ // do nothing
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ Object cloned = resolveCloned(context, base, property);
+ if (null != cloned) {
+ context.setPropertyResolved(true);
+ return cloned.getClass();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ Object cloned = resolveCloned(context, base, property);
+ if (null != cloned) {
+ context.setPropertyResolved(true);
+ }
+ return cloned;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public static Object resolveCloned(ELContext context, Object base, Object property) {
+ if (null != base || null != property) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ Map<String, Object> requestMap = facesContext.getExternalContext().getRequestMap();
+ for (String key : requestMap.keySet()) {
+ if (null != key && key.startsWith(GraphValidatorState.STATE_ATTRIBUTE_PREFIX)) {
+ GraphValidatorState state = (GraphValidatorState) requestMap.get(key);
+ if (state.isSame(base, property)) {
+ return state.getCloned();
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ClonedObjectResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,22 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+
+import javax.faces.application.FacesMessage;
+import javax.faces.convert.Converter;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ConverterDescriptorImpl extends BaseFacesObjectDescriptor<Converter> implements ConverterDescriptor {
+
+
+ ConverterDescriptorImpl(Class<? extends Converter> converterClass,FacesMessage message) {
+ super(converterClass,message);
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterDescriptorImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterServiceImpl.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ConverterServiceImpl.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterServiceImpl.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,86 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.BigDecimalConverter;
+import javax.faces.convert.BigIntegerConverter;
+import javax.faces.convert.BooleanConverter;
+import javax.faces.convert.ByteConverter;
+import javax.faces.convert.CharacterConverter;
+import javax.faces.convert.Converter;
+import javax.faces.convert.DateTimeConverter;
+import javax.faces.convert.DoubleConverter;
+import javax.faces.convert.EnumConverter;
+import javax.faces.convert.FloatConverter;
+import javax.faces.convert.IntegerConverter;
+import javax.faces.convert.LongConverter;
+import javax.faces.convert.NumberConverter;
+import javax.faces.convert.ShortConverter;
+
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ConverterServiceImpl extends FacesServiceBase<Converter> implements FacesConverterService {
+
+ private static final String DEFAULT_CONVERTER_MESSAGE_ID = UIInput.CONVERSION_MESSAGE_ID;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.FacesConverterService#getConverterDescription(javax.faces.context.FacesContext,
+ * javax.faces.convert.Converter)
+ */
+ public ConverterDescriptor getConverterDescription(FacesContext context, Converter converter) {
+ // determine converter message.
+ FacesMessage message = getMessage(context, converter);
+ ConverterDescriptorImpl descriptor = new ConverterDescriptorImpl(converter.getClass(), message);
+ fillParameters(descriptor, converter);
+ descriptor.makeImmutable();
+ return descriptor;
+ }
+
+ @Override
+ protected String getMessageId(Converter converter) {
+ String messageId;
+ if (converter instanceof BigDecimalConverter) {
+ messageId = BigDecimalConverter.DECIMAL_ID;
+ } else if (converter instanceof BigIntegerConverter) {
+ messageId = BigIntegerConverter.BIGINTEGER_ID;
+ } else if (converter instanceof BooleanConverter) {
+ messageId = BooleanConverter.BOOLEAN_ID;
+ } else if (converter instanceof ByteConverter) {
+ messageId = ByteConverter.BYTE_ID;
+ } else if (converter instanceof CharacterConverter) {
+ messageId = CharacterConverter.CHARACTER_ID;
+ } else if (converter instanceof DateTimeConverter) {
+ // TODO - distinguish Date, Time, and DateTime.
+ messageId = DateTimeConverter.DATETIME_ID;
+ } else if (converter instanceof DoubleConverter) {
+ messageId = DoubleConverter.DOUBLE_ID;
+ } else if (converter instanceof EnumConverter) {
+ messageId = EnumConverter.ENUM_ID;
+ } else if (converter instanceof FloatConverter) {
+ messageId = FloatConverter.FLOAT_ID;
+ } else if (converter instanceof IntegerConverter) {
+ messageId = IntegerConverter.INTEGER_ID;
+ } else if (converter instanceof LongConverter) {
+ messageId = LongConverter.LONG_ID;
+ } else if (converter instanceof NumberConverter) {
+ // TODO - detect case ( currency, percent etc ).
+ messageId = NumberConverter.NUMBER_ID;
+ } else if (converter instanceof ShortConverter) {
+ messageId = ShortConverter.SHORT_ID;
+ } else {
+ messageId = DEFAULT_CONVERTER_MESSAGE_ID;
+ }
+ return messageId;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ConverterServiceImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,26 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class DummyBeanValidatorService implements BeanValidatorService {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.validator.BeanValidatorService#getConstrains(javax.faces.context.FacesContext, javax.el.ValueExpression, java.lang.Class<?>[])
+ */
+ public Collection<ValidatorDescriptor> getConstrains(FacesContext context, ValueExpression expression,
+ Class<?>... groups) {
+ return Collections.emptySet();
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/DummyBeanValidatorService.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanValidator.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesBeanValidator.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanValidator.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,178 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.validator;
+
+import java.io.Serializable;
+import java.text.MessageFormat;
+import java.util.Collection;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+
+/**
+ * Implementation of the JSF validator to use with Bean Validation / Hibernate validator
+ *
+ * @author asmirnov
+ *
+ */
+public class FacesBeanValidator implements Serializable, Validator, GraphValidator {
+
+ public static final String BEAN_VALIDATOR_TYPE = "org.richfaces.BeanValidator";
+ /**
+ *
+ */
+ private static final long serialVersionUID = -264568176252121853L;
+ private ValueExpression summaryExpression = null;
+
+ private String summary = null;
+
+ private ValueExpression profilesExpression = null;
+
+ private Set<String> profiles = null;
+
+ /**
+ * @return the summary
+ */
+ public String getSummary() {
+ String summaryString = null;
+ if (null != summaryExpression) {
+ summaryString = (String) summaryExpression.getValue(FacesContext.getCurrentInstance().getELContext());
+ } else {
+ summaryString = this.summary;
+ }
+ return summaryString;
+ }
+
+ /**
+ * @param summary
+ * the summary to set
+ */
+ public void setSummary(ValueExpression summary) {
+ this.summaryExpression = summary;
+ }
+
+ /**
+ * @param summary
+ * the summary to set
+ */
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.validator.Validator#validate(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent, java.lang.Object)
+ */
+ public void validate(FacesContext context, UIComponent component, Object convertedValue) throws ValidatorException {
+ if (component instanceof EditableValueHolder) {
+ // Validate input component
+ EditableValueHolder input = (EditableValueHolder) component;
+ try {
+ ValueExpression valueExpression = component.getValueExpression("value");
+ if (null != valueExpression) {
+ Collection<String> messages =
+ ObjectValidator.getInstance(context).validate(context, valueExpression, convertedValue,
+ getProfiles());
+ if (null != messages) {
+ input.setValid(false);
+ Object label = getLabel(context, component);
+ Locale locale = context.getViewRoot().getLocale();
+ // send all validation messages.
+ for (String msg : messages) {
+ // https://jira.jboss.org/jira/browse/RF-7636 -
+ // format values.
+ String formattedMessage = formatMessage(msg, locale, label, convertedValue); // create Summary message ?
+ String summaryString = getSummary() != null ? getSummary() : formattedMessage;
+ summaryString = formatMessage(summaryString, locale, label, convertedValue);
+ context.addMessage(component.getClientId(context), new FacesMessage(
+ FacesMessage.SEVERITY_ERROR, summaryString, formattedMessage));
+ }
+ }
+ }
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ }
+ }
+
+ static String formatMessage(String msg, Locale locale, Object... messageParams) {
+ if (msg.contains("{")) {
+ try {
+ MessageFormat messageFormat = new MessageFormat(msg, locale);
+ msg = messageFormat.format(messageParams);
+ } catch (IllegalArgumentException e) {
+ // Do nothing, use original string unchanged.
+ }
+ }
+ return msg;
+ }
+
+ static Object getLabel(FacesContext context, UIComponent component) {
+ Object label = component.getAttributes().get("label");
+ if (null == label || 0 == label.toString().length()) {
+ label = component.getClientId(context);
+ }
+ return label;
+ }
+
+ public Collection<String> validateGraph(FacesContext context, UIComponent component, Object value,
+ Set<String> profiles) throws ValidatorException {
+ ObjectValidator beanValidator = ObjectValidator.getInstance(context);
+ Collection<String> messages = beanValidator.validateGraph(context, value, profiles);
+ return messages;
+ }
+
+ /**
+ * @return the profiles
+ */
+ public Set<String> getProfiles() {
+ Set<String> profiles;
+ if (null != profilesExpression) {
+ profiles = (Set<String>) profilesExpression.getValue(FacesContext.getCurrentInstance().getELContext());
+ } else {
+ profiles = this.profiles;
+ }
+ return profiles;
+ }
+
+ /**
+ * @param profiles
+ * the profiles to set
+ */
+ public void setProfiles(Set<String> profiles) {
+ this.profiles = profiles;
+ }
+
+ public void setProfiles(ValueExpression profilesExpression) {
+ this.profilesExpression = profilesExpression;
+ }
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesBeanValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServiceBase.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesServiceBase.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServiceBase.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServiceBase.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,60 @@
+package org.richfaces.validator;
+
+import java.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import com.google.common.collect.ImmutableSet;
+
+public abstract class FacesServiceBase<T> {
+
+ private static final ImmutableSet<String> HIDDEN_PROPERTIES = ImmutableSet.of("class", "transient");
+
+ protected abstract String getMessageId(T component);
+
+
+ protected void fillParameters(BaseFacesObjectDescriptor<T> descriptor, T component) {
+ // get bean attributes for converter, put them into parameters.
+ try {
+ BeanInfo beanInfo = Introspector.getBeanInfo(component.getClass());
+ PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
+ String name = propertyDescriptor.getName();
+ if (!HIDDEN_PROPERTIES.contains(name)) {
+ try {
+ Object value = propertyDescriptor.getReadMethod().invoke(component);
+ if (null != value) {
+ descriptor.addParameter(name, value);
+ }
+ } catch (IllegalArgumentException e) {
+ // Ignore
+ } catch (IllegalAccessException e) {
+ // Ignore
+ } catch (InvocationTargetException e) {
+ // Ignore
+ }
+ }
+ }
+ } catch (IntrospectionException e) {
+ // Ignore.
+ }
+ }
+
+ /**
+ * Creates message for converter, using current locale.
+ *
+ * @param context
+ * @param component
+ * @return
+ */
+ protected FacesMessage getMessage(FacesContext context, T component) {
+ String messageId = getMessageId(component);
+ return MessageFactory.createMessage(context, messageId);
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesServiceBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,12 @@
+package org.richfaces.validator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.validator.Validator;
+
+public class FacesValidatorDescriptor extends BaseFacesObjectDescriptor<Validator> implements ValidatorDescriptor {
+
+ public FacesValidatorDescriptor(Class<? extends Validator> validatorClass, FacesMessage message) {
+ super(validatorClass, message);
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorDescriptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,55 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.DoubleRangeValidator;
+import javax.faces.validator.LengthValidator;
+import javax.faces.validator.LongRangeValidator;
+import javax.faces.validator.RegexValidator;
+import javax.faces.validator.RequiredValidator;
+import javax.faces.validator.Validator;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class FacesValidatorServiceImpl extends FacesServiceBase<Validator> implements FacesValidatorService {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.FacesValidatorService#getValidatorDescription(javax.faces.context.FacesContext,
+ * javax.faces.validator.Validator)
+ */
+ public ValidatorDescriptor getValidatorDescription(FacesContext context, Validator validator) {
+ FacesMessage message = getMessage(context, validator);
+ FacesValidatorDescriptor descriptor = new FacesValidatorDescriptor(validator.getClass(), message);
+ fillParameters(descriptor, validator);
+ descriptor.makeImmutable();
+ return descriptor;
+ }
+
+ @Override
+ protected String getMessageId(Validator component) {
+ String messageId;
+ if (component instanceof DoubleRangeValidator) {
+ messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
+ } else if (component instanceof LengthValidator) {
+ messageId = DoubleRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
+ } else if (component instanceof LongRangeValidator) {
+ messageId = LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID;
+ } else if (component instanceof RegexValidator) {
+ messageId = RegexValidator.NOT_MATCHED_MESSAGE_ID;
+ } else if (component instanceof RequiredValidator) {
+ messageId = UIInput.REQUIRED_MESSAGE_ID;
+ } else {
+ messageId = UIInput.UPDATE_MESSAGE_ID;
+ }
+ return messageId;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/FacesValidatorServiceImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,24 @@
+package org.richfaces.validator;
+
+final class LibraryFunctionImplementation implements LibraryFunction {
+ private final LibraryResource library;
+ private final String functionName;
+
+ LibraryFunctionImplementation(LibraryResource library, String functionName) {
+ this.library = library;
+ this.functionName = functionName;
+ }
+
+ LibraryFunctionImplementation(String library, String resource, String functionName) {
+ this.library = new LibraryResource(library, resource);
+ this.functionName = functionName;
+ }
+
+ public LibraryResource getResource() {
+ return library;
+ }
+
+ public String getName() {
+ return functionName;
+ }
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/LibraryFunctionImplementation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/MessageFactory.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/MessageFactory.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/MessageFactory.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/MessageFactory.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,75 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public final class MessageFactory {
+
+ private MessageFactory(){}
+
+ public static FacesMessage createMessage(FacesContext context, String messageId) {
+ Locale locale = getCurrentLocale(context);
+ String messageBundle = context.getApplication().getMessageBundle();
+ FacesMessage message;
+ try {
+ if (null != messageBundle) {
+ try {
+ message = getMessageFromBundle(locale, messageBundle, messageId);
+ } catch (MissingResourceException e) {
+ message = getMessageFromBundle(locale, FacesMessage.FACES_MESSAGES, messageId);
+ }
+ } else {
+ message = getMessageFromBundle(locale, FacesMessage.FACES_MESSAGES, messageId);
+ }
+ } catch (MissingResourceException e) {
+ // No bundles at all, fall back message.
+ return new FacesMessage("conversion error");
+ }
+ return message;
+ }
+
+ private static FacesMessage getMessageFromBundle(Locale locale, String messageBundle, String messageId)
+ throws MissingResourceException {
+ ResourceBundle bundle = ResourceBundle.getBundle(messageBundle, locale, getCurrentLoader(messageId));
+ String summary = bundle.getString(messageId);
+ String detail;
+ try {
+ detail = bundle.getString(messageId + "_detail");
+ } catch (MissingResourceException e) {
+ return new FacesMessage(summary);
+ }
+ return new FacesMessage(summary, detail);
+ }
+
+ public static Locale getCurrentLocale(FacesContext context) {
+ UIViewRoot viewRoot = context.getViewRoot();
+ Locale locale;
+ if (null == viewRoot) {
+ locale = Locale.getDefault();
+ } else {
+ locale = viewRoot.getLocale();
+ }
+ return locale;
+ }
+
+ private static ClassLoader getCurrentLoader(Object fallbackClass) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null) {
+ loader = fallbackClass.getClass().getClassLoader();
+ }
+ return loader;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/MessageFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/NullValidator.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/NullValidator.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/NullValidator.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/NullValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.util.Collection;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class NullValidator extends ObjectValidator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.ObjectValidator#validate(java.lang.Object, java.lang.String, java.lang.Object,
+ * java.util.Locale)
+ */
+ @Override
+ protected Collection<String> validate(FacesContext facesContext, Object base, String property, Object value,
+ Set<String> profiles) {
+ // do nothing.
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.richfaces.validator.ObjectValidator#validateGraph(javax.faces.context.FacesContext, java.lang.Object,
+ * java.util.Set)
+ */
+ @Override
+ public Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles) {
+ // do nothing
+ return null;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/NullValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ObjectValidator.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/ObjectValidator.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ObjectValidator.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ObjectValidator.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,420 @@
+package org.richfaces.validator;
+
+import java.beans.FeatureDescriptor;
+import java.util.Collection;
+import java.util.EmptyStackException;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.Stack;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.application.ServiceTracker;
+import org.richfaces.el.ELContextWrapper;
+
+public abstract class ObjectValidator {
+
+ private static final String RESOURCE_BUNDLE_IS_NOT_REGISTERED_FOR_CURRENT_LOCALE =
+ "Resource bundle is not registered for current locale";
+
+ private static final String FACES_CONTEXT_IS_NULL = "Faces context is null";
+ private static final String INPUT_PARAMETERS_IS_NOT_CORRECT = "Input parameters is not correct.";
+ private static final String LOCALE_IS_NOT_SET = "Locale is not set";
+ private static final String VIEW_ROOT_IS_NOT_INITIALIZED = "ViewRoot is not initialized";
+
+ protected final ObjectValidator parent;
+
+ ObjectValidator() {
+ this.parent = null;
+ }
+
+ ObjectValidator(ObjectValidator parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * Return BeanValidator object from a ServletContext attribute. Create new instance if none is defined.
+ *
+ * @param context
+ * @return
+ */
+ public static ObjectValidator getInstance(FacesContext context) {
+ return ServiceTracker.getService(context, ObjectValidator.class);
+ }
+
+ public abstract Collection<String> validateGraph(FacesContext context, Object value, Set<String> profiles);
+
+ /**
+ * Perform Validation for a new value.
+ *
+ * @param context
+ * current faces context.
+ * @param target
+ * {@link ValueExpression} for a value assignment.
+ * @param value
+ * new value for validation
+ * @param profiles
+ * TODO
+ * @return null if no validation errors. Array of the validation messages otherwise.
+ * @throws FacesException
+ * if locale or context not properly initialized
+ */
+ public Collection<String> validate(FacesContext context, ValueExpression target, Object value, Set<String> profiles) {
+ if (null == context) {
+ throw new FacesException(INPUT_PARAMETERS_IS_NOT_CORRECT);
+ }
+ Collection<String> validationMessages = null;
+ if (null != target) {
+ ELContext elContext = context.getELContext();
+ ValidationResolver validationResolver =
+ createValidationResolver(context, elContext.getELResolver(), profiles);
+ ELContextWrapper wrappedElContext = new ELContextWrapper(elContext, validationResolver);
+ try {
+ target.setValue(wrappedElContext, value);
+ } catch (ELException e) {
+ throw new FacesException(e);
+ }
+ if (!validationResolver.isValid()) {
+ validationMessages = validationResolver.getValidationMessages();
+ }
+ if (null != parent) {
+ Collection<String> parentMessages = parent.validate(context, target, value, profiles);
+ if (null != validationMessages) {
+ if (null != parentMessages) {
+ validationMessages.addAll(parentMessages);
+ }
+ } else {
+ validationMessages = parentMessages;
+ }
+ }
+
+ }
+ return validationMessages;
+ }
+
+ /**
+ * Validate bean property for a new value.
+ *
+ * @param facesContext
+ * TODO
+ * @param base
+ * - bean
+ * @param property
+ * - bean property name.
+ * @param value
+ * new value.
+ * @param profiles
+ * TODO
+ *
+ * @return null for a valid value, array of the validation messages othervise.
+ */
+ protected abstract Collection<String> validate(FacesContext facesContext, Object base, String property,
+ Object value, Set<String> profiles);
+
+ static Locale calculateLocale(FacesContext context) {
+ if (null == context.getViewRoot()) {
+ throw new FacesException(VIEW_ROOT_IS_NOT_INITIALIZED);
+ } else if (null == context.getViewRoot().getLocale()) {
+ throw new FacesException(LOCALE_IS_NOT_SET);
+ }
+ Locale locale = context.getViewRoot().getLocale();
+ return locale;
+ }
+
+ static ResourceBundle getResourceBundle(FacesContext facesContext, String name) {
+ ResourceBundle bundle = null;
+ if (null != facesContext) {
+ Application application = facesContext.getApplication();
+ try {
+ bundle = application.getResourceBundle(facesContext, name);
+
+ } catch (Exception e) {
+ // Let one more attempt to load resource
+ }
+ }
+ if (null == bundle) {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ if (null == classLoader) {
+ classLoader = ObjectValidator.class.getClassLoader();
+ }
+ try {
+ bundle = ResourceBundle.getBundle(name, calculateLocale(facesContext), classLoader);
+
+ } catch (MissingResourceException e) {
+ // Do nothing, use default bundle.
+ }
+ }
+ return bundle;
+ }
+
+ protected ValidationResolver createValidationResolver(FacesContext context, ELResolver parent, Set<String> profiles) {
+ return new ValidationResolver(parent, context, profiles);
+ }
+
+ /**
+ * @author asmirnov
+ *
+ */
+ protected static class BasePropertyPair {
+ private final Object base;
+ private final Object property;
+
+ /**
+ * @param base
+ * @param property
+ */
+ public BasePropertyPair(Object base, Object property) {
+ this.base = base;
+ this.property = property;
+ }
+
+ /**
+ * @return the base
+ */
+ public Object getBase() {
+ return base;
+ }
+
+ /**
+ * @return the property
+ */
+ public Object getProperty() {
+ return property;
+ }
+
+ }
+
+ /**
+ * Class for identify validator instance by locale
+ *
+ * @author amarkhel
+ *
+ */
+ protected static class ValidatorKey {
+ private final Class<? extends Object> validatableClass;
+ private final Locale locale;
+
+ /**
+ * Constructor for ValidatorKey object
+ *
+ * @param validatableClass
+ * - class to validate
+ * @param locale
+ * - User locale to determine Resource bundle, used during validation process
+ */
+ public ValidatorKey(Class<? extends Object> validatableClass, Locale locale) {
+ this.validatableClass = validatableClass;
+ this.locale = locale;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((this.locale == null) ? 0 : this.locale.hashCode());
+ result = prime * result + ((this.validatableClass == null) ? 0 : this.validatableClass.hashCode());
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ValidatorKey other = (ValidatorKey) obj;
+ if (this.locale == null) {
+ if (other.locale != null) {
+ return false;
+ }
+ } else if (!this.locale.equals(other.locale)) {
+ return false;
+ }
+ if (this.validatableClass == null) {
+ if (other.validatableClass != null) {
+ return false;
+ }
+ } else if (!this.validatableClass.equals(other.validatableClass)) {
+ return false;
+ }
+ return true;
+ }
+
+
+
+ }
+
+ /**
+ * Wrapper class for a {@link ELResolver}. For a setValue method, perform validation instead of real assignment.
+ *
+ * @author asmirnov
+ *
+ */
+ final class ValidationResolver extends ELResolver {
+
+ /**
+ * Original resolver.
+ */
+ private final ELResolver parent;
+
+ private boolean valid = true;
+
+ private Collection<String> validationMessages = null;
+
+ private Stack<BasePropertyPair> valuesStack;
+
+ private Set<String> profiles;
+
+ private FacesContext facesContext;
+
+ private boolean clonedObject = false;
+
+ /**
+ * @param parent
+ * @param context
+ */
+ public ValidationResolver(ELResolver parent, FacesContext context, Set<String> profiles) {
+ this.parent = parent;
+ this.valuesStack = new Stack<BasePropertyPair>();
+ this.profiles = profiles;
+ this.facesContext = context;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getCommonPropertyType(javax.el.ELContext, java.lang.Object)
+ */
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ return parent.getCommonPropertyType(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @return
+ * @see javax.el.ELResolver#getFeatureDescriptors(javax.el.ELContext, java.lang.Object)
+ */
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return parent.getFeatureDescriptors(context, base);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getType(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ return parent.getType(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#getValue(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public Object getValue(ELContext context, Object base, Object property) {
+ Object value = ClonedObjectResolver.resolveCloned(context, base, property);
+ if (null != value) {
+ this.clonedObject = true;
+ context.setPropertyResolved(true);
+ } else {
+ value = parent.getValue(context, base, property);
+ }
+ valuesStack.push(new BasePropertyPair(base, property));
+ return value;
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @return
+ * @see javax.el.ELResolver#isReadOnly(javax.el.ELContext, java.lang.Object, java.lang.Object)
+ */
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ return parent.isReadOnly(context, base, property);
+ }
+
+ /**
+ * @param context
+ * @param base
+ * @param property
+ * @param value
+ * @see javax.el.ELResolver#setValue(javax.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
+ */
+ public void setValue(ELContext context, Object base, Object property, Object value) {
+ if (null != base && null != property) {
+ // TODO - detect value object from inderect references ( e.g. data table variables ).
+ if (this.clonedObject) {
+ parent.setValue(context, base, property, value);
+ }
+ context.setPropertyResolved(true);
+ // For Arrays, Collection or Map use parent base and property.
+ BasePropertyPair basePropertyPair = lookupBeanProperty(new BasePropertyPair(base, property));
+ base = basePropertyPair.getBase();
+ property = basePropertyPair.getProperty();
+ if (null != base && null != property) {
+ // https://jira.jboss.org/jira/browse/RF-4034
+ // apache el looses locale information during value
+ // resolution,
+ // so we use our own
+ validationMessages = validate(facesContext, base, property.toString(), value, profiles);
+ valid = null == validationMessages || 0 == validationMessages.size();
+
+ }
+ }
+ }
+
+ private BasePropertyPair lookupBeanProperty(BasePropertyPair pair) {
+ Object base = pair.getBase();
+ if (null != base && (base instanceof Collection || base instanceof Map || base.getClass().isArray())) {
+ try {
+ pair = lookupBeanProperty(valuesStack.pop());
+ } catch (EmptyStackException e) {
+ // Do nothing, this is a first item.
+ }
+ }
+ return pair;
+ }
+
+ /**
+ * @return the validationMessages
+ */
+ public Collection<String> getValidationMessages() {
+ return validationMessages;
+ }
+
+ }
+
+}
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/ObjectValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,97 @@
+/**
+ *
+ */
+package org.richfaces.validator;
+
+import java.lang.annotation.Annotation;
+import java.util.Locale;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIInput;
+import javax.faces.context.FacesContext;
+import javax.validation.MessageInterpolator;
+import javax.validation.MessageInterpolator.Context;
+import javax.validation.Validation;
+import javax.validation.Validator;
+import javax.validation.ValidatorContext;
+import javax.validation.ValidatorFactory;
+import javax.validation.metadata.ConstraintDescriptor;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class RichFacesBeanValidatorFactory implements BeanValidatorFactory {
+
+ private ValidatorFactory validatorFactory;
+ private ValidatorContext validatorContext;
+
+ public RichFacesBeanValidatorFactory() {
+ // Enforce class to load
+ ValidatorFactory.class.getName();
+ // Check Factory, to avoid instantiation errors
+ // https://jira.jboss.org/jira/browse/RF-7226
+ validatorFactory = Validation.buildDefaultValidatorFactory();
+ validatorContext = validatorFactory.usingContext();
+ MessageInterpolator jsfMessageInterpolator =
+ new JsfMessageInterpolator(validatorFactory.getMessageInterpolator());
+ validatorContext.messageInterpolator(jsfMessageInterpolator);
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.validator.BeanValidatorFactory#getValidator(javax.faces.context.FacesContext)
+ */
+ public Validator getValidator(FacesContext context) {
+ return validatorContext.getValidator();
+ }
+
+ public FacesMessage interpolateMessage(FacesContext context,final ConstraintDescriptor<? extends Annotation> constrain){
+ if(constrain.getAttributes().containsKey("message")){
+ Object object = constrain.getAttributes().get("message");
+ String interpolatedMessage;
+ interpolatedMessage = validatorFactory.getMessageInterpolator().interpolate(object.toString(), new Context() {
+
+ public Object getValidatedValue() {
+ return "{0}";
+ }
+
+ public ConstraintDescriptor<?> getConstraintDescriptor() {
+ return constrain;
+ }
+ }, MessageFactory.getCurrentLocale(context));
+ return new FacesMessage(interpolatedMessage);
+ } else {
+ return MessageFactory.createMessage(context, UIInput.UPDATE_MESSAGE_ID);
+ }
+ }
+
+ private static final class JsfMessageInterpolator implements MessageInterpolator {
+
+ private MessageInterpolator delegate;
+
+ public JsfMessageInterpolator(MessageInterpolator delegate) {
+ this.delegate = delegate;
+ }
+
+ public String interpolate(String messageTemplate, Context context) {
+
+ Locale locale = MessageFactory.getCurrentLocale(FacesContext.getCurrentInstance());
+ if (null != locale) {
+ return delegate.interpolate(messageTemplate, context, locale);
+ } else {
+ return delegate.interpolate(messageTemplate, context);
+ }
+ }
+
+ public String interpolate(String messageTemplate, Context context, Locale locale) {
+ Locale faceslocale = MessageFactory.getCurrentLocale(FacesContext.getCurrentInstance());
+ if (null != faceslocale) {
+ return delegate.interpolate(messageTemplate, context, faceslocale);
+ } else {
+ return delegate.interpolate(messageTemplate, context, locale);
+ }
+ }
+
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/RichFacesBeanValidatorFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/main/java/org/richfaces/validator/model (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/java/org/richfaces/validator/model)
Copied: branches/RF-8742-1/ui/validator/ui/src/main/resources/META-INF/services (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/main/resources/META-INF/services)
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ELTestBase.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,143 @@
+package org.richfaces.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.BeanELResolver;
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.ListELResolver;
+import javax.el.MapELResolver;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+
+import org.jboss.el.ExpressionFactoryImpl;
+import org.junit.After;
+import org.junit.Before;
+import org.richfaces.el.model.Bean;
+import org.richfaces.el.model.Person;
+
+import com.google.common.collect.Iterators;
+
+public class ELTestBase {
+
+ class DummyELResolver extends ELResolver {
+
+ private final ELResolver beanResolver = new BeanELResolver();
+ private final ELResolver mapResolver = new MapELResolver();
+ private final ELResolver listResolver = new ListELResolver();
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ return String.class;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
+ return Iterators.emptyIterator();
+ }
+
+ @Override
+ public Class<?> getType(ELContext context, Object base, Object property) {
+ if (null == base) {
+ if ("bean".equals(property)) {
+ return Bean.class;
+ } else if ("person".equals(property)) {
+ return Person.class;
+ }
+ } else if (base instanceof List) {
+ return listResolver.getType(context, base, property);
+ } else if (base instanceof Map) {
+ return mapResolver.getType(context, base, property);
+ }
+ return beanResolver.getType(context, base, property);
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property) {
+ if (null == base) {
+ if ("bean".equals(property)) {
+ return bean;
+ } else if ("person".equals(property)) {
+ return person;
+ }
+ } else if (base instanceof List) {
+ return listResolver.getValue(context, base, property);
+ } else if (base instanceof Map) {
+ return mapResolver.getValue(context, base, property);
+ }
+ return beanResolver.getValue(context, base, property);
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext context, Object base, Object property) {
+ return true;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value) {
+ // do nothing
+
+ }
+
+ }
+
+ class DummyELContext extends ELContext {
+
+ @Override
+ public ELResolver getELResolver() {
+ return elResolver;
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper() {
+ return null;
+ }
+
+ @Override
+ public VariableMapper getVariableMapper() {
+ return null;
+ }
+
+ }
+
+ protected ExpressionFactoryImpl expressionFactory;
+ protected Bean bean;
+ protected ELResolver elResolver;
+ protected ELContext elContext;
+ protected CapturingELContext capturingELContext;
+ protected Person person;
+
+ @Before
+ public void setUp() throws Exception {
+ expressionFactory = new ExpressionFactoryImpl();
+ bean = new Bean();
+ person = new Person();
+ bean.setString("foo");
+ ArrayList<String> list = new ArrayList<String>(1);
+ list.add("bar");
+ bean.setList(list);
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("boo", "baz");
+ bean.setMap(map);
+ elResolver = new DummyELResolver();
+ elContext = new DummyELContext();
+ capturingELContext = new CapturingELContext(elContext);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ expressionFactory = null;
+ }
+
+ protected ValueExpression parse(String expressionString) {
+ ValueExpression expression = expressionFactory.createValueExpression(elContext, expressionString, String.class);
+ return expression;
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ELTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/TestCaptureEL.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,61 @@
+package org.richfaces.el;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+
+import javax.el.ValueExpression;
+
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(MockTestRunner.class)
+public class TestCaptureEL extends ELTestBase {
+
+ @Test
+ public void testDummyResolverString() throws Exception {
+ ValueExpression expression = parse("#{bean.string}");
+ assertEquals("foo", expression.getValue(elContext));
+ }
+
+ @Test
+ public void testDummyResolverList() throws Exception {
+ ValueExpression expression = parse("#{bean.list[0]}");
+ assertEquals("bar", expression.getValue(elContext));
+ }
+
+ @Test
+ public void testDummyResolverMap() throws Exception {
+ ValueExpression expression = parse("#{bean.map['boo']}");
+ assertEquals("baz", expression.getValue(elContext));
+ }
+
+ @Test
+ public void captureString() throws Exception {
+ ValueExpression expression = parse("#{bean.string}");
+ expression.getType(capturingELContext);
+ ValueReference reference = capturingELContext.getReference();
+ assertEquals("string", reference.getProperty());
+ assertSame(bean, reference.getBase());
+ reference = reference.next();
+ assertNotNull(reference);
+ assertEquals("bean", reference.getProperty());
+ assertNull(reference.getBase());
+ assertNull(reference.next());
+ }
+
+ @Test
+ public void captureMap() throws Exception {
+ ValueExpression expression = parse("#{bean.map['boo']}");
+ expression.getType(capturingELContext);
+ ValueReference reference = capturingELContext.getReference();
+ assertEquals("boo", reference.getProperty());
+ assertSame(bean.getMap(), reference.getBase());
+ reference = reference.next();
+ assertNotNull(reference);
+ assertEquals("map", reference.getProperty());
+ }
+
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/TestCaptureEL.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,57 @@
+package org.richfaces.el;
+
+
+import static org.easymock.EasyMock.expect;
+import static org.junit.Assert.*;
+
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+
+import org.jboss.test.faces.mock.FacesMock;
+import org.jboss.test.faces.mock.Mock;
+import org.jboss.test.faces.mock.MockTestRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.richfaces.el.model.Bean;
+
+(a)RunWith(MockTestRunner.class)
+public class ValueExpressionAnalayserTest extends ELTestBase {
+
+
+ private ValueExpressionAnalayser analayser;
+
+ @Mock
+ private FacesContext facesContext;
+
+ @Before
+ public void setUpAnalayser() throws Exception {
+ analayser = new ValueExpressionAnalayserImpl();
+ }
+
+ @After
+ public void tearDownAnalayser() throws Exception {
+ analayser = null;
+ }
+ @Test
+ public void testGetDescriptionPositive() throws Exception {
+ ValueExpression expression = parse("#{bean.string}");
+ expect(facesContext.getELContext()).andReturn(elContext);
+ FacesMock.replay(facesContext);
+ ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
+ assertEquals(Bean.class, propertyDescriptor.getBeanType());
+ assertEquals("string", propertyDescriptor.getName());
+ assertEquals(String.class,propertyDescriptor.getPropertyType());
+ FacesMock.verify(facesContext);
+ }
+
+ @Test(expected=ELException.class)
+ public void testGetDescriptionNegative() throws Exception {
+ ValueExpression expression = parse("#{bean}");
+ expect(facesContext.getELContext()).andReturn(elContext);
+ FacesMock.replay(facesContext);
+ ValueDescriptor propertyDescriptor = analayser.getPropertyDescriptor(facesContext, expression);
+ }
+}
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/ValueExpressionAnalayserTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/el/model (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/el/model)
Copied: branches/RF-8742-1/ui/validator/ui/src/test/java/org/richfaces/validator (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/java/org/richfaces/validator)
Copied: branches/RF-8742-1/ui/validator/ui/src/test/resources/badcsv.xml (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/resources/badcsv.xml)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/resources/badcsv.xml (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/resources/badcsv.xml 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scripts>
+ <component>
+ <type>non.existed.Class</type>
+ <library>org.richfaces</library>
+ <resource>csv.js</resource>
+ <function>stringConverter</function>
+ </component>
+</scripts>
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/resources/badcsv.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/test/resources/csv.xml (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/resources/csv.xml)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/resources/csv.xml (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/resources/csv.xml 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scripts>
+ <component>
+ <type>java.lang.String</type>
+ <library>org.richfaces</library>
+ <resource>csv.js</resource>
+ <function>stringConverter</function>
+ </component>
+ <component>
+ <type>java.lang.Integer</type>
+ <library>org.richfaces</library>
+ <resource>csv.js</resource>
+ <function>intConverter</function>
+ </component>
+</scripts>
\ No newline at end of file
Property changes on: branches/RF-8742-1/ui/validator/ui/src/test/resources/csv.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: branches/RF-8742-1/ui/validator/ui/src/test/resources/test.html (from rev 20023, branches/RF-8742-1/ui/validator/impl/src/test/resources/test.html)
===================================================================
--- branches/RF-8742-1/ui/validator/ui/src/test/resources/test.html (rev 0)
+++ branches/RF-8742-1/ui/validator/ui/src/test/resources/test.html 2010-11-10 22:36:12 UTC (rev 20025)
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
+
+<html>
+<head>
+ <title>Untitled</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Test Page</title>
+ <script type="text/javascript" src="jquery.js"></script>
+ <script type="text/javascript" src="richfaces.js"></script>
+ <script type="text/javascript" src="length.js"></script>
+
+</head>
+
+<body style="margin : 30px">
+<form id="myForm">
+<input id="myInput" type="text" value="aaa"/>
+<input type="button" onclick="v();" value="validate length"/>
+<input type="button" onclick="v({'LengthValidator.MINIMUM':'CustomMessage: length of the {1} is smaller then {0} chars', 'LengthValidator.MAXIMUM':'CustomMessage: length of the {1} is bigger then {0} chars'});" value="validate length (custom message)"/>
+</form>
+<script>
+RichFaces.csv.addMessage({'LengthValidator.MINIMUM':'Hello, length of the "{1}" is smaller then {0} chars', 'LengthValidator.MAXIMUM':'Hello, length of the "{1}" is bigger then {0} chars'});
+var v = function (customMessages) {
+ RichFaces.csv.validate(null, 'myInput', {'length':{min:1, max:5, customMessages:customMessages}}, null, null);
+};
+</script>
+</body>
+<html>
\ No newline at end of file
14 years, 2 months
JBoss Rich Faces SVN: r20024 - branches/RF-8742-1.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-10 16:22:24 -0500 (Wed, 10 Nov 2010)
New Revision: 20024
Modified:
branches/RF-8742-1/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-20022" from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RF-8742-1
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
+ /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /trunk:1-20022
14 years, 2 months
JBoss Rich Faces SVN: r20023 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-10 16:00:08 -0500 (Wed, 10 Nov 2010)
New Revision: 20023
Added:
branches/RF-8742-1/
Log:
create CSV working branch
Copied: branches/RF-8742-1 (from rev 20022, trunk)
14 years, 2 months
JBoss Rich Faces SVN: r20022 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-11-10 15:58:36 -0500 (Wed, 10 Nov 2010)
New Revision: 20022
Removed:
branches/RF-8742/
Log:
delete merged working branch
14 years, 2 months
JBoss Rich Faces SVN: r20021 - in trunk: archetypes and 60 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 13:22:42 -0500 (Wed, 10 Nov 2010)
New Revision: 20021
Modified:
trunk/archetypes/pom.xml
trunk/archetypes/rf-gae-sample/pom.xml
trunk/archetypes/richfaces-archetype-simpleapp/pom.xml
trunk/archetypes/richfaces-component-short/pom.xml
trunk/archetypes/richfaces-component/pom.xml
trunk/archetypes/richfaces-components-aggregator/pom.xml
trunk/bom/pom.xml
trunk/cdk/annotations/pom.xml
trunk/cdk/attributes/pom.xml
trunk/cdk/commons/pom.xml
trunk/cdk/dist/pom.xml
trunk/cdk/generator/pom.xml
trunk/cdk/maven-cdk-plugin/pom.xml
trunk/cdk/maven-resources-plugin/pom.xml
trunk/cdk/parent/pom.xml
trunk/cdk/pom.xml
trunk/cdk/xinclude/pom.xml
trunk/core/api/pom.xml
trunk/core/impl/pom.xml
trunk/core/parent/pom.xml
trunk/core/pom.xml
trunk/dist/pom.xml
trunk/examples/core-demo/pom.xml
trunk/examples/input-demo/pom.xml
trunk/examples/iteration-demo/pom.xml
trunk/examples/misc-demo/pom.xml
trunk/examples/output-demo/pom.xml
trunk/examples/parent/pom.xml
trunk/examples/pom.xml
trunk/examples/push-demo/pom.xml
trunk/examples/repeater-demo/pom.xml
trunk/examples/richfaces-showcase/pom.xml
trunk/examples/template/pom.xml
trunk/examples/validator-demo/pom.xml
trunk/parent/pom.xml
trunk/pom.xml
trunk/ui/common/api/pom.xml
trunk/ui/common/pom.xml
trunk/ui/common/ui/pom.xml
trunk/ui/core/api/pom.xml
trunk/ui/core/pom.xml
trunk/ui/core/ui/pom.xml
trunk/ui/dist/pom.xml
trunk/ui/dist/richfaces-components-api/pom.xml
trunk/ui/dist/richfaces-components-ui/pom.xml
trunk/ui/input/api/pom.xml
trunk/ui/input/pom.xml
trunk/ui/input/ui/pom.xml
trunk/ui/iteration/api/pom.xml
trunk/ui/iteration/pom.xml
trunk/ui/iteration/ui/pom.xml
trunk/ui/misc/pom.xml
trunk/ui/misc/ui/pom.xml
trunk/ui/output/api/pom.xml
trunk/ui/output/pom.xml
trunk/ui/output/ui/pom.xml
trunk/ui/parent/pom.xml
trunk/ui/pom.xml
trunk/ui/validator/api/pom.xml
trunk/ui/validator/impl/pom.xml
trunk/ui/validator/pom.xml
trunk/ui/validator/ui/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/archetypes/pom.xml
===================================================================
--- trunk/archetypes/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -30,7 +30,7 @@
<groupId>org.richfaces.archetypes</groupId>
<artifactId>archetypes-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces Archetypes: Aggregator</name>
@@ -49,9 +49,9 @@
</properties>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetypes</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/archetypes</url>
</scm>
</project>
Modified: trunk/archetypes/rf-gae-sample/pom.xml
===================================================================
--- trunk/archetypes/rf-gae-sample/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/rf-gae-sample/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
<artifactId>richfaces-archetype-gae</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: GAE Application</name>
@@ -92,9 +92,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetyp...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: trunk/archetypes/richfaces-archetype-simpleapp/pom.xml
===================================================================
--- trunk/archetypes/richfaces-archetype-simpleapp/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/richfaces-archetype-simpleapp/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
<artifactId>richfaces-archetype-simpleapp</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: Simple Application</name>
@@ -92,9 +92,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetyp...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: trunk/archetypes/richfaces-component/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/richfaces-component/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
<artifactId>richfaces-component</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: Component</name>
@@ -96,9 +96,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetyp...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: trunk/archetypes/richfaces-component-short/pom.xml
===================================================================
--- trunk/archetypes/richfaces-component-short/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/richfaces-component-short/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
<artifactId>richfaces-component-short</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: Component Short</name>
@@ -96,9 +96,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetyp...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: trunk/archetypes/richfaces-components-aggregator/pom.xml
===================================================================
--- trunk/archetypes/richfaces-components-aggregator/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/archetypes/richfaces-components-aggregator/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.archetypes</groupId>
<artifactId>richfaces-components-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>RichFaces Archetypes: Components Aggregator</name>
@@ -96,9 +96,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/a...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/arch...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/archetyp...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/archetypes/richfac...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/archetypes/richfaces-...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
Modified: trunk/bom/pom.xml
===================================================================
--- trunk/bom/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/bom/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -23,7 +23,7 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<packaging>pom</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces BOM</name>
<parent>
@@ -222,9 +222,9 @@
</dependencyManagement>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/b...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/buil...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/build/bom</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/build/bom</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/build/bom</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/build/bom</url>
</scm>
</project>
Modified: trunk/cdk/annotations/pom.xml
===================================================================
--- trunk/cdk/annotations/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/annotations/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,12 +4,12 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<description>That project contains annotations for JSF classes</description>
<name>annotations</name>
<dependencies>
Modified: trunk/cdk/attributes/pom.xml
===================================================================
--- trunk/cdk/attributes/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/attributes/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,12 +4,12 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>attributes</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<description>That project contains JAXB bindings for model classes representing schema attributes data</description>
<name>attributes</name>
Modified: trunk/cdk/commons/pom.xml
===================================================================
--- trunk/cdk/commons/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/commons/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,12 +4,12 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>commons</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>commons</name>
<build>
<plugins>
Modified: trunk/cdk/dist/pom.xml
===================================================================
--- trunk/cdk/dist/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/dist/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,20 +4,20 @@
<parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
<artifactId>dist</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>JSF Components Development Kit (CDK) distribution assembly</name>
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/c...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/cdk/...</developerConnection>
- <url>http://fisheye.jboss.org/browse/Richfaces/cdk/tags/4.0.0.20101110-M4/cdk/...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/cdk/dist</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/cdk/dist</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Richfaces/cdk</url>
</scm>
<build>
<finalName>cdk</finalName>
Modified: trunk/cdk/generator/pom.xml
===================================================================
--- trunk/cdk/generator/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/generator/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -3,13 +3,13 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
<artifactId>generator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Java Server Faces component generator</name>
Modified: trunk/cdk/maven-cdk-plugin/pom.xml
===================================================================
--- trunk/cdk/maven-cdk-plugin/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/maven-cdk-plugin/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -2,13 +2,13 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Maven plugin for JSF components code generation</name>
<dependencies>
Modified: trunk/cdk/maven-resources-plugin/pom.xml
===================================================================
--- trunk/cdk/maven-resources-plugin/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/maven-resources-plugin/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,13 +4,13 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>maven-resources-plugin</name>
<description>Maven plugin for packaging resources with web application</description>
Modified: trunk/cdk/parent/pom.xml
===================================================================
--- trunk/cdk/parent/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/parent/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -13,7 +13,7 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JSF Components Development Kit (CDK)</name>
@@ -22,9 +22,9 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/c...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/cdk/...</developerConnection>
- <url>http://fisheye.jboss.org/browse/Richfaces/cdk/parent/tags/4.0.0.20101110-...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/cdk/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/cdk/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Richfaces/cdk/parent</url>
</scm>
<build>
Modified: trunk/cdk/pom.xml
===================================================================
--- trunk/cdk/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.cdk</groupId>
<artifactId>aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JSF Components Development Kit (CDK)</name>
<properties>
@@ -32,9 +32,9 @@
</modules>
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/cdk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/cdk</developerConnection>
- <url>http://fisheye.jboss.org/browse/Richfaces/cdk/tags/4.0.0.20101110-M4/cdk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/cdk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/cdk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/Richfaces/cdk</url>
</scm>
<!-- Minimal build configuration -->
Modified: trunk/cdk/xinclude/pom.xml
===================================================================
--- trunk/cdk/xinclude/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/cdk/xinclude/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -22,13 +22,13 @@
<parent>
<artifactId>parent</artifactId>
<groupId>org.richfaces.cdk</groupId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.cdk</groupId>
<artifactId>xinclude</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Cocoon 3: xinclude transformer</name>
<description>Cocoon 3 xinclude transformer with Xpointer scheme support.</description>
Modified: trunk/core/api/pom.xml
===================================================================
--- trunk/core/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/core/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -80,8 +80,8 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/c...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/core...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/core/api</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/core/api</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/core/api</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/core/api</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/core/impl/pom.xml
===================================================================
--- trunk/core/impl/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/core/impl/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -20,7 +20,7 @@
<parent>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -237,8 +237,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/c...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/core...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/core/impl</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/core/impl</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/core/impl</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/core/impl</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/core/parent/pom.xml
===================================================================
--- trunk/core/parent/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/core/parent/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -23,13 +23,13 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-parent</artifactId>
<packaging>pom</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Core Parent</name>
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -46,8 +46,8 @@
</dependencyManagement>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/c...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/core...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/core/parent</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/core/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/core/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/core/parent</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/core/pom.xml
===================================================================
--- trunk/core/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/core/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -29,7 +29,7 @@
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces Core Aggregator</name>
@@ -43,9 +43,9 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/core</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/core</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/core</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/core</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/core</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/core</url>
</scm>
</project>
Modified: trunk/dist/pom.xml
===================================================================
--- trunk/dist/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/dist/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,13 +24,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-distribution</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces Distribution Assembler</name>
@@ -187,8 +187,8 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/dist</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/dist</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/dist</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/dist</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/dist</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/examples/core-demo/pom.xml
===================================================================
--- trunk/examples/core-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/core-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,14 +24,14 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>core-demo</artifactId>
<packaging>war</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Examples: Core</name>
<properties>
@@ -193,8 +193,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/e...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/exam...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/examples...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/core-demo</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/core-demo</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/examples/input-demo/pom.xml
===================================================================
--- trunk/examples/input-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/input-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -12,7 +12,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>input-demo</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Richfaces Examples: Inputs</name>
<packaging>war</packaging>
Modified: trunk/examples/iteration-demo/pom.xml
===================================================================
--- trunk/examples/iteration-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/iteration-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,14 +24,14 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>iteration-demo</artifactId>
<packaging>war</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Examples: Iteration</name>
<properties>
Modified: trunk/examples/misc-demo/pom.xml
===================================================================
--- trunk/examples/misc-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/misc-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,13 +24,13 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>misc-demo</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>RichFaces Examples: Miscellanous</name>
Modified: trunk/examples/output-demo/pom.xml
===================================================================
--- trunk/examples/output-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/output-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -12,7 +12,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>output-demo</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Richfaces Examples: Outputs</name>
<packaging>war</packaging>
Modified: trunk/examples/parent/pom.xml
===================================================================
--- trunk/examples/parent/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/parent/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -29,7 +29,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces Examples Parent</name>
@@ -229,8 +229,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/e...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/exam...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/examples...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/examples/parent</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/examples/pom.xml
===================================================================
--- trunk/examples/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -34,7 +34,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>examples-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces Examples: Aggregator</name>
@@ -53,9 +53,9 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/e...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/exam...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/examples</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/examples</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/examples/push-demo/pom.xml
===================================================================
--- trunk/examples/push-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/push-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,14 +24,14 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>push-demo</artifactId>
<packaging>war</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Examples: Push</name>
<properties>
@@ -196,8 +196,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/e...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/exam...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/examples...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/push-demo</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/push-demo</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/examples/repeater-demo/pom.xml
===================================================================
--- trunk/examples/repeater-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/repeater-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,14 +25,14 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>repeater-demo</artifactId>
<packaging>war</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Richfaces Examples: Repeater</name>
<properties>
Modified: trunk/examples/richfaces-showcase/pom.xml
===================================================================
--- trunk/examples/richfaces-showcase/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/richfaces-showcase/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -7,13 +7,13 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-showcase</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Richfaces Examples: Richfaces Showcase Application</name>
@@ -373,8 +373,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/e...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/exam...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/examples...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/examples/richfaces-sh...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/examples/template/pom.xml
===================================================================
--- trunk/examples/template/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/template/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -3,14 +3,14 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces.examples</groupId>
<artifactId>template</artifactId>
<packaging>war</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>examples template</name>
<dependencies>
</dependencies>
Modified: trunk/examples/validator-demo/pom.xml
===================================================================
--- trunk/examples/validator-demo/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/examples/validator-demo/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.richfaces.examples</groupId>
<artifactId>richfaces-example-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -12,7 +12,7 @@
<groupId>org.richfaces.examples</groupId>
<artifactId>validator-demo</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Richfaces Examples: Outputs</name>
<packaging>war</packaging>
@@ -41,23 +41,23 @@
<dependency>
<groupId>org.richfaces.examples</groupId>
<artifactId>template</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.richfaces.ui.validator</groupId>
<artifactId>richfaces-ui-validator-ui</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui.validator</groupId>
<artifactId>richfaces-ui-validator-impl</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui.validator</groupId>
<artifactId>richfaces-ui-validator-api</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
Modified: trunk/parent/pom.xml
===================================================================
--- trunk/parent/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/parent/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -23,13 +23,13 @@
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
<packaging>pom</packaging>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>RichFaces Root Parent</name>
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../bom/pom.xml</relativePath>
</parent>
@@ -394,11 +394,11 @@
<!-- SCM and distribution management -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/p...
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/parent
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/parent
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/parent
</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/parent</url>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk/parent</url>
</scm>
</project>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -12,7 +12,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces Aggregator</name>
@@ -59,8 +59,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/trunk</url>
</scm>
</project>
Modified: trunk/ui/common/api/pom.xml
===================================================================
--- trunk/ui/common/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/common/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: trunk/ui/common/pom.xml
===================================================================
--- trunk/ui/common/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/common/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.common</groupId>
<artifactId>richfaces-ui-common-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Common Aggregator</name>
Modified: trunk/ui/common/ui/pom.xml
===================================================================
--- trunk/ui/common/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/common/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: trunk/ui/core/api/pom.xml
===================================================================
--- trunk/ui/core/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/core/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -20,7 +20,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: trunk/ui/core/pom.xml
===================================================================
--- trunk/ui/core/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/core/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.core</groupId>
<artifactId>richfaces-ui-core-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Core Aggregator</name>
@@ -41,8 +41,8 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/core</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/core</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/core</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/core</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/core/ui/pom.xml
===================================================================
--- trunk/ui/core/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/core/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -61,10 +61,10 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/core/ui
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/c...
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/core/ui
</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/core/ui</url>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/dist/pom.xml
===================================================================
--- trunk/ui/dist/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/dist/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -22,13 +22,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-assembler</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Assembler</name>
@@ -63,9 +63,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/dist</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/dist</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/dist</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/dist</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/dist/richfaces-components-api/pom.xml
===================================================================
--- trunk/ui/dist/richfaces-components-api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/dist/richfaces-components-api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,13 +24,13 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-api</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Richfaces UI Components API</name>
@@ -169,8 +169,8 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/d...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/dist/...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/dist/richfaces-...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/dist/richfaces-com...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/dist/richfaces-components-ui/pom.xml
===================================================================
--- trunk/ui/dist/richfaces-components-ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/dist/richfaces-components-ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,13 +24,13 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Richfaces UI Components UI</name>
@@ -237,9 +237,9 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/d...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/dist/...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/dist/richfaces-...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/dist/richfaces-com...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/input/api/pom.xml
===================================================================
--- trunk/ui/input/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/input/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: trunk/ui/input/pom.xml
===================================================================
--- trunk/ui/input/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/input/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.input</groupId>
<artifactId>richfaces-ui-input-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Input Aggregator</name>
@@ -41,8 +41,8 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/i...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/input</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/input</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/input</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/input/ui/pom.xml
===================================================================
--- trunk/ui/input/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/input/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
Modified: trunk/ui/iteration/api/pom.xml
===================================================================
--- trunk/ui/iteration/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/iteration/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -54,9 +54,9 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/i...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/itera...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/iteration/datas...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/iteration/datascro...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/iteration/pom.xml
===================================================================
--- trunk/ui/iteration/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/iteration/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.iteration</groupId>
<artifactId>richfaces-ui-iteration-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Iteration Aggregator</name>
@@ -41,8 +41,8 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/i...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/itera...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/iteration</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/iteration</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/iteration/ui/pom.xml
===================================================================
--- trunk/ui/iteration/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/iteration/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -60,8 +60,8 @@
</build>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/i...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/itera...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/iteration/datas...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/iteration/datascro...</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/misc/pom.xml
===================================================================
--- trunk/ui/misc/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/misc/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Miscellanous Aggregator</name>
@@ -40,9 +40,9 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/misc</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/misc</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/misc/ui/pom.xml
===================================================================
--- trunk/ui/misc/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/misc/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,13 +24,13 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.misc</groupId>
<artifactId>richfaces-ui-misc-ui</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Richfaces UI Misc UI</name>
@@ -155,10 +155,10 @@
</profiles>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc/dist/richf...
</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/m...
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc/dist/richface...
</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/misc/...</url>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/output/api/pom.xml
===================================================================
--- trunk/ui/output/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/output/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -51,10 +51,10 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/o...
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/output/panels/api</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/output/panels/api
</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/outpu...</url>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/output/pom.xml
===================================================================
--- trunk/ui/output/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/output/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.output</groupId>
<artifactId>richfaces-ui-output-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Richfaces UI Components: Output Aggregator</name>
@@ -41,8 +41,8 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/o...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/output</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/output</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/output</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/output/ui/pom.xml
===================================================================
--- trunk/ui/output/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/output/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -26,7 +26,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -80,9 +80,9 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/o...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/outpu...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/output/panels/ui</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/output/panels/ui</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/parent/pom.xml
===================================================================
--- trunk/ui/parent/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/parent/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,13 +25,13 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<name>Richfaces UI Components Parent</name>
<packaging>pom</packaging>
@@ -194,8 +194,8 @@
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/p...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/parent</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/parent</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/parent</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
</scm>
</project>
\ No newline at end of file
Modified: trunk/ui/pom.xml
===================================================================
--- trunk/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -31,7 +31,7 @@
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-aggregator</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>RichFaces UI: Aggregator</name>
@@ -46,10 +46,4 @@
<module>dist</module>
<module>validator</module>
</modules>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/modules/build/parent/tag...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/modules/build/parent/tags/4...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/modules/build/parent/tags/4.0.0...</url>
- </scm>
</project>
Modified: trunk/ui/validator/api/pom.xml
===================================================================
--- trunk/ui/validator/api/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/validator/api/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -60,9 +60,9 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/v...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/valid...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/api</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/api</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/ui/validator/impl/pom.xml
===================================================================
--- trunk/ui/validator/impl/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/validator/impl/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -85,8 +85,8 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/v...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/valid...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/impl</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/impl</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/ui/validator/pom.xml
===================================================================
--- trunk/ui/validator/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/validator/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-root-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.validator</groupId>
@@ -39,8 +39,8 @@
</modules>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/v...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/valid...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
Modified: trunk/ui/validator/ui/pom.xml
===================================================================
--- trunk/ui/validator/ui/pom.xml 2010-11-10 18:20:51 UTC (rev 20020)
+++ trunk/ui/validator/ui/pom.xml 2010-11-10 18:22:42 UTC (rev 20021)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-ui-parent</artifactId>
- <version>4.0.0.20101110-M4</version>
+ <version>4.0.0-SNAPSHOT</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
@@ -102,8 +102,8 @@
</dependencies>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/u...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/tags/4.0.0.20101110-M4/ui/v...</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/tags/4.0.0.20101110-M4/ui/valid...</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/validator/ui</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/validator/ui</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces</url>
</scm>
</project>
14 years, 2 months
JBoss Rich Faces SVN: r20020 - tags.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 13:20:51 -0500 (Wed, 10 Nov 2010)
New Revision: 20020
Added:
tags/4.0.0.20101110-M4/
Log:
[maven-scm] copy for tag 4.0.0.20101110-M4
Copied: tags/4.0.0.20101110-M4 (from rev 20019, trunk)
14 years, 2 months
JBoss Rich Faces SVN: r20018 - trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java-gae-jsf-ri/com/sun/faces/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 12:12:59 -0500 (Wed, 10 Nov 2010)
New Revision: 20018
Modified:
trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
Log:
Update of WebConfiguration for Mojarra 2.0.3
Modified: trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
===================================================================
--- trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 17:10:46 UTC (rev 20017)
+++ trunk/archetypes/rf-gae-sample/src/main/resources/archetype-resources/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 17:12:59 UTC (rev 20018)
@@ -1,1112 +1,1391 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License"). You
- * may not use this file except in compliance with the License. You can obtain
- * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
- * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- * language governing permissions and limitations under the License.
- *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- * Sun designates this particular file as subject to the "Classpath" exception
- * as provided by Sun in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the License
- * Header, with the fields enclosed by brackets [] replaced by your own
- * identifying information: "Portions Copyrighted [year]
- * [name of copyright owner]"
- *
- * Contributor(s):
- *
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license." If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above. However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
- */
-
-package com.sun.faces.config;
-
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-import javax.faces.application.ResourceHandler;
-import javax.faces.application.StateManager;
-import javax.faces.application.ViewHandler;
-import javax.faces.component.UIInput;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.BeanValidator;
-import javax.faces.view.facelets.ResourceResolver;
-import javax.servlet.ServletContext;
-
-import com.sun.faces.util.FacesLogger;
-import com.sun.faces.util.Util;
-
-/** Class Documentation */
-public class WebConfiguration
-{
-
- // Log instance for this class
- private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
-
- // A Simple regular expression of allowable boolean values
- private static final Pattern ALLOWABLE_BOOLEANS = Pattern
- .compile("true|false");
-
- // Key under which we store our WebConfiguration instance.
- private static final String WEB_CONFIG_KEY = "com.sun.faces.config.WebConfiguration";
-
- // Logging level. Defaults to FINE
- private Level loggingLevel = Level.FINE;
-
- private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters = new EnumMap<BooleanWebContextInitParameter, Boolean>(
- BooleanWebContextInitParameter.class);
-
- private Map<WebContextInitParameter, String> contextParameters = new EnumMap<WebContextInitParameter, String>(
- WebContextInitParameter.class);
-
- private Map<WebEnvironmentEntry, String> envEntries = new EnumMap<WebEnvironmentEntry, String>(
- WebEnvironmentEntry.class);
-
- private Map<WebContextInitParameter, String[]> cachedListParams;
-
- private List<String> setParams = new ArrayList<String>();
-
- private ServletContext servletContext;
-
- // ------------------------------------------------------------ Constructors
-
- private WebConfiguration(ServletContext servletContext)
- {
-
- this.servletContext = servletContext;
-
- String contextName = getServletContextName();
-
- initSetList(servletContext);
- processBooleanParameters(servletContext, contextName);
- processInitParameters(servletContext, contextName);
- if (canProcessJndiEntries())
- {
- processJndiEntries(contextName);
- }
-
- // build the cache of list type params
- cachedListParams = new HashMap<WebContextInitParameter, String[]>(3);
- getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
- getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
- getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
-
- }
-
- // ---------------------------------------------------------- Public Methods
-
- /**
- * Return the WebConfiguration instance for this application passing the
- * result of FacesContext.getCurrentInstance().getExternalContext() to
- * {@link ${symbol_pound}getInstance(javax.faces.context.ExternalContext)}.
- *
- * @return the WebConfiguration for this application or <code>null</code> if
- * no FacesContext is available.
- */
- public static WebConfiguration getInstance()
- {
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- return getInstance(facesContext.getExternalContext());
-
- }
-
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param extContext
- * the ExternalContext for this request
- * @return the WebConfiguration for this application
- */
- public static WebConfiguration getInstance(ExternalContext extContext)
- {
-
- WebConfiguration config = (WebConfiguration) extContext
- .getApplicationMap().get(WEB_CONFIG_KEY);
- if (config == null)
- {
- return getInstance((ServletContext) extContext.getContext());
- }
- else
- {
- return config;
- }
-
- }
-
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param servletContext
- * the ServletContext
- * @return the WebConfiguration for this application or <code>null</code> if
- * no WebConfiguration could be located
- */
- public static WebConfiguration getInstance(ServletContext servletContext)
- {
-
- WebConfiguration webConfig = (WebConfiguration) servletContext
- .getAttribute(WEB_CONFIG_KEY);
-
- if (webConfig == null)
- {
- webConfig = new WebConfiguration(servletContext);
- servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
- }
- return webConfig;
-
- }
-
- /**
- * @return The <code>ServletContext</code> originally used to construct this
- * WebConfiguration instance
- */
- public ServletContext getServletContext()
- {
-
- return servletContext;
-
- }
-
- /**
- * Obtain the value of the specified boolean parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified boolean parameter
- */
- public boolean isOptionEnabled(BooleanWebContextInitParameter param)
- {
-
- if (booleanContextParameters.get(param) != null)
- {
- return booleanContextParameters.get(param);
- }
- else
- {
- return param.getDefaultValue();
- }
-
- }
-
- /**
- * Obtain the value of the specified parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified parameter
- */
- public String getOptionValue(WebContextInitParameter param)
- {
- String result = contextParameters.get(param);
-
- if (null == result)
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (null != alternate)
- {
- result = contextParameters.get(alternate);
- }
- }
-
- return result;
-
- }
-
- public String[] getOptionValue(WebContextInitParameter param, String sep)
- {
- String[] result;
-
- assert (null != cachedListParams);
- if (null == (result = cachedListParams.get(param)))
- {
- String value = getOptionValue(param);
- if (null == value)
- {
- result = new String[0];
- }
- else
- {
- result = Util.split(value, sep);
- }
- cachedListParams.put(param, result);
- }
-
- return result;
- }
-
- /**
- * Obtain the value of the specified env-entry
- *
- * @param entry
- * the env-entry of interest
- * @return the value of the specified env-entry
- */
- public String getEnvironmentEntry(WebEnvironmentEntry entry)
- {
-
- return envEntries.get(entry);
-
- }
-
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(WebContextInitParameter param)
- {
-
- return isSet(param.getQualifiedName());
-
- }
-
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(BooleanWebContextInitParameter param)
- {
-
- return isSet(param.getQualifiedName());
-
- }
-
- /**
- * @return the name of this application
- */
- public String getServletContextName()
- {
-
- if (servletContext.getMajorVersion() == 2
- && servletContext.getMinorVersion() <= 4)
- {
- return servletContext.getServletContextName();
- }
- else
- {
- return servletContext.getContextPath();
- }
-
- }
-
- public void overrideContextInitParameter(
- BooleanWebContextInitParameter param, boolean value)
- {
-
- if (param == null) { return; }
- boolean oldVal = booleanContextParameters.put(param, value);
- if (LOGGER.isLoggable(Level.FINE) && oldVal != value)
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
-
- }
-
- public void overrideContextInitParameter(WebContextInitParameter param,
- String value)
- {
-
- if (param == null || value == null || value.length() == 0) { return; }
- value = value.trim();
- String oldVal = contextParameters.put(param, value);
- cachedListParams.remove(param);
- if (oldVal != null)
- {
- if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value)))
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
- }
-
- }
-
- // ------------------------------------------------- Package Private Methods
-
- static void clear(ServletContext servletContext)
- {
-
- servletContext.removeAttribute(WEB_CONFIG_KEY);
-
- }
-
- // --------------------------------------------------------- Private Methods
-
- /**
- * <p>
- * Is the configured value valid against the default boolean pattern.
- * </p>
- *
- * @param param
- * the boolean parameter
- * @param value
- * the configured value
- * @return <code>true</code> if the value is valid, otherwise
- * <code>false</code>
- */
- private boolean isValueValid(BooleanWebContextInitParameter param,
- String value)
- {
-
- if (!ALLOWABLE_BOOLEANS.matcher(value).matches())
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.boolconfig.invalidvalue",
- new Object[]
- {
- value, param.getQualifiedName(), "true|false"
- });
- }
- return false;
- }
-
- return true;
-
- }
-
- /**
- * <p>
- * Process all boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processBooleanParameters(ServletContext servletContext,
- String contextName)
- {
-
- // process boolean contxt parameters
- for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
- .values())
- {
- String strValue = servletContext.getInitParameter(param
- .getQualifiedName());
- boolean value;
-
- if (strValue != null && strValue.length() > 0
- && param.isDeprecated())
- {
- BooleanWebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
-
- if (alternate != null)
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
-
- if (LOGGER.isLoggable(Level.INFO) && alternate != null)
- {
- LOGGER
- .log(
- Level.INFO,
- ((value) ? "jsf.config.webconfig.configinfo.reset.enabled"
- : "jsf.config.webconfig.configinfo.reset.disabled"),
- new Object[]
- {
- contextName,
- alternate.getQualifiedName()
- });
- }
-
- booleanContextParameters.put(alternate, value);
- }
- continue;
- }
-
- if (!param.isDeprecated())
- {
- if (strValue == null)
- {
- value = param.getDefaultValue();
- }
- else
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
- }
-
- // first param processed should be
- // com.sun.faces.displayConfiguration
- if (BooleanWebContextInitParameter.DisplayConfiguration
- .equals(param)
- && value)
- {
- loggingLevel = Level.INFO;
- }
-
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- ((value) ? "jsf.config.webconfig.boolconfiginfo.enabled"
- : "jsf.config.webconfig.boolconfiginfo.disabled"),
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
-
- booleanContextParameters.put(param, value);
- }
-
- }
-
- }
-
- /**
- * Adds all com.sun.faces init parameter names to a list. This allows
- * callers to determine if a parameter was explicitly set.
- *
- * @param servletContext
- * the ServletContext of interest
- */
- private void initSetList(ServletContext servletContext)
- {
-
- for (Enumeration e = servletContext.getInitParameterNames(); e
- .hasMoreElements();)
- {
- String name = e.nextElement().toString();
- if (name.startsWith("com.sun.faces"))
- {
- setParams.add(name);
- }
- }
-
- }
-
- /**
- * @param name
- * the param name
- * @return <code>true</code> if the name was explicitly specified
- */
- private boolean isSet(String name)
- {
-
- return setParams.contains(name);
-
- }
-
- /**
- * <p>
- * Process all non-boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processInitParameters(ServletContext servletContext,
- String contextName)
- {
-
- for (WebContextInitParameter param : WebContextInitParameter.values())
- {
- String value = servletContext.getInitParameter(param
- .getQualifiedName());
-
- if (value != null && value.length() > 0 && param.isDeprecated())
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
-
- if (alternate != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- LOGGER.log(Level.INFO,
- "jsf.config.webconfig.configinfo.reset",
- new Object[]
- {
- contextName,
- alternate.getQualifiedName(), value
- });
- }
-
- contextParameters.put(alternate, value);
- }
- continue;
- }
-
- if ((value == null || value.length() == 0) && !param.isDeprecated())
- {
- value = param.getDefaultValue();
- }
- if (value == null || value.length() == 0)
- {
- continue;
- }
-
- if (value.length() > 0)
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel, "jsf.config.webconfig.configinfo",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- value
- });
-
- }
- contextParameters.put(param, value);
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.option.notconfigured",
- new Object[]
- {
- contextName, param.getQualifiedName()
- });
- }
- }
-
- }
-
- }
-
- /**
- * <p>
- * Process all JNDI entries.
- * </p>
- *
- * @param contextName
- * the context name
- */
- private void processJndiEntries(String contextName)
- {
-/*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
- Context initialContext = null;
- try
- {
- initialContext = new InitialContext();
- }
- catch (NamingException ne)
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING, ne.toString(), ne);
- }
- }
-
- if (initialContext != null)
- {
- // process environment entries
- for (WebEnvironmentEntry entry : WebEnvironmentEntry.values())
- {
- String entryName = entry.getQualifiedName();
- String value = null;
-
- try
- {
- value = (String) initialContext.lookup(entryName);
- }
- catch (NamingException root)
- {
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER.fine(root.toString());
- }
- }
-
- if (value != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- // special logic for ClientStateSavingPassword
- if (!entry
- .equals(WebEnvironmentEntry.ClientStateSavingPassword))
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.enventryinfo",
- new Object[]
- {
- contextName, entryName, value
- });
- }
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- "jsf.config.webconfig.enventry.clientencrypt",
- contextName);
- }
- }
- }
- envEntries.put(entry, value);
- }
- }
- }
-*/
- }
-
- private boolean canProcessJndiEntries()
- {
-
- /*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6
- try
- {
- Util.getCurrentLoader(this)
- .loadClass("javax.naming.InitialContext");
- }
- catch (Exception e)
- {
- */
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER
- .fine("javax.naming is forced unavailable. JNDI entries related to Mojarra configuration will not be processed.");
- }
- return false;
- /*
- }
- return true;
- */
-
- }
-
- // ------------------------------------------------------------------- Enums
-
- /**
- * <p>
- * An <code>enum</code> of all non-boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum WebContextInitParameter
- {
-
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
-
- ManagedBeanFactoryDecorator(
- "com.sun.faces.managedBeanFactoryDecoratorClass", ""), StateSavingMethod(
- "javax.faces.STATE_SAVING_METHOD", "server"), FaceletsSuffix(
- ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_FACELETS_SUFFIX), DefaultSuffix(
- ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_SUFFIX), JavaxFacesConfigFiles(
- "javax.faces.CONFIG_FILES", ""), JavaxFacesProjectStage(
- "javax.faces.PROJECT_STAGE", "Production"), AlternateLifecycleId(
- "javax.faces.LIFECYCLE_ID", ""), ResourceExcludes(
- ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
- ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"), NumberOfViews(
- "com.sun.faces.numberOfViewsInSession", "15"), NumberOfViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION", "15", true,
- NumberOfViews), NumberOfLogicalViews(
- "com.sun.faces.numberOfLogicalViews", "15"), NumberOfLogicalViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
- "15", true, NumberOfLogicalViews), NumberOfConcurrentFlashUsers(
- "com.sun.faces.numberOfConcerrentFlashUsers", "5000"), NumberOfFlashesBetweenFlashReapings(
- "com.sun.faces.numberOfFlashesBetweenFlashReapings", "5000"), InjectionProviderClass(
- "com.sun.faces.injectionProvider", ""), SerializationProviderClass(
- "com.sun.faces.serializationProvider", ""), ResponseBufferSize(
- "com.sun.faces.responseBufferSize", "1024"), FaceletsBufferSize(
- "javax.faces.FACELETS_BUFFER_SIZE", "1024", true,
- ResponseBufferSize), FaceletsBufferSizeDeprecated(
- "facelets.BUFFER_SIZE", "1024", true, FaceletsBufferSize), ClientStateWriteBufferSize(
- "com.sun.faces.clientStateWriteBufferSize", "8192"), ResourceBufferSize(
- "com.sun.faces.resourceBufferSize", "2048"), ExpressionFactory(
- "com.sun.faces.expressionFactory",
- "com.sun.el.ExpressionFactoryImpl"), ClientStateTimeout(
- "com.sun.faces.clientStateTimeout", ""), DefaultResourceMaxAge(
- "com.sun.faces.defaultResourceMaxAge", "604800"), ResourceUpdateCheckPeriod(
- "com.sun.faces.resourceUpdateCheckPeriod", "5" // in minutes
- ), CompressableMimeTypes("com.sun.faces.compressableMimeTypes", ""), DisableUnicodeEscaping(
- "com.sun.faces.disableUnicodeEscaping", "auto"), FaceletsDefaultRefreshPeriod(
- "javax.faces.FACELETS_REFRESH_PERIOD", "2"), FaceletsDefaultRefreshPeriodDeprecated(
- "facelets.REFRESH_PERIOD", "2", true,
- FaceletsDefaultRefreshPeriod), FaceletsResourceResolver(
- ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME, ""), FaceletsResourceResolverDeprecated(
- "facelets.RESOURCE_RESOLVER", "", true,
- FaceletsResourceResolver), FaceletsViewMappings(
- ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME, ""), FaceletsViewMappingsDeprecated(
- "facelets.VIEW_MAPPINGS", "", true, FaceletsViewMappings), FaceletsLibraries(
- "javax.faces.FACELETS_LIBRARIES", ""), FaceletsLibrariesDeprecated(
- "facelets.LIBRARIES", "", true, FaceletsLibraries), FaceletsDecorators(
- "javax.faces.FACELETS_DECORATORS", ""), FaceletsDecoratorsDeprecated(
- "facelets.DECORATORS", "", true, FaceletsDecorators), DuplicateJARPattern(
- "com.sun.faces.duplicateJARPattern", ""), ValidateEmptyFields(
- UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME, "auto"), FullStateSavingViewIds(
- StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, ""), AnnotationScanPackages(
- "com.sun.faces.annotationScanPackages", ""), FaceletFactory(
- "com.sun.faces.faceletFactory", "");
-
- private String defaultValue;
- private String qualifiedName;
- private WebContextInitParameter alternate;
- private boolean deprecated;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public String getDefaultValue()
- {
-
- return defaultValue;
-
- }
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- WebContextInitParameter(String qualifiedName, String defaultValue)
- {
-
- this(qualifiedName, defaultValue, false, null);
-
- }
-
- WebContextInitParameter(String qualifiedName, String defaultValue,
- boolean deprecated, WebContextInitParameter alternate)
- {
-
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
-
- }
-
- // --------------------------------------------------------- Private
- // Methods
-
- private WebContextInitParameter getAlternate()
- {
-
- return alternate;
-
- }
-
- private boolean isDeprecated()
- {
-
- return deprecated;
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum BooleanWebContextInitParameter
- {
-
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
-
- DisplayConfiguration("com.sun.faces.displayConfiguration", false), ValidateFacesConfigFiles(
- "com.sun.faces.validateXml", false), VerifyFacesConfigObjects(
- "com.sun.faces.verifyObjects", false), ForceLoadFacesConfigFiles(
- "com.sun.faces.forceLoadConfiguration", false), DisableArtifactVersioning(
- "com.sun.faces.disableVersionTracking", false, true, null), EnableHtmlTagLibraryValidator(
- "com.sun.faces.enableHtmlTagLibValidator", false), EnableCoreTagLibraryValidator(
- "com.sun.faces.enableCoreTagLibValidator", false), PreferXHTMLContentType(
- "com.sun.faces.preferXHTML", false), PreferXHTMLContextTypeDeprecated(
- "com.sun.faces.PreferXHTML", false, true,
- PreferXHTMLContentType), CompressViewState(
- "com.sun.faces.compressViewState", true), CompressViewStateDeprecated(
- "com.sun.faces.COMPRESS_STATE", true, true, CompressViewState), CompressJavaScript(
- "com.sun.faces.compressJavaScript", true), ExternalizeJavaScriptDeprecated(
- "com.sun.faces.externalizeJavaScript", true, true, null), SendPoweredByHeader(
- "com.sun.faces.sendPoweredByHeader", true), EnableJSStyleHiding(
- "com.sun.faces.enableJSStyleHiding", false), EnableScriptInAttributeValue(
- "com.sun.faces.enableScriptsInAttributeValues", true), WriteStateAtFormEnd(
- "com.sun.faces.writeStateAtFormEnd", true), EnableLazyBeanValidation(
- "com.sun.faces.enableLazyBeanValidation", true), EnableLoadBundle11Compatibility(
- "com.sun.faces.enabledLoadBundle11Compatibility", false), EnableRestoreView11Compatibility(
- "com.sun.faces.enableRestoreView11Compatibility", false), SerializeServerState(
- "com.sun.faces.serializeServerState", false), EnableViewStateIdRendering(
- "com.sun.faces.enableViewStateIdRendering", true), RegisterConverterPropertyEditors(
- "com.sun.faces.registerConverterPropertyEditors", false), EnableGroovyScripting(
- "com.sun.faces.enableGroovyScripting", false), DisableFaceletJSFViewHandler(
- "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER", false), DisableDefaultBeanValidator(
- BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME, false), DateTimeConverterUsesSystemTimezone(
- "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
- false), FaceletsSkipComments(
- "javax.faces.FACELETS_SKIP_COMMENTS", false), FaceletsSkipCommentsDeprecated(
- "facelets.SKIP_COMMENTS", false, true, FaceletsSkipComments), PartialStateSaving(
- StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, true), GenerateUniqueServerStateIds(
- "com.sun.faces.generateUniqueServerStateIds", true), AutoCompleteOffOnViewState(
- "com.sun.faces.autoCompleteOffOnViewState", true), EnableThreading(
- "com.sun.faces.enableThreading", true), AllowTextChildren(
- "com.sun.faces.allowTextChildren", false);
-
- private BooleanWebContextInitParameter alternate;
-
- private String qualifiedName;
- private boolean defaultValue;
- private boolean deprecated;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public boolean getDefaultValue()
- {
-
- return defaultValue;
-
- }
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue)
- {
-
- this(qualifiedName, defaultValue, false, null);
-
- }
-
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue, boolean deprecated,
- BooleanWebContextInitParameter alternate)
- {
-
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
-
- }
-
- // --------------------------------------------------------- Private
- // Methods
-
- private BooleanWebContextInitParameter getAlternate()
- {
-
- return alternate;
-
- }
-
- private boolean isDeprecated()
- {
-
- return deprecated;
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all environment entries (specified in the
- * web.xml) recognized by the implemenetation.
- * </p>
- */
- public enum WebEnvironmentEntry
- {
-
- ClientStateSavingPassword("ClientStateSavingPassword"), ProjectStage(
- javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
-
- private static final String JNDI_PREFIX = "java:comp/env/";
- private String qualifiedName;
-
- // ---------------------------------------------------------- Public
- // Methods
-
- public String getQualifiedName()
- {
-
- return qualifiedName;
-
- }
-
- // ------------------------------------------------- Package Private
- // Methods
-
- WebEnvironmentEntry(String qualifiedName)
- {
-
- if (qualifiedName.startsWith(JNDI_PREFIX))
- {
- this.qualifiedName = qualifiedName;
- }
- else
- {
- this.qualifiedName = JNDI_PREFIX + qualifiedName;
- }
-
- }
-
- }
-
- /**
- * <p>
- * An <code>enum</code> of all possible values for the
- * <code>disableUnicodeEscaping</code> configuration parameter.
- * </p>
- */
- public enum DisableUnicodeEscaping
- {
- True("true"), False("false"), Auto("auto");
-
- private final String value;
-
- DisableUnicodeEscaping(String value)
- {
- this.value = value;
- }
-
- public static DisableUnicodeEscaping getByValue(String value)
- {
- for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping
- .values())
- {
- if (disableUnicodeEscaping.value.equals(value)) { return disableUnicodeEscaping; }
- }
-
- return null;
- }
- }
-
-} // END WebConfiguration
\ No newline at end of file
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can obtain
+ * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [year]
+ * [name of copyright owner]"
+ *
+ * Contributor(s):
+ *
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package com.sun.faces.config;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+import javax.faces.application.ResourceHandler;
+import javax.faces.application.StateManager;
+import javax.faces.application.ViewHandler;
+import javax.faces.component.UIInput;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.BeanValidator;
+import javax.faces.view.facelets.ResourceResolver;
+import javax.servlet.ServletContext;
+
+import com.sun.faces.util.FacesLogger;
+import com.sun.faces.util.Util;
+
+
+/** Class Documentation */
+public class WebConfiguration {
+
+
+ // Log instance for this class
+ private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
+
+ // A Simple regular expression of allowable boolean values
+ private static final Pattern ALLOWABLE_BOOLEANS =
+ Pattern.compile("true|false");
+
+ // Key under which we store our WebConfiguration instance.
+ private static final String WEB_CONFIG_KEY =
+ "com.sun.faces.config.WebConfiguration";
+
+ // Logging level. Defaults to FINE
+ private Level loggingLevel = Level.FINE;
+
+ private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters =
+ new EnumMap<BooleanWebContextInitParameter, Boolean>(BooleanWebContextInitParameter.class);
+
+ private Map<WebContextInitParameter, String> contextParameters =
+ new EnumMap<WebContextInitParameter, String>(WebContextInitParameter.class);
+
+ private Map<WebEnvironmentEntry, String> envEntries =
+ new EnumMap<WebEnvironmentEntry, String>(WebEnvironmentEntry.class);
+
+ private Map<WebContextInitParameter, String []> cachedListParams;
+
+ private Set<String> setParams = new HashSet<String>();
+
+ private ServletContext servletContext;
+
+ private ArrayList<DeferredLoggingAction> deferredLoggingActions;
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ private WebConfiguration(ServletContext servletContext) {
+
+ this.servletContext = servletContext;
+
+ String contextName = getServletContextName();
+
+ initSetList(servletContext);
+ processBooleanParameters(servletContext, contextName);
+ processInitParameters(servletContext, contextName);
+ if (canProcessJndiEntries()) {
+ processJndiEntries(contextName);
+ }
+
+ // build the cache of list type params
+ cachedListParams = new HashMap<WebContextInitParameter, String []>(3);
+ getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
+ getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
+ getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
+
+ }
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ /**
+ * Return the WebConfiguration instance for this application passing
+ * the result of FacesContext.getCurrentInstance().getExternalContext()
+ * to {@link #getInstance(javax.faces.context.ExternalContext)}.
+ * @return the WebConfiguration for this application or <code>null</code>
+ * if no FacesContext is available.
+ */
+ public static WebConfiguration getInstance() {
+
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ return getInstance(facesContext.getExternalContext());
+
+ }
+
+
+ /**
+ * Return the WebConfiguration instance for this application.
+ * @param extContext the ExternalContext for this request
+ * @return the WebConfiguration for this application
+ */
+ public static WebConfiguration getInstance(ExternalContext extContext) {
+
+ WebConfiguration config = (WebConfiguration) extContext.getApplicationMap()
+ .get(WEB_CONFIG_KEY);
+ if (config == null) {
+ return getInstance((ServletContext) extContext.getContext());
+ } else {
+ return config;
+ }
+
+ }
+
+
+ /**
+ * Return the WebConfiguration instance for this application.
+ * @param servletContext the ServletContext
+ * @return the WebConfiguration for this application or <code>null</code>
+ * if no WebConfiguration could be located
+ */
+ public static WebConfiguration getInstance(ServletContext servletContext) {
+
+ WebConfiguration webConfig = (WebConfiguration)
+ servletContext.getAttribute(WEB_CONFIG_KEY);
+
+ if (webConfig == null) {
+ webConfig = new WebConfiguration(servletContext);
+ servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
+ }
+ return webConfig;
+
+ }
+
+
+ /**
+ * @return The <code>ServletContext</code> originally used to construct
+ * this WebConfiguration instance
+ */
+ public ServletContext getServletContext() {
+
+ return servletContext;
+
+ }
+
+
+ /**
+ * Obtain the value of the specified boolean parameter
+ * @param param the parameter of interest
+ * @return the value of the specified boolean parameter
+ */
+ public boolean isOptionEnabled(BooleanWebContextInitParameter param) {
+
+ if (booleanContextParameters.get(param) != null) {
+ return booleanContextParameters.get(param);
+ } else {
+ return param.getDefaultValue();
+ }
+
+ }
+
+
+ /**
+ * Obtain the value of the specified parameter
+ * @param param the parameter of interest
+ * @return the value of the specified parameter
+ */
+ public String getOptionValue(WebContextInitParameter param) {
+ String result = contextParameters.get(param);
+
+ if (null == result) {
+ WebContextInitParameter alternate = param.getAlternate();
+ if (null != alternate) {
+ result = contextParameters.get(alternate);
+ }
+ }
+
+ return result;
+
+ }
+
+ public String[] getOptionValue(WebContextInitParameter param, String sep) {
+ String [] result;
+
+ assert(null != cachedListParams);
+ if (null == (result = cachedListParams.get(param))) {
+ String value = getOptionValue(param);
+ if (null == value) {
+ result = new String[0];
+ } else {
+ result = Util.split(value, sep);
+ }
+ cachedListParams.put(param, result);
+ }
+
+ return result;
+ }
+
+
+ /**
+ * Obtain the value of the specified env-entry
+ * @param entry the env-entry of interest
+ * @return the value of the specified env-entry
+ */
+ public String getEnvironmentEntry(WebEnvironmentEntry entry) {
+
+ return envEntries.get(entry);
+
+ }
+
+
+ /**
+ * @param param the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set,
+ * otherwise, <code>false</code>
+ */
+ public boolean isSet(WebContextInitParameter param) {
+
+ return isSet(param.getQualifiedName());
+
+ }
+
+
+ /**
+ * @param param the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set,
+ * otherwise, <code>false</code>
+ */
+ public boolean isSet(BooleanWebContextInitParameter param) {
+
+ return isSet(param.getQualifiedName());
+
+ }
+
+
+ /**
+ * @return the name of this application
+ */
+ public String getServletContextName() {
+
+ if (servletContext.getMajorVersion() == 2
+ && servletContext.getMinorVersion() <= 4) {
+ return servletContext.getServletContextName();
+ } else {
+ return servletContext.getContextPath();
+ }
+
+ }
+
+
+ public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) {
+
+ if (param == null) {
+ return;
+ }
+ boolean oldVal = booleanContextParameters.put(param, value);
+ if (LOGGER.isLoggable(Level.FINE) && oldVal != value) {
+ LOGGER.log(Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[] { param.getQualifiedName(), oldVal, value});
+ }
+
+ }
+
+
+ public void overrideContextInitParameter(WebContextInitParameter param, String value) {
+
+ if (param == null || value == null || value.length() == 0) {
+ return;
+ }
+ value = value.trim();
+ String oldVal = contextParameters.put(param, value);
+ cachedListParams.remove(param);
+ if (oldVal != null) {
+ if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value))) {
+ LOGGER.log(Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[]{param.getQualifiedName(),
+ oldVal,
+ value});
+ }
+ }
+
+
+ }
+
+
+ public void doLoggingActions() {
+
+ if (deferredLoggingActions != null) {
+ for (DeferredLoggingAction loggingAction : deferredLoggingActions) {
+ loggingAction.log();
+ }
+ }
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ static void clear(ServletContext servletContext) {
+
+ servletContext.removeAttribute(WEB_CONFIG_KEY);
+
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ /**
+ * <p>Is the configured value valid against the default boolean pattern.</p>
+ * @param param the boolean parameter
+ * @param value the configured value
+ * @return <code>true</code> if the value is valid,
+ * otherwise <code>false</code>
+ */
+ private boolean isValueValid(BooleanWebContextInitParameter param,
+ String value) {
+
+ if (!ALLOWABLE_BOOLEANS.matcher(value).matches()) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ LOGGER.log(Level.WARNING,
+ "jsf.config.webconfig.boolconfig.invalidvalue",
+ new Object[]{
+ value,
+ param.getQualifiedName(),
+ "true|false"
+ });
+ }
+ return false;
+ }
+
+ return true;
+
+ }
+
+
+ /**
+ * <p>Process all boolean context initialization parameters.</p>
+ * @param servletContext the ServletContext of interest
+ * @param contextName the context name
+ */
+ private void processBooleanParameters(ServletContext servletContext,
+ String contextName) {
+
+ // process boolean contxt parameters
+ for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
+ .values()) {
+ String strValue =
+ servletContext.getInitParameter(param.getQualifiedName());
+ boolean value;
+
+ if (strValue != null && strValue.length() > 0 && param.isDeprecated()) {
+ BooleanWebContextInitParameter alternate = param.getAlternate();
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ if (alternate != null) {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]{
+ contextName,
+ param.getQualifiedName(),
+ alternate.getQualifiedName()}));
+
+ } else {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]{
+ contextName,
+ param.getQualifiedName()}));
+
+ }
+ }
+
+ if (alternate != null) {
+ if (isValueValid(param, strValue)) {
+ value = Boolean.valueOf(strValue);
+ } else {
+ value = param.getDefaultValue();
+ }
+
+ if (LOGGER.isLoggable(Level.INFO) && alternate != null) {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.INFO,
+ ((value)
+ ? "jsf.config.webconfig.configinfo.reset.enabled"
+ : "jsf.config.webconfig.configinfo.reset.disabled"),
+ new Object[]{
+ contextName,
+ alternate.getQualifiedName()}));
+ }
+
+ booleanContextParameters.put(alternate, value);
+ }
+ continue;
+ }
+
+ if (!param.isDeprecated()) {
+ if (strValue == null) {
+ value = param.getDefaultValue();
+ } else {
+ if (isValueValid(param, strValue)) {
+ value = Boolean.valueOf(strValue);
+ } else {
+ value = param.getDefaultValue();
+ }
+ }
+
+ // first param processed should be
+ // com.sun.faces.displayConfiguration
+ if (BooleanWebContextInitParameter.DisplayConfiguration.equals(param) && value) {
+ loggingLevel = Level.INFO;
+ }
+
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ ((value)
+ ? "jsf.config.webconfig.boolconfiginfo.enabled"
+ : "jsf.config.webconfig.boolconfiginfo.disabled"),
+ new Object[]{contextName,
+ param.getQualifiedName()});
+ }
+
+ booleanContextParameters.put(param, value);
+ }
+
+ }
+
+ }
+
+
+ /**
+ * Adds all com.sun.faces init parameter names to a list. This allows
+ * callers to determine if a parameter was explicitly set.
+ * @param servletContext the ServletContext of interest
+ */
+ private void initSetList(ServletContext servletContext) {
+
+ for (Enumeration e = servletContext.getInitParameterNames();
+ e.hasMoreElements(); ) {
+ String name = e.nextElement().toString();
+ if (name.startsWith("com.sun.faces") ||
+ name.startsWith("javax.faces")) {
+ setParams.add(name);
+ }
+ }
+
+ }
+
+
+ /**
+ * @param name the param name
+ * @return <code>true</code> if the name was explicitly specified
+ */
+ private boolean isSet(String name) {
+
+ return setParams.contains(name);
+
+ }
+
+
+ /**
+ * <p>Process all non-boolean context initialization parameters.</p>
+ * @param servletContext the ServletContext of interest
+ * @param contextName the context name
+ */
+ private void processInitParameters(ServletContext servletContext,
+ String contextName) {
+
+ for (WebContextInitParameter param : WebContextInitParameter.values()) {
+ String value =
+ servletContext.getInitParameter(param.getQualifiedName());
+
+ if (value != null && value.length() > 0 && param.isDeprecated()) {
+ WebContextInitParameter alternate = param.getAlternate();
+ DeprecationLoggingStrategy strategy = param.getDeprecationLoggingStrategy();
+ if (strategy == null || strategy.shouldBeLogged(this)) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ if (alternate != null) {
+ queueLoggingAction(new DeferredParameterLoggingAction(param, Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]{
+ contextName,
+ param.getQualifiedName(),
+ alternate.getQualifiedName()}));
+
+ } else {
+ queueLoggingAction(new DeferredParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]{
+ contextName,
+ param.getQualifiedName()}));
+ }
+ }
+ }
+
+ if (alternate != null) {
+ queueLoggingAction(
+ new DeferredParameterLoggingAction(param,
+ Level.INFO,
+ "jsf.config.webconfig.configinfo.reset",
+ new Object[]{
+ contextName,
+ alternate.getQualifiedName(),
+ value}));
+
+ contextParameters.put(alternate, value);
+ }
+ continue;
+ }
+
+ if ((value == null || value.length() == 0) && !param.isDeprecated()) {
+ value = param.getDefaultValue();
+ }
+ if (value == null || value.length() == 0) {
+ continue;
+ }
+
+ if (value.length() > 0) {
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.configinfo",
+ new Object[]{contextName,
+ param.getQualifiedName(),
+ value});
+
+ }
+ contextParameters.put(param, value);
+ } else {
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.option.notconfigured",
+ new Object[]{contextName,
+ param.getQualifiedName()});
+ }
+ }
+
+ }
+
+ }
+
+
+ /**
+ * <p>Process all JNDI entries.</p>
+ * @param contextName the context name
+ */
+ //This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
+ private void processJndiEntries(String contextName) {
+//
+// Context initialContext = null;
+// try {
+// initialContext = new InitialContext();
+// } catch (NamingException ne) {
+// if (LOGGER.isLoggable(Level.WARNING)) {
+// LOGGER.log(Level.WARNING, ne.toString(), ne);
+// }
+// }
+//
+// if (initialContext != null) {
+// // process environment entries
+// for (WebEnvironmentEntry entry : WebEnvironmentEntry.values()) {
+// String entryName = entry.getQualifiedName();
+// String value = null;
+//
+// try {
+// value = (String) initialContext.lookup(entryName);
+// } catch (NamingException root) {
+// if (LOGGER.isLoggable(Level.FINE)) {
+// LOGGER.fine(root.toString());
+// }
+// }
+//
+// if (value != null) {
+// if (LOGGER.isLoggable(Level.INFO)) {
+// // special logic for ClientStateSavingPassword
+// if (!entry
+// .equals(WebEnvironmentEntry.ClientStateSavingPassword)) {
+// if (LOGGER
+// .isLoggable(loggingLevel)) {
+// LOGGER.log(loggingLevel,
+// "jsf.config.webconfig.enventryinfo",
+// new Object[]{contextName,
+// entryName,
+// value});
+// }
+// } else {
+// if (LOGGER
+// .isLoggable(loggingLevel)) {
+// LOGGER.log(loggingLevel,
+// "jsf.config.webconfig.enventry.clientencrypt",
+// contextName);
+// }
+// }
+// }
+// envEntries.put(entry, value);
+// }
+// }
+// }
+
+ }
+
+
+ //This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
+ private boolean canProcessJndiEntries() {
+//
+// try {
+// Util.getCurrentLoader(this).loadClass("javax.naming.InitialContext");
+// } catch (Exception e) {
+// if (LOGGER.isLoggable(Level.FINE)) {
+// LOGGER.fine(
+// "javax.naming is unavailable. JNDI entries related to Mojarra configuration will not be processed.");
+// }
+// return false;
+// }
+// return true;
+ return false;
+ }
+
+
+ private void queueLoggingAction(DeferredLoggingAction loggingAction) {
+
+ if (deferredLoggingActions == null) {
+ deferredLoggingActions = new ArrayList<DeferredLoggingAction>();
+ }
+ deferredLoggingActions.add(loggingAction);
+
+ }
+
+
+ // ------------------------------------------------------------------- Enums
+
+
+ /**
+ * <p>An <code>enum</code> of all non-boolean context initalization parameters
+ * recognized by the implementation.</p>
+ */
+ public enum WebContextInitParameter {
+
+
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
+
+ ManagedBeanFactoryDecorator(
+ "com.sun.faces.managedBeanFactoryDecoratorClass",
+ ""
+ ),
+ StateSavingMethod(
+ "javax.faces.STATE_SAVING_METHOD",
+ "server"
+ ),
+ FaceletsSuffix(
+ ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_FACELETS_SUFFIX
+ ),
+ DefaultSuffix(
+ ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_SUFFIX
+ ),
+ JavaxFacesConfigFiles(
+ "javax.faces.CONFIG_FILES",
+ ""
+ ),
+ JavaxFacesProjectStage(
+ "javax.faces.PROJECT_STAGE",
+ "Production"
+ ),
+ AlternateLifecycleId(
+ "javax.faces.LIFECYCLE_ID",
+ ""
+ ),
+ ResourceExcludes(
+ ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
+ ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"
+ ),
+ NumberOfViews(
+ "com.sun.faces.numberOfViewsInSession",
+ "15"
+ ),
+ NumberOfViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION",
+ "15",
+ true,
+ NumberOfViews
+ ),
+ NumberOfLogicalViews(
+ "com.sun.faces.numberOfLogicalViews",
+ "15"
+ ),
+ NumberOfLogicalViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
+ "15",
+ true,
+ NumberOfLogicalViews
+ ),
+ NumberOfConcurrentFlashUsers(
+ "com.sun.faces.numberOfConcerrentFlashUsers",
+ "5000"
+ ),
+ NumberOfFlashesBetweenFlashReapings(
+ "com.sun.faces.numberOfFlashesBetweenFlashReapings",
+ "5000"
+ ),
+ InjectionProviderClass(
+ "com.sun.faces.injectionProvider",
+ ""
+ ),
+ SerializationProviderClass(
+ "com.sun.faces.serializationProvider",
+ ""
+ ),
+ ResponseBufferSize(
+ "com.sun.faces.responseBufferSize",
+ "1024"
+ ),
+ FaceletsBufferSize(
+ "javax.faces.FACELETS_BUFFER_SIZE",
+ "1024"
+ ),
+ FaceletsBufferSizeDeprecated(
+ "facelets.BUFFER_SIZE",
+ "1024",
+ true,
+ FaceletsBufferSize,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ ClientStateWriteBufferSize(
+ "com.sun.faces.clientStateWriteBufferSize",
+ "8192"
+ ),
+ ResourceBufferSize(
+ "com.sun.faces.resourceBufferSize",
+ "2048"
+ ),
+ ExpressionFactory(
+ "com.sun.faces.expressionFactory",
+ "com.sun.el.ExpressionFactoryImpl"
+ ),
+ ClientStateTimeout(
+ "com.sun.faces.clientStateTimeout",
+ ""
+ ),
+ DefaultResourceMaxAge(
+ "com.sun.faces.defaultResourceMaxAge",
+ "604800000" // 7 days
+ ),
+ ResourceUpdateCheckPeriod(
+ "com.sun.faces.resourceUpdateCheckPeriod",
+ "5" // in minutes
+ ),
+ CompressableMimeTypes(
+ "com.sun.faces.compressableMimeTypes",
+ ""
+ ),
+ DisableUnicodeEscaping(
+ "com.sun.faces.disableUnicodeEscaping",
+ "auto"
+ ),
+ FaceletsDefaultRefreshPeriod(
+ "javax.faces.FACELETS_REFRESH_PERIOD",
+ "2"
+ ),
+ FaceletsDefaultRefreshPeriodDeprecated(
+ "facelets.REFRESH_PERIOD",
+ "2",
+ true,
+ FaceletsDefaultRefreshPeriod,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsResourceResolver(
+ ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME,
+ ""
+ ),
+ FaceletsResourceResolverDeprecated(
+ "facelets.RESOURCE_RESOLVER",
+ "",
+ true,
+ FaceletsResourceResolver,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsViewMappings(
+ ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME,
+ ""
+ ),
+ FaceletsViewMappingsDeprecated(
+ "facelets.VIEW_MAPPINGS",
+ "",
+ true,
+ FaceletsViewMappings,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsLibraries(
+ "javax.faces.FACELETS_LIBRARIES",
+ ""
+ ),
+ FaceletsLibrariesDeprecated(
+ "facelets.LIBRARIES",
+ "",
+ true,
+ FaceletsLibraries,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsDecorators(
+ "javax.faces.FACELETS_DECORATORS",
+ ""
+ ),
+ FaceletsDecoratorsDeprecated(
+ "facelets.DECORATORS",
+ "",
+ true,
+ FaceletsDecorators,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ DuplicateJARPattern(
+ "com.sun.faces.duplicateJARPattern",
+ ""
+ ),
+ ValidateEmptyFields(
+ UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME,
+ "auto"
+ ),
+ FullStateSavingViewIds(
+ StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME,
+ ""
+ ),
+ AnnotationScanPackages(
+ "com.sun.faces.annotationScanPackages",
+ ""
+ ),
+ FaceletFactory(
+ "com.sun.faces.faceletFactory",
+ ""
+ ),
+ FaceletCache(
+ "com.sun.faces.faceletCache",
+ ""
+ );
+
+
+
+ private String defaultValue;
+ private String qualifiedName;
+ private WebContextInitParameter alternate;
+ private boolean deprecated;
+ private DeprecationLoggingStrategy loggingStrategy;
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String getDefaultValue() {
+
+ return defaultValue;
+
+ }
+
+
+ public String getQualifiedName() {
+
+ return qualifiedName;
+
+ }
+
+
+ DeprecationLoggingStrategy getDeprecationLoggingStrategy() {
+
+ return loggingStrategy;
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue) {
+
+ this(qualifiedName, defaultValue, false, null);
+
+ }
+
+
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue,
+ boolean deprecated,
+ WebContextInitParameter alternate) {
+
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
+
+ }
+
+
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue,
+ boolean deprecated,
+ WebContextInitParameter alternate,
+ DeprecationLoggingStrategy loggingStrategy) {
+
+ this(qualifiedName, defaultValue, deprecated, alternate);
+ this.loggingStrategy = loggingStrategy;
+
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ private WebContextInitParameter getAlternate() {
+
+ return alternate;
+
+ }
+
+
+ private boolean isDeprecated() {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all boolean context initalization parameters
+ * recognized by the implementation.</p>
+ */
+ public enum BooleanWebContextInitParameter {
+
+
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
+
+ DisplayConfiguration(
+ "com.sun.faces.displayConfiguration",
+ false
+ ),
+ ValidateFacesConfigFiles(
+ "com.sun.faces.validateXml",
+ false
+ ),
+ VerifyFacesConfigObjects(
+ "com.sun.faces.verifyObjects",
+ false
+ ),
+ ForceLoadFacesConfigFiles(
+ "com.sun.faces.forceLoadConfiguration",
+ false
+ ),
+ DisableArtifactVersioning(
+ "com.sun.faces.disableVersionTracking",
+ false,
+ true,
+ null
+ ),
+ EnableHtmlTagLibraryValidator(
+ "com.sun.faces.enableHtmlTagLibValidator",
+ false
+ ),
+ EnableCoreTagLibraryValidator(
+ "com.sun.faces.enableCoreTagLibValidator",
+ false
+ ),
+ PreferXHTMLContentType(
+ "com.sun.faces.preferXHTML",
+ false
+ ),
+ PreferXHTMLContextTypeDeprecated(
+ "com.sun.faces.PreferXHTML",
+ false,
+ true,
+ PreferXHTMLContentType
+ ),
+ CompressViewState(
+ "com.sun.faces.compressViewState",
+ true
+ ),
+ CompressViewStateDeprecated(
+ "com.sun.faces.COMPRESS_STATE",
+ true,
+ true,
+ CompressViewState
+ ),
+ CompressJavaScript(
+ "com.sun.faces.compressJavaScript",
+ true
+ ),
+ ExternalizeJavaScriptDeprecated(
+ "com.sun.faces.externalizeJavaScript",
+ true,
+ true,
+ null
+ ),
+ SendPoweredByHeader(
+ "com.sun.faces.sendPoweredByHeader",
+ true
+ ),
+ EnableJSStyleHiding(
+ "com.sun.faces.enableJSStyleHiding",
+ false
+ ),
+ EnableScriptInAttributeValue(
+ "com.sun.faces.enableScriptsInAttributeValues",
+ true
+ ),
+ WriteStateAtFormEnd(
+ "com.sun.faces.writeStateAtFormEnd",
+ true
+ ),
+ EnableLazyBeanValidation(
+ "com.sun.faces.enableLazyBeanValidation",
+ true
+ ),
+ EnableLoadBundle11Compatibility(
+ "com.sun.faces.enabledLoadBundle11Compatibility",
+ false
+ ),
+ EnableRestoreView11Compatibility(
+ "com.sun.faces.enableRestoreView11Compatibility",
+ false
+ ),
+ SerializeServerState(
+ "com.sun.faces.serializeServerState",
+ false
+ ),
+ EnableViewStateIdRendering(
+ "com.sun.faces.enableViewStateIdRendering",
+ true
+ ),
+ RegisterConverterPropertyEditors(
+ "com.sun.faces.registerConverterPropertyEditors",
+ false
+ ),
+ EnableGroovyScripting(
+ "com.sun.faces.enableGroovyScripting",
+ false
+ ),
+ DisableFaceletJSFViewHandler(
+ "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER",
+ false
+ ),
+ DisableDefaultBeanValidator(
+ BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME,
+ false),
+ DateTimeConverterUsesSystemTimezone(
+ "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
+ false
+ ),
+ FaceletsSkipComments(
+ "javax.faces.FACELETS_SKIP_COMMENTS",
+ false
+ ),
+ FaceletsSkipCommentsDeprecated(
+ "facelets.SKIP_COMMENTS",
+ false,
+ true,
+ FaceletsSkipComments,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ PartialStateSaving(
+ StateManager.PARTIAL_STATE_SAVING_PARAM_NAME,
+ true
+ ),
+ GenerateUniqueServerStateIds(
+ "com.sun.faces.generateUniqueServerStateIds",
+ true
+ ),
+ AutoCompleteOffOnViewState(
+ "com.sun.faces.autoCompleteOffOnViewState",
+ true
+ ),
+ EnableThreading(
+ "com.sun.faces.enableThreading",
+ false
+ ),
+ AllowTextChildren(
+ "com.sun.faces.allowTextChildren",
+ false
+ ),
+ CacheResourceModificationTimestamp(
+ "com.sun.faces.cacheResourceModificationTimestamp",
+ false
+ );
+
+ private BooleanWebContextInitParameter alternate;
+
+ private String qualifiedName;
+ private boolean defaultValue;
+ private boolean deprecated;
+ private DeprecationLoggingStrategy loggingStrategy;
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public boolean getDefaultValue() {
+
+ return defaultValue;
+
+ }
+
+
+ public String getQualifiedName() {
+
+ return qualifiedName;
+
+ }
+
+
+ DeprecationLoggingStrategy getDeprecationLoggingStrategy() {
+
+ return loggingStrategy;
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue) {
+
+ this(qualifiedName, defaultValue, false, null);
+
+ }
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue,
+ boolean deprecated,
+ BooleanWebContextInitParameter alternate) {
+
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
+
+ }
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue,
+ boolean deprecated,
+ BooleanWebContextInitParameter alternate,
+ DeprecationLoggingStrategy loggingStrategy) {
+
+ this(qualifiedName, defaultValue, deprecated, alternate);
+ this.loggingStrategy = loggingStrategy;
+
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ private BooleanWebContextInitParameter getAlternate() {
+
+ return alternate;
+
+ }
+
+
+ private boolean isDeprecated() {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all environment entries (specified in the
+ * web.xml) recognized by the implemenetation.</p>
+ */
+ public enum WebEnvironmentEntry {
+
+
+ ClientStateSavingPassword("ClientStateSavingPassword"),
+ ProjectStage(javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
+
+ private static final String JNDI_PREFIX = "java:comp/env/";
+ private String qualifiedName;
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String getQualifiedName() {
+
+ return qualifiedName;
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ WebEnvironmentEntry(String qualifiedName) {
+
+ if (qualifiedName.startsWith(JNDI_PREFIX)) {
+ this.qualifiedName = qualifiedName;
+ } else {
+ this.qualifiedName = JNDI_PREFIX + qualifiedName;
+ }
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all possible values for the <code>disableUnicodeEscaping</code>
+ * configuration parameter.</p>
+ */
+ public enum DisableUnicodeEscaping {
+ True("true"),
+ False("false"),
+ Auto("auto");
+
+ private final String value;
+
+ DisableUnicodeEscaping(String value) {
+ this.value = value;
+ }
+
+ public static DisableUnicodeEscaping getByValue(String value)
+ {
+ for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping.values()) {
+ if (disableUnicodeEscaping.value.equals(value)) {
+ return disableUnicodeEscaping;
+ }
+ }
+
+ return null;
+ }
+ }
+
+
+ // ----------------------------------------------------------- Inner Classes
+
+
+ private interface DeprecationLoggingStrategy {
+
+ boolean shouldBeLogged(WebConfiguration configuration);
+
+ }
+
+
+ private static class FaceletsConfigParamLoggingStrategy implements DeprecationLoggingStrategy {
+
+ public boolean shouldBeLogged(WebConfiguration configuration) {
+ return !configuration.isOptionEnabled(BooleanWebContextInitParameter.DisableFaceletJSFViewHandler);
+ }
+
+ } // END FaceletsConfigParamLoggingStrategy
+
+
+ private interface DeferredLoggingAction {
+
+ void log();
+
+ } // END DeferredLogginAction
+
+
+ private class DeferredParameterLoggingAction implements DeferredLoggingAction {
+
+ private WebContextInitParameter parameter;
+ private Level loggingLevel;
+ private String logKey;
+ private Object[] params;
+
+
+ DeferredParameterLoggingAction(WebContextInitParameter parameter,
+ Level loggingLevel,
+ String logKey,
+ Object[] params) {
+
+ this.parameter = parameter;
+ this.loggingLevel = loggingLevel;
+ this.logKey = logKey;
+ this.params = params;
+
+ }
+
+ public void log() {
+
+ if (WebConfiguration.LOGGER.isLoggable(loggingLevel)) {
+ DeprecationLoggingStrategy strategy = parameter.getDeprecationLoggingStrategy();
+ if (strategy != null && strategy.shouldBeLogged(WebConfiguration.this)) {
+ WebConfiguration.LOGGER.log(loggingLevel, logKey, params);
+ }
+ }
+
+ }
+
+ } // END DeferredParameterLogginAction
+
+
+ private class DeferredBooleanParameterLoggingAction implements DeferredLoggingAction {
+
+ private BooleanWebContextInitParameter parameter;
+ private Level loggingLevel;
+ private String logKey;
+ private Object[] params;
+
+ DeferredBooleanParameterLoggingAction(BooleanWebContextInitParameter parameter,
+ Level loggingLevel,
+ String logKey,
+ Object[] params) {
+ this.parameter = parameter;
+ this.loggingLevel = loggingLevel;
+ this.logKey = logKey;
+ this.params = params;
+ }
+
+ public void log() {
+
+ if (WebConfiguration.LOGGER.isLoggable(loggingLevel)) {
+ DeprecationLoggingStrategy strategy = parameter.getDeprecationLoggingStrategy();
+ if (strategy != null && strategy.shouldBeLogged(WebConfiguration.this)) {
+ WebConfiguration.LOGGER.log(loggingLevel, logKey, params);
+ }
+ }
+
+ }
+
+ } // END DeferredBooleanParameterLoggingAction
+
+} // END WebConfiguration
14 years, 2 months
JBoss Rich Faces SVN: r20017 - trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 12:10:46 -0500 (Wed, 10 Nov 2010)
New Revision: 20017
Modified:
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
Log:
Update of WebConfiguration for Mojarra 2.0.3
Modified: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 17:06:55 UTC (rev 20016)
+++ trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 17:10:46 UTC (rev 20017)
@@ -40,8 +40,9 @@
import java.util.EnumMap;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.List;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
@@ -59,1051 +60,1329 @@
import com.sun.faces.util.FacesLogger;
import com.sun.faces.util.Util;
+
/** Class Documentation */
-public class WebConfiguration
-{
+public class WebConfiguration {
- // Log instance for this class
- private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
- // A Simple regular expression of allowable boolean values
- private static final Pattern ALLOWABLE_BOOLEANS = Pattern
- .compile("true|false");
+ // Log instance for this class
+ private static final Logger LOGGER = FacesLogger.CONFIG.getLogger();
- // Key under which we store our WebConfiguration instance.
- private static final String WEB_CONFIG_KEY = "com.sun.faces.config.WebConfiguration";
+ // A Simple regular expression of allowable boolean values
+ private static final Pattern ALLOWABLE_BOOLEANS =
+ Pattern.compile("true|false");
- // Logging level. Defaults to FINE
- private Level loggingLevel = Level.FINE;
+ // Key under which we store our WebConfiguration instance.
+ private static final String WEB_CONFIG_KEY =
+ "com.sun.faces.config.WebConfiguration";
- private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters = new EnumMap<BooleanWebContextInitParameter, Boolean>(
- BooleanWebContextInitParameter.class);
+ // Logging level. Defaults to FINE
+ private Level loggingLevel = Level.FINE;
- private Map<WebContextInitParameter, String> contextParameters = new EnumMap<WebContextInitParameter, String>(
- WebContextInitParameter.class);
+ private Map<BooleanWebContextInitParameter, Boolean> booleanContextParameters =
+ new EnumMap<BooleanWebContextInitParameter, Boolean>(BooleanWebContextInitParameter.class);
- private Map<WebEnvironmentEntry, String> envEntries = new EnumMap<WebEnvironmentEntry, String>(
- WebEnvironmentEntry.class);
+ private Map<WebContextInitParameter, String> contextParameters =
+ new EnumMap<WebContextInitParameter, String>(WebContextInitParameter.class);
- private Map<WebContextInitParameter, String[]> cachedListParams;
+ private Map<WebEnvironmentEntry, String> envEntries =
+ new EnumMap<WebEnvironmentEntry, String>(WebEnvironmentEntry.class);
- private List<String> setParams = new ArrayList<String>();
+ private Map<WebContextInitParameter, String []> cachedListParams;
- private ServletContext servletContext;
+ private Set<String> setParams = new HashSet<String>();
- // ------------------------------------------------------------ Constructors
+ private ServletContext servletContext;
- private WebConfiguration(ServletContext servletContext)
- {
+ private ArrayList<DeferredLoggingAction> deferredLoggingActions;
- this.servletContext = servletContext;
- String contextName = getServletContextName();
+ // ------------------------------------------------------------ Constructors
- initSetList(servletContext);
- processBooleanParameters(servletContext, contextName);
- processInitParameters(servletContext, contextName);
- if (canProcessJndiEntries())
- {
- processJndiEntries(contextName);
- }
- // build the cache of list type params
- cachedListParams = new HashMap<WebContextInitParameter, String[]>(3);
- getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
- getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
- getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
+ private WebConfiguration(ServletContext servletContext) {
- }
+ this.servletContext = servletContext;
- // ---------------------------------------------------------- Public Methods
+ String contextName = getServletContextName();
- /**
- * Return the WebConfiguration instance for this application passing the
- * result of FacesContext.getCurrentInstance().getExternalContext() to
- * {@link #getInstance(javax.faces.context.ExternalContext)}.
- *
- * @return the WebConfiguration for this application or <code>null</code> if
- * no FacesContext is available.
- */
- public static WebConfiguration getInstance()
- {
+ initSetList(servletContext);
+ processBooleanParameters(servletContext, contextName);
+ processInitParameters(servletContext, contextName);
+ if (canProcessJndiEntries()) {
+ processJndiEntries(contextName);
+ }
+
+ // build the cache of list type params
+ cachedListParams = new HashMap<WebContextInitParameter, String []>(3);
+ getOptionValue(WebContextInitParameter.ResourceExcludes, " ");
+ getOptionValue(WebContextInitParameter.DefaultSuffix, " ");
+ getOptionValue(WebContextInitParameter.FaceletsViewMappings, ";");
- FacesContext facesContext = FacesContext.getCurrentInstance();
- return getInstance(facesContext.getExternalContext());
+ }
- }
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param extContext
- * the ExternalContext for this request
- * @return the WebConfiguration for this application
- */
- public static WebConfiguration getInstance(ExternalContext extContext)
- {
+ // ---------------------------------------------------------- Public Methods
- WebConfiguration config = (WebConfiguration) extContext
- .getApplicationMap().get(WEB_CONFIG_KEY);
- if (config == null)
- {
- return getInstance((ServletContext) extContext.getContext());
- }
- else
- {
- return config;
- }
- }
+ /**
+ * Return the WebConfiguration instance for this application passing
+ * the result of FacesContext.getCurrentInstance().getExternalContext()
+ * to {@link #getInstance(javax.faces.context.ExternalContext)}.
+ * @return the WebConfiguration for this application or <code>null</code>
+ * if no FacesContext is available.
+ */
+ public static WebConfiguration getInstance() {
- /**
- * Return the WebConfiguration instance for this application.
- *
- * @param servletContext
- * the ServletContext
- * @return the WebConfiguration for this application or <code>null</code> if
- * no WebConfiguration could be located
- */
- public static WebConfiguration getInstance(ServletContext servletContext)
- {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ return getInstance(facesContext.getExternalContext());
- WebConfiguration webConfig = (WebConfiguration) servletContext
- .getAttribute(WEB_CONFIG_KEY);
+ }
- if (webConfig == null)
- {
- webConfig = new WebConfiguration(servletContext);
- servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
- }
- return webConfig;
- }
+ /**
+ * Return the WebConfiguration instance for this application.
+ * @param extContext the ExternalContext for this request
+ * @return the WebConfiguration for this application
+ */
+ public static WebConfiguration getInstance(ExternalContext extContext) {
- /**
- * @return The <code>ServletContext</code> originally used to construct this
- * WebConfiguration instance
- */
- public ServletContext getServletContext()
- {
+ WebConfiguration config = (WebConfiguration) extContext.getApplicationMap()
+ .get(WEB_CONFIG_KEY);
+ if (config == null) {
+ return getInstance((ServletContext) extContext.getContext());
+ } else {
+ return config;
+ }
- return servletContext;
+ }
- }
- /**
- * Obtain the value of the specified boolean parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified boolean parameter
- */
- public boolean isOptionEnabled(BooleanWebContextInitParameter param)
- {
+ /**
+ * Return the WebConfiguration instance for this application.
+ * @param servletContext the ServletContext
+ * @return the WebConfiguration for this application or <code>null</code>
+ * if no WebConfiguration could be located
+ */
+ public static WebConfiguration getInstance(ServletContext servletContext) {
- if (booleanContextParameters.get(param) != null)
- {
- return booleanContextParameters.get(param);
- }
- else
- {
- return param.getDefaultValue();
- }
+ WebConfiguration webConfig = (WebConfiguration)
+ servletContext.getAttribute(WEB_CONFIG_KEY);
- }
+ if (webConfig == null) {
+ webConfig = new WebConfiguration(servletContext);
+ servletContext.setAttribute(WEB_CONFIG_KEY, webConfig);
+ }
+ return webConfig;
- /**
- * Obtain the value of the specified parameter
- *
- * @param param
- * the parameter of interest
- * @return the value of the specified parameter
- */
- public String getOptionValue(WebContextInitParameter param)
- {
- String result = contextParameters.get(param);
+ }
- if (null == result)
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (null != alternate)
- {
- result = contextParameters.get(alternate);
- }
- }
- return result;
+ /**
+ * @return The <code>ServletContext</code> originally used to construct
+ * this WebConfiguration instance
+ */
+ public ServletContext getServletContext() {
- }
+ return servletContext;
- public String[] getOptionValue(WebContextInitParameter param, String sep)
- {
- String[] result;
+ }
- assert (null != cachedListParams);
- if (null == (result = cachedListParams.get(param)))
- {
- String value = getOptionValue(param);
- if (null == value)
- {
- result = new String[0];
- }
- else
- {
- result = Util.split(value, sep);
- }
- cachedListParams.put(param, result);
- }
- return result;
- }
+ /**
+ * Obtain the value of the specified boolean parameter
+ * @param param the parameter of interest
+ * @return the value of the specified boolean parameter
+ */
+ public boolean isOptionEnabled(BooleanWebContextInitParameter param) {
- /**
- * Obtain the value of the specified env-entry
- *
- * @param entry
- * the env-entry of interest
- * @return the value of the specified env-entry
- */
- public String getEnvironmentEntry(WebEnvironmentEntry entry)
- {
+ if (booleanContextParameters.get(param) != null) {
+ return booleanContextParameters.get(param);
+ } else {
+ return param.getDefaultValue();
+ }
- return envEntries.get(entry);
+ }
- }
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(WebContextInitParameter param)
- {
+ /**
+ * Obtain the value of the specified parameter
+ * @param param the parameter of interest
+ * @return the value of the specified parameter
+ */
+ public String getOptionValue(WebContextInitParameter param) {
+ String result = contextParameters.get(param);
+
+ if (null == result) {
+ WebContextInitParameter alternate = param.getAlternate();
+ if (null != alternate) {
+ result = contextParameters.get(alternate);
+ }
+ }
- return isSet(param.getQualifiedName());
+ return result;
- }
+ }
+
+ public String[] getOptionValue(WebContextInitParameter param, String sep) {
+ String [] result;
+
+ assert(null != cachedListParams);
+ if (null == (result = cachedListParams.get(param))) {
+ String value = getOptionValue(param);
+ if (null == value) {
+ result = new String[0];
+ } else {
+ result = Util.split(value, sep);
+ }
+ cachedListParams.put(param, result);
+ }
+
+ return result;
+ }
- /**
- * @param param
- * the init parameter of interest
- * @return <code>true</code> if the parameter was explicitly set, otherwise,
- * <code>false</code>
- */
- public boolean isSet(BooleanWebContextInitParameter param)
- {
- return isSet(param.getQualifiedName());
+ /**
+ * Obtain the value of the specified env-entry
+ * @param entry the env-entry of interest
+ * @return the value of the specified env-entry
+ */
+ public String getEnvironmentEntry(WebEnvironmentEntry entry) {
- }
+ return envEntries.get(entry);
- /**
- * @return the name of this application
- */
- public String getServletContextName()
- {
+ }
- if (servletContext.getMajorVersion() == 2
- && servletContext.getMinorVersion() <= 4)
- {
- return servletContext.getServletContextName();
- }
- else
- {
- return servletContext.getContextPath();
- }
- }
+ /**
+ * @param param the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set,
+ * otherwise, <code>false</code>
+ */
+ public boolean isSet(WebContextInitParameter param) {
- public void overrideContextInitParameter(
- BooleanWebContextInitParameter param, boolean value)
- {
+ return isSet(param.getQualifiedName());
- if (param == null) { return; }
- boolean oldVal = booleanContextParameters.put(param, value);
- if (LOGGER.isLoggable(Level.FINE) && oldVal != value)
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
+ }
- }
- public void overrideContextInitParameter(WebContextInitParameter param,
- String value)
- {
+ /**
+ * @param param the init parameter of interest
+ * @return <code>true</code> if the parameter was explicitly set,
+ * otherwise, <code>false</code>
+ */
+ public boolean isSet(BooleanWebContextInitParameter param) {
- if (param == null || value == null || value.length() == 0) { return; }
- value = value.trim();
- String oldVal = contextParameters.put(param, value);
- cachedListParams.remove(param);
- if (oldVal != null)
- {
- if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value)))
- {
- LOGGER
- .log(
- Level.FINE,
- "Overriding init parameter {0}. Changing from {1} to {2}.",
- new Object[]
- {
- param.getQualifiedName(), oldVal, value
- });
- }
- }
+ return isSet(param.getQualifiedName());
- }
+ }
- // ------------------------------------------------- Package Private Methods
- static void clear(ServletContext servletContext)
- {
+ /**
+ * @return the name of this application
+ */
+ public String getServletContextName() {
- servletContext.removeAttribute(WEB_CONFIG_KEY);
+ if (servletContext.getMajorVersion() == 2
+ && servletContext.getMinorVersion() <= 4) {
+ return servletContext.getServletContextName();
+ } else {
+ return servletContext.getContextPath();
+ }
- }
+ }
- // --------------------------------------------------------- Private Methods
- /**
- * <p>
- * Is the configured value valid against the default boolean pattern.
- * </p>
- *
- * @param param
- * the boolean parameter
- * @param value
- * the configured value
- * @return <code>true</code> if the value is valid, otherwise
- * <code>false</code>
- */
- private boolean isValueValid(BooleanWebContextInitParameter param,
- String value)
- {
+ public void overrideContextInitParameter(BooleanWebContextInitParameter param, boolean value) {
- if (!ALLOWABLE_BOOLEANS.matcher(value).matches())
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.boolconfig.invalidvalue",
- new Object[]
- {
- value, param.getQualifiedName(), "true|false"
- });
- }
- return false;
- }
+ if (param == null) {
+ return;
+ }
+ boolean oldVal = booleanContextParameters.put(param, value);
+ if (LOGGER.isLoggable(Level.FINE) && oldVal != value) {
+ LOGGER.log(Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[] { param.getQualifiedName(), oldVal, value});
+ }
- return true;
+ }
- }
- /**
- * <p>
- * Process all boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processBooleanParameters(ServletContext servletContext,
- String contextName)
- {
+ public void overrideContextInitParameter(WebContextInitParameter param, String value) {
- // process boolean contxt parameters
- for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
- .values())
- {
- String strValue = servletContext.getInitParameter(param
- .getQualifiedName());
- boolean value;
+ if (param == null || value == null || value.length() == 0) {
+ return;
+ }
+ value = value.trim();
+ String oldVal = contextParameters.put(param, value);
+ cachedListParams.remove(param);
+ if (oldVal != null) {
+ if (LOGGER.isLoggable(Level.FINE) && !(oldVal.equals(value))) {
+ LOGGER.log(Level.FINE,
+ "Overriding init parameter {0}. Changing from {1} to {2}.",
+ new Object[]{param.getQualifiedName(),
+ oldVal,
+ value});
+ }
+ }
- if (strValue != null && strValue.length() > 0
- && param.isDeprecated())
- {
- BooleanWebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
- if (alternate != null)
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
+ }
- if (LOGGER.isLoggable(Level.INFO) && alternate != null)
- {
- LOGGER
- .log(
- Level.INFO,
- ((value) ? "jsf.config.webconfig.configinfo.reset.enabled"
- : "jsf.config.webconfig.configinfo.reset.disabled"),
- new Object[]
- {
- contextName,
- alternate.getQualifiedName()
- });
- }
- booleanContextParameters.put(alternate, value);
- }
- continue;
- }
+ public void doLoggingActions() {
- if (!param.isDeprecated())
- {
- if (strValue == null)
- {
- value = param.getDefaultValue();
- }
- else
- {
- if (isValueValid(param, strValue))
- {
- value = Boolean.valueOf(strValue);
- }
- else
- {
- value = param.getDefaultValue();
- }
- }
+ if (deferredLoggingActions != null) {
+ for (DeferredLoggingAction loggingAction : deferredLoggingActions) {
+ loggingAction.log();
+ }
+ }
- // first param processed should be
- // com.sun.faces.displayConfiguration
- if (BooleanWebContextInitParameter.DisplayConfiguration
- .equals(param)
- && value)
- {
- loggingLevel = Level.INFO;
- }
+ }
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- ((value) ? "jsf.config.webconfig.boolconfiginfo.enabled"
- : "jsf.config.webconfig.boolconfiginfo.disabled"),
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- booleanContextParameters.put(param, value);
- }
+ // ------------------------------------------------- Package Private Methods
- }
- }
+ static void clear(ServletContext servletContext) {
- /**
- * Adds all com.sun.faces init parameter names to a list. This allows
- * callers to determine if a parameter was explicitly set.
- *
- * @param servletContext
- * the ServletContext of interest
- */
- private void initSetList(ServletContext servletContext)
- {
+ servletContext.removeAttribute(WEB_CONFIG_KEY);
- for (Enumeration e = servletContext.getInitParameterNames(); e
- .hasMoreElements();)
- {
- String name = e.nextElement().toString();
- if (name.startsWith("com.sun.faces"))
- {
- setParams.add(name);
- }
- }
+ }
- }
- /**
- * @param name
- * the param name
- * @return <code>true</code> if the name was explicitly specified
- */
- private boolean isSet(String name)
- {
+ // --------------------------------------------------------- Private Methods
- return setParams.contains(name);
- }
+ /**
+ * <p>Is the configured value valid against the default boolean pattern.</p>
+ * @param param the boolean parameter
+ * @param value the configured value
+ * @return <code>true</code> if the value is valid,
+ * otherwise <code>false</code>
+ */
+ private boolean isValueValid(BooleanWebContextInitParameter param,
+ String value) {
- /**
- * <p>
- * Process all non-boolean context initialization parameters.
- * </p>
- *
- * @param servletContext
- * the ServletContext of interest
- * @param contextName
- * the context name
- */
- private void processInitParameters(ServletContext servletContext,
- String contextName)
- {
+ if (!ALLOWABLE_BOOLEANS.matcher(value).matches()) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ LOGGER.log(Level.WARNING,
+ "jsf.config.webconfig.boolconfig.invalidvalue",
+ new Object[]{
+ value,
+ param.getQualifiedName(),
+ "true|false"
+ });
+ }
+ return false;
+ }
- for (WebContextInitParameter param : WebContextInitParameter.values())
- {
- String value = servletContext.getInitParameter(param
- .getQualifiedName());
+ return true;
- if (value != null && value.length() > 0 && param.isDeprecated())
- {
- WebContextInitParameter alternate = param.getAlternate();
- if (LOGGER.isLoggable(Level.WARNING))
- {
- if (alternate != null)
- {
- LOGGER.log(Level.WARNING,
- "jsf.config.webconfig.param.deprecated",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- alternate.getQualifiedName()
- });
- }
- else
- {
- LOGGER
- .log(
- Level.WARNING,
- "jsf.config.webconfig.param.deprecated.no_replacement",
- new Object[]
- {
- contextName,
- param.getQualifiedName()
- });
- }
- }
+ }
- if (alternate != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- LOGGER.log(Level.INFO,
- "jsf.config.webconfig.configinfo.reset",
- new Object[]
- {
- contextName,
- alternate.getQualifiedName(), value
- });
- }
- contextParameters.put(alternate, value);
- }
- continue;
- }
+ /**
+ * <p>Process all boolean context initialization parameters.</p>
+ * @param servletContext the ServletContext of interest
+ * @param contextName the context name
+ */
+ private void processBooleanParameters(ServletContext servletContext,
+ String contextName) {
- if ((value == null || value.length() == 0) && !param.isDeprecated())
- {
- value = param.getDefaultValue();
- }
- if (value == null || value.length() == 0)
- {
- continue;
- }
+ // process boolean contxt parameters
+ for (BooleanWebContextInitParameter param : BooleanWebContextInitParameter
+ .values()) {
+ String strValue =
+ servletContext.getInitParameter(param.getQualifiedName());
+ boolean value;
- if (value.length() > 0)
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel, "jsf.config.webconfig.configinfo",
- new Object[]
- {
- contextName, param.getQualifiedName(),
- value
- });
+ if (strValue != null && strValue.length() > 0 && param.isDeprecated()) {
+ BooleanWebContextInitParameter alternate = param.getAlternate();
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ if (alternate != null) {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]{
+ contextName,
+ param.getQualifiedName(),
+ alternate.getQualifiedName()}));
- }
- contextParameters.put(param, value);
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.option.notconfigured",
- new Object[]
- {
- contextName, param.getQualifiedName()
- });
- }
- }
+ } else {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]{
+ contextName,
+ param.getQualifiedName()}));
- }
+ }
+ }
- }
+ if (alternate != null) {
+ if (isValueValid(param, strValue)) {
+ value = Boolean.valueOf(strValue);
+ } else {
+ value = param.getDefaultValue();
+ }
- /**
- * <p>
- * Process all JNDI entries.
- * </p>
- *
- * @param contextName
- * the context name
- */
- private void processJndiEntries(String contextName)
- {
-/*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
- Context initialContext = null;
- try
- {
- initialContext = new InitialContext();
- }
- catch (NamingException ne)
- {
- if (LOGGER.isLoggable(Level.WARNING))
- {
- LOGGER.log(Level.WARNING, ne.toString(), ne);
- }
- }
+ if (LOGGER.isLoggable(Level.INFO) && alternate != null) {
+ queueLoggingAction(new DeferredBooleanParameterLoggingAction(
+ param,
+ Level.INFO,
+ ((value)
+ ? "jsf.config.webconfig.configinfo.reset.enabled"
+ : "jsf.config.webconfig.configinfo.reset.disabled"),
+ new Object[]{
+ contextName,
+ alternate.getQualifiedName()}));
+ }
- if (initialContext != null)
- {
- // process environment entries
- for (WebEnvironmentEntry entry : WebEnvironmentEntry.values())
- {
- String entryName = entry.getQualifiedName();
- String value = null;
+ booleanContextParameters.put(alternate, value);
+ }
+ continue;
+ }
- try
- {
- value = (String) initialContext.lookup(entryName);
- }
- catch (NamingException root)
- {
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER.fine(root.toString());
- }
- }
+ if (!param.isDeprecated()) {
+ if (strValue == null) {
+ value = param.getDefaultValue();
+ } else {
+ if (isValueValid(param, strValue)) {
+ value = Boolean.valueOf(strValue);
+ } else {
+ value = param.getDefaultValue();
+ }
+ }
- if (value != null)
- {
- if (LOGGER.isLoggable(Level.INFO))
- {
- // special logic for ClientStateSavingPassword
- if (!entry
- .equals(WebEnvironmentEntry.ClientStateSavingPassword))
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER.log(loggingLevel,
- "jsf.config.webconfig.enventryinfo",
- new Object[]
- {
- contextName, entryName, value
- });
- }
- }
- else
- {
- if (LOGGER.isLoggable(loggingLevel))
- {
- LOGGER
- .log(
- loggingLevel,
- "jsf.config.webconfig.enventry.clientencrypt",
- contextName);
- }
- }
- }
- envEntries.put(entry, value);
- }
- }
- }
-*/
- }
+ // first param processed should be
+ // com.sun.faces.displayConfiguration
+ if (BooleanWebContextInitParameter.DisplayConfiguration.equals(param) && value) {
+ loggingLevel = Level.INFO;
+ }
- private boolean canProcessJndiEntries()
- {
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ ((value)
+ ? "jsf.config.webconfig.boolconfiginfo.enabled"
+ : "jsf.config.webconfig.boolconfiginfo.disabled"),
+ new Object[]{contextName,
+ param.getQualifiedName()});
+ }
- /*
- * This section has been disabled due to incompatibilities with Google App Engine 1.2.6
- try
- {
- Util.getCurrentLoader(this)
- .loadClass("javax.naming.InitialContext");
- }
- catch (Exception e)
- {
- */
- if (LOGGER.isLoggable(Level.FINE))
- {
- LOGGER
- .fine("javax.naming is forced unavailable. JNDI entries related to Mojarra configuration will not be processed.");
- }
- return false;
- /*
- }
- return true;
- */
+ booleanContextParameters.put(param, value);
+ }
- }
+ }
- // ------------------------------------------------------------------- Enums
+ }
- /**
- * <p>
- * An <code>enum</code> of all non-boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum WebContextInitParameter
- {
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
+ /**
+ * Adds all com.sun.faces init parameter names to a list. This allows
+ * callers to determine if a parameter was explicitly set.
+ * @param servletContext the ServletContext of interest
+ */
+ private void initSetList(ServletContext servletContext) {
- ManagedBeanFactoryDecorator(
- "com.sun.faces.managedBeanFactoryDecoratorClass", ""), StateSavingMethod(
- "javax.faces.STATE_SAVING_METHOD", "server"), FaceletsSuffix(
- ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_FACELETS_SUFFIX), DefaultSuffix(
- ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
- ViewHandler.DEFAULT_SUFFIX), JavaxFacesConfigFiles(
- "javax.faces.CONFIG_FILES", ""), JavaxFacesProjectStage(
- "javax.faces.PROJECT_STAGE", "Production"), AlternateLifecycleId(
- "javax.faces.LIFECYCLE_ID", ""), ResourceExcludes(
- ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
- ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"), NumberOfViews(
- "com.sun.faces.numberOfViewsInSession", "15"), NumberOfViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION", "15", true,
- NumberOfViews), NumberOfLogicalViews(
- "com.sun.faces.numberOfLogicalViews", "15"), NumberOfLogicalViewsDeprecated(
- "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
- "15", true, NumberOfLogicalViews), NumberOfConcurrentFlashUsers(
- "com.sun.faces.numberOfConcerrentFlashUsers", "5000"), NumberOfFlashesBetweenFlashReapings(
- "com.sun.faces.numberOfFlashesBetweenFlashReapings", "5000"), InjectionProviderClass(
- "com.sun.faces.injectionProvider", ""), SerializationProviderClass(
- "com.sun.faces.serializationProvider", ""), ResponseBufferSize(
- "com.sun.faces.responseBufferSize", "1024"), FaceletsBufferSize(
- "javax.faces.FACELETS_BUFFER_SIZE", "1024", true,
- ResponseBufferSize), FaceletsBufferSizeDeprecated(
- "facelets.BUFFER_SIZE", "1024", true, FaceletsBufferSize), ClientStateWriteBufferSize(
- "com.sun.faces.clientStateWriteBufferSize", "8192"), ResourceBufferSize(
- "com.sun.faces.resourceBufferSize", "2048"), ExpressionFactory(
- "com.sun.faces.expressionFactory",
- "com.sun.el.ExpressionFactoryImpl"), ClientStateTimeout(
- "com.sun.faces.clientStateTimeout", ""), DefaultResourceMaxAge(
- "com.sun.faces.defaultResourceMaxAge", "604800"), ResourceUpdateCheckPeriod(
- "com.sun.faces.resourceUpdateCheckPeriod", "5" // in minutes
- ), CompressableMimeTypes("com.sun.faces.compressableMimeTypes", ""), DisableUnicodeEscaping(
- "com.sun.faces.disableUnicodeEscaping", "auto"), FaceletsDefaultRefreshPeriod(
- "javax.faces.FACELETS_REFRESH_PERIOD", "2"), FaceletsDefaultRefreshPeriodDeprecated(
- "facelets.REFRESH_PERIOD", "2", true,
- FaceletsDefaultRefreshPeriod), FaceletsResourceResolver(
- ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME, ""), FaceletsResourceResolverDeprecated(
- "facelets.RESOURCE_RESOLVER", "", true,
- FaceletsResourceResolver), FaceletsViewMappings(
- ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME, ""), FaceletsViewMappingsDeprecated(
- "facelets.VIEW_MAPPINGS", "", true, FaceletsViewMappings), FaceletsLibraries(
- "javax.faces.FACELETS_LIBRARIES", ""), FaceletsLibrariesDeprecated(
- "facelets.LIBRARIES", "", true, FaceletsLibraries), FaceletsDecorators(
- "javax.faces.FACELETS_DECORATORS", ""), FaceletsDecoratorsDeprecated(
- "facelets.DECORATORS", "", true, FaceletsDecorators), DuplicateJARPattern(
- "com.sun.faces.duplicateJARPattern", ""), ValidateEmptyFields(
- UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME, "auto"), FullStateSavingViewIds(
- StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME, ""), AnnotationScanPackages(
- "com.sun.faces.annotationScanPackages", ""), FaceletFactory(
- "com.sun.faces.faceletFactory", "");
+ for (Enumeration e = servletContext.getInitParameterNames();
+ e.hasMoreElements(); ) {
+ String name = e.nextElement().toString();
+ if (name.startsWith("com.sun.faces") ||
+ name.startsWith("javax.faces")) {
+ setParams.add(name);
+ }
+ }
- private String defaultValue;
- private String qualifiedName;
- private WebContextInitParameter alternate;
- private boolean deprecated;
+ }
- // ---------------------------------------------------------- Public
- // Methods
- public String getDefaultValue()
- {
+ /**
+ * @param name the param name
+ * @return <code>true</code> if the name was explicitly specified
+ */
+ private boolean isSet(String name) {
- return defaultValue;
+ return setParams.contains(name);
- }
+ }
- public String getQualifiedName()
- {
- return qualifiedName;
+ /**
+ * <p>Process all non-boolean context initialization parameters.</p>
+ * @param servletContext the ServletContext of interest
+ * @param contextName the context name
+ */
+ private void processInitParameters(ServletContext servletContext,
+ String contextName) {
- }
+ for (WebContextInitParameter param : WebContextInitParameter.values()) {
+ String value =
+ servletContext.getInitParameter(param.getQualifiedName());
- // ------------------------------------------------- Package Private
- // Methods
+ if (value != null && value.length() > 0 && param.isDeprecated()) {
+ WebContextInitParameter alternate = param.getAlternate();
+ DeprecationLoggingStrategy strategy = param.getDeprecationLoggingStrategy();
+ if (strategy == null || strategy.shouldBeLogged(this)) {
+ if (LOGGER.isLoggable(Level.WARNING)) {
+ if (alternate != null) {
+ queueLoggingAction(new DeferredParameterLoggingAction(param, Level.WARNING,
+ "jsf.config.webconfig.param.deprecated",
+ new Object[]{
+ contextName,
+ param.getQualifiedName(),
+ alternate.getQualifiedName()}));
- WebContextInitParameter(String qualifiedName, String defaultValue)
- {
+ } else {
+ queueLoggingAction(new DeferredParameterLoggingAction(
+ param,
+ Level.WARNING,
+ "jsf.config.webconfig.param.deprecated.no_replacement",
+ new Object[]{
+ contextName,
+ param.getQualifiedName()}));
+ }
+ }
+ }
- this(qualifiedName, defaultValue, false, null);
+ if (alternate != null) {
+ queueLoggingAction(
+ new DeferredParameterLoggingAction(param,
+ Level.INFO,
+ "jsf.config.webconfig.configinfo.reset",
+ new Object[]{
+ contextName,
+ alternate.getQualifiedName(),
+ value}));
- }
+ contextParameters.put(alternate, value);
+ }
+ continue;
+ }
- WebContextInitParameter(String qualifiedName, String defaultValue,
- boolean deprecated, WebContextInitParameter alternate)
- {
+ if ((value == null || value.length() == 0) && !param.isDeprecated()) {
+ value = param.getDefaultValue();
+ }
+ if (value == null || value.length() == 0) {
+ continue;
+ }
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
+ if (value.length() > 0) {
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.configinfo",
+ new Object[]{contextName,
+ param.getQualifiedName(),
+ value});
- }
+ }
+ contextParameters.put(param, value);
+ } else {
+ if (LOGGER.isLoggable(loggingLevel)) {
+ LOGGER.log(loggingLevel,
+ "jsf.config.webconfig.option.notconfigured",
+ new Object[]{contextName,
+ param.getQualifiedName()});
+ }
+ }
- // --------------------------------------------------------- Private
- // Methods
+ }
- private WebContextInitParameter getAlternate()
- {
+ }
- return alternate;
- }
+ /**
+ * <p>Process all JNDI entries.</p>
+ * @param contextName the context name
+ */
+ //This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
+ private void processJndiEntries(String contextName) {
+//
+// Context initialContext = null;
+// try {
+// initialContext = new InitialContext();
+// } catch (NamingException ne) {
+// if (LOGGER.isLoggable(Level.WARNING)) {
+// LOGGER.log(Level.WARNING, ne.toString(), ne);
+// }
+// }
+//
+// if (initialContext != null) {
+// // process environment entries
+// for (WebEnvironmentEntry entry : WebEnvironmentEntry.values()) {
+// String entryName = entry.getQualifiedName();
+// String value = null;
+//
+// try {
+// value = (String) initialContext.lookup(entryName);
+// } catch (NamingException root) {
+// if (LOGGER.isLoggable(Level.FINE)) {
+// LOGGER.fine(root.toString());
+// }
+// }
+//
+// if (value != null) {
+// if (LOGGER.isLoggable(Level.INFO)) {
+// // special logic for ClientStateSavingPassword
+// if (!entry
+// .equals(WebEnvironmentEntry.ClientStateSavingPassword)) {
+// if (LOGGER
+// .isLoggable(loggingLevel)) {
+// LOGGER.log(loggingLevel,
+// "jsf.config.webconfig.enventryinfo",
+// new Object[]{contextName,
+// entryName,
+// value});
+// }
+// } else {
+// if (LOGGER
+// .isLoggable(loggingLevel)) {
+// LOGGER.log(loggingLevel,
+// "jsf.config.webconfig.enventry.clientencrypt",
+// contextName);
+// }
+// }
+// }
+// envEntries.put(entry, value);
+// }
+// }
+// }
- private boolean isDeprecated()
- {
+ }
- return deprecated;
- }
+ //This section has been disabled due to incompatibilities with Google App Engine 1.2.6.
+ private boolean canProcessJndiEntries() {
+//
+// try {
+// Util.getCurrentLoader(this).loadClass("javax.naming.InitialContext");
+// } catch (Exception e) {
+// if (LOGGER.isLoggable(Level.FINE)) {
+// LOGGER.fine(
+// "javax.naming is unavailable. JNDI entries related to Mojarra configuration will not be processed.");
+// }
+// return false;
+// }
+// return true;
+ return false;
+ }
- }
- /**
- * <p>
- * An <code>enum</code> of all boolean context initalization parameters
- * recognized by the implementation.
- * </p>
- */
- public enum BooleanWebContextInitParameter
- {
+ private void queueLoggingAction(DeferredLoggingAction loggingAction) {
- // implementation note:
- // if a parameter is to be deprecated,
- // then the <name>Deprecated enum element
- // *must* appear after the one that is taking
- // its place. The reporting logic depends on this
+ if (deferredLoggingActions == null) {
+ deferredLoggingActions = new ArrayList<DeferredLoggingAction>();
+ }
+ deferredLoggingActions.add(loggingAction);
- DisplayConfiguration("com.sun.faces.displayConfiguration", false), ValidateFacesConfigFiles(
- "com.sun.faces.validateXml", false), VerifyFacesConfigObjects(
- "com.sun.faces.verifyObjects", false), ForceLoadFacesConfigFiles(
- "com.sun.faces.forceLoadConfiguration", false), DisableArtifactVersioning(
- "com.sun.faces.disableVersionTracking", false, true, null), EnableHtmlTagLibraryValidator(
- "com.sun.faces.enableHtmlTagLibValidator", false), EnableCoreTagLibraryValidator(
- "com.sun.faces.enableCoreTagLibValidator", false), PreferXHTMLContentType(
- "com.sun.faces.preferXHTML", false), PreferXHTMLContextTypeDeprecated(
- "com.sun.faces.PreferXHTML", false, true,
- PreferXHTMLContentType), CompressViewState(
- "com.sun.faces.compressViewState", true), CompressViewStateDeprecated(
- "com.sun.faces.COMPRESS_STATE", true, true, CompressViewState), CompressJavaScript(
- "com.sun.faces.compressJavaScript", true), ExternalizeJavaScriptDeprecated(
- "com.sun.faces.externalizeJavaScript", true, true, null), SendPoweredByHeader(
- "com.sun.faces.sendPoweredByHeader", true), EnableJSStyleHiding(
- "com.sun.faces.enableJSStyleHiding", false), EnableScriptInAttributeValue(
- "com.sun.faces.enableScriptsInAttributeValues", true), WriteStateAtFormEnd(
- "com.sun.faces.writeStateAtFormEnd", true), EnableLazyBeanValidation(
- "com.sun.faces.enableLazyBeanValidation", true), EnableLoadBundle11Compatibility(
- "com.sun.faces.enabledLoadBundle11Compatibility", false), EnableRestoreView11Compatibility(
- "com.sun.faces.enableRestoreView11Compatibility", false), SerializeServerState(
- "com.sun.faces.serializeServerState", false), EnableViewStateIdRendering(
- "com.sun.faces.enableViewStateIdRendering", true), RegisterConverterPropertyEditors(
- "com.sun.faces.registerConverterPropertyEditors", false), EnableGroovyScripting(
- "com.sun.faces.enableGroovyScripting", false), DisableFaceletJSFViewHandler(
- "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER", false), DisableDefaultBeanValidator(
- BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME, false), DateTimeConverterUsesSystemTimezone(
- "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
- false), FaceletsSkipComments(
- "javax.faces.FACELETS_SKIP_COMMENTS", false), FaceletsSkipCommentsDeprecated(
- "facelets.SKIP_COMMENTS", false, true, FaceletsSkipComments), PartialStateSaving(
- StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, true), GenerateUniqueServerStateIds(
- "com.sun.faces.generateUniqueServerStateIds", true), AutoCompleteOffOnViewState(
- "com.sun.faces.autoCompleteOffOnViewState", true), EnableThreading(
- "com.sun.faces.enableThreading", false), AllowTextChildren(
- "com.sun.faces.allowTextChildren", false);
+ }
- private BooleanWebContextInitParameter alternate;
- private String qualifiedName;
- private boolean defaultValue;
- private boolean deprecated;
+ // ------------------------------------------------------------------- Enums
- // ---------------------------------------------------------- Public
- // Methods
- public boolean getDefaultValue()
- {
+ /**
+ * <p>An <code>enum</code> of all non-boolean context initalization parameters
+ * recognized by the implementation.</p>
+ */
+ public enum WebContextInitParameter {
- return defaultValue;
- }
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
- public String getQualifiedName()
- {
+ ManagedBeanFactoryDecorator(
+ "com.sun.faces.managedBeanFactoryDecoratorClass",
+ ""
+ ),
+ StateSavingMethod(
+ "javax.faces.STATE_SAVING_METHOD",
+ "server"
+ ),
+ FaceletsSuffix(
+ ViewHandler.FACELETS_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_FACELETS_SUFFIX
+ ),
+ DefaultSuffix(
+ ViewHandler.DEFAULT_SUFFIX_PARAM_NAME,
+ ViewHandler.DEFAULT_SUFFIX
+ ),
+ JavaxFacesConfigFiles(
+ "javax.faces.CONFIG_FILES",
+ ""
+ ),
+ JavaxFacesProjectStage(
+ "javax.faces.PROJECT_STAGE",
+ "Production"
+ ),
+ AlternateLifecycleId(
+ "javax.faces.LIFECYCLE_ID",
+ ""
+ ),
+ ResourceExcludes(
+ ResourceHandler.RESOURCE_EXCLUDES_PARAM_NAME,
+ ResourceHandler.RESOURCE_EXCLUDES_DEFAULT_VALUE + " .groovy"
+ ),
+ NumberOfViews(
+ "com.sun.faces.numberOfViewsInSession",
+ "15"
+ ),
+ NumberOfViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION",
+ "15",
+ true,
+ NumberOfViews
+ ),
+ NumberOfLogicalViews(
+ "com.sun.faces.numberOfLogicalViews",
+ "15"
+ ),
+ NumberOfLogicalViewsDeprecated(
+ "com.sun.faces.NUMBER_OF_VIEWS_IN_LOGICAL_VIEW_IN_SESSION",
+ "15",
+ true,
+ NumberOfLogicalViews
+ ),
+ NumberOfConcurrentFlashUsers(
+ "com.sun.faces.numberOfConcerrentFlashUsers",
+ "5000"
+ ),
+ NumberOfFlashesBetweenFlashReapings(
+ "com.sun.faces.numberOfFlashesBetweenFlashReapings",
+ "5000"
+ ),
+ InjectionProviderClass(
+ "com.sun.faces.injectionProvider",
+ ""
+ ),
+ SerializationProviderClass(
+ "com.sun.faces.serializationProvider",
+ ""
+ ),
+ ResponseBufferSize(
+ "com.sun.faces.responseBufferSize",
+ "1024"
+ ),
+ FaceletsBufferSize(
+ "javax.faces.FACELETS_BUFFER_SIZE",
+ "1024"
+ ),
+ FaceletsBufferSizeDeprecated(
+ "facelets.BUFFER_SIZE",
+ "1024",
+ true,
+ FaceletsBufferSize,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ ClientStateWriteBufferSize(
+ "com.sun.faces.clientStateWriteBufferSize",
+ "8192"
+ ),
+ ResourceBufferSize(
+ "com.sun.faces.resourceBufferSize",
+ "2048"
+ ),
+ ExpressionFactory(
+ "com.sun.faces.expressionFactory",
+ "com.sun.el.ExpressionFactoryImpl"
+ ),
+ ClientStateTimeout(
+ "com.sun.faces.clientStateTimeout",
+ ""
+ ),
+ DefaultResourceMaxAge(
+ "com.sun.faces.defaultResourceMaxAge",
+ "604800000" // 7 days
+ ),
+ ResourceUpdateCheckPeriod(
+ "com.sun.faces.resourceUpdateCheckPeriod",
+ "5" // in minutes
+ ),
+ CompressableMimeTypes(
+ "com.sun.faces.compressableMimeTypes",
+ ""
+ ),
+ DisableUnicodeEscaping(
+ "com.sun.faces.disableUnicodeEscaping",
+ "auto"
+ ),
+ FaceletsDefaultRefreshPeriod(
+ "javax.faces.FACELETS_REFRESH_PERIOD",
+ "2"
+ ),
+ FaceletsDefaultRefreshPeriodDeprecated(
+ "facelets.REFRESH_PERIOD",
+ "2",
+ true,
+ FaceletsDefaultRefreshPeriod,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsResourceResolver(
+ ResourceResolver.FACELETS_RESOURCE_RESOLVER_PARAM_NAME,
+ ""
+ ),
+ FaceletsResourceResolverDeprecated(
+ "facelets.RESOURCE_RESOLVER",
+ "",
+ true,
+ FaceletsResourceResolver,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsViewMappings(
+ ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME,
+ ""
+ ),
+ FaceletsViewMappingsDeprecated(
+ "facelets.VIEW_MAPPINGS",
+ "",
+ true,
+ FaceletsViewMappings,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsLibraries(
+ "javax.faces.FACELETS_LIBRARIES",
+ ""
+ ),
+ FaceletsLibrariesDeprecated(
+ "facelets.LIBRARIES",
+ "",
+ true,
+ FaceletsLibraries,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ FaceletsDecorators(
+ "javax.faces.FACELETS_DECORATORS",
+ ""
+ ),
+ FaceletsDecoratorsDeprecated(
+ "facelets.DECORATORS",
+ "",
+ true,
+ FaceletsDecorators,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ DuplicateJARPattern(
+ "com.sun.faces.duplicateJARPattern",
+ ""
+ ),
+ ValidateEmptyFields(
+ UIInput.VALIDATE_EMPTY_FIELDS_PARAM_NAME,
+ "auto"
+ ),
+ FullStateSavingViewIds(
+ StateManager.FULL_STATE_SAVING_VIEW_IDS_PARAM_NAME,
+ ""
+ ),
+ AnnotationScanPackages(
+ "com.sun.faces.annotationScanPackages",
+ ""
+ ),
+ FaceletFactory(
+ "com.sun.faces.faceletFactory",
+ ""
+ ),
+ FaceletCache(
+ "com.sun.faces.faceletCache",
+ ""
+ );
- return qualifiedName;
- }
- // ------------------------------------------------- Package Private
- // Methods
+ private String defaultValue;
+ private String qualifiedName;
+ private WebContextInitParameter alternate;
+ private boolean deprecated;
+ private DeprecationLoggingStrategy loggingStrategy;
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue)
- {
- this(qualifiedName, defaultValue, false, null);
+ // ---------------------------------------------------------- Public Methods
- }
- BooleanWebContextInitParameter(String qualifiedName,
- boolean defaultValue, boolean deprecated,
- BooleanWebContextInitParameter alternate)
- {
+ public String getDefaultValue() {
- this.qualifiedName = qualifiedName;
- this.defaultValue = defaultValue;
- this.deprecated = deprecated;
- this.alternate = alternate;
+ return defaultValue;
- }
+ }
- // --------------------------------------------------------- Private
- // Methods
- private BooleanWebContextInitParameter getAlternate()
- {
+ public String getQualifiedName() {
- return alternate;
+ return qualifiedName;
- }
+ }
- private boolean isDeprecated()
- {
- return deprecated;
+ DeprecationLoggingStrategy getDeprecationLoggingStrategy() {
- }
+ return loggingStrategy;
- }
+ }
- /**
- * <p>
- * An <code>enum</code> of all environment entries (specified in the
- * web.xml) recognized by the implemenetation.
- * </p>
- */
- public enum WebEnvironmentEntry
- {
+
+ // ------------------------------------------------- Package Private Methods
- ClientStateSavingPassword("ClientStateSavingPassword"), ProjectStage(
- javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
- private static final String JNDI_PREFIX = "java:comp/env/";
- private String qualifiedName;
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue) {
- // ---------------------------------------------------------- Public
- // Methods
+ this(qualifiedName, defaultValue, false, null);
- public String getQualifiedName()
- {
+ }
- return qualifiedName;
- }
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue,
+ boolean deprecated,
+ WebContextInitParameter alternate) {
- // ------------------------------------------------- Package Private
- // Methods
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
- WebEnvironmentEntry(String qualifiedName)
- {
+ }
- if (qualifiedName.startsWith(JNDI_PREFIX))
- {
- this.qualifiedName = qualifiedName;
- }
- else
- {
- this.qualifiedName = JNDI_PREFIX + qualifiedName;
- }
- }
+ WebContextInitParameter(String qualifiedName,
+ String defaultValue,
+ boolean deprecated,
+ WebContextInitParameter alternate,
+ DeprecationLoggingStrategy loggingStrategy) {
- }
+ this(qualifiedName, defaultValue, deprecated, alternate);
+ this.loggingStrategy = loggingStrategy;
- /**
- * <p>
- * An <code>enum</code> of all possible values for the
- * <code>disableUnicodeEscaping</code> configuration parameter.
- * </p>
- */
- public enum DisableUnicodeEscaping
- {
- True("true"), False("false"), Auto("auto");
+ }
- private final String value;
- DisableUnicodeEscaping(String value)
- {
- this.value = value;
- }
+ // --------------------------------------------------------- Private Methods
- public static DisableUnicodeEscaping getByValue(String value)
- {
- for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping
- .values())
- {
- if (disableUnicodeEscaping.value.equals(value)) { return disableUnicodeEscaping; }
- }
- return null;
- }
- }
+ private WebContextInitParameter getAlternate() {
-} // END WebConfiguration
\ No newline at end of file
+ return alternate;
+
+ }
+
+
+ private boolean isDeprecated() {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all boolean context initalization parameters
+ * recognized by the implementation.</p>
+ */
+ public enum BooleanWebContextInitParameter {
+
+
+ // implementation note:
+ // if a parameter is to be deprecated,
+ // then the <name>Deprecated enum element
+ // *must* appear after the one that is taking
+ // its place. The reporting logic depends on this
+
+ DisplayConfiguration(
+ "com.sun.faces.displayConfiguration",
+ false
+ ),
+ ValidateFacesConfigFiles(
+ "com.sun.faces.validateXml",
+ false
+ ),
+ VerifyFacesConfigObjects(
+ "com.sun.faces.verifyObjects",
+ false
+ ),
+ ForceLoadFacesConfigFiles(
+ "com.sun.faces.forceLoadConfiguration",
+ false
+ ),
+ DisableArtifactVersioning(
+ "com.sun.faces.disableVersionTracking",
+ false,
+ true,
+ null
+ ),
+ EnableHtmlTagLibraryValidator(
+ "com.sun.faces.enableHtmlTagLibValidator",
+ false
+ ),
+ EnableCoreTagLibraryValidator(
+ "com.sun.faces.enableCoreTagLibValidator",
+ false
+ ),
+ PreferXHTMLContentType(
+ "com.sun.faces.preferXHTML",
+ false
+ ),
+ PreferXHTMLContextTypeDeprecated(
+ "com.sun.faces.PreferXHTML",
+ false,
+ true,
+ PreferXHTMLContentType
+ ),
+ CompressViewState(
+ "com.sun.faces.compressViewState",
+ true
+ ),
+ CompressViewStateDeprecated(
+ "com.sun.faces.COMPRESS_STATE",
+ true,
+ true,
+ CompressViewState
+ ),
+ CompressJavaScript(
+ "com.sun.faces.compressJavaScript",
+ true
+ ),
+ ExternalizeJavaScriptDeprecated(
+ "com.sun.faces.externalizeJavaScript",
+ true,
+ true,
+ null
+ ),
+ SendPoweredByHeader(
+ "com.sun.faces.sendPoweredByHeader",
+ true
+ ),
+ EnableJSStyleHiding(
+ "com.sun.faces.enableJSStyleHiding",
+ false
+ ),
+ EnableScriptInAttributeValue(
+ "com.sun.faces.enableScriptsInAttributeValues",
+ true
+ ),
+ WriteStateAtFormEnd(
+ "com.sun.faces.writeStateAtFormEnd",
+ true
+ ),
+ EnableLazyBeanValidation(
+ "com.sun.faces.enableLazyBeanValidation",
+ true
+ ),
+ EnableLoadBundle11Compatibility(
+ "com.sun.faces.enabledLoadBundle11Compatibility",
+ false
+ ),
+ EnableRestoreView11Compatibility(
+ "com.sun.faces.enableRestoreView11Compatibility",
+ false
+ ),
+ SerializeServerState(
+ "com.sun.faces.serializeServerState",
+ false
+ ),
+ EnableViewStateIdRendering(
+ "com.sun.faces.enableViewStateIdRendering",
+ true
+ ),
+ RegisterConverterPropertyEditors(
+ "com.sun.faces.registerConverterPropertyEditors",
+ false
+ ),
+ EnableGroovyScripting(
+ "com.sun.faces.enableGroovyScripting",
+ false
+ ),
+ DisableFaceletJSFViewHandler(
+ "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER",
+ false
+ ),
+ DisableDefaultBeanValidator(
+ BeanValidator.DISABLE_DEFAULT_BEAN_VALIDATOR_PARAM_NAME,
+ false),
+ DateTimeConverterUsesSystemTimezone(
+ "javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE",
+ false
+ ),
+ FaceletsSkipComments(
+ "javax.faces.FACELETS_SKIP_COMMENTS",
+ false
+ ),
+ FaceletsSkipCommentsDeprecated(
+ "facelets.SKIP_COMMENTS",
+ false,
+ true,
+ FaceletsSkipComments,
+ new FaceletsConfigParamLoggingStrategy()
+ ),
+ PartialStateSaving(
+ StateManager.PARTIAL_STATE_SAVING_PARAM_NAME,
+ true
+ ),
+ GenerateUniqueServerStateIds(
+ "com.sun.faces.generateUniqueServerStateIds",
+ true
+ ),
+ AutoCompleteOffOnViewState(
+ "com.sun.faces.autoCompleteOffOnViewState",
+ true
+ ),
+ EnableThreading(
+ "com.sun.faces.enableThreading",
+ false
+ ),
+ AllowTextChildren(
+ "com.sun.faces.allowTextChildren",
+ false
+ ),
+ CacheResourceModificationTimestamp(
+ "com.sun.faces.cacheResourceModificationTimestamp",
+ false
+ );
+
+ private BooleanWebContextInitParameter alternate;
+
+ private String qualifiedName;
+ private boolean defaultValue;
+ private boolean deprecated;
+ private DeprecationLoggingStrategy loggingStrategy;
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public boolean getDefaultValue() {
+
+ return defaultValue;
+
+ }
+
+
+ public String getQualifiedName() {
+
+ return qualifiedName;
+
+ }
+
+
+ DeprecationLoggingStrategy getDeprecationLoggingStrategy() {
+
+ return loggingStrategy;
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue) {
+
+ this(qualifiedName, defaultValue, false, null);
+
+ }
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue,
+ boolean deprecated,
+ BooleanWebContextInitParameter alternate) {
+
+ this.qualifiedName = qualifiedName;
+ this.defaultValue = defaultValue;
+ this.deprecated = deprecated;
+ this.alternate = alternate;
+
+ }
+
+
+ BooleanWebContextInitParameter(String qualifiedName,
+ boolean defaultValue,
+ boolean deprecated,
+ BooleanWebContextInitParameter alternate,
+ DeprecationLoggingStrategy loggingStrategy) {
+
+ this(qualifiedName, defaultValue, deprecated, alternate);
+ this.loggingStrategy = loggingStrategy;
+
+ }
+
+
+ // --------------------------------------------------------- Private Methods
+
+
+ private BooleanWebContextInitParameter getAlternate() {
+
+ return alternate;
+
+ }
+
+
+ private boolean isDeprecated() {
+
+ return deprecated;
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all environment entries (specified in the
+ * web.xml) recognized by the implemenetation.</p>
+ */
+ public enum WebEnvironmentEntry {
+
+
+ ClientStateSavingPassword("ClientStateSavingPassword"),
+ ProjectStage(javax.faces.application.ProjectStage.PROJECT_STAGE_JNDI_NAME);
+
+ private static final String JNDI_PREFIX = "java:comp/env/";
+ private String qualifiedName;
+
+
+ // ---------------------------------------------------------- Public Methods
+
+
+ public String getQualifiedName() {
+
+ return qualifiedName;
+
+ }
+
+
+ // ------------------------------------------------- Package Private Methods
+
+
+ WebEnvironmentEntry(String qualifiedName) {
+
+ if (qualifiedName.startsWith(JNDI_PREFIX)) {
+ this.qualifiedName = qualifiedName;
+ } else {
+ this.qualifiedName = JNDI_PREFIX + qualifiedName;
+ }
+
+ }
+
+ }
+
+ /**
+ * <p>An <code>enum</code> of all possible values for the <code>disableUnicodeEscaping</code>
+ * configuration parameter.</p>
+ */
+ public enum DisableUnicodeEscaping {
+ True("true"),
+ False("false"),
+ Auto("auto");
+
+ private final String value;
+
+ DisableUnicodeEscaping(String value) {
+ this.value = value;
+ }
+
+ public static DisableUnicodeEscaping getByValue(String value)
+ {
+ for (DisableUnicodeEscaping disableUnicodeEscaping : DisableUnicodeEscaping.values()) {
+ if (disableUnicodeEscaping.value.equals(value)) {
+ return disableUnicodeEscaping;
+ }
+ }
+
+ return null;
+ }
+ }
+
+
+ // ----------------------------------------------------------- Inner Classes
+
+
+ private interface DeprecationLoggingStrategy {
+
+ boolean shouldBeLogged(WebConfiguration configuration);
+
+ }
+
+
+ private static class FaceletsConfigParamLoggingStrategy implements DeprecationLoggingStrategy {
+
+ public boolean shouldBeLogged(WebConfiguration configuration) {
+ return !configuration.isOptionEnabled(BooleanWebContextInitParameter.DisableFaceletJSFViewHandler);
+ }
+
+ } // END FaceletsConfigParamLoggingStrategy
+
+
+ private interface DeferredLoggingAction {
+
+ void log();
+
+ } // END DeferredLogginAction
+
+
+ private class DeferredParameterLoggingAction implements DeferredLoggingAction {
+
+ private WebContextInitParameter parameter;
+ private Level loggingLevel;
+ private String logKey;
+ private Object[] params;
+
+
+ DeferredParameterLoggingAction(WebContextInitParameter parameter,
+ Level loggingLevel,
+ String logKey,
+ Object[] params) {
+
+ this.parameter = parameter;
+ this.loggingLevel = loggingLevel;
+ this.logKey = logKey;
+ this.params = params;
+
+ }
+
+ public void log() {
+
+ if (WebConfiguration.LOGGER.isLoggable(loggingLevel)) {
+ DeprecationLoggingStrategy strategy = parameter.getDeprecationLoggingStrategy();
+ if (strategy != null && strategy.shouldBeLogged(WebConfiguration.this)) {
+ WebConfiguration.LOGGER.log(loggingLevel, logKey, params);
+ }
+ }
+
+ }
+
+ } // END DeferredParameterLogginAction
+
+
+ private class DeferredBooleanParameterLoggingAction implements DeferredLoggingAction {
+
+ private BooleanWebContextInitParameter parameter;
+ private Level loggingLevel;
+ private String logKey;
+ private Object[] params;
+
+ DeferredBooleanParameterLoggingAction(BooleanWebContextInitParameter parameter,
+ Level loggingLevel,
+ String logKey,
+ Object[] params) {
+ this.parameter = parameter;
+ this.loggingLevel = loggingLevel;
+ this.logKey = logKey;
+ this.params = params;
+ }
+
+ public void log() {
+
+ if (WebConfiguration.LOGGER.isLoggable(loggingLevel)) {
+ DeprecationLoggingStrategy strategy = parameter.getDeprecationLoggingStrategy();
+ if (strategy != null && strategy.shouldBeLogged(WebConfiguration.this)) {
+ WebConfiguration.LOGGER.log(loggingLevel, logKey, params);
+ }
+ }
+
+ }
+
+ } // END DeferredBooleanParameterLoggingAction
+
+} // END WebConfiguration
14 years, 2 months
JBoss Rich Faces SVN: r20016 - trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 12:06:55 -0500 (Wed, 10 Nov 2010)
New Revision: 20016
Modified:
trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
Log:
Update of WebConfiguration for Mojarra 2.0.3
Modified: trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java
===================================================================
--- trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 16:29:24 UTC (rev 20015)
+++ trunk/examples/richfaces-showcase/src/main/java-gae-jsf-ri/com/sun/faces/config/WebConfiguration.java 2010-11-10 17:06:55 UTC (rev 20016)
@@ -965,7 +965,7 @@
StateManager.PARTIAL_STATE_SAVING_PARAM_NAME, true), GenerateUniqueServerStateIds(
"com.sun.faces.generateUniqueServerStateIds", true), AutoCompleteOffOnViewState(
"com.sun.faces.autoCompleteOffOnViewState", true), EnableThreading(
- "com.sun.faces.enableThreading", true), AllowTextChildren(
+ "com.sun.faces.enableThreading", false), AllowTextChildren(
"com.sun.faces.allowTextChildren", false);
private BooleanWebContextInitParameter alternate;
14 years, 2 months
JBoss Rich Faces SVN: r20015 - trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-10 11:29:24 -0500 (Wed, 10 Nov 2010)
New Revision: 20015
Modified:
trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
Log:
Fixed unit test failures
Modified: trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java
===================================================================
--- trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-11-10 15:12:10 UTC (rev 20014)
+++ trunk/ui/validator/ui/src/test/java/org/richfaces/component/behavior/BehaviorTestBase.java 2010-11-10 16:29:24 UTC (rev 20015)
@@ -14,6 +14,7 @@
import org.jboss.test.faces.mock.MockController;
import org.jboss.test.faces.mock.MockFacesEnvironment;
import org.jboss.test.faces.mock.Stub;
+import org.junit.After;
import org.junit.Before;
import org.richfaces.application.ServicesFactory;
@@ -44,6 +45,12 @@
behavior = createBehavior();
}
+
+ @After
+ public void tearDown() throws Exception {
+ controller.release();
+ }
+
protected ClientBehaviorContext setupBehaviorContext(UIComponent component) {
expect(behaviorContext.getComponent()).andStubReturn(component);
expect(behaviorContext.getFacesContext()).andStubReturn(environment.getFacesContext());
14 years, 2 months