mirror of
https://github.com/atlanticbiomedical/portal-legacy.git
synced 2025-07-02 01:47:28 -04:00
initial commit
This commit is contained in:
164
lib/symfony/vendor/propel-generator/resources/dtd/database.dtd
vendored
Executable file
164
lib/symfony/vendor/propel-generator/resources/dtd/database.dtd
vendored
Executable file
@ -0,0 +1,164 @@
|
||||
<!--
|
||||
Propel XML database schema DTD
|
||||
$Id: database.dtd,v 1.7 2005/03/30 11:38:18 hlellelid Exp $
|
||||
|
||||
This is based very closely on the schema DTD for Torque, but
|
||||
some differences do exist.
|
||||
-->
|
||||
|
||||
<!--
|
||||
|
||||
defaultPhpNamingMethod determines how a table or column name,
|
||||
from the name attribute in the xml database file, is converted to a
|
||||
PHP class or method name.
|
||||
|
||||
nochange - indicates not change is performed.
|
||||
underscore - Underscores are removed, First letter is
|
||||
capitalized, first letter after an underscore
|
||||
is capitalized, the rest of the letters are
|
||||
converted to lowercase.
|
||||
phpname - same as underscore, but no letters are converted
|
||||
to lowercase.
|
||||
-->
|
||||
|
||||
<!ELEMENT database (external-schema*, table+)>
|
||||
<!ATTLIST database
|
||||
name CDATA #IMPLIED
|
||||
defaultIdMethod (native|none) "none"
|
||||
defaultTranslateMethode CDATA #IMPLIED
|
||||
package CDATA #IMPLIED
|
||||
baseClass CDATA #IMPLIED
|
||||
basePeer CDATA #IMPLIED
|
||||
defaultPhpNamingMethod (nochange|underscore|phpname) "underscore"
|
||||
heavyIndexing (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT external-schema EMPTY>
|
||||
<!ATTLIST external-schema
|
||||
filename CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!--
|
||||
note: the interface="true", requires that useManagers=true in the
|
||||
properties file.
|
||||
-->
|
||||
<!ELEMENT table (column+,(foreign-key|index|unique|id-method-parameter|validator|vendor)*)>
|
||||
<!ATTLIST table
|
||||
name CDATA #REQUIRED
|
||||
phpName CDATA #IMPLIED
|
||||
idMethod (native|autoincrement|sequence|none|null) "null"
|
||||
skipSql (true|false) "false"
|
||||
readOnly (true|false) "false"
|
||||
abstract (true|false) "false"
|
||||
isTree (true|false) "false"
|
||||
package CDATA #IMPLIED
|
||||
baseClass CDATA #IMPLIED
|
||||
basePeer CDATA #IMPLIED
|
||||
alias CDATA #IMPLIED
|
||||
interface CDATA #IMPLIED
|
||||
phpNamingMethod (nochange|underscore|phpname) #IMPLIED
|
||||
heavyIndexing (true|false) #IMPLIED
|
||||
description CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT id-method-parameter EMPTY>
|
||||
<!ATTLIST id-method-parameter
|
||||
name CDATA "default"
|
||||
value CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT column ((inheritance|vendor)*)>
|
||||
<!ATTLIST column
|
||||
name CDATA #REQUIRED
|
||||
phpName CDATA #IMPLIED
|
||||
peerName CDATA #IMPLIED
|
||||
primaryKey (true|false) "false"
|
||||
required (true|false) "false"
|
||||
type
|
||||
(
|
||||
BIT | TINYINT | SMALLINT | INTEGER | BIGINT | FLOAT
|
||||
| REAL | NUMERIC | DECIMAL | CHAR | VARCHAR | LONGVARCHAR
|
||||
| DATE | TIME | TIMESTAMP | BINARY | VARBINARY | LONGVARBINARY
|
||||
| NULL | OTHER | PHP_OBJECT | DISTINCT | STRUCT | ARRAY
|
||||
| BLOB | CLOB | REF | BOOLEANINT | BOOLEANCHAR
|
||||
| DOUBLE | BOOLEAN
|
||||
) "VARCHAR"
|
||||
phpType (object|primitive) #IMPLIED
|
||||
size CDATA #IMPLIED
|
||||
scale CDATA #IMPLIED
|
||||
default CDATA #IMPLIED
|
||||
autoIncrement (true|false) "false"
|
||||
inheritance (single|false) "false"
|
||||
inputValidator CDATA #IMPLIED
|
||||
phpNamingMethod (nochange|underscore|phpname) #IMPLIED
|
||||
description CDATA #IMPLIED
|
||||
lazyLoad (true|false) "false"
|
||||
>
|
||||
|
||||
<!ELEMENT inheritance EMPTY>
|
||||
<!ATTLIST inheritance
|
||||
key CDATA #REQUIRED
|
||||
class CDATA #REQUIRED
|
||||
package CDATA #IMPLIED
|
||||
extends CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT foreign-key (reference+, vendor*)>
|
||||
<!ATTLIST foreign-key
|
||||
foreignTable CDATA #REQUIRED
|
||||
name CDATA #IMPLIED
|
||||
onUpdate (CASCADE|cascade|SETNULL|setnull|RESTRICT|restrict|NONE|none) "none"
|
||||
onDelete (CASCADE|cascade|SETNULL|setnull|RESTRICT|restrict|NONE|none) "none"
|
||||
>
|
||||
|
||||
<!ELEMENT reference EMPTY>
|
||||
<!ATTLIST reference
|
||||
local CDATA #REQUIRED
|
||||
foreign CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT index (index-column+)>
|
||||
<!ATTLIST index
|
||||
name CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT index-column (vendor*)>
|
||||
<!ATTLIST index-column
|
||||
name CDATA #REQUIRED
|
||||
size CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT unique (unique-column+)>
|
||||
<!ATTLIST unique
|
||||
name CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT unique-column (vendor*)>
|
||||
<!ATTLIST unique-column
|
||||
name CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT validator (rule+)>
|
||||
<!ATTLIST validator
|
||||
column CDATA #REQUIRED
|
||||
translate CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT rule EMPTY>
|
||||
<!ATTLIST rule
|
||||
name (mask|maxLength|maxValue|minLength|minValue|required|unique|validValues) #REQUIRED
|
||||
value CDATA #IMPLIED
|
||||
size ID #IMPLIED
|
||||
message CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT vendor (parameter+)>
|
||||
<!ATTLIST validator
|
||||
type CDATA #REQUIRED
|
||||
>
|
||||
|
||||
<!ELEMENT parameter EMPTY>
|
||||
<!ATTLIST parameter
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
>
|
8
lib/symfony/vendor/propel-generator/resources/xsd/custom_datatypes.xsd
vendored
Executable file
8
lib/symfony/vendor/propel-generator/resources/xsd/custom_datatypes.xsd
vendored
Executable file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xs:simpleType name='custom_datatypes'>
|
||||
<xs:restriction base='xs:string'>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:schema>
|
346
lib/symfony/vendor/propel-generator/resources/xsd/database.xsd
vendored
Executable file
346
lib/symfony/vendor/propel-generator/resources/xsd/database.xsd
vendored
Executable file
@ -0,0 +1,346 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- XML Schema for the Propel schema file
|
||||
This is just the first draft derived from the existing DTD
|
||||
and some additional restrictions have been included
|
||||
|
||||
Comments are a quite rare, I guess most things are pretty
|
||||
readable. An additional xml schema: custom_datatypes.xsd is
|
||||
also included. For now this file is unused, but that will
|
||||
change; don't worry.
|
||||
|
||||
Ron -->
|
||||
|
||||
<xs:include schemaLocation="custom_datatypes.xsd"/>
|
||||
|
||||
<xs:element name="database" type="database"/>
|
||||
<xs:element name="vendor" type="vendor"/>
|
||||
|
||||
<xs:simpleType name="file">
|
||||
<xs:restriction base="xs:string">
|
||||
<!-- Match any relative or absolute path and file containing letters, numbers and _ -->
|
||||
<xs:pattern value="((\.{1,2}|[\w_]*)/)*([\w_]*\.?)+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="default_datatypes">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="BIT"/>
|
||||
<xs:enumeration value="TINYINT"/>
|
||||
<xs:enumeration value="SMALLINT"/>
|
||||
<xs:enumeration value="INTEGER"/>
|
||||
<xs:enumeration value="BIGINT"/>
|
||||
<xs:enumeration value="FLOAT"/>
|
||||
<xs:enumeration value="REAL"/>
|
||||
<xs:enumeration value="NUMERIC"/>
|
||||
<xs:enumeration value="DECIMAL"/>
|
||||
<xs:enumeration value="CHAR"/>
|
||||
<xs:enumeration value="VARCHAR"/>
|
||||
<xs:enumeration value="LONGVARCHAR"/>
|
||||
<xs:enumeration value="DATE"/>
|
||||
<xs:enumeration value="TIME"/>
|
||||
<xs:enumeration value="TIMESTAMP"/>
|
||||
<xs:enumeration value="BINARY"/>
|
||||
<xs:enumeration value="VARBINARY"/>
|
||||
<xs:enumeration value="LONGVARBINARY"/>
|
||||
<xs:enumeration value="NULL"/>
|
||||
<xs:enumeration value="OTHER"/>
|
||||
<xs:enumeration value="PHP_OBJECT"/>
|
||||
<xs:enumeration value="DISTINCT"/>
|
||||
<xs:enumeration value="STRUCT"/>
|
||||
<xs:enumeration value="ARRAY"/>
|
||||
<xs:enumeration value="BLOB"/>
|
||||
<xs:enumeration value="CLOB"/>
|
||||
<xs:enumeration value="REF"/>
|
||||
<xs:enumeration value="BOOLEANINT"/>
|
||||
<xs:enumeration value="BOOLEANCHAR"/>
|
||||
<xs:enumeration value="DOUBLE"/>
|
||||
<xs:enumeration value="BOOLEAN"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="datatype">
|
||||
<xs:union memberTypes="default_datatypes custom_datatypes"/>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="dbidmethod">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="native"/>
|
||||
<xs:enumeration value="none"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="tbidmethod">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="autoincrement"/>
|
||||
<xs:enumeration value="sequence"/>
|
||||
<xs:enumeration value="null"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="idmethod">
|
||||
<xs:union memberTypes="dbidmethod tbidmethod"/>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="phpnamingmethod">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="nochange"/>
|
||||
<xs:enumeration value="underscore"/>
|
||||
<xs:enumeration value="phpname"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="delete">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="cascade"/>
|
||||
<xs:enumeration value="set null"/>
|
||||
<xs:enumeration value="setnull"/>
|
||||
<xs:enumeration value="restrict"/>
|
||||
<xs:enumeration value="none"/>
|
||||
<xs:enumeration value=""/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="update">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="cascade"/>
|
||||
<xs:enumeration value="setnull"/>
|
||||
<xs:enumeration value="set null"/>
|
||||
<xs:enumeration value="restrict"/>
|
||||
<xs:enumeration value="none"/>
|
||||
<xs:enumeration value=""/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="rulename">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="mask"/>
|
||||
<xs:enumeration value="maxLength"/>
|
||||
<xs:enumeration value="maxValue"/>
|
||||
<xs:enumeration value="minLength"/>
|
||||
<xs:enumeration value="minValue"/>
|
||||
<xs:enumeration value="required"/>
|
||||
<xs:enumeration value="unique"/>
|
||||
<xs:enumeration value="validValues"/>
|
||||
<xs:enumeration value="notMatch"/>
|
||||
<xs:enumeration value="match"/>
|
||||
<xs:enumeration value="class"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="inh_option">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="single"/>
|
||||
<xs:enumeration value="false"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="php_type">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="primitive"/>
|
||||
<xs:enumeration value="object"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict column name to letters (upper- and lowercase), numbers and the _ -->
|
||||
<xs:simpleType name="column_name">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\w_]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict php name to letters (upper- and lowercase), numbers and the _ -->
|
||||
<xs:simpleType name="php_name">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\w_]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict php class name to letters (upper- and lowercase), numbers and the _. Dot seperated -->
|
||||
<xs:simpleType name="php_class">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="([\w_]+.?)+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict table name to letters (upper- and lowercase), numbers and the _ -->
|
||||
<xs:simpleType name="table_name">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\w_]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict index name to letters (upper- and lowercase), numbers and the _ -->
|
||||
<xs:simpleType name="index_name">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\w_]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<!-- Restrict foreign column name to letters (upper- and lowercase), numbers and the _ -->
|
||||
<xs:simpleType name="foreign_name">
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:pattern value="[\w_]+"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="parameter">
|
||||
<xs:attribute name="name" type="xs:string" use="required"/>
|
||||
<xs:attribute name="value" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="validator">
|
||||
<xs:sequence>
|
||||
<xs:element name="rule" type="rule" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="column" type="column_name" use="required"/>
|
||||
<xs:attribute name="translate" type="xs:string" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="vendor">
|
||||
<xs:sequence>
|
||||
<xs:element name="parameter" type="parameter" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="type" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="rule">
|
||||
<xs:attribute name="name" type="rulename" use="required"/>
|
||||
<xs:attribute name="value" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
|
||||
<xs:attribute name="message" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="class" type="xs:string" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="id-method-parameter">
|
||||
<xs:attribute name="name" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="value" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="index">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="index-column" type="index-column" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="index_name" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="unique">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="unique-column" type="unique-column" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="index_name" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="index-column">
|
||||
<xs:sequence>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="column_name" use="required"/>
|
||||
<xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="unique-column">
|
||||
<xs:sequence>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="column_name" use="required"/>
|
||||
<xs:attribute name="size" type="xs:positiveInteger" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="inheritance">
|
||||
<xs:attribute name="key" type="xs:string" use="required"/>
|
||||
<xs:attribute name="class" type="xs:string" use="required"/>
|
||||
<xs:attribute name="package" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="extends" type="xs:string" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="reference">
|
||||
<xs:attribute name="local" type="column_name" use="required"/>
|
||||
<xs:attribute name="foreign" type="column_name" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="column">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="inheritance" type="inheritance" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="column_name" use="required"/>
|
||||
<xs:attribute name="phpName" type="php_name" use="optional"/>
|
||||
<xs:attribute name="peerName" type="php_class" use="optional"/>
|
||||
<xs:attribute name="primaryKey" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="required" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="type" type="datatype" default="VARCHAR"/>
|
||||
<xs:attribute name="phpType" type="php_type" use="optional"/>
|
||||
<xs:attribute name="size" type="xs:nonNegativeInteger" use="optional"/>
|
||||
<xs:attribute name="scale" type="xs:nonNegativeInteger" use="optional"/>
|
||||
<xs:attribute name="default" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="autoIncrement" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="inheritance" type="inh_option" default="false"/>
|
||||
<xs:attribute name="inputValidator" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="phpNamingMethod" type="phpnamingmethod" use="optional"/>
|
||||
<xs:attribute name="description" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="lazyLoad" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="nodeKeySep" type="xs:string" use="optional"/> <!-- missing in the old DTD, but required to keep the treetest example working -->
|
||||
<xs:attribute name="nodeKey" type="xs:string" use="optional"/> <!-- missing in the old DTD, but required to keep the treetest example working -->
|
||||
<xs:attribute name="require" type="xs:string" use="optional"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="foreign-key">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="reference" type="reference" minOccurs="1" maxOccurs="unbounded"/>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="foreignTable" type="table_name" use="required"/>
|
||||
<xs:attribute name="name" type="foreign_name" use="optional"/>
|
||||
<xs:attribute name="onDelete" type="delete" default="none"/>
|
||||
<xs:attribute name="onUpdate" type="update" default="none"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="external-schema">
|
||||
<xs:attribute name="filename" type="file" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="table">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="column" type="column" maxOccurs="unbounded"/>
|
||||
<xs:element name="foreign-key" type="foreign-key" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="index" type="index" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="unique" type="unique" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="id-method-parameter" type="id-method-parameter" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="validator" type="validator" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element ref="vendor" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="table_name" use="required"/>
|
||||
<xs:attribute name="phpName" type="php_class" use="optional"/>
|
||||
<xs:attribute name="idMethod" type="idmethod" use='optional'/>
|
||||
<xs:attribute name="skipSql" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="readOnly" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="abstract" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="baseClass" type="php_class" use="optional"/>
|
||||
<xs:attribute name="basePeer" type="php_class" use="optional"/>
|
||||
<xs:attribute name="alias" type="table_name" use="optional"/>
|
||||
<xs:attribute name="package" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="interface" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="phpNamingMethod" type="phpnamingmethod" use='optional'/>
|
||||
<xs:attribute name="heavyIndexing" type="xs:boolean" use="optional"/>
|
||||
<xs:attribute name="description" type="xs:string"/>
|
||||
<xs:attribute name="isTree" type="xs:boolean" use="optional"/> <!-- missing in the old DTD, but required to keep the treetest example working -->
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="database">
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="external-schema" type="external-schema" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="table" type="table" minOccurs="1" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="defaultIdMethod" type="dbidmethod" default="none"/>
|
||||
<xs:attribute name="defaultTranslateMethod" type="xs:string" use="optional"/>
|
||||
<xs:attribute name="package" type="php_class" use="optional"/>
|
||||
<xs:attribute name="baseClass" type="php_class" use="optional"/>
|
||||
<xs:attribute name="basePeer" type="php_class" use="optional"/>
|
||||
<xs:attribute name="defaultPhpNamingMethod" type="phpnamingmethod" default="underscore"/>
|
||||
<xs:attribute name="heavyIndexing" type="xs:boolean" default="false"/>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
226
lib/symfony/vendor/propel-generator/resources/xsl/database.xsl
vendored
Executable file
226
lib/symfony/vendor/propel-generator/resources/xsl/database.xsl
vendored
Executable file
@ -0,0 +1,226 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE xsl:stylesheet [<!ENTITY nbsp " ">]>
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select='database'/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='database'>
|
||||
<database>
|
||||
<xsl:if test='not(boolean(@defaultIdMethod))'>
|
||||
<xsl:attribute name='defaultIdMethod'>none</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@defaultPhpNamingMethod))'>
|
||||
<xsl:attribute name='defaultPhpNamingMethod'>underscore</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@heavyIndexing))'>
|
||||
<xsl:attribute name='heavyIndexing'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='external-schema'/>
|
||||
<xsl:apply-templates select='table'/>
|
||||
</database>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@defaultPhPNamingMethod'>
|
||||
<xsl:attribute name='defaultPhPNamingMethod'><xsl:value-of select='translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@onDelete'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='.=""'>
|
||||
<xsl:attribute name='onDelete'>none</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name='onDelete'><xsl:value-of select='translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@OnDelete'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='.=""'>
|
||||
<xsl:attribute name='onDelete'>none</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name='onDelete'><xsl:value-of select='translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@onUpdate'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='.=""'>
|
||||
<xsl:attribute name='onUpdate'>none</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name='onUpdate'><xsl:value-of select='translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@OnUpdate'>
|
||||
<xsl:choose>
|
||||
<xsl:when test='.=""'>
|
||||
<xsl:attribute name='onUpdate'>none</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name='onUpdate'><xsl:value-of select='translate(., "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz")'/></xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@IdMethod'>
|
||||
<xsl:attribute name='idMethod'><xsl:value-of select='.'/></xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='@*' priority='-1'>
|
||||
<xsl:copy-of select='.'/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='external-schema'>
|
||||
<external-schema>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</external-schema>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='table'>
|
||||
<table>
|
||||
<xsl:if test='not(boolean(@skipSql))'>
|
||||
<xsl:attribute name='skipSql'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@abstract))'>
|
||||
<xsl:attribute name='abstract'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='column'/>
|
||||
<xsl:apply-templates select='foreign-key'/>
|
||||
<xsl:apply-templates select='index'/>
|
||||
<xsl:apply-templates select='unique'/>
|
||||
<xsl:apply-templates select='id-method-parameter'/>
|
||||
<xsl:apply-templates select='validator'/>
|
||||
<xsl:apply-templates select='vendor'/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='foreign-key'>
|
||||
<foreign-key>
|
||||
<xsl:if test='not(boolean(@onDelete)) and not(boolean(@OnDelete))'>
|
||||
<xsl:attribute name='onDelete'>none</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@onUpdate)) and not(boolean(@OnUpdate))'>
|
||||
<xsl:attribute name='onUpdate'>none</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='reference'/>
|
||||
<xsl:apply-templates select='vendor'/>
|
||||
</foreign-key>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='index'>
|
||||
<index>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='index-column'/>
|
||||
</index>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='unique'>
|
||||
<unique>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='unique-column'/>
|
||||
</unique>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='unique-column'>
|
||||
<unique-column>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='vendor'/>
|
||||
</unique-column>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='index-column'>
|
||||
<index-column>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='vendor'/>
|
||||
</index-column>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='id-method-parameter'>
|
||||
<id-method-parameter>
|
||||
<xsl:if test='not(boolean(@name))'>
|
||||
<xsl:attribute name='name'>default</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</id-method-parameter>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='validator'>
|
||||
<validator>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='rule'/>
|
||||
</validator>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='rule'>
|
||||
<rule>
|
||||
<xsl:if test='not(boolean(@name))'>
|
||||
<xsl:attribute name='name'>class</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</rule>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='parameter'>
|
||||
<parameter>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</parameter>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='vendor'>
|
||||
<vendor>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='parameter'/>
|
||||
</vendor>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='inheritance'>
|
||||
<inheritance>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</inheritance>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='column'>
|
||||
<column>
|
||||
<xsl:if test='not(boolean(@primaryKey))'>
|
||||
<xsl:attribute name='primaryKey'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@required))'>
|
||||
<xsl:attribute name='required'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@type))'>
|
||||
<xsl:attribute name='type'>VARCHAR</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@autoIncrement))'>
|
||||
<xsl:attribute name='autoIncrement'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test='not(boolean(@lazyLoad))'>
|
||||
<xsl:attribute name='lazyLoad'>false</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
<xsl:apply-templates select='inheritance'/>
|
||||
<xsl:apply-templates select='vendor'/>
|
||||
</column>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match='reference'>
|
||||
<reference>
|
||||
<xsl:apply-templates select='@*'/>
|
||||
</reference>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Reference in New Issue
Block a user