You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-commits@incubator.apache.org by ma...@apache.org on 2006/11/02 18:09:41 UTC

svn commit: r470457 - /incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml

Author: matzew
Date: Thu Nov  2 10:09:39 2006
New Revision: 470457

URL: http://svn.apache.org/viewvc?view=rev&rev=470457
Log:
I guess I found a *nice* documentation :)

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml

Modified: incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml?view=diff&rev=470457&r1=470456&r2=470457
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-build/src/main/resources/META-INF/maven-faces-plugin/validators/trinidad/DateRestriction.xml Thu Nov  2 10:09:39 2006
@@ -23,7 +23,9 @@
     <validator-id>org.apache.myfaces.trinidad.DateRestriction</validator-id>
     <validator-class>org.apache.myfaces.trinidadinternal.validator.DateRestrictionValidator</validator-class>
     <property>
-      <description><![CDATA[the .]]>
+      <description><![CDATA[Specify the month which are invalid for your use case.
+           The attribute takes a whitespace delimited list of months.
+           Possible values are jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.]]>
       </description>
       <property-name>invalidMonths</property-name>
       <property-class>java.lang.String[]</property-class>
@@ -31,7 +33,9 @@
     </property>
     
     <property>
-      <description><![CDATA[the .]]>
+      <description><![CDATA[Specify the weekdays which are invalid for your use case.
+           The attribute takes whitespace delimited list of weekdays.
+           Possible values are sun, mon, tue, wed, thu, fri, sat.]]>
       </description>
       <property-name>invalidDaysOfWeek</property-name>
       <property-class>java.lang.String[]</property-class>
@@ -39,16 +43,39 @@
     </property>
     
     <property>
-      <description><![CDATA[the .]]>
+      <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-extension/>
+      <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>
@@ -59,9 +86,28 @@
         </mfp:property-metadata>
       </property-extension>
     </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>
@@ -72,9 +118,28 @@
         </mfp:property-metadata>
       </property-extension>
     </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>
@@ -89,8 +154,33 @@
     <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:uix2-local-name>validateDateTimeRange</mfp:uix2-local-name>
     </validator-extension>
   </validator>
-</faces-config>
+</faces-config>
\ No newline at end of file