menu.xsd 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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="menu">
  13. <xs:complexType>
  14. <xs:sequence>
  15. <xs:choice maxOccurs="unbounded" minOccurs="0">
  16. <xs:element name="add">
  17. <xs:annotation>
  18. <xs:documentation>
  19. Action designed for adding new item to existing items as a child
  20. </xs:documentation>
  21. </xs:annotation>
  22. <xs:complexType>
  23. <xs:attribute name="id" type="typeId" use="required" />
  24. <xs:attribute name="title" type="typeTitle" use="required" />
  25. <xs:attribute name="module" type="typeModule" use="required" />
  26. <xs:attribute name="sortOrder" type="xs:int" use="optional" />
  27. <xs:attribute name="action" type="typeAction" use="optional" />
  28. <xs:attribute name="parent" type="typeId" use="optional" />
  29. <xs:attribute name="toolTip" type="typeTitle" use="optional" />
  30. <xs:attribute name="resource" type="typeResource" use="required" />
  31. <xs:attribute name="dependsOnModule" type="typeModule" use="optional" />
  32. <xs:attribute name="dependsOnConfig" type="typeDependsConfig" use="optional" />
  33. <xs:attribute name="translate" type="xs:string" use="optional" />
  34. <xs:attribute name="target" type="xs:string" use="optional" />
  35. </xs:complexType>
  36. </xs:element>
  37. <xs:element name="update">
  38. <xs:annotation>
  39. <xs:documentation>
  40. Action designed for updating existing menu items attributes
  41. </xs:documentation>
  42. </xs:annotation>
  43. <xs:complexType>
  44. <xs:attribute name="id" type="typeId" use="required" />
  45. <xs:attribute name="title" type="typeTitle" use="optional" />
  46. <xs:attribute name="module" type="typeModule" use="optional" />
  47. <xs:attribute name="sortOrder" type="xs:int" use="optional" />
  48. <xs:attribute name="action" type="typeAction" use="optional" />
  49. <xs:attribute name="parent" type="typeId" use="optional" />
  50. <xs:attribute name="toolTip" type="typeTitle" use="optional" />
  51. <xs:attribute name="resource" type="typeResource" use="optional" />
  52. <xs:attribute name="dependsOnModule" type="typeModule" use="optional" />
  53. <xs:attribute name="dependsOnConfig" type="typeDependsConfig" use="optional" />
  54. <xs:attribute name="translate" type="xs:string" use="optional" />
  55. <xs:attribute name="target" type="xs:string" use="optional" />
  56. </xs:complexType>
  57. </xs:element>
  58. <xs:element name="remove">
  59. <xs:annotation>
  60. <xs:documentation>
  61. Action designed for removing existing menu item with its children
  62. </xs:documentation>
  63. </xs:annotation>
  64. <xs:complexType>
  65. <xs:attribute name="id" type="typeId" use="required" />
  66. </xs:complexType>
  67. </xs:element>
  68. </xs:choice>
  69. </xs:sequence>
  70. </xs:complexType>
  71. <xs:unique name="uniqueAddItemId">
  72. <xs:annotation>
  73. <xs:documentation>
  74. Attribute id is unique under add actions
  75. </xs:documentation>
  76. </xs:annotation>
  77. <xs:selector xpath="add"/>
  78. <xs:field xpath="@id"/>
  79. </xs:unique>
  80. </xs:element>
  81. </xs:sequence>
  82. </xs:complexType>
  83. </xs:element>
  84. <xs:simpleType name="typeId">
  85. <xs:annotation>
  86. <xs:documentation>
  87. Item id attribute can has only [a-z0-9/_]. Minimal length 3 symbol. Case insensitive.
  88. </xs:documentation>
  89. </xs:annotation>
  90. <xs:restriction base="xs:string">
  91. <xs:pattern value="[A-Za-z0-9/_:]{3,}" />
  92. </xs:restriction>
  93. </xs:simpleType>
  94. <xs:simpleType name="typeAction">
  95. <xs:annotation>
  96. <xs:documentation>
  97. Item action attribute can has only [a-zA-Z0-9/_]. Minimal length 3 symbol
  98. </xs:documentation>
  99. </xs:annotation>
  100. <xs:restriction base="xs:string">
  101. <xs:pattern value="[a-zA-Z0-9/_]{3,}" />
  102. </xs:restriction>
  103. </xs:simpleType>
  104. <xs:simpleType name="typeTitle">
  105. <xs:annotation>
  106. <xs:documentation>
  107. Item title attribute minimal length 3 symbol
  108. </xs:documentation>
  109. </xs:annotation>
  110. <xs:restriction base="xs:string">
  111. <xs:minLength value="3" />
  112. <xs:maxLength value="50" />
  113. </xs:restriction>
  114. </xs:simpleType>
  115. <xs:simpleType name="typeModule">
  116. <xs:annotation>
  117. <xs:documentation>
  118. Item module attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
  119. </xs:documentation>
  120. </xs:annotation>
  121. <xs:restriction base="xs:string">
  122. <xs:pattern value="[A-Za-z0-9_]{3,}" />
  123. </xs:restriction>
  124. </xs:simpleType>
  125. <xs:simpleType name="typeResource">
  126. <xs:annotation>
  127. <xs:documentation>
  128. Item resource attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
  129. </xs:documentation>
  130. </xs:annotation>
  131. <xs:restriction base="xs:string">
  132. <xs:pattern value="[A-Z]+[A-Za-z0-9]{1,}_[A-Z]+[A-Z0-9a-z]{1,}::[A-Za-z_0-9]{1,}" />
  133. </xs:restriction>
  134. </xs:simpleType>
  135. <xs:simpleType name="typeDependsConfig">
  136. <xs:annotation>
  137. <xs:documentation>
  138. Item resource attribute can has only [a-z0-9_]. Minimal length 3 symbol. Case insensitive.
  139. </xs:documentation>
  140. </xs:annotation>
  141. <xs:restriction base="xs:string">
  142. <xs:pattern value="[A-Za-z0-9_/]{3,}" />
  143. </xs:restriction>
  144. </xs:simpleType>
  145. </xs:schema>