doctrine-extensions-mapping-2-1.xsd 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. targetNamespace="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
  4. xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
  5. elementFormDefault="qualified">
  6. <xs:annotation>
  7. <xs:documentation><![CDATA[
  8. This is the XML Schema for the object/relational
  9. mapping file used by the Doctrine Extensions by Gedmo
  10. extensions
  11. Doctrine component version support: 2.1.x
  12. ]]></xs:documentation>
  13. </xs:annotation>
  14. <!--
  15. It would be nice if we could force the gedmo with only necessary elements into each of doctrine elements.
  16. Patches that do that are more than welcome.
  17. Please note, that marking e.g filed element in xml document with xsi:type is not an option as we need to allow other
  18. people to push their own additional attributes/elements into the same field element and they should not extend our schema
  19. -->
  20. <!--
  21. <xs:complexType name="entity-extension">
  22. <xs:sequence>
  23. <xs:element name="translation" type="gedmo:translation" minOccurs="0" maxOccurs="1" />
  24. <xs:element name="tree" type="gedmo:tree" minOccurs="0" maxOccurs="1" />
  25. <xs:element name="tree-closure" type="gedmo:tree-closure" minOccurs="0" maxOccurs="1" />
  26. <xs:element name="loggable" type="gedmo:loggable" minOccurs="0" maxOccurs="1" />
  27. </xs:sequence>
  28. </xs:complexType>
  29. <xs:complexType name="field-extension">
  30. <xs:sequence>
  31. <xs:element name="sluggable" type="gedmo:sluggable" minOccurs="0" maxOccurs="unbounded"/>
  32. <xs:element name="slug" type="gedmo:slug" minOccurs="0" maxOccurs="1"/>
  33. <xs:element name="translatable" type="gedmo:emptyType" minOccurs="0" maxOccurs="unbounded"/>
  34. <xs:element name="timestampable" type="gedmo:timestampable" minOccurs="0" maxOccurs="unbounded"/>
  35. <xs:element name="versioned" type="gedmo:emptyType" minOccurs="0" maxOccurs="unbounded"/>
  36. <xs:element name="tree-left" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  37. <xs:element name="tree-right" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  38. <xs:element name="tree-level" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  39. <xs:element name="tree-root" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  40. </xs:sequence>
  41. </xs:complexType>
  42. <xs:complexType name="many-to-one-extension">
  43. <xs:sequence>
  44. <xs:element name="versioned" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  45. <xs:element name="tree-parent" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  46. </xs:sequence>
  47. </xs:complexType>
  48. <xs:complexType name="one-to-one-extension">
  49. <xs:sequence>
  50. <xs:element name="versioned" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  51. <xs:element name="tree-parent" type="gedmo:emptyType" minOccurs="0" maxOccurs="1"/>
  52. </xs:sequence>
  53. </xs:complexType>
  54. -->
  55. <!-- because of the above we have for now a root element gedmo with all choices -->
  56. <!-- entity -->
  57. <xs:element name="translation" type="gedmo:translation"/>
  58. <xs:element name="tree" type="gedmo:tree"/>
  59. <xs:element name="tree-closure" type="gedmo:tree-closure"/>
  60. <xs:element name="loggable" type="gedmo:loggable"/>
  61. <!-- field -->
  62. <xs:element name="sluggable" type="gedmo:sluggable"/>
  63. <xs:element name="slug" type="gedmo:slug"/>
  64. <xs:element name="translatable" type="gedmo:translatable"/>
  65. <xs:element name="timestampable" type="gedmo:timestampable"/>
  66. <xs:element name="blameable" type="gedmo:blameable"/>
  67. <xs:element name="versioned" type="gedmo:emptyType"/>
  68. <xs:element name="tree-left" type="gedmo:emptyType"/>
  69. <xs:element name="tree-right" type="gedmo:emptyType"/>
  70. <xs:element name="tree-level" type="gedmo:emptyType"/>
  71. <xs:element name="tree-root" type="gedmo:emptyType"/>
  72. <!-- many-to-one -->
  73. <!-- xs:element name="versioned" type="gedmo:emptyType"/-->
  74. <xs:element name="tree-parent" type="gedmo:emptyType"/>
  75. <!-- one-to-one -->
  76. <!-- same as many-to-one
  77. <xs:element name="versioned" type="gedmo:emptyType"/>
  78. <xs:element name="tree-parent" type="gedmo:emptyType"/>
  79. -->
  80. <xs:complexType name="translation">
  81. <xs:attribute name="entity" type="xs:string" use="optional" />
  82. <xs:attribute name="locale" type="xs:string" use="optional" />
  83. <xs:attribute name="language" type="xs:string" use="optional" />
  84. </xs:complexType>
  85. <xs:complexType name="tree">
  86. <xs:attribute name="type" type="gedmo:tree-type" default="nested" />
  87. </xs:complexType>
  88. <xs:complexType name="tree-closure">
  89. <xs:attribute name="class" type="xs:string" use="required" />
  90. </xs:complexType>
  91. <xs:complexType name="loggable">
  92. <xs:attribute name="log-entry-class" type="xs:string" use="optional" />
  93. </xs:complexType>
  94. <xs:complexType name="sluggable">
  95. <xs:attribute name="position" type="xs:integer" use="optional" />
  96. <xs:attribute name="slugField" type="xs:string" use="optional" />
  97. </xs:complexType>
  98. <xs:complexType name="slug">
  99. <xs:attribute name="unique" type="xs:boolean" use="optional" />
  100. <xs:attribute name="updatable" type="xs:boolean" use="optional" />
  101. <xs:attribute name="separator" type="xs:string" use="optional" />
  102. <xs:attribute name="style" type="gedmo:slug-style" use="optional" />
  103. </xs:complexType>
  104. <xs:complexType name="timestampable">
  105. <xs:attribute name="on" type="gedmo:timestampable-action" use="optional" />
  106. <xs:attribute name="field" type="xs:string" use="optional" />
  107. <xs:attribute name="value" type="xs:string" use="optional" />
  108. </xs:complexType>
  109. <xs:complexType name="blameable">
  110. <xs:attribute name="on" type="gedmo:timestampable-action" use="optional" />
  111. <xs:attribute name="field" type="xs:string" use="optional" />
  112. <xs:attribute name="value" type="xs:string" use="optional" />
  113. </xs:complexType>
  114. <xs:complexType name="translatable">
  115. <xs:attribute name="fallback" type="xs:boolean" use="optional" />
  116. </xs:complexType>
  117. <xs:complexType name="emptyType">
  118. </xs:complexType>
  119. <xs:simpleType name="tree-type">
  120. <xs:restriction base="xs:token">
  121. <xs:enumeration value="nested"/>
  122. <xs:enumeration value="closure"/>
  123. </xs:restriction>
  124. </xs:simpleType>
  125. <xs:simpleType name="slug-style">
  126. <xs:restriction base="xs:token">
  127. <xs:enumeration value="default"/>
  128. <xs:enumeration value="camel"/>
  129. <xs:enumeration value="upper"/>
  130. </xs:restriction>
  131. </xs:simpleType>
  132. <xs:simpleType name="timestampable-action">
  133. <xs:restriction base="xs:token">
  134. <xs:enumeration value="create"/>
  135. <xs:enumeration value="update"/>
  136. <xs:enumeration value="change"/>
  137. </xs:restriction>
  138. </xs:simpleType>
  139. </xs:schema>