blob: d166bdd70e746d2536451554ebc242ffdb4599f7 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://turbine.apache.org/schema/intake/4.0"
xmlns:tns="http://turbine.apache.org/schema/intake/4.0"
elementFormDefault="qualified">
<element name="input-data" type="tns:inputDataComplexType">
</element>
<complexType name="groupComplexType">
<sequence>
<element minOccurs="1" maxOccurs="unbounded" name="field" type="tns:fieldComplexType">
</element>
</sequence>
<attribute use="required" name="key" type="string">
<annotation>
<documentation>A short identifier for the group. It is only
used in query parameters so it does not have to be descriptive.
This value must be unique across all groups in the enclosing
input-data element.</documentation>
</annotation>
</attribute>
<attribute use="required" name="name" type="string">
<annotation>
<documentation>Name of the group. This is the value used to
get the group from the Intake Service. It must be unique
across all groups in the enclosing input-data element.</documentation>
</annotation>
</attribute>
<attribute name="mapToObject" type="string">
<annotation>
<documentation>Class name of the object that will be mapped to the
group. Instances of this class can be used to set
the values of the fields within the group. The
Intake Service can also set the attributes of
the object from the fields in the group.
This class name actually used by the intake service
will be basePackage+"."+mapToObject.
Example:
basePackage=org.apache.turbine.om
mapToObject=TurbineUser
Effective class name = org.apache.turbine.om.TurbineUser
Default: null</documentation>
</annotation>
</attribute>
<attribute name="pool-capacity" type="string">
<annotation>
<documentation>Capacity of the pool used to store instances of the fields
within this group.
Default: 128</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="inputDataComplexType">
<annotation>
<documentation>The input-data element is the root of the intake
XML definition file.</documentation>
</annotation>
<sequence>
<element minOccurs="1" maxOccurs="unbounded" name="group"
type="tns:groupComplexType">
</element>
</sequence>
<attribute name="basePackage" type="string">
<annotation>
<documentation>Base package to use for specifying the class
names of mapped objects. This value will be prepended to the
class name of the mapped object to form the fully qualified
class name.
Example: org.apache.turbine.om
Default: ""</documentation>
</annotation>
</attribute>
<attribute name="groupPrefix" type="string">
<annotation>
<documentation>Prefix to be assigned to all groups within the
input-data element. This is used to make group name unique if
the same group name is used in multiple definition files.
Default: null</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="fieldComplexType">
<annotation>
<documentation>The field element defines a field within a group.
This will be used to validate one HTML input field.</documentation>
</annotation>
<sequence>
<element minOccurs="0" maxOccurs="unbounded" name="rule"
type="tns:ruleComplexType">
</element>
</sequence>
<attribute name="key" type="string" use="required">
<annotation>
<documentation>A short identifier for the field. It is only used in
query parameters. It must be unique across all fields
within the enclosing group element.</documentation>
</annotation>
</attribute>
<attribute name="name" type="string" use="required">
<annotation>
<documentation>The name of the field. This is the identifier used to
get the field from the Intake Service. It must be unique
across all fields all fields within the enclosing group
element.</documentation>
</annotation>
</attribute>
<attribute name="displayName" type="string">
<annotation>
<documentation>An optional name for the field that can be used for display
on HTML forms. This is intended to be a friendly name for labels etc. or
a localization key.
Default: name</documentation>
</annotation>
</attribute>
<attribute name="displaySize" type="string">
<annotation>
<documentation>An optional size value to use when create the HTML input tag
for this field.</documentation>
</annotation>
</attribute>
<attribute name="type" default="String">
<annotation>
<documentation>Type of data contained in the field.
Default: "String"</documentation>
</annotation>
<simpleType>
<restriction base="string">
<enumeration value="boolean"></enumeration>
<enumeration value="BigDecimal"></enumeration>
<enumeration value="int"></enumeration>
<enumeration value="float"></enumeration>
<enumeration value="FileItem"></enumeration>
<enumeration value="String"></enumeration>
<enumeration value="DateString"></enumeration>
<enumeration value="ComboKey"></enumeration>
<enumeration value="double"></enumeration>
<enumeration value="short"></enumeration>
<enumeration value="long"></enumeration>
<enumeration value="custom"></enumeration>
</restriction>
</simpleType>
</attribute>
<attribute name="multiValued" type="boolean" default="false">
<annotation>
<documentation>If this is true, the field will accept multiple values.
Otherwise, the field only accepts a single value.
Default: false</documentation>
</annotation>
</attribute>
<attribute name="fieldClass" type="string">
<annotation>
<documentation>Name of the class used for handling the field. This is used to
customize field types. The attribute is only interpreted if the
type attribute is set to "custom".
If the the name of the class is not fully qualified, it will
be prepended with org.apache.fulcrum.intake.model.
For example: a value of "CurrencyField" will be read as
"org.apache.fulcrum.intake.model.CurrencyField".</documentation>
</annotation>
</attribute>
<attribute name="mapToObject" type="string">
<annotation>
<documentation>Class name of the mapped object. This will override the
mapToObject attribute of the enclosing group element.
Default: mapToObject from the enclosing group element</documentation>
</annotation>
</attribute>
<attribute name="mapToProperty" type="string">
<annotation>
<documentation>Name of the property within the mapped object that
will be mapped to the field. This value has no meaning
if mapToObject is not set.
This is used to determine the names of the getter and
setter methods in the mapped object. The actually
attribute within the object is never accessed directly.
When determining the name of the getter and setter methods,
the first character of the value of mapToProperty is made
uppercase. It is the prepended with either "get" or "set"
appropriately.
The getter method must not take any parameters. The setter
method must take exactly one parameter. For more information
of the details of determining the methods, see the javadocs
for java.beans.PropertyDescriptor.
Note: Specifying an empty string for the value of this attribute
will have the effect of not mapping this field. This is very
useful in cases where the group has a value for mapToObject but
there are fields in the group which should not be mapped.
Default: The name of the field.</documentation>
</annotation>
</attribute>
<attribute name="validator" type="string">
<annotation>
<documentation>Name of the class used for validating the value of the
field. This is used to have the field validated by a custom
validator object. If this is not set, a default validator
will be used according to the field type.
If the the name of the class is not fully qualified, it will
be prepended with org.apache.fulcrum.intake.validator.
For example: a value of "NumberValidator" will be read as
"org.apache.fulcrum.intake.validator.NumberValidator".
Default: default validator for the field type.</documentation>
</annotation>
</attribute>
<attribute name="defaultValue" type="string">
<annotation>
<documentation>Default value to be used for the value of the field if one
is not supplied my the mapped object.
Default: null</documentation>
</annotation>
</attribute>
<attribute name="emptyValue" type="string">
<annotation>
<documentation>Value to be used for the value of the field if it is not
supplied by the parameters returned from an input form.
Default: null</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="ruleComplexType">
<annotation>
<documentation>The rule element is used to describe validation rules for
fields.</documentation>
</annotation>
<simpleContent>
<annotation>
<documentation>Error message set for the field if the validation rule
fails.</documentation>
</annotation>
<extension base="string">
<attribute name="name" type="string" use="required">
<annotation>
<documentation>Name of the rule. The valid rule names vary
by field type.</documentation>
</annotation>
</attribute>
<attribute name="value" type="string" use="required">
<annotation>
<documentation>Value passed to the rule. The meaning of this
attribute varies by rule.</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
</schema>