All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.maven-faces-plugin.validators.trinidad.DateTimeRange.xml Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
<?xml version="1.0" ?> 
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
     
--><faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:tr="http://myfaces.apache.org/trinidad"
              xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
                 xmlns:fmd="http://java.sun.com/xml/ns/javaee/faces/design-time-metadata">
  <validator>
    <description><![CDATA[Validate that the date entered is within a given range.]]></description>
    <display-name>validateDateTimeRange</display-name>
    <validator-id>org.apache.myfaces.trinidad.DateTimeRange</validator-id>
    <validator-class>org.apache.myfaces.trinidadinternal.validator.DateTimeRangeValidator</validator-class>
    <property>
      <description><![CDATA[Whether the converter should be disabled, default to false.]]>
      </description>
      <property-name>disabled</property-name>
      <property-class>boolean</property-class>
      <default-value>false</default-value>
    </property>
    <property>
      <description>
             <![CDATA[the maximum java.util.Date.
           ISO 8601 date strings, of the form 'yyyy-MM-dd'
           (for example 2004-06-22) is also allowed.
           This will be parsed to date. When binding to Date objects, it is advised to create the Date object with 
maximum value for any date-time components that aren't displayed (usually hours, minutes, seconds, milliseconds) 
to allow the largest range of values to be accepted.]]>
      </description>
      <property-name>maximum</property-name>
      <property-class>java.util.Date</property-class>
      <property-extension>
        <mfp:property-metadata>
          <mfp:use-max-time>true</mfp:use-max-time>
        </mfp:property-metadata>
        <fmd:property-metadata>
          <fmd:preferred>true</fmd:preferred>
        </fmd:property-metadata>
      </property-extension>
    </property>
    <property>
      <description>
             <![CDATA[The minimum java.util.Date.
           ISO 8601 date strings, of the form 'yyyy-MM-dd'
           (for example 2004-06-22) are also allowed.
           This will be parsed to date. When binding to Date objects, it is advised to create the Date object with zeroed-out
values for any date-time components that aren't displayed (usually hours, minutes, seconds, milliseconds)
to allow the largest range of values to be accepted.]] ]]>
      </description>
      <property-name>minimum</property-name>
      <property-class>java.util.Date</property-class>
      <property-extension>
        <mfp:property-metadata/>
        <fmd:property-metadata>
          <fmd:preferred>true</fmd:preferred>
        </fmd: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>maximum</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 maximum allowed date
            </li>
           </ul>
          </p>]]>
      </description>
      <property-name>messageDetailMaximum</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:property-metadata>
          <mfp:translatable>true</mfp:translatable>
        </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>minimum</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 minimum allowed date
            </li>
           </ul>
          </p>]]>
      </description>
      <property-name>messageDetailMinimum</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:property-metadata>
          <mfp:translatable>true</mfp:translatable>
        </mfp:property-metadata>
      </property-extension>
    </property>
        <property>
      <description><![CDATA[<p>
           The detail error message to be used for constructing faces messages,
           if input value is not with in the range, when
           <code>minimum</code> and <code>maximum</code> is
           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 minimum allowed date
            </li>
            <li>
             {3} the maximum allowed date
            </li>
           </ul>
          </p>]]>
      </description>
      <property-name>messageDetailNotInRange</property-name>
      <property-class>java.lang.String</property-class>
      <property-extension>
        <mfp:property-metadata>
          <mfp:translatable>true</mfp:translatable>
        </mfp:property-metadata>
      </property-extension>
    </property>
    <validator-extension>
      <mfp:tag-name>tr:validateDateTimeRange</mfp:tag-name>
      <mfp:tag-class>org.apache.myfaces.trinidadinternal.taglib.validator.ValidateDateTimeRangeTag</mfp:tag-class>
      <mfp:long-description><![CDATA[<html:p>

        Validate that the date entered is within a given range.
</html:p>]]></mfp:long-description>
      <mfp:example>
        <mfp:source-code><![CDATA[<tr:inputDate id="mdf3" value="#{date.date3}"
                               label="max validator">
  <tr:validateDateTimeRange maximum="#{date.maxDate}"/>
</tr:inputDate>

<tr:inputDate id="mdf3" value="2004-11-25"
                                tip="min=2004-11-16  max=2004-12-16"
                                label="Submission period">
  <tr:convertDateTime pattern="yyyy-MM-dd"/>

  <!-- Supports ISO date format strings of the form "yyyy-MM-dd" -->
  <tr:validateDateTimeRange
       minimum="2004-11-16"
       maximum="2004-12-16"
       messageDetailNotInRange="Date &quot;{1}&quot; does not fall within the range {2} : {3}"/>
</tr:inputDate>]]>
        </mfp:source-code>
      </mfp:example>
      <mfp:author>Gabrielle Crawford</mfp:author>
    </validator-extension>
  </validator>
</faces-config>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy