You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2007/12/15 20:03:27 UTC
svn commit: r604488 - in
/myfaces/commons/trunk/myfaces-commons-validators/src/main:
java/org/apache/myfaces/commons/validator/
java/org/apache/myfaces/commons/validator/model/
maven-faces-plugin/validators/commons/
Author: matzew
Date: Sat Dec 15 11:03:26 2007
New Revision: 604488
URL: http://svn.apache.org/viewvc?rev=604488&view=rev
Log:
some more stuff...
Added:
myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/DateRestrictionValidator.java
- copied, changed from r604447, myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java
myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/
myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/DateListProvider.java
- copied, changed from r604449, myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/DateListProvider.java
myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/DateRestriction.xml
- copied, changed from r604448, myfaces/trinidad/trunk_1.2.x/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml
Modified:
myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/CreditCard.xml
myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Email.xml
myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Equal.xml
myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/RegExpr.xml
Copied: myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/DateRestrictionValidator.java (from r604447, myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/DateRestrictionValidator.java?p2=myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/DateRestrictionValidator.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java&r1=604447&r2=604488&rev=604488&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/validator/DateRestrictionValidator.java (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/DateRestrictionValidator.java Sat Dec 15 11:03:26 2007
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.trinidad.validator;
+package org.apache.myfaces.commons.validator;
import java.util.Calendar;
import java.util.Date;
@@ -25,9 +25,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.TimeZone;
-
-import javax.el.ValueExpression;
import javax.faces.application.FacesMessage;
import javax.faces.component.StateHolder;
@@ -40,19 +37,12 @@
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
-import org.apache.myfaces.trinidad.bean.FacesBean;
-import org.apache.myfaces.trinidad.bean.PropertyKey;
-import org.apache.myfaces.trinidad.context.RequestContext;
-import org.apache.myfaces.trinidad.logging.TrinidadLogger;
-import org.apache.myfaces.trinidad.model.DateListProvider;
-import org.apache.myfaces.trinidad.util.ComponentUtils;
-import org.apache.myfaces.trinidad.util.MessageFactory;
-
+import org.apache.myfaces.commons.validator.model.DateListProvider;
-public class DateRestrictionValidator implements Validator, StateHolder {
+public class DateRestrictionValidator extends ValidatorBase implements Validator, StateHolder {
- public static final String VALIDATOR_ID = "org.apache.myfaces.trinidad.DateRestriction";
+ public static final String VALIDATOR_ID = "org.apache.myfaces.commons.validator.DateRestriction";
/**
* <p>The message identifier of the {@link javax.faces.application.FacesMessage}
@@ -63,7 +53,7 @@
* days value.</p>
*/
public static final String DAY_MESSAGE_ID =
- "org.apache.myfaces.trinidad.validator.DateRestrictionValidator.DAY";
+ "org.apache.myfaces.commons.validator.DateRestrictionValidator.DAY";
/**
* <p>The message identifier of the {@link javax.faces.application.FacesMessage}
@@ -74,7 +64,7 @@
* month value.</p>
*/
public static final String MONTH_MESSAGE_ID =
- "org.apache.myfaces.trinidad.validator.DateRestrictionValidator.MONTH";
+ "org.apache.myfaces.commons.validator.DateRestrictionValidator.MONTH";
/**
* <p>The message identifier of the {@link javax.faces.application.FacesMessage}
@@ -85,7 +75,7 @@
* weekdays value.</p>
*/
public static final String WEEKDAY_MESSAGE_ID =
- "org.apache.myfaces.trinidad.validator.DateRestrictionValidator.WEEKDAY";
+ "org.apache.myfaces.commons.validator.DateRestrictionValidator.WEEKDAY";
/**
* Construct a {@link Validator} with no preconfigured limits.
@@ -95,111 +85,42 @@
super();
_initMaps();
}
+
+ //the foreign component_id on which the validation is based.
+ private String[] invalidMonths = null;
+ private String[] invalidDaysOfWeek = null;
+ private DateListProvider invalidDays = null;
public final String[] getInvalidMonths()
{
- return (String[]) _facesBean.getProperty(_INVALID_MONTHS);
+ return invalidMonths;
}
public final void setInvalidMonths(String[] invalidMonths)
{
- _facesBean.setProperty(_INVALID_MONTHS, invalidMonths);
+ this.invalidMonths = invalidMonths;
}
public final String[] getInvalidDaysOfWeek()
{
- return (String[]) _facesBean.getProperty(_INVALID_DAYS_OF_WEEK); }
+ return invalidDaysOfWeek;
+ }
public final void setInvalidDaysOfWeek(String[] invalidDaysOfWeek)
{
- _facesBean.setProperty(_INVALID_DAYS_OF_WEEK, invalidDaysOfWeek);
+ this.invalidDaysOfWeek = invalidDaysOfWeek;
}
public final DateListProvider getInvalidDays()
{
- return (DateListProvider)_facesBean.getProperty(_INVALID_DAYS);
+ return invalidDays;
}
public final void setInvalidDays(DateListProvider invalidDays)
{
- _facesBean.setProperty(_INVALID_DAYS, invalidDays);
- }
-
- public final String getMessageDetailInvalidMonths()
- {
- Object messageDetailInvalidMonths = _facesBean.getProperty(_INVALID_MONTHS_MESSAGE_DETAIL_KEY);
- return ComponentUtils.resolveString(messageDetailInvalidMonths);
- }
-
- public final void setMessageDetailInvalidMonths(String invalidMonths)
- {
- _facesBean.setProperty(_INVALID_MONTHS_MESSAGE_DETAIL_KEY, invalidMonths);
- }
-
- public final String getMessageDetailInvalidDaysOfWeek()
- {
- Object messageDetailInvalidDaysOfWeek = _facesBean.getProperty(_INVALID_DAYS_OF_WEEK_MESSAGE_DETAIL_KEY);
- return ComponentUtils.resolveString(messageDetailInvalidDaysOfWeek);
- }
-
- public final void setMessageDetailInvalidDaysOfWeek(String invalidDaysOfWeek)
- {
- _facesBean.setProperty(_INVALID_DAYS_OF_WEEK_MESSAGE_DETAIL_KEY, invalidDaysOfWeek);
+ this.invalidDays= invalidDays;
}
- public final String getMessageDetailInvalidDays()
- {
- Object messageDetailInvalidDays = _facesBean.getProperty(_INVALID_DAYS_MESSAGE_DETAIL_KEY);
- return ComponentUtils.resolveString(messageDetailInvalidDays);
- }
-
- public final void setMessageDetailInvalidDays(String invalidDays)
- {
- _facesBean.setProperty(_INVALID_DAYS_MESSAGE_DETAIL_KEY, invalidDays);
- }
-
- /**
- * <p>Custom hint invalidDaysOfWeek message.</p>
- * Overrides default hint message
- * @param hintWeek Custom hint message.
- */
- public void setHintInvalidDaysOfWeek(String hintWeek)
- {
- _facesBean.setProperty(_HINT_WEEK_KEY, hintWeek);
- }
-
- /**
- * <p>Return custom hint invalidDaysOfWeek message.</p>
- * @return Custom hint message.
- * @see #setHintInvalidDaysOfWeek(String)
- */
- public String getHintInvalidDaysOfWeek()
- {
- Object obj = _facesBean.getProperty(_HINT_WEEK_KEY);
- return ComponentUtils.resolveString(obj);
- }
-
- /**
- * <p>Custom hint invalidMonths message.</p>
- * Overrides default hint message
- * @param hintMonth Custom hint message.
- */
- public void setHintInvalidMonths(String hintMonth)
- {
- _facesBean.setProperty(_HINT_MONTH_KEY, hintMonth);
- }
-
- /**
- * <p>Return custom hint invalidMonths message.</p>
- * @return Custom hint message.
- * @see #setHintInvalidMonths(String)
- */
- public String getHintInvalidMonths()
- {
- Object obj = _facesBean.getProperty(_HINT_MONTH_KEY);
- return ComponentUtils.resolveString(obj);
- }
-
/**
* @exception IllegalArgumentException if <code>value</code> is not of type
* {@link java.util.Date}
@@ -211,8 +132,8 @@
{
if ((context == null) || (component == null))
{
- throw new NullPointerException(_LOG.getMessage(
- "NULL_FACESCONTEXT_OR_UICOMPONENT"));
+ throw new NullPointerException((
+ "NULL_FACESCONTEXT_OR_UICOMPONENT"));
}
if (value != null)
@@ -225,14 +146,14 @@
if (_getInvalidDaysOfWeek().contains(weekday))
{
throw new ValidatorException(
- _getWrongWeekDayMessage(context, component, value, weekday));
+ getWrongWeekDayMessage(context, component, value, weekday));
}
String month = _monthMap.get(calendar.get(Calendar.MONTH));
if ( _getInvalidMonths().contains(month))
{
throw new ValidatorException(
- _getWrongMonthMessage(context, component, value, month));
+ getWrongMonthMessage(context, component, value, month));
}
DateListProvider dlp = getInvalidDays();
@@ -250,7 +171,7 @@
if(!date.before(convertedDate) && !date.after(convertedDate))
{
throw new ValidatorException(
- _getWrongDayMessage(context, component, value, date));
+ getWrongDayMessage(context, component, value, date));
}
}
}
@@ -260,150 +181,26 @@
// StateHolder Methods
public Object saveState(FacesContext context)
{
- return _facesBean.saveState(context);
+ Object[] state = new Object[4];
+ state[0] = super.saveState(context);
+ state[1] = invalidMonths;
+ state[2] = invalidDaysOfWeek;
+ state[3] = invalidDays;
+ return state;
}
public void restoreState(FacesContext context, Object state)
{
- _facesBean.restoreState(context, state);
- }
-
- public boolean isTransient()
- {
- return (_transientValue);
- }
-
-
- public void setTransient(boolean transientValue)
- {
- _transientValue = transientValue;
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+ invalidMonths = (String[]) values[1];
+ invalidDaysOfWeek = (String[]) values[2];
+ invalidDays = (DateListProvider) values[3];
}
// End of StateHolder Methods
-
-
- /**
- * <p>Set the {@link ValueExpression} used to calculate the value for the
- * specified attribute if any.</p>
- *
- * @param name Name of the attribute for which to set a {@link ValueExpression}
- * @param expression The {@link ValueExpression} to set, or <code>null</code>
- * to remove any currently set {@link ValueExpression}
- *
- * @exception NullPointerException if <code>name</code>
- * is <code>null</code>
- * @exception IllegalArgumentException if <code>name</code> is not a valid
- * attribute of this converter
- */
- public void setValueExpression(String name, ValueExpression expression)
- {
- ValidatorUtils.setValueExpression(_facesBean, name, expression) ;
- }
-
-
- /**
- * <p>Return the {@link ValueExpression} used to calculate the value for the
- * specified attribute name, if any.</p>
- *
- * @param name Name of the attribute or property for which to retrieve a
- * {@link ValueExpression}
- *
- * @exception NullPointerException if <code>name</code>
- * is <code>null</code>
- * @exception IllegalArgumentException if <code>name</code> is not a valid
- * attribute of this converter
- */
- public ValueExpression getValueExpression(String name)
- {
- return ValidatorUtils.getValueExpression(_facesBean, name);
- }
-
-
- /**
- * <p>Set the {@link ValueBinding} used to calculate the value for the
- * specified attribute if any.</p>
- *
- * @param name Name of the attribute for which to set a {@link ValueBinding}
- * @param binding The {@link ValueBinding} to set, or <code>null</code>
- * to remove any currently set {@link ValueBinding}
- *
- * @exception NullPointerException if <code>name</code>
- * is <code>null</code>
- * @exception IllegalArgumentException if <code>name</code> is not a valid
- * attribute of this validator
- * @deprecated
- */
- public void setValueBinding(String name, ValueBinding binding)
- {
- ValidatorUtils.setValueBinding(_facesBean, name, binding) ;
- }
-
- /**
- * <p>Return the {@link ValueBinding} used to calculate the value for the
- * specified attribute name, if any.</p>
- *
- * @param name Name of the attribute or property for which to retrieve a
- * {@link ValueBinding}
- *
- * @exception NullPointerException if <code>name</code>
- * is <code>null</code>
- * @exception IllegalArgumentException if <code>name</code> is not a valid
- * attribute of this validator
- * @deprecated
- */
- public ValueBinding getValueBinding(String name)
- {
- return ValidatorUtils.getValueBinding(_facesBean, name);
- }
-
- @Override
- public boolean equals(Object o)
- {
- if ( o instanceof DateRestrictionValidator)
- {
- DateRestrictionValidator that = (DateRestrictionValidator)o;
-
- if ( _transientValue == that._transientValue &&
- (ValidatorUtils.equals(getInvalidDays(), that.getInvalidDays())) &&
- (ValidatorUtils.equals(getInvalidDaysOfWeek(), that.getInvalidDaysOfWeek())) &&
- (ValidatorUtils.equals(getInvalidMonths(), that.getInvalidMonths())) &&
- (ValidatorUtils.equals(getMessageDetailInvalidDays(),
- that.getMessageDetailInvalidDays())) &&
- (ValidatorUtils.equals(getMessageDetailInvalidDaysOfWeek(),
- that.getMessageDetailInvalidDaysOfWeek())) &&
- (ValidatorUtils.equals(getMessageDetailInvalidMonths(),
- that.getMessageDetailInvalidMonths()))
- )
- {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- int result = 17;
- Object days = getInvalidDays();
- Object daysOfWeek = getInvalidDaysOfWeek();
- Object month = getInvalidMonths();
- Object msgDetDays = getMessageDetailInvalidDays();
- Object msgDetDaysOfWeek = getMessageDetailInvalidDaysOfWeek();
- Object msgDetMonth = getMessageDetailInvalidMonths();
-
- result = 37 * result + ( days == null ? 0 : days.hashCode());
- result = 37 * result + ( daysOfWeek == null ? 0 : daysOfWeek.hashCode());
- result = 37 * result + ( month == null ? 0 : month.hashCode());
- result = 37 * result + ( _transientValue ? 0 : 1);
- result = 37 * result + ( msgDetDays == null ? 0: msgDetDays.hashCode());
- result = 37 * result + ( msgDetDaysOfWeek == null ? 0: msgDetDaysOfWeek.hashCode());
- result = 37 * result + ( msgDetMonth == null ? 0: msgDetMonth.hashCode());
- return result;
- }
-
-
- private Converter _getConverter(
+
+ private Converter getConverter(
FacesContext context,
UIComponent component)
{
@@ -430,17 +227,8 @@
protected Calendar getCalendar()
{
- TimeZone tz = null;
- RequestContext rctx = RequestContext.getCurrentInstance();
- if (rctx != null)
- {
- tz = rctx.getTimeZone();
- }
- else
- {
- tz = TimeZone.getDefault();
- }
- return Calendar.getInstance(tz);
+ //TODO: make it better
+ return Calendar.getInstance();
}
@@ -458,82 +246,55 @@
return ( (Date)value );
}
- throw new IllegalArgumentException(_LOG.getMessage(
- "VALUE_IS_NOT_DATE_TYPE"));
+ throw new IllegalArgumentException("value is not a date type");
}
- private FacesMessage _getWrongWeekDayMessage(
+ private FacesMessage getWrongWeekDayMessage(
FacesContext context,
UIComponent component,
Object value,
Object weekday)
{
- Converter converter = _getConverter(context, component);
+ Converter converter = getConverter(context, component);
Object cValue = _getConvertedValue(context, component, converter, value);
Object cWeekday = _getConvertedValue(context, component, converter, weekday);
- Object msg = _getRawInvalidDaysOfWeekMessageDetail();
- Object label = ValidatorUtils.getComponentLabel(component);
-
- Object[] params = {label, cValue, cWeekday};
-
- return MessageFactory.getMessage(context, WEEKDAY_MESSAGE_ID,
- msg, params, component);
- }
- private Object _getRawInvalidDaysOfWeekMessageDetail()
- {
- return _facesBean.getRawProperty(_INVALID_DAYS_OF_WEEK_MESSAGE_DETAIL_KEY);
+ Object[] params = {cValue, cWeekday};
+ return getFacesMessage(WEEKDAY_MESSAGE_ID, params);
}
- private FacesMessage _getWrongMonthMessage(
+ private FacesMessage getWrongMonthMessage(
FacesContext context,
UIComponent component,
Object value,
- Object weekday)
+ Object month)
{
- Converter converter = _getConverter(context, component);
+ Converter converter = getConverter(context, component);
Object cValue = _getConvertedValue(context, component, converter, value);
- Object cWeekday = _getConvertedValue(context, component, converter, weekday);
-
- Object msg = _getRawInvalidMonthMessageDetail();
- Object label = ValidatorUtils.getComponentLabel(component);
+ Object cWeekday = _getConvertedValue(context, component, converter, month);
- Object[] params = {label, cValue, cWeekday};
+ Object[] params = {cValue, cWeekday};
- return MessageFactory.getMessage(context, MONTH_MESSAGE_ID,
- msg, params, component);
- }
- private Object _getRawInvalidMonthMessageDetail()
- {
- return _facesBean.getRawProperty(_INVALID_MONTHS_MESSAGE_DETAIL_KEY);
+ return getFacesMessage(MONTH_MESSAGE_ID, params);
}
- private FacesMessage _getWrongDayMessage(
+ private FacesMessage getWrongDayMessage(
FacesContext context,
UIComponent component,
Object value,
Object day)
{
- Converter converter = _getConverter(context, component);
+ Converter converter = getConverter(context, component);
Object cValue = _getConvertedValue(context, component, converter, value);
Object cDay = _getConvertedValue(context, component, converter, day);
- Object msg = _getRawInvalidDaysMessageDetail();
- Object label = ValidatorUtils.getComponentLabel(component);
-
- Object[] params = {label, cValue, cDay};
-
- return MessageFactory.getMessage(context, DAY_MESSAGE_ID,
- msg, params, component);
- }
- private Object _getRawInvalidDaysMessageDetail()
- {
- return _facesBean.getRawProperty(_INVALID_DAYS_MESSAGE_DETAIL_KEY);
+ Object[] params = {cValue, cDay};
+
+ return getFacesMessage(DAY_MESSAGE_ID, params);
}
-
private Object _getConvertedValue(
FacesContext context,
UIComponent component,
@@ -599,40 +360,6 @@
_monthMap.put(Calendar.DECEMBER, "dec");
}
- private static final FacesBean.Type _TYPE = new FacesBean.Type();
-
- private static final PropertyKey _INVALID_MONTHS =
- _TYPE.registerKey("invalidMonths", String[].class);
-
- private static final PropertyKey _INVALID_DAYS_OF_WEEK =
- _TYPE.registerKey("invalidDaysOfWeek", String[].class);
-
- private static final PropertyKey _INVALID_DAYS =
- _TYPE.registerKey("invalidDays", DateListProvider.class);
-
- private static final PropertyKey _INVALID_MONTHS_MESSAGE_DETAIL_KEY =
- _TYPE.registerKey("messageDetailInvalidMonths", String.class);
-
- private static final PropertyKey _INVALID_DAYS_OF_WEEK_MESSAGE_DETAIL_KEY =
- _TYPE.registerKey("messageDetailInvalidDaysOfWeek", String.class);
-
- private static final PropertyKey _INVALID_DAYS_MESSAGE_DETAIL_KEY =
- _TYPE.registerKey("messageDetailInvalidDays", String.class);
-
- private static final PropertyKey _HINT_WEEK_KEY =
- _TYPE.registerKey("hintWeek", String.class);
-
- private static final PropertyKey _HINT_MONTH_KEY =
- _TYPE.registerKey("hintMonth", String.class);
-
- private FacesBean _facesBean = ValidatorUtils.getFacesBean(_TYPE);
-
- private boolean _transientValue = false;
-
private Map<Integer, String> _dayMap = null;
private Map<Integer, String> _monthMap = null;
-
- private static final TrinidadLogger _LOG =
- TrinidadLogger.createTrinidadLogger(DateRestrictionValidator.class);
-
}
Copied: myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/DateListProvider.java (from r604449, myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/DateListProvider.java)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/DateListProvider.java?p2=myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/DateListProvider.java&p1=myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/DateListProvider.java&r1=604449&r2=604488&rev=604488&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/DateListProvider.java (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/java/org/apache/myfaces/commons/validator/model/DateListProvider.java Sat Dec 15 11:03:26 2007
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.myfaces.trinidad.model;
+package org.apache.myfaces.commons.validator.model;
import java.util.List;
import java.util.Calendar;
@@ -49,7 +49,7 @@
* requested.
* @param rangeEnd The end of the range for which dates are being requested.
*/
- public List <Date> getDateList(FacesContext context,
+ List<Date> getDateList(FacesContext context,
Calendar base,
Date rangeStart,
Date rangeEnd);
Modified: myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/CreditCard.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/CreditCard.xml?rev=604488&r1=604487&r2=604488&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/CreditCard.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/CreditCard.xml Sat Dec 15 11:03:26 2007
@@ -27,7 +27,30 @@
<display-name>validateCreditCard</display-name>
<validator-id>org.apache.myfaces.commons.validator.CreditCard</validator-id>
<validator-class>org.apache.myfaces.commons.validator.CreditCardValidator</validator-class>
- <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>message</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>detailMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>summaryMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
<property>
<description><![CDATA[<p>
TODO
Copied: myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/DateRestriction.xml (from r604448, myfaces/trinidad/trunk_1.2.x/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml)
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/DateRestriction.xml?p2=myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/DateRestriction.xml&p1=myfaces/trinidad/trunk_1.2.x/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml&r1=604448&r2=604488&rev=604488&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/DateRestriction.xml Sat Dec 15 11:03:26 2007
@@ -19,13 +19,38 @@
-->
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:tr="http://myfaces.apache.org/trinidad"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:mcv="http://myfaces.apache.org/commons/validators"
xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin">
<validator>
<description><![CDATA[Validate that the date entered is within a given restriction.]]></description>
<display-name>validateDateRestriction</display-name>
- <validator-id>org.apache.myfaces.trinidad.DateRestriction</validator-id>
- <validator-class>org.apache.myfaces.trinidadinternal.validator.DateRestrictionValidator</validator-class>
+ <validator-id>org.apache.myfaces.commons.validator.DateRestriction</validator-id>
+ <validator-class>org.apache.myfaces.commons.validator.DateRestrictionValidator</validator-class>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>message</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>detailMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>summaryMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
<property>
<description><![CDATA[Specify the month which are invalid for your use case.
The attribute takes a whitespace delimited list of months.
@@ -39,7 +64,6 @@
</mfp:property-metadata>
</property-extension>
</property>
-
<property>
<description><![CDATA[Specify the weekdays which are invalid for your use case.
The attribute takes whitespace delimited list of weekdays.
@@ -53,130 +77,24 @@
</mfp:property-metadata>
</property-extension>
</property>
-
<property>
<description><![CDATA[To specifiy a concrete List of Dates, use the invalidDays attribute and wire it
to a DateListProvider implementation. This returns a list of dates, which are invalid.]]>
</description>
<property-name>invalidDays</property-name>
- <property-class>org.apache.myfaces.trinidad.model.DateListProvider</property-class>
+ <property-class>org.apache.myfaces.commons.validator.model.DateListProvider</property-class>
<property-extension>
<mfp:property-metadata>
<mfp:preferred>true</mfp:preferred>
</mfp:property-metadata>
</property-extension>
</property>
-
- <property>
- <description><![CDATA[<p>
- The detail error message to be used for constructing faces messages,
- when input value exceeds the <code>invalidMonths</code> value
- set.
- </p>
- <p>
- <strong>
- Parameters:
- </strong>
- <ul>
- <li>
- {0} the label that identifies the component
- </li>
- <li>
- {1} value entered by the user
- </li>
- <li>
- {2} the invalid month
- </li>
- </ul>
- </p>]]>
- </description>
- <property-name>messageDetailInvalidMonths</property-name>
- <property-class>java.lang.String</property-class>
- </property>
-
- <property>
- <description><![CDATA[<p>
- The detail error message to be used for constructing faces messages,
- when input value is less than the set <code>invalidDaysOfWeek</code>
- value.
- </p>
- <p>
- <strong>
- Parameters:
- </strong>
- <ul>
- <li>
- {0} the label that identifies the component
- </li>
- <li>
- {1} value entered by the user
- </li>
- <li>
- {2} the invalid weekday
- </li>
- </ul>
- </p>]]>
- </description>
- <property-name>messageDetailInvalidDaysOfWeek</property-name>
- <property-class>java.lang.String</property-class>
- </property>
-
- <property>
- <description><![CDATA[<p>
- The detail error message to be used for constructing faces messages,
- when input value is less than the set <code>invalidDate</code>
- value.
- </p>
- <p>
- <strong>
- Parameters:
- </strong>
- <ul>
- <li>
- {0} the label that identifies the component
- </li>
- <li>
- {1} value entered by the user
- </li>
- <li>
- {2} the invalid date
- </li>
- </ul>
- </p>]]>
- </description>
- <property-name>messageDetailInvalidDays</property-name>
- <property-class>java.lang.String</property-class>
- </property>
-
<validator-extension>
- <mfp:tag-name>tr:validateDateRestriction</mfp:tag-name>
- <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.validator.ValidateDateRestrictionTag</mfp:tag-class>
- <mfp:long-description><![CDATA[<html:p>
-
- Validate that the date is valid with some given restrictions.
-</html:p>]]></mfp:long-description>
- <mfp:example>
- <mfp:source-code>
- <![CDATA[<tr:inputDate id="days" value="#{bean.date}"
- label="Select a date, but check possible holidays first">
- <tr:convertDateTime pattern="yyyy-MM-dd"/>
- <tr:validateDateRestriction invalidDays="#{bean.date.nationalHolidays}" />
- </tr:inputDate>
-
- <tr:inputDate id="month" value="#{bean.date}"
- label="Select a date, but not within November or December">
- <tr:convertDateTime pattern="yyyy-MM-dd"/>
- <tr:validateDateRestriction invalidMonths="Nov Dec" />
- </tr:inputDate>
-
- <tr:inputDate id="daysOfWeek" value="#{bean.date}"
- label="Select a date, but not a Monday">
- <tr:convertDateTime pattern="yyyy-MM-dd"/>
- <tr:validateDateRestriction invalidDaysOfWeek="Mon"/>
- </tr:inputDate>]]>
- </mfp:source-code>
- </mfp:example>
- <mfp:author>Matthias Wessendorf</mfp:author>
+ <mfp:tag-name>mcv:validateDateRestriction</mfp:tag-name>
+ <mfp:tag-class>org.apache.myfaces.commons.validator.ValidateDateRestrictionTag</mfp:tag-class>
+ <mfp:long-description>
+ <![CDATA[<html:p>Validate that the date is valid with some given restrictions.</html:p>]]>
+ </mfp:long-description>
</validator-extension>
</validator>
</faces-config>
Modified: myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Email.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Email.xml?rev=604488&r1=604487&r2=604488&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Email.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Email.xml Sat Dec 15 11:03:26 2007
@@ -27,7 +27,30 @@
<display-name>validateEmail</display-name>
<validator-id>org.apache.myfaces.commons.validator.Email</validator-id>
<validator-class>org.apache.myfaces.commons.validator.EmailValidator</validator-class>
- <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>message</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>detailMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>summaryMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
<validator-extension>
<mfp:tag-name>mcv:validateEmail</mfp:tag-name>
<mfp:tag-class>org.apache.myfaces.commons.validator.ValidateEmailTag</mfp:tag-class>
Modified: myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Equal.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Equal.xml?rev=604488&r1=604487&r2=604488&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Equal.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/Equal.xml Sat Dec 15 11:03:26 2007
@@ -27,7 +27,30 @@
<display-name>validateEqual</display-name>
<validator-id>org.apache.myfaces.commons.validator.Equal</validator-id>
<validator-class>org.apache.myfaces.commons.validator.EqualValidator</validator-class>
- <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>message</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>detailMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>summaryMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
<property>
<description><![CDATA[<p>
TODO
Modified: myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/RegExpr.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/RegExpr.xml?rev=604488&r1=604487&r2=604488&view=diff
==============================================================================
--- myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/RegExpr.xml (original)
+++ myfaces/commons/trunk/myfaces-commons-validators/src/main/maven-faces-plugin/validators/commons/RegExpr.xml Sat Dec 15 11:03:26 2007
@@ -27,7 +27,30 @@
<display-name>validateRegExpr</display-name>
<validator-id>org.apache.myfaces.commons.validator.RegExpr</validator-id>
<validator-class>org.apache.myfaces.commons.validator.RegExprValidator</validator-class>
- <xi:include href="includes/CommonAttrs.xml" xpointer="/faces-config/component/*"/>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>message</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>detailMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <description><![CDATA[<p>
+ TODO
+ </p>]]>
+ </description>
+ <property-name>summaryMessage</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
<property>
<description><![CDATA[<p>
TODO