codegen.xsd 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xs:schema id="codegen" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <xs:element name="config">
  4. <xs:complexType>
  5. <xs:sequence>
  6. <!--模板 -->
  7. <xs:element name="templates" maxOccurs="1" minOccurs="1">
  8. <xs:complexType>
  9. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  10. <xs:element name="template">
  11. <xs:complexType>
  12. <xs:attributeGroup ref="templateAttr"></xs:attributeGroup>
  13. </xs:complexType>
  14. </xs:element>
  15. </xs:sequence>
  16. <xs:attribute name="basepath" type="xs:string">
  17. <xs:annotation>
  18. <xs:documentation>模板的基路径.</xs:documentation>
  19. </xs:annotation>
  20. </xs:attribute>
  21. </xs:complexType>
  22. </xs:element>
  23. <!-- 生成文件模版 -->
  24. <xs:element name="dbFiles" maxOccurs="unbounded" minOccurs="0">
  25. <xs:complexType>
  26. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  27. <xs:element name="file">
  28. <xs:complexType>
  29. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  30. </xs:complexType>
  31. </xs:element>
  32. </xs:sequence>
  33. </xs:complexType>
  34. </xs:element>
  35. <xs:element name="daoFiles" maxOccurs="unbounded" minOccurs="0">
  36. <xs:complexType>
  37. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  38. <xs:element name="file">
  39. <xs:complexType>
  40. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  41. </xs:complexType>
  42. </xs:element>
  43. </xs:sequence>
  44. </xs:complexType>
  45. </xs:element>
  46. <xs:element name="domainFiles" maxOccurs="unbounded" minOccurs="0">
  47. <xs:complexType>
  48. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  49. <xs:element name="file">
  50. <xs:complexType>
  51. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  52. </xs:complexType>
  53. </xs:element>
  54. </xs:sequence>
  55. </xs:complexType>
  56. </xs:element>
  57. <xs:element name="serviceFiles" maxOccurs="unbounded" minOccurs="0">
  58. <xs:complexType>
  59. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  60. <xs:element name="file">
  61. <xs:complexType>
  62. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  63. </xs:complexType>
  64. </xs:element>
  65. </xs:sequence>
  66. </xs:complexType>
  67. </xs:element>
  68. <xs:element name="controllerFiles" maxOccurs="unbounded" minOccurs="0">
  69. <xs:complexType>
  70. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  71. <xs:element name="file">
  72. <xs:complexType>
  73. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  74. </xs:complexType>
  75. </xs:element>
  76. </xs:sequence>
  77. </xs:complexType>
  78. </xs:element>
  79. <xs:element name="viewFiles" maxOccurs="unbounded" minOccurs="0">
  80. <xs:complexType>
  81. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  82. <xs:element name="file">
  83. <xs:complexType>
  84. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  85. </xs:complexType>
  86. </xs:element>
  87. </xs:sequence>
  88. </xs:complexType>
  89. </xs:element>
  90. <xs:element name="reportFiles" maxOccurs="unbounded" minOccurs="0">
  91. <xs:complexType>
  92. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  93. <xs:element name="file">
  94. <xs:complexType>
  95. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  96. </xs:complexType>
  97. </xs:element>
  98. </xs:sequence>
  99. </xs:complexType>
  100. </xs:element>
  101. <xs:element name="reportViewFiles" maxOccurs="unbounded" minOccurs="0">
  102. <xs:complexType>
  103. <xs:sequence minOccurs="1" maxOccurs="unbounded">
  104. <xs:element name="file">
  105. <xs:complexType>
  106. <xs:attributeGroup ref="fileAttr"></xs:attributeGroup>
  107. </xs:complexType>
  108. </xs:element>
  109. </xs:sequence>
  110. </xs:complexType>
  111. </xs:element>
  112. <!--变量 -->
  113. <xs:element name="variables" maxOccurs="1">
  114. <xs:complexType>
  115. <xs:sequence>
  116. <xs:element name="variable" maxOccurs="unbounded">
  117. <xs:complexType>
  118. <xs:attributeGroup ref="variableAttr"></xs:attributeGroup>
  119. </xs:complexType>
  120. </xs:element>
  121. </xs:sequence>
  122. </xs:complexType>
  123. </xs:element>
  124. </xs:sequence>
  125. </xs:complexType>
  126. </xs:element>
  127. <!--模板属性 -->
  128. <xs:attributeGroup name="templateAttr">
  129. <xs:attribute name="key" type="xs:string" use="required">
  130. <xs:annotation>
  131. <xs:documentation>
  132. 模版Key
  133. </xs:documentation>
  134. </xs:annotation>
  135. </xs:attribute>
  136. <xs:attribute name="path" type="xs:string" use="required">
  137. <xs:annotation>
  138. <xs:documentation>
  139. 模板路径
  140. </xs:documentation>
  141. </xs:annotation>
  142. </xs:attribute>
  143. </xs:attributeGroup>
  144. <!--变量属性 -->
  145. <xs:attributeGroup name="variableAttr">
  146. <xs:attribute name="name" use="required" type="xs:string">
  147. </xs:attribute>
  148. <xs:attribute name="value" type="xs:string" use="required"></xs:attribute>
  149. <xs:attribute name="comment" type="xs:string"></xs:attribute>
  150. </xs:attributeGroup>
  151. <xs:attributeGroup name="dirAttr">
  152. <xs:attribute name="sys" type="xs:string">
  153. </xs:attribute>
  154. <xs:attribute name="keys" use="required" type="xs:string">
  155. </xs:attribute>
  156. <xs:attribute name="value" type="xs:string" use="required"></xs:attribute>
  157. </xs:attributeGroup>
  158. <!--文件属性-->
  159. <xs:attributeGroup name="fileAttr">
  160. <xs:attribute name="refTemplate" type="xs:string" use="required" >
  161. <xs:annotation>
  162. <xs:documentation>
  163. 引用的模板,引用模板的ID
  164. </xs:documentation>
  165. </xs:annotation>
  166. </xs:attribute>
  167. <xs:attribute name="filename" type="xs:string" use="required">
  168. <xs:annotation>
  169. <xs:documentation>
  170. 生成的文件名称.
  171. </xs:documentation>
  172. </xs:annotation>
  173. </xs:attribute>
  174. <xs:attribute name="dir" type="xs:string" use="required">
  175. <xs:annotation>
  176. <xs:documentation>
  177. 生成的文件存放的目录.
  178. </xs:documentation>
  179. </xs:annotation>
  180. </xs:attribute>
  181. <xs:attribute name="sub" type="xs:string" use="optional" default="false">
  182. <xs:annotation>
  183. <xs:documentation>
  184. 子表生成文件
  185. </xs:documentation>
  186. </xs:annotation>
  187. </xs:attribute>
  188. <xs:attribute name="override" type="xs:boolean" use="optional" default="false">
  189. <xs:annotation>
  190. <xs:documentation>
  191. 是否覆盖原有文件 默认为false
  192. </xs:documentation>
  193. </xs:annotation>
  194. </xs:attribute>
  195. <xs:attribute name="append" type="xs:boolean" use="optional">
  196. <xs:annotation>
  197. <xs:documentation>是否添加</xs:documentation>
  198. </xs:annotation>
  199. </xs:attribute>
  200. <xs:attribute name="insertTag" default="&lt;!--insertbefore--&gt;">
  201. <xs:annotation>
  202. <xs:documentation>标签功能,新增的内容插在之前</xs:documentation>
  203. </xs:annotation>
  204. </xs:attribute>
  205. <xs:attribute name="startTag" default="start{tabname}">
  206. <xs:annotation>
  207. <xs:documentation>起始标签</xs:documentation>
  208. </xs:annotation>
  209. </xs:attribute>
  210. <xs:attribute name="endTag" default="end{tabname}">
  211. <xs:annotation>
  212. <xs:documentation>结束标签</xs:documentation>
  213. </xs:annotation>
  214. </xs:attribute>
  215. <xs:attribute name="notDelete" type="xs:boolean" use="optional">
  216. <xs:annotation>
  217. <xs:documentation>是否删除,默认是false,不用填,如果要不删除则填true</xs:documentation>
  218. </xs:annotation>
  219. </xs:attribute>
  220. </xs:attributeGroup>
  221. <xs:attributeGroup name="tableAttr">
  222. <xs:attribute name="tableName" type="xs:string" use="required">
  223. <xs:annotation>
  224. <xs:documentation>
  225. 表名
  226. </xs:documentation>
  227. </xs:annotation>
  228. </xs:attribute>
  229. <xs:attribute name="foreignKey" type="xs:string" use="required">
  230. <xs:annotation>
  231. <xs:documentation>
  232. 外键
  233. </xs:documentation>
  234. </xs:annotation>
  235. </xs:attribute>
  236. </xs:attributeGroup>
  237. <xs:attributeGroup name="batFleAttr">
  238. <xs:attribute name="refTemplate" type="xs:string" use="required">
  239. <xs:annotation>
  240. <xs:documentation>
  241. 引用的模板,引用模板的ID
  242. </xs:documentation>
  243. </xs:annotation>
  244. </xs:attribute>
  245. <xs:attribute name="filename" type="xs:string" use="optional">
  246. <xs:annotation>
  247. <xs:documentation>
  248. 生成的文件名称.
  249. </xs:documentation>
  250. </xs:annotation>
  251. </xs:attribute>
  252. <xs:attribute name="extName" type="xs:string" use="optional">
  253. <xs:annotation>
  254. <xs:documentation>
  255. 文件扩展名 如: .htm
  256. </xs:documentation>
  257. </xs:annotation>
  258. </xs:attribute>
  259. <xs:attribute name="dir" type="xs:string" use="required">
  260. <xs:annotation>
  261. <xs:documentation>
  262. 生成的文件存放的目录.
  263. </xs:documentation>
  264. </xs:annotation>
  265. </xs:attribute>
  266. <xs:attribute name="genMode" type="GenModel" use="required">
  267. <xs:annotation>
  268. <xs:documentation>
  269. 产生一个文件/产生多个文件
  270. </xs:documentation>
  271. </xs:annotation>
  272. </xs:attribute>
  273. </xs:attributeGroup>
  274. <xs:simpleType name="GenModel">
  275. <xs:restriction base="xs:string">
  276. <xs:enumeration value="MultiFile">
  277. <xs:annotation>
  278. <xs:documentation>产生多个文件,这个时候需要填写扩展名属性</xs:documentation>
  279. </xs:annotation>
  280. </xs:enumeration>
  281. <xs:enumeration value="SingleFile">
  282. <xs:annotation>
  283. <xs:documentation>产生一个文件,这个时候需要填写文件名称</xs:documentation>
  284. </xs:annotation>
  285. </xs:enumeration>
  286. </xs:restriction>
  287. </xs:simpleType>
  288. </xs:schema>