Author: spagop
Date: 2009-07-13 04:24:47 -0400 (Mon, 13 Jul 2009)
New Revision: 1099
Added:
trunk/utils/dna-jcr-gen/src/main/resources/benerator-0.5.9-SR1.xsd
Log:
enhanced argument input ways
Copied: trunk/utils/dna-jcr-gen/src/main/resources/benerator-0.5.9-SR1.xsd (from rev 1096,
trunk/utils/dna-jcr-gen/benerator-0.5.9-SR1.xsd)
===================================================================
--- trunk/utils/dna-jcr-gen/src/main/resources/benerator-0.5.9-SR1.xsd
(rev 0)
+++ trunk/utils/dna-jcr-gen/src/main/resources/benerator-0.5.9-SR1.xsd 2009-07-13 08:24:47
UTC (rev 1099)
@@ -0,0 +1,372 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+
targetNamespace="http://databene.org/benerator/0.5.9-SR1"
+
xmlns="http://databene.org/benerator/0.5.9-SR1"
+ elementFormDefault="qualified">
+
+ <xs:annotation>
+ <xs:documentation>The benerator schema describes the generation setup for
benerator.</xs:documentation>
+ <xs:appinfo/>
+ </xs:annotation>
+
+ <xs:simpleType name="script-expression-type">
+ <xs:restriction base="xs:string">
+ <xs:pattern value="\{.*\}"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="errorhandler-type">
+ <xs:union>
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="fatal"/>
+ <xs:enumeration value="error"/>
+ <xs:enumeration value="warn"/>
+ <xs:enumeration value="info"/>
+ <xs:enumeration value="debug"/>
+ <xs:enumeration value="trace"/>
+ <xs:enumeration value="ignore"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="script-expression-type"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+
+
+ <!-- The document root, it can list beans, create-entities and run-tasks in arbitrary
order. -->
+ <xs:element name="setup">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="import" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="include" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="property" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="database" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="bean" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="defaultAttributes" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="create-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="update-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="run-task" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="execute" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="evaluate" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="echo" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="default-script" type="xs:string"/>
<!-- deprecated -->
+ <xs:attribute name="default-null" type="xs:string"/>
<!-- deprecated -->
+ <xs:attribute name="defaultScript"
type="xs:string"/>
+ <xs:attribute name="defaultNull"
type="xs:string"/>
+ <xs:attribute name="defaultEncoding"
type="xs:string"/>
+ <xs:attribute name="defaultLineSeparator"
type="xs:string"/>
+ <xs:attribute name="defaultLocale"
type="xs:string"/>
+ <xs:attribute name="defaultDataset"
type="xs:string"/>
+ <xs:attribute name="defaultPagesize"
type="xs:string"/>
+ <xs:attribute name="defaultSeparator"
type="xs:string"/>
+ <xs:attribute name="defaultErrorHandler"
type="errorhandler-type"/>
+ <xs:attribute name="maxCount"
type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="comment" type="xs:string" />
+
+ <!-- Imports classes. -->
+ <xs:element name="import">
+ <xs:complexType>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="domain" type="xs:string"/>
+ <xs:attribute name="defaults" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Includes a properties file. -->
+ <xs:element name="include">
+ <xs:complexType>
+ <xs:attribute name="uri" type="xs:string"
use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Outputs a message to the console. -->
+ <xs:element name="echo">
+ <xs:complexType>
+ <xs:attribute name="message" type="xs:string"
use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Instantiates a JavaBean of the given class.
+ If the 'id' is set, the bean is put into the context with that name.
+ If the JavaBean itself has a property named 'id', this one is set to the
value specified here. -->
+ <xs:element name="bean">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="property" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"
use="required"/>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="spec" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- connects to a database -->
+ <xs:element name="database">
+ <xs:complexType>
+ <xs:attribute name="id" type="xs:string"
use="required"/>
+ <xs:attribute name="url" type="xs:string"/>
+ <xs:attribute name="driver" type="xs:string"/>
+ <xs:attribute name="user" type="xs:string"/>
+ <xs:attribute name="schema" type="xs:string"/>
+ <xs:attribute name="password" type="xs:string"/>
+ <xs:attribute name="batch" type="xs:string"/>
+ <xs:attribute name="fetchSize" type="xs:string"/>
+ <xs:attribute name="readOnly" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="execute-type">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="uri"
type="xs:string"/>
+ <xs:attribute name="encoding"
type="xs:string"/>
+ <xs:attribute name="target"
type="xs:string"/>
+ <xs:attribute name="type"
type="xs:string"/>
+ <xs:attribute name="onError"
type="errorhandler-type"/>
+ <xs:attribute name="optimize"
type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <!-- executes a script, e.g. SQL -->
+ <xs:element name="execute" />
+
+ <!-- evaluates a script, e.g. SQL -->
+ <xs:element name="evaluate">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="execute-type">
+ <xs:attribute name="assert"
type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Declares a JavaBean to be used as consumer, either by referencing an object from
the context (ref)
+ or by instantiating a JavaBean like with the <bean> tag. -->
+ <xs:element name="consumer">
+ <xs:complexType>
+ <xs:sequence minOccurs="1" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="property" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"/>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="ref" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Sets a JavaBean's property to the simple property specified as
'value' attribute
+ or to the object stored in the context with the 'ref'. -->
+ <xs:element name="property">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="bean" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="idref" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="value" type="xs:string"/>
+ <xs:attribute name="ref" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Represents a reference to a JavaBean (of the name specified by the
'bean' attribute) from the context. -->
+ <xs:element name="idref">
+ <xs:complexType>
+ <xs:attribute name="bean" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Instantiates and executes a JavaBean that implements the Task interface.
+ Properties are handled like in the <bean> tag.
+ The task is executed 'count' times in a number of 'threads'
parallel threads.
+ Invocations are executed in groups of size 'pagesize'. -->
+ <xs:element name="run-task">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="property" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="class" type="xs:string"/>
+ <xs:attribute name="count" type="xs:string"/>
+ <xs:attribute name="pagesize" type="xs:string"/>
+ <xs:attribute name="threads" type="xs:string"/>
+ <xs:attribute name="pager" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="defaultAttributes">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="id" minOccurs="0"
maxOccurs="1"/>
+ <xs:element ref="attribute" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="reference" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="count" type="xs:string"/>
+ <xs:attribute name="pagesize" type="xs:string"/>
+ <xs:attribute name="threads" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="encoding" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Creates entities. If a 'count' is provided the corresponding number
of entities is created.
+ If no count is provided, entities are created as long as each involved generator
is available. -->
+ <xs:element name="create-entities">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="id" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="attribute" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="reference" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="variable" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="consumer" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="create-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="update-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="count" type="xs:string"/>
+ <xs:attribute name="minCount" type="xs:string"/>
+ <xs:attribute name="maxCount" type="xs:string"/>
+ <xs:attribute name="pagesize" type="xs:string"/>
+ <xs:attribute name="threads" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="selector" type="xs:string"/>
+ <xs:attribute name="encoding" type="xs:string"/>
+ <xs:attribute name="consumer" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Updates entities. -->
+ <xs:element name="update-entities">
+ <xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="comment" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="id" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="attribute" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="reference" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="variable" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="consumer" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="create-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ <xs:element ref="update-entities" minOccurs="0"
maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="count" type="xs:string"/>
+ <xs:attribute name="pagesize" type="xs:string"/>
+ <xs:attribute name="threads" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="selector" type="xs:string"/>
+ <xs:attribute name="encoding" type="xs:string"/>
+ <xs:attribute name="consumer" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Defines an ID generator that can be reused in different scopes. -->
+ <xs:element name="id">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="type" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="strategy" type="xs:string"/>
+ <xs:attribute name="scope" type="xs:string"/>
+ <xs:attribute name="param" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Defines a reference generator. -->
+ <xs:element name="reference">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="type" type="xs:string"/>
+ <xs:attribute name="nullable" type="xs:string"/>
+ <xs:attribute name="nullQuota" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="targetType" type="xs:string"/>
+ <xs:attribute name="selector" type="xs:string"/>
+ <xs:attribute name="distribution" type="xs:string"/>
+ <xs:attribute name="mode" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- Defines a variable that is recreated by a generator on each entity creation
-->
+ <xs:element name="variable" type="generator-setup"/>
+
+ <xs:complexType name="generator-setup">
+ <xs:attribute name="name" type="xs:string"
use="required"/>
+ <xs:attribute name="type" type="xs:string"/>
+ <xs:attribute name="generator" type="xs:string"/>
+ <xs:attribute name="validator" type="xs:string"/>
+ <xs:attribute name="values" type="xs:string"/>
+ <xs:attribute name="source" type="xs:string"/>
+ <xs:attribute name="encoding" type="xs:string"/>
+ <xs:attribute name="selector" type="xs:string"/>
+ <xs:attribute name="pattern" type="xs:string"/>
+ <xs:attribute name="nullQuota" type="xs:string"/>
+ <xs:attribute name="converter" type="xs:string"/>
+ <xs:attribute name="dataset" type="xs:string"/>
+ <xs:attribute name="nesting" type="xs:string"/>
+ <xs:attribute name="locale" type="xs:string"/>
+ <xs:attribute name="unique" type="xs:string"/>
+ <xs:attribute name="distribution" type="xs:string"/>
+ <xs:attribute name="variation1" type="xs:string"/>
+ <xs:attribute name="variation2" type="xs:string"/>
+ <xs:attribute name="cyclic" type="xs:string"/>
+ <xs:attribute name="proxy">
+ <xs:simpleType>
+ <xs:union>
+ <xs:simpleType> <!-- (skip | repeat) -->
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="skip"/>
+ <xs:enumeration value="repeat"/>
+ </xs:restriction>
+ </xs:simpleType>
+ <xs:simpleType>
+ <xs:restriction base="script-expression-type"/>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="proxy-param1" type="xs:string"/>
+ <xs:attribute name="proxy-param2" type="xs:string"/>
+ </xs:complexType>
+
+ <xs:element name="attribute"
type="attribute-generator-setup"/>
+
+ <xs:complexType name="attribute-generator-setup">
+ <xs:complexContent>
+ <xs:extension base="generator-setup">
+
+ <xs:attribute name="nullable" type="xs:string"/>
+ <xs:attribute name="mode" type="xs:string"/>
+
+ <!-- boolean generator setup -->
+ <xs:attribute name="trueQuota" type="xs:string"/>
+
+ <!-- number generator setup -->
+ <xs:attribute name="min" type="xs:string"/>
+ <xs:attribute name="minExclusive" type="xs:string"/>
+ <xs:attribute name="max" type="xs:string"/>
+ <xs:attribute name="maxExclusive" type="xs:string"/>
+ <xs:attribute name="precision" type="xs:string"/>
+
+ <!-- String generator setup -->
+ <xs:attribute name="script" type="xs:string"/>
+ <xs:attribute name="minLength" type="xs:string"/>
+ <xs:attribute name="maxLength" type="xs:string"/>
+
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+</xs:schema>