图书馆智能管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
10 KiB

5 months ago
  1. /* Licensed under the Apache License, Version 2.0 (the "License");
  2. * you may not use this file except in compliance with the License.
  3. * You may obtain a copy of the License at
  4. *
  5. * http://www.apache.org/licenses/LICENSE-2.0
  6. *
  7. * Unless required by applicable law or agreed to in writing, software
  8. * distributed under the License is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. * See the License for the specific language governing permissions and
  11. * limitations under the License.
  12. */
  13. var FLOWABLE = FLOWABLE || {};
  14. /*
  15. * Contains methods to retrieve the (mostly) base urls of the different end points.
  16. * Two of the methods #getImageUrl and #getModelThumbnailUrl are exposed in the $rootScope for usage in the HTML views.
  17. */
  18. FLOWABLE.APP_URL = {
  19. /* ACCOUNT URLS */
  20. getAccountUrl: function () {
  21. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account';
  22. },
  23. getLogoutUrl: function () {
  24. return FLOWABLE.CONFIG.contextRoot + '/app/logout';
  25. },
  26. /* MODEL URLS */
  27. getModelsUrl: function (query) {
  28. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models' + (query || "");
  29. },
  30. getModelUrl: function (modelId) {
  31. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId;
  32. },
  33. getModelModelJsonUrl: function (modelId) {
  34. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/model-json';
  35. },
  36. getModelBpmn20ExportUrl: function (modelId) {
  37. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/bpmn20?version=' + Date.now();
  38. },
  39. getCloneModelsUrl: function (modelId) {
  40. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/clone';
  41. },
  42. getModelHistoriesUrl: function (modelId) {
  43. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/history';
  44. },
  45. getModelHistoryUrl: function (modelId, modelHistoryId) {
  46. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/history/' + modelHistoryId;
  47. },
  48. getModelHistoryModelJsonUrl: function (modelId, modelHistoryId) {
  49. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/history/' + modelHistoryId + '/model-json';
  50. },
  51. getModelHistoryBpmn20ExportUrl: function (modelId, modelHistoryId) {
  52. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/history/' + modelHistoryId + '/bpmn20?version=' + Date.now();
  53. },
  54. getCmmnModelDownloadUrl: function (modelId, modelHistoryId) {
  55. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + (modelHistoryId ? '/history/' + modelHistoryId : '') + '/cmmn?version=' + Date.now();
  56. },
  57. getModelParentRelationsUrl: function (modelId) {
  58. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/parent-relations';
  59. },
  60. /* APP DEFINITION URLS */
  61. getAppDefinitionImportUrl: function (renewIdmIds) {
  62. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/import?renewIdmEntries=' + renewIdmIds;
  63. },
  64. getAppDefinitionTextImportUrl: function (renewIdmIds) {
  65. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/text/import?renewIdmEntries=' + renewIdmIds;
  66. },
  67. getAppDefinitionUrl: function (modelId) {
  68. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId;
  69. },
  70. getAppDefinitionModelImportUrl: function (modelId, renewIdmIds) {
  71. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/import?renewIdmEntries=' + renewIdmIds;
  72. },
  73. getAppDefinitionModelTextImportUrl: function (modelId, renewIdmIds) {
  74. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/text/import?renewIdmEntries=' + renewIdmIds;
  75. },
  76. getAppDefinitionPublishUrl: function (modelId) {
  77. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/publish';
  78. },
  79. getAppDefinitionExportUrl: function (modelId) {
  80. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/export?version=' + Date.now();
  81. },
  82. getAppDefinitionBarExportUrl: function (modelId) {
  83. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/export-bar?version=' + Date.now();
  84. },
  85. getAppDefinitionHistoryUrl: function (modelId, historyModelId) {
  86. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/app-definitions/' + modelId + '/history/' + historyModelId;
  87. },
  88. getModelsForAppDefinitionUrl: function () {
  89. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models-for-app-definition';
  90. },
  91. getCmmnModelsForAppDefinitionUrl: function () {
  92. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/cmmn-models-for-app-definition';
  93. },
  94. /* PROCESS INSTANCE URLS */
  95. getProcessInstanceModelJsonUrl: function (modelId) {
  96. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/process-instances/' + modelId + '/model-json';
  97. },
  98. getProcessInstanceModelJsonHistoryUrl: function (historyModelId) {
  99. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/process-instances/history/' + historyModelId + '/model-json';
  100. },
  101. /* PROCESS DEFINITION URLS */
  102. getProcessDefinitionModelJsonUrl: function (processDefinitionId) {
  103. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/process-definitions/' + processDefinitionId + '/model-json';
  104. },
  105. /* PROCESS MODEL URLS */
  106. getImportProcessModelUrl: function () {
  107. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-process-model';
  108. },
  109. getImportProcessModelTextUrl: function () {
  110. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-process-model/text';
  111. },
  112. /* DECISION TABLE URLS */
  113. getDecisionTableModelsUrl: function () {
  114. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models';
  115. },
  116. getDecisionTableImportUrl: function () {
  117. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/import-decision-table';
  118. },
  119. getDecisionTableTextImportUrl: function () {
  120. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/import-decision-table-text';
  121. },
  122. getDecisionTableModelUrl: function (modelId) {
  123. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/' + modelId;
  124. },
  125. getDecisionTableModelValuesUrl: function (query) {
  126. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/values?' + query;
  127. },
  128. getDecisionTableModelsHistoryUrl: function (modelHistoryId) {
  129. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/history/' + modelHistoryId;
  130. },
  131. getDecisionTableModelHistoryUrl: function (modelId, modelHistoryId) {
  132. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-table-models/' + modelId + '/history/' + modelHistoryId;
  133. },
  134. /* DECISION SERVICE URLS */
  135. getDecisionServiceModelsUrl: function () {
  136. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-service-models';
  137. },
  138. getDecisionServiceImportUrl: function () {
  139. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-decision-service-model';
  140. },
  141. getDecisionServiceTextImportUrl: function () {
  142. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-decision-service-model/text';
  143. },
  144. getDmnModelDownloadUrl: function (modelId, modelHistoryId) {
  145. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/decision-service-models/' + modelId + (modelHistoryId ? '/history/' + modelHistoryId : '') + '/dmn?version=' + Date.now();
  146. },
  147. /* FORM MODEL URLS */
  148. getFormModelsUrl: function () {
  149. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/form-models';
  150. },
  151. getFormModelValuesUrl: function (query) {
  152. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/form-models/values?' + query;
  153. },
  154. getFormModelUrl: function (modelId) {
  155. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/form-models/' + modelId;
  156. },
  157. getFormModelHistoryUrl: function (modelId, modelHistoryId) {
  158. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/form-models/' + modelId + '/history/' + modelHistoryId;
  159. },
  160. /* CASE MODEL URLS */
  161. getCaseModelsUrl: function (query) {
  162. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/case-models' + (query || "");
  163. },
  164. getCaseModelImportUrl: function () {
  165. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-case-model';
  166. },
  167. getCaseModelTextImportUrl: function () {
  168. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/import-case-model/text';
  169. },
  170. getCaseInstancesHistoryModelJsonUrl: function (modelHistoryId) {
  171. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/case-instances/history/' + modelHistoryId + '/model-json';
  172. },
  173. getCaseInstancesModelJsonUrl: function (modelId) {
  174. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/case-instances/' + modelId + '/model-json';
  175. },
  176. getCaseDefinitionModelJsonUrl: function (caseDefinitionId) {
  177. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/case-definitions/' + caseDefinitionId + '/model-json';
  178. },
  179. /* IMAGE URLS (exposed in rootscope in app.js */
  180. getImageUrl: function (imageId) {
  181. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/image/' + imageId;
  182. },
  183. getModelThumbnailUrl: function (modelId, version) {
  184. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/thumbnail' + (version ? "?version=" + version : "");
  185. },
  186. /* OTHER URLS */
  187. getEditorUsersUrl: function () {
  188. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-users';
  189. },
  190. getEditorGroupsUrl: function () {
  191. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-groups';
  192. },
  193. getAboutInfoUrl: function () {
  194. return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/about-info';
  195. }
  196. };