mview.xsd 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  9. <xs:element name="config">
  10. <xs:complexType>
  11. <xs:sequence>
  12. <xs:element name="view" type="viewType" minOccurs="1" maxOccurs="unbounded" />
  13. </xs:sequence>
  14. </xs:complexType>
  15. <xs:unique name="uniqueViewId">
  16. <xs:annotation>
  17. <xs:documentation>
  18. View Id must be unique.
  19. </xs:documentation>
  20. </xs:annotation>
  21. <xs:selector xpath="view" />
  22. <xs:field xpath="@id" />
  23. </xs:unique>
  24. </xs:element>
  25. <xs:complexType name="viewType">
  26. <xs:annotation>
  27. <xs:documentation>
  28. View declaration.
  29. </xs:documentation>
  30. </xs:annotation>
  31. <xs:sequence>
  32. <xs:element minOccurs="0" name="subscriptions" type="subscriptionsType">
  33. <xs:unique name="uniqueSubscriptionsTable">
  34. <xs:annotation>
  35. <xs:documentation>
  36. Table must be unique.
  37. </xs:documentation>
  38. </xs:annotation>
  39. <xs:selector xpath=".//table" />
  40. <xs:field xpath="@name" />
  41. <xs:field xpath="@entity_column" />
  42. </xs:unique>
  43. </xs:element>
  44. </xs:sequence>
  45. <xs:attribute name="id" type="xs:string" use="required" />
  46. <xs:attribute name="class" type="classType" use="required" />
  47. <xs:attribute name="group" type="xs:string" use="required" />
  48. </xs:complexType>
  49. <xs:simpleType name="classType">
  50. <xs:annotation>
  51. <xs:documentation>
  52. Class name can contain only [a-zA-Z\].
  53. </xs:documentation>
  54. </xs:annotation>
  55. <xs:restriction base="xs:string">
  56. <xs:pattern value="[a-zA-Z\\]+" />
  57. </xs:restriction>
  58. </xs:simpleType>
  59. <xs:complexType name="subscriptionsType">
  60. <xs:annotation>
  61. <xs:documentation>
  62. Subscriptions declaration.
  63. </xs:documentation>
  64. </xs:annotation>
  65. <xs:sequence>
  66. <xs:element name="table" type="subscriptionsTableType" minOccurs="1" maxOccurs="unbounded" />
  67. </xs:sequence>
  68. </xs:complexType>
  69. <xs:complexType name="subscriptionsTableType">
  70. <xs:annotation>
  71. <xs:documentation>
  72. Table declaration.
  73. </xs:documentation>
  74. </xs:annotation>
  75. <xs:attribute name="name" type="tableNameType" use="required" />
  76. <xs:attribute name="entity_column" type="entityColumnType" use="required" />
  77. <xs:attribute name="subscription_model" type="subscriptionModelType" />
  78. </xs:complexType>
  79. <xs:simpleType name="entityColumnType">
  80. <xs:annotation>
  81. <xs:documentation>
  82. Entity column can contain only [a-z_].
  83. </xs:documentation>
  84. </xs:annotation>
  85. <xs:restriction base="xs:string">
  86. <xs:pattern value="[a-z_]+" />
  87. </xs:restriction>
  88. </xs:simpleType>
  89. <xs:simpleType name="tableNameType">
  90. <xs:annotation>
  91. <xs:documentation>
  92. Table name can contain only [a-z_].
  93. </xs:documentation>
  94. </xs:annotation>
  95. <xs:restriction base="xs:string">
  96. <xs:pattern value="[a-z_]+" />
  97. </xs:restriction>
  98. </xs:simpleType>
  99. <xs:simpleType name="subscriptionModelType">
  100. <xs:annotation>
  101. <xs:documentation>
  102. DEPRECATED. Subscription model must be a valid PHP class or interface name.
  103. </xs:documentation>
  104. </xs:annotation>
  105. <xs:restriction base="xs:string">
  106. <xs:pattern value="[a-zA-Z_][a-zA-Z0-9\\]*" />
  107. </xs:restriction>
  108. </xs:simpleType>
  109. </xs:schema>