widgetsSchema.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. {
  2. "copyright": "Licensed Materials - Property of IBM. IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2020. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.",
  3. "$id": "widgetsSchema.json",
  4. "$schema": "http://json-schema.org/draft-07/schema#",
  5. "title": "widget set",
  6. "description": "The widget of the dashboard specification, representing ...",
  7. "definitions": {
  8. "widgetData": {
  9. "type": "object",
  10. "properties": {
  11. "id": { "$ref": "schemaDefs.json#/definitions/modelId" },
  12. "itemId": { "$ref": "schemaDefs.json#/definitions/queryId" },
  13. "itemLabel": { "$ref": "schemaDefs.json#/definitions/name" },
  14. "selection": {
  15. "type": "array",
  16. "items": {
  17. "type": "object",
  18. "properties": {
  19. "operation": {
  20. "type": "string",
  21. "enum": ["add", "remove", "order", "keep"]
  22. },
  23. "selectDepth": { "type": "string"},
  24. "set": { "$ref": "schemaDefs.json#/definitions/strArray" },
  25. "filter": {
  26. "type": "object",
  27. "properties": {
  28. "not": { "$ref": "#/definitions/filterEntry" },
  29. "or": {
  30. "type": "array",
  31. "items": {
  32. "type": "object",
  33. "properties": {
  34. "type": { "$ref": "#/definitions/filterEntry" },
  35. "not": { "$ref": "#/definitions/filterEntry" }
  36. }
  37. }
  38. }
  39. }
  40. },
  41. "children": { "$ref": "schemaDefs.json#/definitions/strArray" },
  42. "sort": {
  43. "type": "object",
  44. "properties": {
  45. "type": {
  46. "type": "string",
  47. "enum": ["asc", "desc"]
  48. },
  49. "priority": { "type": "number" },
  50. "by": {
  51. "type": "string",
  52. "enum": ["caption"]
  53. }
  54. }
  55. },
  56. "topBottom": {
  57. "type": "object",
  58. "properties": {
  59. "type": {
  60. "type": "string",
  61. "enum": ["topcount", "bottomcount", "toppercent", "bottompercent"]
  62. },
  63. "value": { "type": "number" }
  64. }
  65. },
  66. "context": {
  67. "type": "array",
  68. "items": {
  69. "itemId": { "$ref": "schemaDefs.json#/definitions/id" }
  70. }
  71. }
  72. }
  73. }
  74. },
  75. "format": {
  76. "type": "object",
  77. "properties": {
  78. "formatSpec": {
  79. "type": "object",
  80. "properties": {
  81. "local": { "type": "boolean" },
  82. "type": {
  83. "type": "string",
  84. "enum": ["number","percent","currency"]
  85. },
  86. "timezone": { "type": "string" },
  87. "locale": { "type": "string" },
  88. "convertPercent": { "type": "boolean" },
  89. "currencyCode": { "type": "string" },
  90. "currencyDisplay": {
  91. "type": "string",
  92. "enum": ["symbol", "code"]
  93. },
  94. "maximumFractionDigits": { "type": "number" },
  95. "minimumFractionDigits": { "type": "number" },
  96. "dateStyle": {
  97. "type": "string",
  98. "enum": ["short", "medium", "full", "long"]
  99. },
  100. "timeStyle": {
  101. "type": "string",
  102. "enum": ["short", "full", "long"]
  103. }
  104. }
  105. }
  106. }
  107. },
  108. "aggregate": { "$ref": "#/definitions/aggregationType" }
  109. }
  110. },
  111. "filterEntry": {
  112. "type": "object",
  113. "properties": {
  114. "id": { "$ref": "schemaDefs.json#/definitions/modelId" },
  115. "columnId": { "$ref": "schemaDefs.json#/definitions/id" },
  116. "operator": { "$ref": "#/definitions/operatorType" },
  117. "values": { "$ref": "#/definitions/values" },
  118. "excludedValues": {
  119. "type": "array",
  120. "items": { "$ref": "#/definitions/values" }
  121. },
  122. "idSuffix": { "type": "integer" },
  123. "valueDataItem": { "$ref": "schemaDefs.json#/definitions/modelId" },
  124. "aggregationType": { "$ref": "#/definitions/aggregationType" },
  125. "preOrPost": {
  126. "type": "string",
  127. "enum": ["pre", "post"]
  128. },
  129. "conditions": {
  130. "type": "object",
  131. "properties": {
  132. "operator": { "$ref": "#/definitions/operatorType" },
  133. "itemId": { "$ref": "schemaDefs.json#/definitions/queryId" },
  134. "ignoreCase": { "type": "boolean" },
  135. "values": { "$ref": "#/definitions/values" },
  136. "valueType": {
  137. "type": "string",
  138. "enum": ["display"]
  139. },
  140. "and" : {
  141. "type": "array",
  142. "minItems": 2,
  143. "items": {
  144. "operator": { "$ref": "#/definitions/operatorType" },
  145. "itemId": { "$ref": "schemaDefs.json#/definitions/queryId" },
  146. "ignoreCase": { "type": "boolean" },
  147. "values": { "$ref": "#/definitions/values" },
  148. "valueType": {
  149. "type": "string",
  150. "enum": ["display"]
  151. }
  152. }
  153. },
  154. "or" : {
  155. "type": "array",
  156. "minItems": 2,
  157. "items": {
  158. "operator": { "$ref": "#/definitions/operatorType" },
  159. "itemId": { "$ref": "schemaDefs.json#/definitions/queryId" },
  160. "ignoreCase": { "type": "boolean" },
  161. "values": { "$ref": "#/definitions/values" },
  162. "valueType": {
  163. "type": "string",
  164. "enum": ["display"]
  165. }
  166. }
  167. }
  168. }
  169. },
  170. "overrideHierarchyDefaultSelection": { "type": "boolean" },
  171. "visualizationId": { "$ref": "schemaDefs.json#/definitions/id" }
  172. }
  173. },
  174. "slotmapping": {
  175. "type": "object",
  176. "properties": {
  177. "slots": {
  178. "type": "array",
  179. "items": {
  180. "type": "object",
  181. "properties": {
  182. "name": { "$ref": "schemaDefs.json#/definitions/name" },
  183. "caption": { "$ref": "schemaDefs.json#/definitions/name" },
  184. "id": { "$ref": "schemaDefs.json#/definitions/name" },
  185. "layerId": { "$ref": "schemaDefs.json#/definitions/name" },
  186. "dataItems": {
  187. "type": "array",
  188. "items": { "$ref": "schemaDefs.json#/definitions/modelId" }
  189. },
  190. "type": {
  191. "type": "string",
  192. "enum": ["categorical", "ordinal", "any"]
  193. }
  194. }
  195. }
  196. }
  197. }
  198. },
  199. "possibleKeyDrivers": {
  200. "type": "array",
  201. "items": {
  202. "$ref": "schemaDefs.json#/definitions/queryId"
  203. }
  204. },
  205. "localFilters": {
  206. "type": "array",
  207. "items": {
  208. "$ref": "#/definitions/filterEntry"
  209. }
  210. },
  211. "aggregationType": {
  212. "type": "string",
  213. "enum": ["avg", "sum", "min", "max", "count", "countdistinct"]
  214. },
  215. "operatorType": {
  216. "type": "string",
  217. "enum": ["containsignorecase", "eq", "beginswith", "endswith", "in", "notin", "between", "notbetween", "or", "not", "gt", "lt"]
  218. },
  219. "values": {
  220. "anyOf": [ {
  221. "$ref": "schemaDefs.json#/definitions/strArray"
  222. },
  223. {
  224. "type": "array",
  225. "items": {
  226. "type": "object",
  227. "properties": {
  228. "u": {"type": ["string", "number"] },
  229. "d": {"type": ["string", "number"] }
  230. }
  231. }
  232. } ]
  233. },
  234. "data" :{
  235. "type": "object",
  236. "properties": {
  237. "dataViews": {
  238. "type": "array",
  239. "items": {
  240. "type": "object",
  241. "properties": {
  242. "id": { "$ref": "schemaDefs.json#/definitions/modelId" },
  243. "modelRef": { "$ref": "schemaDefs.json#/definitions/modelId" },
  244. "dataItems": {
  245. "type": "array",
  246. "items": { "$ref": "#/definitions/widgetData" }
  247. }
  248. }
  249. }
  250. }
  251. }
  252. }
  253. },
  254. "type": "object",
  255. "patternProperties": {
  256. "[0-9,a-z,-,_]*": {
  257. "type": "object",
  258. "allOf": [
  259. { "$ref": "widgetsTemplateSchema.json#/definitions/widget" },
  260. {
  261. "properties": {
  262. "data": { "$ref": "#/definitions/data" },
  263. "slotmapping": { "$ref": "#/definitions/slotmapping" },
  264. "possibleKeyDrivers": { "$ref": "#/definitions/possibleKeyDrivers" },
  265. "localFilters": { "$ref": "#/definitions/localFilters" }
  266. }
  267. }
  268. ]
  269. }
  270. }
  271. }