Built files from Bizgaze WebServer
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

dashboardmanager.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Unibase;
  11. (function (Unibase) {
  12. let Platform;
  13. (function (Platform) {
  14. let Dashboards;
  15. (function (Dashboards) {
  16. let Managers;
  17. (function (Managers) {
  18. class DashboardManager extends Platform.Core.BaseManager {
  19. getDashboardGroups() {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/platform/dashboards/groups';
  22. return yield this.dataHelper().getAsync(url).then(function (response) {
  23. if (response.result !== null) {
  24. response.result = JSON.parse(response.result);
  25. }
  26. return response;
  27. });
  28. });
  29. }
  30. getDashboardGroup(DashboardGroupId) {
  31. return __awaiter(this, void 0, void 0, function* () {
  32. const url = 'apis/v4/unibase/platform/dashboards/get/' + DashboardGroupId;
  33. return yield this.dataHelper().getAsync(url).then(function (response) {
  34. if (response.result !== null) {
  35. response.result = JSON.parse(response.result);
  36. }
  37. return response;
  38. });
  39. });
  40. }
  41. getDashboardGroupbyName(DashboardGroupName) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/unibase/platform/dashboards/groups/name/' + DashboardGroupName;
  44. return yield this.dataHelper().getAsync(url).then(function (response) {
  45. if (response.result !== null && response.result != "") {
  46. response.result = JSON.parse(response.result);
  47. }
  48. return response;
  49. });
  50. });
  51. }
  52. saveDashboardGroup(obj) {
  53. return __awaiter(this, void 0, void 0, function* () {
  54. const url = 'apis/v4/unibase/platform/dashboards/savedashboardgroup';
  55. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  56. if (response.result !== null) {
  57. response.result = JSON.parse(response.result);
  58. }
  59. return response;
  60. });
  61. });
  62. }
  63. updateDashboardGroup(obj) {
  64. return __awaiter(this, void 0, void 0, function* () {
  65. const url = 'apis/v4/unibase/platform/dashboards/changegroup';
  66. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  67. if (response.result !== null) {
  68. response.result = JSON.parse(response.result);
  69. }
  70. return response;
  71. });
  72. });
  73. }
  74. deleteDashboardGroup(DashboardGroupId) {
  75. return __awaiter(this, void 0, void 0, function* () {
  76. const url = 'apis/v4/unibase/platform/dashboards/deletegroup/groupid/' + DashboardGroupId;
  77. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  78. if (response.result !== null) {
  79. response.result = JSON.parse(response.result);
  80. }
  81. return response;
  82. });
  83. });
  84. }
  85. unGroupAllandDelete(ItemsArray, ToDeleteGroupId) {
  86. return __awaiter(this, void 0, void 0, function* () {
  87. const url = 'apis/v4/unibase/platform/dashboards/deletedashboardgroup/groupid/' + ToDeleteGroupId + '/groupitems/' + ItemsArray;
  88. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  89. if (response.result !== null) {
  90. response.result = JSON.parse(response.result);
  91. }
  92. return response;
  93. });
  94. });
  95. }
  96. renameGroup(obj) {
  97. return __awaiter(this, void 0, void 0, function* () {
  98. const url = 'apis/v4/unibase/platform/dashboards/renamedashboardgroup';
  99. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  100. if (response.result !== null) {
  101. response.result = JSON.parse(response.result);
  102. }
  103. return response;
  104. });
  105. });
  106. }
  107. setDashboardGroupAsViewable(obj) {
  108. return __awaiter(this, void 0, void 0, function* () {
  109. var ViewAll = obj.IsExclude;
  110. var DashboardGroupId = Number(obj.DashboardGroupId);
  111. const url = 'apis/v4/unibase/platform/dashboards/setgroupasviewable/dashboardgroupid/' + DashboardGroupId + '/viewall/' + ViewAll;
  112. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  113. if (response.result !== null) {
  114. response.result = JSON.parse(response.result);
  115. }
  116. return response;
  117. });
  118. });
  119. }
  120. getDashboards() {
  121. return __awaiter(this, void 0, void 0, function* () {
  122. const url = 'apis/v4/unibase/platform/dashboards/get';
  123. return yield this.dataHelper().getAsync(url).then(function (response) {
  124. if (response.result !== null)
  125. response.result = JSON.parse(response.result);
  126. return response;
  127. });
  128. });
  129. }
  130. getUserDashboards() {
  131. return __awaiter(this, void 0, void 0, function* () {
  132. const url = 'apis/bizgaze/platform/dashboards/userdashboards';
  133. return yield this.dataHelper().getAsync(url).then(function (response) {
  134. if (response.result !== null)
  135. response.result = JSON.parse(response.result);
  136. return response;
  137. });
  138. });
  139. }
  140. getUnGroupedDashboards() {
  141. return __awaiter(this, void 0, void 0, function* () {
  142. const url = 'apis/v4/unibase/platform/dashboards/ungrouped';
  143. return yield this.dataHelper().getAsync(url).then(function (response) {
  144. if (response.result !== null)
  145. response.result = JSON.parse(response.result);
  146. return response;
  147. });
  148. });
  149. }
  150. saveDashboard(obj) {
  151. return __awaiter(this, void 0, void 0, function* () {
  152. const url = 'apis/v4/unibase/platform/dashboards/save';
  153. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  154. if (response.result !== null)
  155. response.result = JSON.parse(response.result);
  156. return response;
  157. });
  158. });
  159. }
  160. deleteDashboard(DashboardId) {
  161. return __awaiter(this, void 0, void 0, function* () {
  162. const url = 'apis/v4/unibase/platform/dashboards/delete/dashboardid/' + DashboardId;
  163. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  164. if (response.result !== null)
  165. response.result = JSON.parse(response.result);
  166. return response;
  167. });
  168. });
  169. }
  170. getDashboardsByInstalledApp(installedAppId) {
  171. return __awaiter(this, void 0, void 0, function* () {
  172. const url = 'apis/v4/unibase/platform/dashboards/getdashboards/installedappid/' + installedAppId;
  173. return yield this.dataHelper().getAsync(url).then(function (response) {
  174. if (response.result !== null) {
  175. response.result = JSON.parse(response.result);
  176. }
  177. return response;
  178. });
  179. });
  180. }
  181. getDashboard(DashboardId) {
  182. return __awaiter(this, void 0, void 0, function* () {
  183. const url = 'apis/v4/unibase/platform/dashboards/getdashboard/dashboardid/' + DashboardId;
  184. return yield this.dataHelper().getAsync(url).then(function (response) {
  185. if (response.result !== null) {
  186. response.result = JSON.parse(response.result);
  187. }
  188. return response;
  189. });
  190. });
  191. }
  192. getDashboardsByGroup(groupId) {
  193. return __awaiter(this, void 0, void 0, function* () {
  194. const url = 'apis/v4/unibase/platform/dashboards/getdashboardsbygroup/groupid/' + groupId;
  195. return yield this.dataHelper().getAsync(url).then(function (response) {
  196. if (response.result !== null) {
  197. response.result = JSON.parse(response.result);
  198. }
  199. return response;
  200. });
  201. });
  202. }
  203. trackDashboard(obj) {
  204. return __awaiter(this, void 0, void 0, function* () {
  205. const url = 'apis/v4/unibase/platform/dashboards/track';
  206. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  207. if (response.result !== null) {
  208. response.result = JSON.parse(response.result);
  209. }
  210. return response;
  211. });
  212. });
  213. }
  214. getDashboardRolesByGroup(DashboardGroupId) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. const url = 'apis/v4/unibase/platform/dashboards/getdashboardgroupprole/dashboardgroupid/' + DashboardGroupId;
  217. return yield this.dataHelper().getAsync(url).then(function (response) {
  218. if (response.result !== null) {
  219. response.result = JSON.parse(response.result);
  220. }
  221. return response;
  222. });
  223. });
  224. }
  225. getRolesList() {
  226. return __awaiter(this, void 0, void 0, function* () {
  227. let term;
  228. if (term == "") {
  229. term = undefined;
  230. }
  231. const url = 'apis/v4/unibase/platform/roles/get/term/' + term;
  232. return yield this.dataHelper().getAsync(url).then(function (response) {
  233. if (response.result !== null) {
  234. response.result = JSON.parse(response.result);
  235. }
  236. return response;
  237. });
  238. });
  239. }
  240. saveDashboardGroupRole(obj) {
  241. return __awaiter(this, void 0, void 0, function* () {
  242. const url = 'apis/v4/unibase/platform/dashboards/savedashboardgrouprole';
  243. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  244. if (response.result !== null) {
  245. response.result = JSON.parse(response.result);
  246. }
  247. return response;
  248. });
  249. });
  250. }
  251. removeDashboardGroupRole(obj) {
  252. return __awaiter(this, void 0, void 0, function* () {
  253. const url = 'apis/v4/unibase/platform/dashboards/deletedashboardgrouprole/dashboardgroupid/' + obj.DashboardGroupId + '/roleid/' + obj.RoleId;
  254. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  255. if (response.result !== null) {
  256. response.result = JSON.parse(response.result);
  257. }
  258. return response;
  259. });
  260. });
  261. }
  262. getDashboardRoles(DashboardId) {
  263. return __awaiter(this, void 0, void 0, function* () {
  264. const url = 'apis/v4/unibase/platform/dashboards/dashboardroles/dashboardid/' + DashboardId;
  265. return yield this.dataHelper().getAsync(url).then(function (response) {
  266. if (response.result !== null) {
  267. response.result = JSON.parse(response.result);
  268. }
  269. return response;
  270. });
  271. });
  272. }
  273. addViewRole(obj) {
  274. return __awaiter(this, void 0, void 0, function* () {
  275. const url = 'apis/v4/unibase/platform/dashboards/savedashboardrole';
  276. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  277. if (response.result !== null) {
  278. response.result = JSON.parse(response.result);
  279. }
  280. return response;
  281. });
  282. });
  283. }
  284. removeViewRole(obj) {
  285. return __awaiter(this, void 0, void 0, function* () {
  286. let DashboardId = obj.DashboardId;
  287. let roleId = obj.RoleId;
  288. const url = 'apis/v4/unibase/platform/dashboards/deletedashboardrole/dashboardid/' + DashboardId + '/roleid/' + roleId;
  289. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  290. if (response.result !== null) {
  291. response.result = JSON.parse(response.result);
  292. }
  293. return response;
  294. });
  295. });
  296. }
  297. exportDashboard() {
  298. return __awaiter(this, void 0, void 0, function* () {
  299. const url = 'apis/v4/unibase/platform/apps/exportdashboardportlets';
  300. return yield this.dataHelper().getAsync(url).then(function (response) {
  301. if (response.result != null) {
  302. }
  303. return response;
  304. });
  305. });
  306. }
  307. setDashboardAsViewable(DashboardId, viewable) {
  308. return __awaiter(this, void 0, void 0, function* () {
  309. const url = 'apis/v4/unibase/platform/dashboards/setdashboardasviewable/dashboardid/' + DashboardId + '/viewall/' + viewable;
  310. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  311. if (response.result !== null) {
  312. response.result = JSON.parse(response.result);
  313. }
  314. return response;
  315. });
  316. });
  317. }
  318. saveAllDashboardSetting(obj) {
  319. return __awaiter(this, void 0, void 0, function* () {
  320. const url = 'apis/v4/unibase/platform/dashboards/savedashboardsettings/List';
  321. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  322. if (response.result !== null) {
  323. response.result = JSON.parse(response.result);
  324. }
  325. return response;
  326. });
  327. });
  328. }
  329. exportDashboardByDashboardId(dashboardid) {
  330. return __awaiter(this, void 0, void 0, function* () {
  331. const url = 'apis/v4/unibase/platform/apps/exportdashboardportlet/dashboardgroupid/' + dashboardid;
  332. return yield this.dataHelper().getAsync(url).then(function (response) {
  333. if (response.result != null) {
  334. }
  335. return response;
  336. });
  337. });
  338. }
  339. exportPortlet(portletId) {
  340. return __awaiter(this, void 0, void 0, function* () {
  341. const url = 'apis/v4/unibase/platform/portlets/exportportlet/PortletId/' + portletId;
  342. return yield this.dataHelper().getAsync(url).then(function (response) {
  343. if (response.result != null) {
  344. }
  345. return response;
  346. });
  347. });
  348. }
  349. static Instance() {
  350. if (this._instance === undefined)
  351. this._instance = new DashboardManager();
  352. return this._instance;
  353. }
  354. }
  355. Managers.DashboardManager = DashboardManager;
  356. })(Managers = Dashboards.Managers || (Dashboards.Managers = {}));
  357. })(Dashboards = Platform.Dashboards || (Platform.Dashboards = {}));
  358. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  359. })(Unibase || (Unibase = {}));