types.xsd 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. xmlns:p5TypeParam="http://biuro.biall-net.pl/p5/schema/typeParams"
  4. xmlns:p5Type="http://biuro.biall-net.pl/p5/schema/types" elementFormDefault="qualified"
  5. targetNamespace="http://biuro.biall-net.pl/p5/schema/types">
  6. <!--<xs:import namespace="http://biuro.biall-net.pl/p5/schema/typeParams" schemaLocation=""/>
  7. @2018-03-23 bindera: widze, ze tego nie ma i raczej jest niepotrzebne?
  8. -->
  9. <xs:simpleType name="string">
  10. <xs:restriction base="xs:string"/>
  11. </xs:simpleType>
  12. <xs:simpleType name="text">
  13. <xs:restriction base="xs:string"/>
  14. </xs:simpleType>
  15. <xs:simpleType name="enumeration">
  16. <xs:restriction base="xs:string"/>
  17. </xs:simpleType>
  18. <xs:simpleType name="set">
  19. <xs:annotation>
  20. <xs:documentation>
  21. Example appinfo for `CRM_PRZYPADEK`.`FORM_TREAT` field defined as set('', 'R', 'W', 'X', 'C', 'S', 'O', 'V', 'E'):
  22. <xs:appinfo>
  23. <p5TypeParam:param name="enumeration">
  24. <p5TypeParam:enumeration value="0" label="" description="Brak"/>
  25. <p5TypeParam:enumeration value="2" label="R" description="Read"/>
  26. <p5TypeParam:enumeration value="4" label="W" description="Write"/>
  27. <p5TypeParam:enumeration value="8" label="X" description="Execute"/>
  28. <p5TypeParam:enumeration value="16" label="C" description="Create"/>
  29. <p5TypeParam:enumeration value="32" label="S" description="..."/>
  30. <p5TypeParam:enumeration value="64" label="O" description="..."/>
  31. <p5TypeParam:enumeration value="124" label="V" description="..."/>
  32. <p5TypeParam:enumeration value="256" label="E" description="Export"/>
  33. </p5TypeParam:param>
  34. </xs:appinfo>
  35. SELECT ID, `FORM_TREAT`, CAST(`FORM_TREAT` AS UNSIGNED) FROM `CRM_PRZYPADEK`;
  36. IF 8 == 'X' THEN
  37. insert into `CRM_PRZYPADEK`(`FORM_TREAT`) values('X');
  38. IS EQUAL TO
  39. insert into `CRM_PRZYPADEK`(`FORM_TREAT`) values(8);
  40. </xs:documentation>
  41. </xs:annotation>
  42. <xs:restriction base="xs:integer"/>
  43. </xs:simpleType>
  44. <xs:simpleType name="integer">
  45. <xs:restriction base="xs:integer"/>
  46. </xs:simpleType>
  47. <xs:simpleType name="decimal">
  48. <xs:restriction base="xs:decimal"/>
  49. </xs:simpleType>
  50. <xs:simpleType name="double">
  51. <xs:restriction base="xs:double"/>
  52. </xs:simpleType>
  53. <xs:simpleType name="float">
  54. <xs:restriction base="xs:double"/>
  55. </xs:simpleType>
  56. <xs:simpleType name="binary">
  57. <xs:restriction base="xs:hexBinary"/>
  58. </xs:simpleType>
  59. <xs:simpleType name="hexBinary">
  60. <xs:restriction base="xs:hexBinary"/>
  61. </xs:simpleType>
  62. <xs:simpleType name="date">
  63. <xs:union memberTypes="xs:date p5Type:dateZero"/>
  64. </xs:simpleType>
  65. <xs:simpleType name="dateZero">
  66. <xs:restriction base="xs:string">
  67. <xs:enumeration value="0000-00-00"/>
  68. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  69. </xs:restriction>
  70. </xs:simpleType>
  71. <xs:simpleType name="dateTime">
  72. <xs:union memberTypes="xs:dateTime p5Type:dateTimeZero"/>
  73. </xs:simpleType>
  74. <xs:simpleType name="dateTimeZero">
  75. <xs:restriction base="xs:string">
  76. <xs:enumeration value="0000-00-00 00:00:00"/>
  77. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  78. </xs:restriction>
  79. </xs:simpleType>
  80. <xs:simpleType name="time">
  81. <xs:union memberTypes="xs:time p5Type:timeZero"/>
  82. </xs:simpleType>
  83. <xs:simpleType name="timeZero">
  84. <xs:restriction base="xs:string">
  85. <xs:enumeration value="00:00:00"/>
  86. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  87. </xs:restriction>
  88. </xs:simpleType>
  89. <xs:simpleType name="year">
  90. <xs:union memberTypes="xs:gYear p5Type:yearZero"/>
  91. </xs:simpleType>
  92. <xs:simpleType name="yearZero">
  93. <xs:restriction base="xs:string">
  94. <xs:enumeration value="0000"/>
  95. <xs:enumeration value="CURRENT_TIMESTAMP"/>
  96. </xs:restriction>
  97. </xs:simpleType>
  98. <!--
  99. TODO: Geometry
  100. TODO: MultiPolygon
  101. TODO: MultiPoint
  102. TODO: MultiLineString
  103. TODO: GeometryCollection
  104. <gml:MultiPolygon>
  105. <gml:polygonMember>
  106. <gml:Polygon>
  107. ...
  108. -->
  109. <xs:simpleType name="geometry">
  110. <xs:restriction base="xs:string"/>
  111. </xs:simpleType>
  112. <xs:simpleType name="polygon">
  113. <xs:restriction base="xs:string">
  114. <xs:pattern value="(\-?\d+\.?\d*,-?\d+\.?\d*)( (\-?\d+\.?\d*,-?\d+\.?\d*))+"/>
  115. </xs:restriction>
  116. </xs:simpleType>
  117. <xs:simpleType name="point">
  118. <xs:restriction base="xs:string">
  119. <xs:pattern value="\-?\d\.?\d*,\-?\d\.?\d*"/>
  120. </xs:restriction>
  121. </xs:simpleType>
  122. <xs:simpleType name="lineString">
  123. <xs:restriction base="xs:string">
  124. <xs:pattern value="(\-?\d+\.?\d*,\-?\d+\.?\d*)( (\-?\d+\.?\d*,\-?\d+\.?\d*))+"/>
  125. </xs:restriction>
  126. </xs:simpleType>
  127. </xs:schema>