From a52d50e788792a63e97a9176ab319d53db7a2853 Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 24 Jul 2018 17:34:04 +0300 Subject: Replaced old implementation at root Old project files and directories has been moved under 'deprecated-workflow-designer'. The old project is not built by the CI anymore, but can be still built manually. New modules/directories have been moved up and integrated with the CI system. Change-Id: I1528c792bcbcce9e50bfc294a1328a20e72c91cf Issue-ID: SDC-1559 Signed-off-by: vempo --- .../main/assembly/ext-activities-display-info.json | 45 + .../src/main/assembly/ext-activities.json | 362 +++ .../src/main/assembly/temp_workflow.json | 143 + .../ActivitySpecServiceProxyInfo.java | 97 + .../sdc/workflowdesigner/SDCServiceProxyInfo.java | 74 + .../sdc/workflowdesigner/WorkflowDesignerApp.java | 106 + .../WorkflowDesignerConfiguration.java | 103 + .../common/ActivitySpecProxyException.java | 34 + .../workflowdesigner/common/SDCProxyException.java | 33 + .../sdc/workflowdesigner/config/AdapterType.java | 20 + .../sdc/workflowdesigner/config/AppConfig.java | 81 + .../onap/sdc/workflowdesigner/config/Config.java | 54 + .../externalservice/sdc/ActivitySpecService.java | 51 + .../sdc/ActivitySpecServiceProxy.java | 89 + .../externalservice/sdc/SDCService.java | 51 + .../externalservice/sdc/SDCServiceProxy.java | 94 + .../sdc/entity/ActivityContent.java | 59 + .../externalservice/sdc/entity/ActivitySpec.java | 179 ++ .../sdc/entity/GenericCollectionWrapper.java | 61 + .../externalservice/sdc/entity/Parameter.java | 87 + .../sdc/entity/WorkflowArtifactInfo.java | 102 + .../sdc/workflowdesigner/model/DataObject.java | 42 + .../onap/sdc/workflowdesigner/model/Element.java | 85 + .../onap/sdc/workflowdesigner/model/EndEvent.java | 16 + .../sdc/workflowdesigner/model/ErrorEndEvent.java | 28 + .../workflowdesigner/model/ErrorStartEvent.java | 28 + .../workflowdesigner/model/ExclusiveGateway.java | 16 + .../model/IntermediateCatchEvent.java | 25 + .../workflowdesigner/model/ParallelGateway.java | 16 + .../onap/sdc/workflowdesigner/model/Parameter.java | 103 + .../onap/sdc/workflowdesigner/model/Position.java | 33 + .../onap/sdc/workflowdesigner/model/Process.java | 67 + .../workflowdesigner/model/RestServiceTask.java | 95 + .../sdc/workflowdesigner/model/ScriptTask.java | 33 + .../sdc/workflowdesigner/model/SequenceFlow.java | 70 + .../sdc/workflowdesigner/model/ServiceTask.java | 44 + .../sdc/workflowdesigner/model/StartEvent.java | 29 + .../model/TimerEventDefinition.java | 52 + .../parser/Bpmn4ToscaJsonParser.java | 216 ++ .../onap/sdc/workflowdesigner/parser/JsonKeys.java | 92 + .../resources/ExtendActivityResource.java | 283 ++ .../resources/HealthCheckResource.java | 51 + .../resources/WorkflowModelerResource.java | 267 ++ .../resources/entity/CategoryData.java | 65 + .../workflowdesigner/resources/entity/Content.java | 95 + .../resources/entity/ExtActivity.java | 120 + .../resources/entity/ExtActivityDisplayInfo.java | 53 + .../resources/entity/I18nString.java | 69 + .../resources/entity/IconData.java | 68 + .../resources/entity/InputOutput.java | 135 + .../resources/entity/NodeCategory.java | 34 + .../resources/entity/WorkflowInfo.java | 133 + .../utils/FileCommonConstants.java | 21 + .../workflowdesigner/utils/FileCommonUtils.java | 287 ++ .../onap/sdc/workflowdesigner/utils/JsonUtils.java | 41 + .../onap/sdc/workflowdesigner/utils/RestUtils.java | 28 + .../onap/sdc/workflowdesigner/utils/ToolUtils.java | 26 + .../utils/entity/CommonErrorResponse.java | 56 + .../writer/BpmnPlanArtefactWriter.java | 64 + .../main/resources/api-doc/META-INF/MANIFEST.MF | 3 + .../src/main/resources/api-doc/WEB-INF/web.xml | 41 + .../src/main/resources/api-doc/css/reset.css | 140 + .../src/main/resources/api-doc/css/screen.css | 1271 ++++++++ .../src/main/resources/api-doc/css/typography.css | 41 + .../api-doc/fonts/droid-sans-v6-latin-700.eot | Bin 0 -> 22924 bytes .../api-doc/fonts/droid-sans-v6-latin-700.svg | 411 +++ .../api-doc/fonts/droid-sans-v6-latin-700.ttf | Bin 0 -> 40516 bytes .../api-doc/fonts/droid-sans-v6-latin-700.woff | Bin 0 -> 25992 bytes .../api-doc/fonts/droid-sans-v6-latin-700.woff2 | Bin 0 -> 11480 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.eot | Bin 0 -> 22008 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.svg | 403 +++ .../api-doc/fonts/droid-sans-v6-latin-regular.ttf | Bin 0 -> 39072 bytes .../api-doc/fonts/droid-sans-v6-latin-regular.woff | Bin 0 -> 24868 bytes .../fonts/droid-sans-v6-latin-regular.woff2 | Bin 0 -> 11304 bytes .../resources/api-doc/images/explorer_icons.png | Bin 0 -> 5763 bytes .../main/resources/api-doc/images/logo_small.png | Bin 0 -> 770 bytes .../resources/api-doc/images/pet_store_api.png | Bin 0 -> 824 bytes .../src/main/resources/api-doc/images/throbber.gif | Bin 0 -> 9257 bytes .../main/resources/api-doc/images/wordnik_api.png | Bin 0 -> 980 bytes .../src/main/resources/api-doc/index.html | 115 + .../src/main/resources/api-doc/lib/backbone-min.js | 30 + .../main/resources/api-doc/lib/handlebars-2.0.0.js | 43 + .../resources/api-doc/lib/highlight.7.3.pack.js | 16 + .../main/resources/api-doc/lib/jquery-1.8.0.min.js | 17 + .../resources/api-doc/lib/jquery.ba-bbq.min.js | 25 + .../resources/api-doc/lib/jquery.slideto.min.js | 16 + .../resources/api-doc/lib/jquery.wiggle.min.js | 23 + .../src/main/resources/api-doc/lib/marked.js | 1281 ++++++++ .../src/main/resources/api-doc/lib/shred.bundle.js | 2780 ++++++++++++++++ .../main/resources/api-doc/lib/shred/content.js | 207 ++ .../main/resources/api-doc/lib/swagger-client.js | 3309 ++++++++++++++++++++ .../main/resources/api-doc/lib/swagger-oauth.js | 294 ++ .../main/resources/api-doc/lib/underscore-min.js | 21 + .../src/main/resources/api-doc/o2c.html | 37 + .../src/main/resources/api-doc/swagger-ui.js | 2255 +++++++++++++ .../src/main/resources/api-doc/swagger-ui.min.js | 17 + .../bpmn-templates/bpmn_dataObject_template.xml | 5 + .../bpmn_element_endEvent_template.xml | 2 + .../bpmn_element_errorEndEvent_template.xml | 3 + .../bpmn_element_errorStartEvent_template.xml | 3 + .../bpmn_element_exclusiveGateway_template.xml | 1 + ...pmn_element_intermediateCatchEvent_template.xml | 13 + .../bpmn_element_parallelGateway_template.xml | 1 + .../bpmn_element_restTask_template.xml | 33 + .../bpmn_element_scriptTask_template.xml | 3 + .../bpmn_element_serviceTask_template.xml | 14 + .../bpmn_element_startEvent_template.xml | 7 + .../bpmn-templates/bpmn_sequenceFlow_template.xml | 5 + .../resources/bpmn-templates/bpmn_template.xml | 28 + .../src/main/resources/bpmn.config.properties | 2 + 110 files changed, 17827 insertions(+) create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities-display-info.json create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities.json create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/temp_workflow.json create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/META-INF/MANIFEST.MF create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/WEB-INF/web.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/reset.css create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/screen.css create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/typography.css create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/explorer_icons.png create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/logo_small.png create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/pet_store_api.png create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/throbber.gif create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/wordnik_api.png create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/index.html create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/backbone-min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/handlebars-2.0.0.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/highlight.7.3.pack.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/jquery-1.8.0.min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/jquery.ba-bbq.min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/jquery.slideto.min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/jquery.wiggle.min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/marked.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/shred.bundle.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/shred/content.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/swagger-client.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/swagger-oauth.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/underscore-min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/o2c.html create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/swagger-ui.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/swagger-ui.min.js create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_dataObject_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_endEvent_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorEndEvent_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_errorStartEvent_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_exclusiveGateway_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_intermediateCatchEvent_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_parallelGateway_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_restTask_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_scriptTask_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_serviceTask_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_element_startEvent_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_sequenceFlow_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn-templates/bpmn_template.xml create mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/bpmn.config.properties (limited to 'deprecated-workflow-designer/sdc-workflow-designer-server/src/main') diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities-display-info.json b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities-display-info.json new file mode 100644 index 00000000..d6817db2 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities-display-info.json @@ -0,0 +1,45 @@ +{ + "nodes": { + "apds_script": {}, + "apds_service": {}, + "apds_rest": {}, + "apds_scriptA": { + "category": "aaa" + }, + "apds_scriptB": { + "category": "aaa" + }, + "apds_serviceA": { + "category": "bbb" + }, + "apds_restA": { + "category": "ccc" + }, + "apds_restB": { + "category": "ccc" + } + }, + "categoryData": { + "aaa": { + "displayName": { + "zh_CN": "扩展脚本任务", + "en_US": "Extension Script Task" + }, + "collapse": true + }, + "bbb": { + "displayName": { + "zh_CN": "扩展Service任务", + "en_US": "Extension Service Task" + }, + "collapse": true + }, + "ccc": { + "displayName": { + "zh_CN": "扩展REST任务", + "en_US": "Extension REST Service Task" + }, + "collapse": true + } + } +} \ No newline at end of file diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities.json b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities.json new file mode 100644 index 00000000..eae58fce --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/ext-activities.json @@ -0,0 +1,362 @@ +[ + { + "id": "apds_service", + "displayName": { + "zh_CN": "Service", + "en_US": "Service" + }, + "description": { + "zh_CN": "JAVA 节点", + "en_US": "JAVA Node" + }, + "type": "serviceTask", + "icon": { + "name": "apds_service", + "width": 56, + "height": 56 + }, + "content": { + "class": "", + "inputs": {} + } + }, + { + "id": "apds_rest", + "displayName": { + "zh_CN": "REST", + "en_US": "REST" + }, + "description": { + "zh_CN": "REST 节点", + "en_US": "REST Node" + }, + "type": "restTask", + "icon": { + "name": "apds_rest", + "width": 56, + "height": 56 + }, + "content": { + "url": "", + "name": "", + "version": "", + "path": "", + "method": "", + "accept": "", + "inputs": {} + } + }, + { + "id": "apds_script", + "displayName": { + "zh_CN": "默认脚本", + "en_US": "Script" + }, + "description": { + "zh_CN": "脚本节点", + "en_US": "Script Node" + }, + "type": "scriptTask", + "icon": { + "name": "apds_script", + "width": 56, + "height": 56 + }, + "content": { + "scriptFormat": "", + "script": "" + } + }, + { + "id": "apds_scriptA", + "displayName": { + "zh_CN": "JavaScript", + "en_US": "JavaScript" + }, + "description": { + "zh_CN": "脚本节点", + "en_US": "Script Node" + }, + "type": "scriptTask", + "icon": { + "name": "apds_script", + "width": 56, + "height": 56 + }, + "content": { + "scriptFormat": "JavaScript", + "script": "abc" + } + }, + { + "id": "apds_scriptB", + "displayName": { + "zh_CN": "Groovy", + "en_US": "Groovy" + }, + "description": { + "zh_CN": "脚本节点", + "en_US": "Script Node" + }, + "type": "scriptTask", + "icon": { + "name": "apds_script", + "width": 56, + "height": 56 + }, + "content": { + "scriptFormat": "Groovy", + "script": "xyz" + } + }, + { + "id": "apds_serviceA", + "displayName": { + "zh_CN": "JAVA A", + "en_US": "JAVA A" + }, + "description": { + "zh_CN": "JAVA 节点", + "en_US": "JAVA Node" + }, + "type": "serviceTask", + "icon": { + "name": "apds_service", + "width": 56, + "height": 56 + }, + "content": { + "class": "com.zte.ums.workflow.activitiext.restservicetask.HttpUtil", + "inputs": { + "param1": { + "type": "string", + "default": "default", + "required": false, + "displayName": { + "zh_CN": "参数1", + "en_US": "Param1" + }, + "show": false, + "editable": true + }, + "param2": { + "type": "string", + "required": true, + "displayName": { + "zh_CN": "参数2", + "en_US": "Param2" + }, + "show": true, + "editable": true + }, + "param3": { + "type": "string", + "default": "value3", + "required": true, + "displayName": { + "zh_CN": "参数3", + "en_US": "Param3" + }, + "show": true, + "editable": false + } + }, + "outputs": { + "out1": { + "type": "string", + "required": false, + "displayName": { + "zh_CN": "输出1", + "en_US": "Output Param 1" + }, + "show": true, + "editable": true + } + } + } + }, + { + "id": "apds_restA", + "displayName": { + "zh_CN": "REST无参数", + "en_US": "REST No Parameters" + }, + "description": { + "zh_CN": "REST无参数", + "en_US": "REST No Parameters" + }, + "type": "restTask", + "icon": { + "name": "apds_rest", + "width": 56, + "height": 56 + }, + "content": { + "serviceName": "name", + "serviceVersion": "v1", + "baseUrl": "url", + "path": "/test/", + "method": "put", + "consumes": "application/json, text/plain", + "produces": "application/json, text/plain", + "inputs": {} + } + }, + { + "id": "apds_restB", + "displayName": { + "zh_CN": "REST复杂参数", + "en_US": "REST Complex Parameters" + }, + "description": { + "zh_CN": "REST复杂参数", + "en_US": "REST Complex Parameters" + }, + "type": "restTask", + "icon": { + "name": "apds_rest", + "width": 56, + "height": 56 + }, + "content": { + "serviceName": "ServiceName", + "serviceVersion": "v1", + "baseUrl": "url", + "path": "/test/", + "method": "put", + "consumes": "application/json, text/plain", + "produces": "application/json, text/plain", + "inputs": { + "param1": { + "in": "query", + "type": "string", + "default": "default", + "required": false, + "show": false, + "editable": true + }, + "param2": { + "in": "body", + "schema": { + "type": "object", + "properties": { + "a": { + "type": "number", + "default": 123 + }, + "b": { + "type": "string", + "default": "xyz" + }, + "c": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "a", + "b", + "c" + ] + } + }, + "d": { + "type": "array", + "items": { + "type": "object", + "properties": { + "p1": { + "type": "number" + }, + "p2": { + "type": "boolean" + } + } + } + }, + "y": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "z": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "required": true, + "show": true, + "editable": true + }, + "param3": { + "in": "path", + "type": "string", + "default": "value3", + "required": true, + "show": true, + "editable": false + } + }, + "outputs": { + "body": { + "displayName": { + "zh_CN": "消息体", + "en_US": "Message Body" + }, + "schema": { + "type": "object", + "properties": { + "a": { + "type": "number" + }, + "b": { + "type": "string" + }, + "c": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "a", + "b", + "c" + ] + } + }, + "d": { + "type": "array", + "items": { + "type": "object", + "properties": { + "p1": { + "type": "number" + }, + "p2": { + "type": "boolean" + } + } + } + }, + "y": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "z": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "editable": false + } + } + } + } +] \ No newline at end of file diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/temp_workflow.json b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/temp_workflow.json new file mode 100644 index 00000000..1d9c5474 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/assembly/temp_workflow.json @@ -0,0 +1,143 @@ +{ + "id":"id12345", + "name":"test", + "scene":"abcd", + "data":{ + "nodes":[ + { + "id":"node0", + "type":"startEvent", + "name":"开始", + "parentId":"root", + "position":{ + "left":100, + "top":136, + "width":56, + "height":56 + }, + "connection":[ + { + "sourceRef":"node0", + "targetRef":"node1" + } + ], + "parameters":[ + + ] + }, + { + "id":"node1", + "type":"restTask", + "name":"REST", + "parentId":"root", + "position":{ + "left":254, + "top":136, + "width":56, + "height":56 + }, + "connection":[ + { + "sourceRef":"node1", + "targetRef":"node2" + } + ], + "produces":[ + "application/json; charset=utf-8" + ], + "parameters":[ + { + "name":"body", + "value":{ + "value":{ + "type":{ + "value":"jhgjhv", + "valueSource":"String" + }, + "provider":{ + "value":"", + "valueSource":"Variable" + }, + "serviceType":{ + "value":"", + "valueSource":"String" + }, + "start":{ + "value":{ + "year":{ + "value":"", + "valueSource":"String" + }, + "month":{ + "value":"", + "valueSource":"String" + }, + "day":{ + "value":"", + "valueSource":"String" + } + }, + "valueSource":"Definition" + }, + "end":{ + "value":{ + "year":{ + "value":"", + "valueSource":"String" + }, + "month":{ + "value":"", + "valueSource":"String" + }, + "day":{ + "value":"", + "valueSource":"String" + } + }, + "valueSource":"Definition" + } + }, + "valueSource":"Definition" + }, + "valueSource":"String", + "type":"String", + "required":false, + "position":"body", + "schema":{ + "$ref":"#/definitions/PackageQueryParams" + } + }, + { + "name":"language-option", + "value":"", + "valueSource":"String", + "type":"String", + "required":false, + "position":"header" + } + ], + "responses":[ + + ], + "restConfigId":"catalog.v1", + "path":"/csars", + "method":"post" + }, + { + "id":"node2", + "type":"endEvent", + "name":"结束", + "parentId":"root", + "position":{ + "left":396, + "top":136, + "width":56, + "height":56 + }, + "connection":[ + + ] + } + ] + } +} \ No newline at end of file diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java new file mode 100644 index 00000000..fb82e506 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java @@ -0,0 +1,97 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflowdesigner; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + */ +public class ActivitySpecServiceProxyInfo { + private String serviceAddr; + + private String xEcompInstanceId; + + private String authorization; + + private String userId; + + /** + * @return the serviceAddr + */ + @JsonProperty + public String getServiceAddr() { + return serviceAddr; + } + + /** + * @param serviceAddr the serviceAddr to set + */ + @JsonProperty + public void setServiceAddr(String serviceAddr) { + this.serviceAddr = serviceAddr; + } + + /** + * @return the xEcompInstanceId + */ + @JsonProperty + public String getxEcompInstanceId() { + return xEcompInstanceId; + } + + /** + * @param xEcompInstanceId the xEcompInstanceId to set + */ + @JsonProperty + public void setxEcompInstanceId(String xEcompInstanceId) { + this.xEcompInstanceId = xEcompInstanceId; + } + + /** + * @return the authorization + */ + @JsonProperty + public String getAuthorization() { + return authorization; + } + + /** + * @param authorization the authorization to set + */ + @JsonProperty + public void setAuthorization(String authorization) { + this.authorization = authorization; + } + + /** + * @return the userId + */ + @JsonProperty + public String getUserId() { + return userId; + } + + /** + * @param userId the userId to set + */ + @JsonProperty + public void setUserId(String userId) { + this.userId = userId; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java new file mode 100644 index 00000000..e8fd07d4 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + */ +public class SDCServiceProxyInfo { + private String serviceAddr; + + private String xEcompInstanceId; + + private String authorization; + + /** + * @return the serviceAddr + */ + @JsonProperty + public String getServiceAddr() { + return serviceAddr; + } + + /** + * @param serviceAddr the serviceAddr to set + */ + @JsonProperty + public void setServiceAddr(String serviceAddr) { + this.serviceAddr = serviceAddr; + } + + /** + * @return the xEcompInstanceId + */ + @JsonProperty + public String getxEcompInstanceId() { + return xEcompInstanceId; + } + + /** + * @param xEcompInstanceId the xEcompInstanceId to set + */ + @JsonProperty + public void setxEcompInstanceId(String xEcompInstanceId) { + this.xEcompInstanceId = xEcompInstanceId; + } + + /** + * @return the authorization + */ + @JsonProperty + public String getAuthorization() { + return authorization; + } + + /** + * @param authorization the authorization to set + */ + @JsonProperty + public void setAuthorization(String authorization) { + this.authorization = authorization; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java new file mode 100644 index 00000000..c9e0c40d --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner; + +import org.onap.sdc.workflowdesigner.config.AdapterType; +import org.onap.sdc.workflowdesigner.config.AppConfig; +import org.onap.sdc.workflowdesigner.resources.ExtendActivityResource; +import org.onap.sdc.workflowdesigner.resources.WorkflowModelerResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonInclude; + +import io.dropwizard.Application; +import io.dropwizard.assets.AssetsBundle; +import io.dropwizard.server.SimpleServerFactory; +import io.dropwizard.setup.Bootstrap; +import io.dropwizard.setup.Environment; +import io.swagger.jaxrs.config.BeanConfig; +import io.swagger.jaxrs.listing.ApiListingResource; + +public class WorkflowDesignerApp extends Application { + private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowDesignerApp.class); + + public static void main(String[] args) throws Exception { + new WorkflowDesignerApp().run(args); + } + + @Override + public String getName() { + return "Workflow Designer"; + } + + @Override + public void initialize(Bootstrap bootstrap) { + bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc")); + bootstrap.addBundle(new AssetsBundle("/workflow-modeler", "/workflow-modeler", "index.html", + "workflow-modeler")); + bootstrap.addBundle(new AssetsBundle("/workflow-modeler", "/", "index.html", "ng")); + } + + @Override + public void run(WorkflowDesignerConfiguration configuration, Environment environment) { + LOGGER.info("Start to initialize Workflow Designer."); + + saveAppConfig(configuration); + + environment.jersey().register(new WorkflowModelerResource()); + environment.jersey().register(new ExtendActivityResource()); + + // register rest interface + environment.jersey().packages("org.onap.sdc.workflowdesigner.resources"); + + initSwaggerConfig(environment, configuration); + + LOGGER.info("Initialize catalogue finished."); + } + + /** + * @param configuration + */ + private void saveAppConfig(WorkflowDesignerConfiguration configuration) { + AppConfig.setAdapterType(AdapterType.valueOf(configuration.getAdapterType())); + AppConfig.setSdcServiceProxy(configuration.getSdcServiceProxy()); + AppConfig.setActivitySpecServiceProxy(configuration.getActivitySpecServiceProxy()); + } + + /** + * initialize swagger configuration. + * + * @param environment environment information + * @param configuration catalogue configuration + */ + private void initSwaggerConfig(Environment environment, + WorkflowDesignerConfiguration configuration) { + environment.jersey().register(new ApiListingResource()); + environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); + + BeanConfig config = new BeanConfig(); + config.setTitle("Workflow Designer rest API"); + config.setVersion("1.0.0"); + config.setResourcePackage("org.onap.sdc.workflowdesigner.resources"); + + // set rest api basepath in swagger + SimpleServerFactory simpleServerFactory = + (SimpleServerFactory) configuration.getServerFactory(); + String basePath = simpleServerFactory.getApplicationContextPath(); + String rootPath = simpleServerFactory.getJerseyRootPath().get(); + rootPath = rootPath.substring(0, rootPath.indexOf("/*")); + basePath = basePath.equals("/") ? rootPath + : (new StringBuilder()).append(basePath).append(rootPath).toString(); + config.setBasePath(basePath); + config.setScan(true); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java new file mode 100644 index 00000000..4c6766be --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner; + +import javax.validation.constraints.NotNull; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.dropwizard.Configuration; + +public class WorkflowDesignerConfiguration extends Configuration { + private String template; + + private String defaultName = "Workflow Designer"; + + private String adapterType; + + @NotNull + private SDCServiceProxyInfo sdcServiceProxy; + + @NotNull + private ActivitySpecServiceProxyInfo activitySpecServiceProxy; + + + @JsonProperty + public String getTemplate() { + return template; + } + + @JsonProperty + public void setTemplate(String template) { + this.template = template; + } + + @JsonProperty + public String getDefaultName() { + return defaultName; + } + + @JsonProperty + public void setDefaultName(String name) { + this.defaultName = name; + } + + /** + * @return the adapterType + */ + @JsonProperty + public String getAdapterType() { + return adapterType; + } + + /** + * @param adapterType the adapterType to set + */ + @JsonProperty + public void setAdapterType(String adapterType) { + this.adapterType = adapterType; + } + + /** + * @return the sdcServiceProxy + */ + @JsonProperty + public SDCServiceProxyInfo getSdcServiceProxy() { + return sdcServiceProxy; + } + + /** + * @param sdcServiceProxy the sdcServiceProxy to set + */ + @JsonProperty + public void setSdcServiceProxy(SDCServiceProxyInfo sdcServiceProxy) { + this.sdcServiceProxy = sdcServiceProxy; + } + + /** + * @return the activitySpecServiceProxy + */ + @JsonProperty + public ActivitySpecServiceProxyInfo getActivitySpecServiceProxy() { + return activitySpecServiceProxy; + } + + /** + * @param activitySpecServiceProxy the activitySpecServiceProxy to set + */ + @JsonProperty + public void setActivitySpecServiceProxy(ActivitySpecServiceProxyInfo activitySpecServiceProxy) { + this.activitySpecServiceProxy = activitySpecServiceProxy; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java new file mode 100644 index 00000000..bc3cf4b6 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java @@ -0,0 +1,34 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflowdesigner.common; + +public class ActivitySpecProxyException extends Exception { + + private static final long serialVersionUID = 1L; + + public ActivitySpecProxyException() { + super(); + } + + public ActivitySpecProxyException(String msg, Exception e) { + super(msg, e); + } + + public ActivitySpecProxyException(String msg) { + super(msg); + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java new file mode 100644 index 00000000..8f596b0c --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.common; + +public class SDCProxyException extends Exception { + + private static final long serialVersionUID = 1L; + + public SDCProxyException() { + super(); + } + + public SDCProxyException(String msg, Exception e) { + super(msg, e); + } + + public SDCProxyException(String msg) { + super(msg); + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java new file mode 100644 index 00000000..0c6e4c8b --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.config; + +/** + * + */ +public enum AdapterType { + DEFAULT, SDC + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java new file mode 100644 index 00000000..a6f72be0 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.config; + +import org.onap.sdc.workflowdesigner.SDCServiceProxyInfo; +import org.onap.sdc.workflowdesigner.ActivitySpecServiceProxyInfo; + +/** + * + */ +public class AppConfig { + private static AdapterType adapterType; + + private static SDCServiceProxyInfo sdcServiceProxy; + + private static ActivitySpecServiceProxyInfo activitySpecServiceProxy; + + private AppConfig() {} + + /** + * @return the adapterType + */ + public static AdapterType getAdapterType() { + return adapterType; + } + + /** + * @param adapterType the adapterType to set + */ + public static void setAdapterType(AdapterType adapterType) { + AppConfig.adapterType = adapterType; + } + + /** + * @param sdcServiceProxy + */ + public static void setSdcServiceProxy(SDCServiceProxyInfo sdcServiceProxy) { + AppConfig.sdcServiceProxy = sdcServiceProxy; + } + + /** + * @return the sdcServiceProxy + */ + public static SDCServiceProxyInfo getSdcServiceProxy() { + return sdcServiceProxy; + } + + /** + * @return + */ + public static boolean isSDCAdapter() { + return adapterType.equals(AdapterType.SDC); + } + + /** + * @param activitySpecServiceProxy + */ + public static void setActivitySpecServiceProxy(ActivitySpecServiceProxyInfo activitySpecServiceProxy) { + AppConfig.activitySpecServiceProxy = activitySpecServiceProxy; + } + + /** + * @return the activitySpecServiceProxy + */ + public static ActivitySpecServiceProxyInfo getActivitySpecServiceProxy() { + return activitySpecServiceProxy; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java new file mode 100644 index 00000000..74d80e04 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.config; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Config { + private static Logger log = LoggerFactory.getLogger(Config.class); + private static String configFilePath = "bpmn.config.properties"; + public final static String HANDLER_ClASS = "handlerClass"; + public final static String TEMPLATE_PATH = "templatePath"; + + public final static Properties PROPERTIES = load(); + + public static Properties load() { + Properties properties = new Properties(); + InputStream in = null; + try { + in = Config.class.getClassLoader().getResourceAsStream(configFilePath); + properties.load(in); + } catch (FileNotFoundException e) { + log.error(configFilePath, e); + } catch (IOException e) { + log.error(configFilePath, e); + } catch (Exception e) { + log.error(configFilePath, e); + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException e) { + log.error(configFilePath, e); + } + } + } + + return properties; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java new file mode 100644 index 00000000..b85d6d0b --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.GenericCollectionWrapper; + +@Path("") +public interface ActivitySpecService { + @GET + @Path("/activity-spec?Filter=Certified") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public GenericCollectionWrapper getActivitySpecs( + @HeaderParam("USER_ID") String userId, + @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, + @HeaderParam("Authorization") String authorization) throws Exception; + + @GET + @Path("/activity-spec/{id}/versions/{versionId}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public ActivitySpec getActivitySpec( + @HeaderParam("USER_ID") String userId, + @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, + @HeaderParam("Authorization") String authorization, + @PathParam("versionId") String versionId, + @PathParam("id") String id) throws Exception; + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java new file mode 100644 index 00000000..e210e872 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.glassfish.jersey.client.ClientConfig; +import org.onap.sdc.workflowdesigner.common.ActivitySpecProxyException; +import org.onap.sdc.workflowdesigner.config.AppConfig; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.GenericCollectionWrapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.eclipsesource.jaxrs.consumer.ConsumerFactory; + +/** + * + */ +public class ActivitySpecServiceProxy { + private static final Logger LOGGER = LoggerFactory.getLogger(ActivitySpecServiceProxy.class); + + private static final String AUTHORIZATION = AppConfig.getActivitySpecServiceProxy().getAuthorization(); + + private static final String X_ECOMP_INSTANCE_ID = AppConfig.getActivitySpecServiceProxy().getxEcompInstanceId(); + + private static final String USER_ID = AppConfig.getActivitySpecServiceProxy().getUserId(); + + /** */ + private static final String ACTIVITY_ROOT_PATH = "/activity-spec-api/v1.0"; + + private static final String ACTIVITY_SPEC_VERSION_ID_DEFAULT_VALUE = "latest"; + + private static String getActivityRootPath() { + return AppConfig.getActivitySpecServiceProxy().getServiceAddr() + ACTIVITY_ROOT_PATH; + } + + /** + * @return + */ + private ActivitySpecService getActivitySpecServiceProxy() { + ClientConfig config = new ClientConfig(); + return ConsumerFactory.createConsumer(getActivityRootPath(), config, ActivitySpecService.class); + } + + + /** + * + * @return + * @throws ActivitySpecProxyException + */ + public ActivitySpec[] getActivitySpecs() throws ActivitySpecProxyException { + ActivitySpecService serviceProxy = getActivitySpecServiceProxy(); + List activitySpecList = new ArrayList<>(); + try { + GenericCollectionWrapper activityCollection = serviceProxy.getActivitySpecs(USER_ID, X_ECOMP_INSTANCE_ID, AUTHORIZATION); + for (Object obj : activityCollection.getResults()) { + if (obj instanceof Map){ + Map activitySpecMap = (Map) obj; + String activitySpecId = activitySpecMap.get("id").toString(); + ActivitySpec activitySpec = serviceProxy.getActivitySpec(USER_ID, X_ECOMP_INSTANCE_ID, AUTHORIZATION, ACTIVITY_SPEC_VERSION_ID_DEFAULT_VALUE, activitySpecId); + activitySpec.setId(activitySpecId); + activitySpecList.add(activitySpec); + } + } + } catch (Exception e) { + LOGGER.error("Get Activity Specifications Failed.", e); + throw new ActivitySpecProxyException("Get Activity Specifications Failed.", e); + } + return activitySpecList.toArray(new ActivitySpec[activitySpecList.size()]); + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java new file mode 100644 index 00000000..d5a55669 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; + +@Path("/catalog") +public interface SDCService { + @POST + @Path("/resource/{uuid}/interfaces/{operationID}/artifacts/{id}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public void saveWorkflowArtifact(@PathParam("uuid") String uuid, + @PathParam("operationID") String operationId, @PathParam("id") String workflowId, + @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, + @HeaderParam("Authorization") String authorization, + WorkflowArtifactInfo workflowArtifactInfo) throws Exception; + + + @GET + @Path("/resource/{uuid}/interfaces/{operationID}/artifacts/{id}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public WorkflowArtifactInfo getWorkflowArtifact(@PathParam("uuid") String uuid, + @PathParam("operationID") String operationId, @PathParam("id") String workflowId, + @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, + @HeaderParam("Authorization") String authorization) throws Exception; + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java new file mode 100644 index 00000000..374bca7a --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java @@ -0,0 +1,94 @@ +/** + * Copyright 2017-2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc; + +import org.glassfish.jersey.client.ClientConfig; +import org.onap.sdc.workflowdesigner.common.SDCProxyException; +import org.onap.sdc.workflowdesigner.config.AppConfig; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.eclipsesource.jaxrs.consumer.ConsumerFactory; + +/** + * + */ +public class SDCServiceProxy { + private static final Logger LOGGER = LoggerFactory.getLogger(SDCService.class); + + private static final String AUTHORIZATION = AppConfig.getSdcServiceProxy().getAuthorization(); + + private static final String X_ECOMP_INSTANCE_ID = + AppConfig.getSdcServiceProxy().getxEcompInstanceId(); + /** */ + private static final String SDC_ROOT_PATH = "/sdc/v1"; + + + private static String getSDCRootPath() { + return AppConfig.getSdcServiceProxy().getServiceAddr() + SDC_ROOT_PATH; + } + + /** + * @return + */ + private SDCService getSDCServiceProxy() { + ClientConfig config = new ClientConfig(); + return ConsumerFactory.createConsumer(getSDCRootPath(), config, SDCService.class); + } + + /** + * + * @param uuid + * @param operationId + * @param workflowId + * @param workflowArtifactInfo + * @throws SDCProxyException + */ + public void saveWorkflowArtifact(String uuid, String operationId, String workflowId, + WorkflowArtifactInfo workflowArtifactInfo) throws SDCProxyException { + SDCService serviceProxy = getSDCServiceProxy(); + try { + serviceProxy.saveWorkflowArtifact(uuid, operationId, workflowId, X_ECOMP_INSTANCE_ID, + AUTHORIZATION, workflowArtifactInfo); + } catch (Exception e) { + LOGGER.error("Save WorkflowArtifact Failed.", e); + throw new SDCProxyException("Save WorkflowArtifact Failed.", e); + } + } + + /** + * + * @param uuid + * @param operationId + * @param workflowId + * @return + * @throws SDCProxyException + */ + public WorkflowArtifactInfo getWorkflowArtifact(String uuid, String operationId, + String workflowId) throws SDCProxyException { + SDCService serviceProxy = getSDCServiceProxy(); + try { + return serviceProxy.getWorkflowArtifact(uuid, operationId, workflowId, X_ECOMP_INSTANCE_ID, + AUTHORIZATION); + } catch (Exception e) { + LOGGER.error("Get WorkflowArtifact Failed.", e); + throw new SDCProxyException("Get WorkflowArtifact Failed.", e); + } + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java new file mode 100644 index 00000000..092e8627 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; + +/** + * + */ +public class ActivityContent { + @JsonProperty(value="class") // for dropwizard's Jackson + @SerializedName("class") // for Gson + public String clazz; + + private String scriptFormat; + + private String script; + + + /** + * @return the scriptFormat + */ + public String getScriptFormat() { + return scriptFormat; + } + + /** + * @param scriptFormat the scriptFormat to set + */ + public void setScriptFormat(String scriptFormat) { + this.scriptFormat = scriptFormat; + } + + /** + * @return the script + */ + public String getScript() { + return script; + } + + /** + * @param script the script to set + */ + public void setScript(String script) { + this.script = script; + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java new file mode 100644 index 00000000..ecaffb38 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; + +/** + * + */ +public class ActivitySpec { + private String id; + + private String versionId; + + private String name; + + private String description; + + private String type; + + private String content; + + private String[] categoryList; + + private Parameter[] inputs; + + private Parameter[] outputs; + + private String status; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the versionId + */ + public String getVersionId() { + return versionId; + } + + /** + * @param versionId the versionId to set + */ + public void setVersionId(String versionId) { + this.versionId = versionId; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the content + */ + public String getContent() { + return content; + } + + /** + * @param content the content to set + */ + public void setContent(String content) { + this.content = content; + } + + /** + * @return the categoryList + */ + public String[] getCategoryList() { + return categoryList; + } + + /** + * @param categoryList the categoryList to set + */ + public void setCategoryList(String[] categoryList) { + this.categoryList = categoryList; + } + + /** + * @return the inputs + */ + public Parameter[] getInputs() { + return inputs; + } + + /** + * @param inputs the inputs to set + */ + public void setInputs(Parameter[] inputs) { + this.inputs = inputs; + } + + /** + * @return the outputs + */ + public Parameter[] getOutputs() { + return outputs; + } + + /** + * @param outputs the outputs to set + */ + public void setOutputs(Parameter[] outputs) { + this.outputs = outputs; + } + + /** + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * @param status the status to set + */ + public void setStatus(String status) { + this.status = status; + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java new file mode 100644 index 00000000..59813605 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java @@ -0,0 +1,61 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +public class GenericCollectionWrapper implements Serializable { + private static final long serialVersionUID = 1L; + + private transient List results; + private int listCount; + + public GenericCollectionWrapper() { + this.results = new ArrayList<>(); + } + + /** + * Instantiates a new Generic collection wrapper. + * + * @param list the list + */ + public GenericCollectionWrapper(List list) { + if (!list.isEmpty()) { + this.results = list; + this.listCount = list.size(); + } + } + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public int getListCount() { + return listCount; + } + + public void setListCount(int listCount) { + this.listCount = listCount; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java new file mode 100644 index 00000000..86a3d578 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; + +import com.google.gson.annotations.SerializedName; + +/** + * + */ +public class Parameter { + private String name; + + private String type; + + @SerializedName("default") + private String defaultValue; + + private String value; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the defaultValue + */ + public String getDefault() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefault(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } + + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java new file mode 100644 index 00000000..e2cab05e --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; + +import java.io.Serializable; + +public class WorkflowArtifactInfo implements Serializable { + public static final long serialVersionUID = 1L; + + private String artifactName; + + private String description; + + private String artifactType = "WORKFLOW"; + + private String payloadData; + + public WorkflowArtifactInfo(String artifactName, String description, + String payloadData) { + super(); + this.artifactName = artifactName; + this.description = description; + this.payloadData = payloadData; + } + + /** + * @return the artifactName + */ + public String getArtifactName() { + return artifactName; + } + + /** + * @param artifactName the artifactName to set + */ + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the artifactType + */ + public String getArtifactType() { + return artifactType; + } + + /** + * @param artifactType the artifactType to set + */ + public void setArtifactType(String artifactType) { + this.artifactType = artifactType; + } + + /** + * @return the payloadData + */ + public String getPayloadData() { + return payloadData; + } + + /** + * @param payloadData the payloadData to set + */ + public void setPayloadData(String payloadData) { + this.payloadData = payloadData; + } + + /** + * @return the serialversionuid + */ + public static long getSerialversionuid() { + return serialVersionUID; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java new file mode 100644 index 00000000..7c1e058c --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class DataObject { + private String id; + private String name; + private String value; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java new file mode 100644 index 00000000..4c362231 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import java.util.List; + +public class Element { + public enum TYPE { + startEvent, + endEvent, + errorStartEvent, + errorEndEvent, + serviceTask, + scriptTask, + exclusiveGateway, + parallelGateway, + restTask, + intermediateCatchEvent + }; + + private String id; + private String name; + private TYPE type; + private String documentation; + private Position position; + private List connections; + + public String getId() { + return id; + } + + public Position getPosition() { + return position; + } + + public void setPosition(Position position) { + this.position = position; + } + + public List getConnections() { + return connections; + } + + public void setConnections(List connections) { + this.connections = connections; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDocumentation() { + return documentation; + } + + public void setDocumentation(String documentation) { + this.documentation = documentation; + } + + public TYPE getType() { + return type; + } + + public void setType(TYPE type) { + this.type = type; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java new file mode 100644 index 00000000..56d81e63 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class EndEvent extends Element { + public final static String TYPE = "endEvent"; +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java new file mode 100644 index 00000000..0fda8c27 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ErrorEndEvent extends Element { + @JsonProperty("parameter") + private Parameter parameter; + + public Parameter getParameter() { + return parameter; + } + + public void setParameter(Parameter parameter) { + this.parameter = parameter; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java new file mode 100644 index 00000000..b4cf96c0 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ErrorStartEvent extends Element { + @JsonProperty("parameter") + private Parameter parameter; + + public Parameter getParameter() { + return parameter; + } + + public void setParameter(Parameter parameter) { + this.parameter = parameter; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java new file mode 100644 index 00000000..d34a4f9e --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class ExclusiveGateway extends Element { + public final static String TYPE = "exclusiveGateway"; +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java new file mode 100644 index 00000000..be8b28ea --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class IntermediateCatchEvent extends Element { + private TimerEventDefinition timerEventDefinition; + + public TimerEventDefinition getTimerEventDefinition() { + return timerEventDefinition; + } + + public void setTimerEventDefinition(TimerEventDefinition timerEventDefinition) { + this.timerEventDefinition = timerEventDefinition; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java new file mode 100644 index 00000000..bde17957 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class ParallelGateway extends Element { + public final static String TYPE = "parallelGateway"; +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java new file mode 100644 index 00000000..039427ca --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class Parameter { + private static Logger log = LoggerFactory.getLogger(Parameter.class); + private String description = ""; + private String name; + private String position; + private boolean required; + private String type; + + // body parameter may be a json object + private Object value; + + @JsonInclude(Include.NON_NULL) + private String valueSource; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + public boolean isRequired() { + return required; + } + + public void setRequired(boolean required) { + this.required = required; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public String getValueSource() { + return valueSource; + } + + public void setValueSource(String valueSource) { + this.valueSource = valueSource; + } + + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + String result = null; + try { + result = mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + log.error("fail to convert parameter to json string", e); + } + return result; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java new file mode 100644 index 00000000..094bce34 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class Position { + private int left; + private int top; + + public int getLeft() { + return left; + } + + public void setLeft(int left) { + this.left = left; + } + + public int getTop() { + return top; + } + + public void setTop(int top) { + this.top = top; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java new file mode 100644 index 00000000..3a9c7def --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import java.util.ArrayList; +import java.util.List; + +public class Process { + private String id; + private boolean isExecutable; + private List elementList = new ArrayList(); + private List sequenceFlowList = new ArrayList(); + private List dataObjectList = new ArrayList(); + + public Process(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public boolean isExecutable() { + return isExecutable; + } + + public void setExecutable(boolean isExecutable) { + this.isExecutable = isExecutable; + } + + public List getElementList() { + return elementList; + } + + public void setElementList(List elementList) { + this.elementList = elementList; + } + + public List getSequenceFlowList() { + return sequenceFlowList; + } + + public void setSequenceFlowList(List sequenceFlowList) { + this.sequenceFlowList = sequenceFlowList; + } + + public List getDataObjectList() { + return dataObjectList; + } + + public void setDataObjectList(List dataObjectList) { + this.dataObjectList = dataObjectList; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java new file mode 100644 index 00000000..fb425aae --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import java.util.List; + +import org.onap.sdc.workflowdesigner.config.Config; + +public class RestServiceTask extends ServiceTask { + private static String handler = Config.PROPERTIES.getProperty(Config.HANDLER_ClASS); + +// private String restConfigId; +// public String getRestConfigId() { +// return restConfigId; +// } +// public void setRestConfigId(String restConfigId) { +// this.restConfigId = restConfigId; +// } + private List produces; + private List consumes; + + + private List parameters; + private String baseUrl; + private String serviceName; + private String serviceVersion; + private String path; + private String method; + + public String getBaseUrl() { + return baseUrl; + } + public void setBaseUrl(String url) { + this.baseUrl = url; + } + + public String getMethod() { + return method; + } + + public static String getHandler() { + return handler; + } + public static void setHandler(String handler) { + RestServiceTask.handler = handler; + } + public void setMethod(String method) { + this.method = method; + } + public List getProduces() { + return produces; + } + public void setProduces(List produces) { + this.produces = produces; + } + public List getConsumes() { + return consumes; + } + public void setConsumes(List consumes) { + this.consumes = consumes; + } + public List getParameters() { + return parameters; + } + public void setParameters(List parameters) { + this.parameters = parameters; + } + public String getServiceName() { + return serviceName; + } + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + public String getServiceVersion() { + return serviceVersion; + } + public void setServiceVersion(String serviceVersion) { + this.serviceVersion = serviceVersion; + } + public String getPath() { + return path; + } + public void setPath(String path) { + this.path = path; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java new file mode 100644 index 00000000..51d916cd --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class ScriptTask extends Element { + private String scriptFormat; + private String script; + + public String getScriptFormat() { + return scriptFormat; + } + + public void setScriptFormat(String scriptFormat) { + this.scriptFormat = scriptFormat; + } + + public String getScript() { + return script; + } + + public void setScript(String script) { + this.script = script; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java new file mode 100644 index 00000000..6e7588a7 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class SequenceFlow { + private String id = ""; + private String name; + private String sourceRef; + private String targetRef; + private String documentation; + private String condition; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSourceRef() { + return sourceRef; + } + + public void setSourceRef(String sourceRef) { + this.sourceRef = sourceRef; + } + + public String getTargetRef() { + return targetRef; + } + + public void setTargetRef(String targetRef) { + this.targetRef = targetRef; + } + + public String getDocumentation() { + return documentation; + } + + public void setDocumentation(String documentation) { + this.documentation = documentation; + } + + public String getCondition() { + return condition; + } + + public void setCondition(String condition) { + this.condition = condition; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java new file mode 100644 index 00000000..8770d39c --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import java.util.List; + +public class ServiceTask extends Element { + private String className; + private List inputs; + private List outputs; + + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public List getInputs() { + return inputs; + } + + public void setInputs(List inputs) { + this.inputs = inputs; + } + + public List getOutputs() { + return outputs; + } + + public void setOutputs(List outputs) { + this.outputs = outputs; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java new file mode 100644 index 00000000..c6517512 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class StartEvent extends Element { + @JsonProperty("parameters") + private List parameters; + + public List getParameters() { + return parameters; + } + + public void setParameters(List parameters) { + this.parameters = parameters; + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java new file mode 100644 index 00000000..67304f96 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.model; + +public class TimerEventDefinition { + private String type; + private String timeDuration; + private String timeDate; + private String timeCycle; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTimeDuration() { + return timeDuration; + } + + public void setTimeDuration(String timeDuration) { + this.timeDuration = timeDuration; + } + + public String getTimeDate() { + return timeDate; + } + + public void setTimeDate(String timeDate) { + this.timeDate = timeDate; + } + + public String getTimeCycle() { + return timeCycle; + } + + public void setTimeCycle(String timeCycle) { + this.timeCycle = timeCycle; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java new file mode 100644 index 00000000..f41faa37 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java @@ -0,0 +1,216 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.parser; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.onap.sdc.workflowdesigner.model.DataObject; +import org.onap.sdc.workflowdesigner.model.Element; +import org.onap.sdc.workflowdesigner.model.EndEvent; +import org.onap.sdc.workflowdesigner.model.ErrorEndEvent; +import org.onap.sdc.workflowdesigner.model.ErrorStartEvent; +import org.onap.sdc.workflowdesigner.model.ExclusiveGateway; +import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent; +import org.onap.sdc.workflowdesigner.model.ParallelGateway; +import org.onap.sdc.workflowdesigner.model.Parameter; +import org.onap.sdc.workflowdesigner.model.Process; +import org.onap.sdc.workflowdesigner.model.RestServiceTask; +import org.onap.sdc.workflowdesigner.model.ScriptTask; +import org.onap.sdc.workflowdesigner.model.SequenceFlow; +import org.onap.sdc.workflowdesigner.model.ServiceTask; +import org.onap.sdc.workflowdesigner.model.StartEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +public class Bpmn4ToscaJsonParser { + + private static Logger log = LoggerFactory.getLogger(Bpmn4ToscaJsonParser.class); + + private static ObjectMapper MAPPER = new ObjectMapper(); + + private Map restConfigMap = new HashMap(); + + static { + MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + } + + public Process parse(String processName, URI jsonFileUrl) + throws JsonParseException, JsonMappingException, MalformedURLException, IOException { + Process process = new Process(processName); + + JsonNode rootNode = MAPPER.readValue(jsonFileUrl.toURL(), JsonNode.class); + + log.debug("Creating Process models..."); +// JsonNode nodes = rootNode.get(JsonKeys.NODES); + JsonNode data = rootNode.get(JsonKeys.DATA); + if(null == data) { + return process; + } + JsonNode nodes = data.get(JsonKeys.NODES); + if (nodes == null) { + return process; + } + + this.loadConfigs(rootNode.get(JsonKeys.CONFIGS)); + + Iterator iter = nodes.iterator(); + while (iter.hasNext()) { + JsonNode jsonNode = (JsonNode) iter.next(); + + // get element + Element element = createElementFromJson(jsonNode); + process.getElementList().add(element); + + // get sequence flows + List flowList = getSequenceFlows(jsonNode); + process.getSequenceFlowList().addAll(flowList); + + // add dataObject + if (element instanceof StartEvent) { + List dataObjects = this.getDataObject((StartEvent) element); + process.getDataObjectList().addAll(dataObjects); + } + } + + return process; + + } + + private List getDataObject(StartEvent startEvent) { + List dataObjects = new ArrayList(); + + for (Parameter parameter : startEvent.getParameters()) { + DataObject dataObject = new DataObject(); + dataObject.setId(parameter.getName()); + dataObject.setName(parameter.getName()); + dataObject.setValue((String) parameter.getValue()); + + dataObjects.add(dataObject); + } + + return dataObjects; + } + + private void loadConfigs(JsonNode config) { + if(config == null) { + return; + } + loadRestConfigs(config.get(JsonKeys.REST_CONFIGS)); + } + + private void loadRestConfigs(JsonNode restConfigs) { + if(restConfigs == null) { + return; + } + + Iterator iter = restConfigs.iterator(); + while (iter.hasNext()) { + JsonNode restConfig = (JsonNode) iter.next(); + + String configId = getValueFromJsonNode(restConfig, JsonKeys.ID); + restConfigMap.put(configId, restConfig); + } + } + + private List getSequenceFlows(JsonNode jsonNode) { + List flowList = new ArrayList(); + String elementId = getValueFromJsonNode(jsonNode, JsonKeys.ID); + JsonNode connectionsNode = jsonNode.get(JsonKeys.CONNECTIONS); + + Iterator iter = connectionsNode.iterator(); + while (iter.hasNext()) { + JsonNode connectionEntry = (JsonNode) iter.next(); + String targetRef = getValueFromJsonNode(connectionEntry, JsonKeys.TARGET_REF); + String condition = getValueFromJsonNode(connectionEntry, JsonKeys.CONDITION); + SequenceFlow flow = new SequenceFlow(); + flow.setId(elementId + targetRef); + flow.setSourceRef(elementId); + flow.setTargetRef(targetRef); + flow.setCondition(condition); + flowList.add(flow); + } + + return flowList; + } + + protected Element createElementFromJson(JsonNode jsonNode) + throws JsonParseException, JsonMappingException, IOException { + String jsonObject = jsonNode.toString(); + Element element; + + String nodeType = getValueFromJsonNode(jsonNode, JsonKeys.TYPE); + if (nodeType == null) { + log.warn("Ignoring node: type is null"); + return null; + } + + switch (nodeType) { + case "startEvent": + element = MAPPER.readValue(jsonObject, StartEvent.class); + break; + case "endEvent": + element = MAPPER.readValue(jsonObject, EndEvent.class); + break; + case "errorStartEvent": + element = MAPPER.readValue(jsonObject, ErrorStartEvent.class); + break; + case "errorEndEvent": + element = MAPPER.readValue(jsonObject, ErrorEndEvent.class); + break; + case "intermediateCatchEvent": + element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class); + break; + case "serviceTask": + element = MAPPER.readValue(jsonObject, ServiceTask.class); + break; + case "restTask": + // element = this.createRestServiceTask(jsonObject); + element = MAPPER.readValue(jsonObject, RestServiceTask.class); + break; + case "scriptTask": + element = MAPPER.readValue(jsonObject, ScriptTask.class); + break; + case "exclusiveGateway": + element = MAPPER.readValue(jsonObject, ExclusiveGateway.class); + break; + case "parallelGateway": + element = MAPPER.readValue(jsonObject, ParallelGateway.class); + break; + default: + log.warn("Ignoring node: type '" + nodeType + "' is unkown"); + return null; + } + + return element; + } + + + private String getValueFromJsonNode(JsonNode jsonNode, String key) { + return jsonNode.get(key) == null ? null : jsonNode.get(key).asText(); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java new file mode 100644 index 00000000..6128cfdf --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.parser; + +public interface JsonKeys { + + + /* + * Field names of BPMN4Tosca Model + */ + public static final String DATA = "data"; + public static final String NODES = "nodes"; + public static final String REST_CONFIGS = "restConfigs"; + public static final String CONFIGS = "configs"; + + + // microservice info + public static final String MICROSERVICE_URL = "url"; + public static final String MICROSERVICE_NAME = "name"; + public static final String MICROSERVICE_VERSION = "version"; + + public static final String NAME = "name"; + + public static final String ID = "id"; + + public static final String TYPE = "type"; + + public static final String INPUT = "input"; + + public static final String OUTPUT = "output"; + + public static final String VALUE = "value"; + + public static final String NODE_TEMPLATE = "node_template"; + + public static final String NODE_OPERATION = "node_operation"; + + public static final String NODE_INTERFACE_NAME = "interface"; + + public static final String CONNECTIONS = "connection"; + + public static final String SOURCE_REF = "sourceRef"; + + public static final String TARGET_REF = "targetRef"; + + public static final String CONDITIONS = "conditions"; + + public static final String CONDITION = "condition"; + + public static final String DEFAULT = "default"; + + + /* + * Exclusive-Gateway, Event, Management-Task Types + * + */ + public static final String NODE_TYPE_MGMT_TASK = "ToscaNodeManagementTask"; + + public static final String NODE_TYPE_START_EVENT = "StartEvent"; + + public static final String NODE_TYPE_END_EVENT = "EndEvent"; + + public static final String NODE_TYPE_GATEWAY_EXCLUSIVE = "ExclusiveGateway"; + + public static final String NODE_TYPE_GATEWAY_EXCLUSIVE_END = "ExclusiveGatewayEnd"; + + + /* + * Parameter Types + */ + public static final String PARAM_TYPE_VALUE_STRING = "string"; + + public static final String PARAM_TYPE_VALUE_TOPOLOGY = "topology"; + + public static final String PARAM_TYPE_VALUE_PLAN = "plan"; + + public static final String PARAM_TYPE_VALUE_CONCAT = "concat"; + + public static final String PARAM_TYPE_VALUE_IA = "implementation_artifact"; + + public static final String PARAM_TYPE_VALUE_DA = "deployment_artifact"; + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java new file mode 100644 index 00000000..4a40597a --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.resources; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.eclipse.jetty.http.HttpStatus; +import org.onap.sdc.workflowdesigner.common.ActivitySpecProxyException; +import org.onap.sdc.workflowdesigner.config.AppConfig; +import org.onap.sdc.workflowdesigner.externalservice.sdc.ActivitySpecServiceProxy; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.Parameter; +import org.onap.sdc.workflowdesigner.resources.entity.ExtActivityDisplayInfo; +import org.onap.sdc.workflowdesigner.resources.entity.I18nString; +import org.onap.sdc.workflowdesigner.resources.entity.InputOutput; +import org.onap.sdc.workflowdesigner.resources.entity.NodeCategory; +import org.onap.sdc.workflowdesigner.resources.entity.CategoryData; +import org.onap.sdc.workflowdesigner.resources.entity.Content; +import org.onap.sdc.workflowdesigner.resources.entity.ExtActivity; +import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; +import org.onap.sdc.workflowdesigner.utils.JsonUtils; +import org.onap.sdc.workflowdesigner.utils.RestUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.codahale.metrics.annotation.Timed; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +/** + * Extend Activity Resource. + * + */ +@Path("/ext-activities") +@Api(tags = {"Workflow Modeler"}) +public class ExtendActivityResource { + private static final Logger LOGGER = LoggerFactory.getLogger(ExtendActivityResource.class); + + /** */ + private static final String EXT_ACTIVITIES_DISPLAY_INFO_FILE_NAME = + "ext-activities-display-info.json"; + + private static final String EXT_ACTIVITIES_FILE_NAME = "ext-activities.json"; + + private static final CategoryData EXTENSION_TASK_CATEGORY = + new CategoryData(new I18nString("Extension Task", "Extension Task")); + + private static final String EXTENSION_TASK_CATEGORY_CATEGORY_ID = "extension_task_category_id"; + + /** + * test function. + * + * @return Response + */ + @Path("/") + @GET + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Get Extend Activities.", response = ExtActivity.class, + responseContainer = "List") + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", + response = String.class), + @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, + message = "Unprocessable MicroServiceInfo Entity ", response = String.class), + @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", + response = String.class)}) + @Timed + public Response getExtActivities(@ApiParam(value = "sence") @QueryParam("sence") String sence) { + if (AppConfig.isSDCAdapter()) { + return getExtActivitiesfromSDC(); + } else { + return getExtActivitiesfromLocal(); + } + } + + /** + * @return + */ + private Response getExtActivitiesfromLocal() { + try { + String json = FileCommonUtils.readString(EXT_ACTIVITIES_FILE_NAME); + ExtActivity[] extActivities = JsonUtils.fromJson(json, ExtActivity[].class); + return Response.status(Response.Status.OK).entity(extActivities).build(); + } catch (IOException e) { + LOGGER.error("Get ExtActivities from local failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @return + */ + private Response getExtActivitiesfromSDC() { + try { + ActivitySpecServiceProxy proxy = new ActivitySpecServiceProxy(); + ActivitySpec[] activitySpecs = proxy.getActivitySpecs(); + ExtActivity[] extActivities = convert2ExtActivities(activitySpecs); + return Response.status(Response.Status.OK).entity(extActivities).build(); + } catch (ActivitySpecProxyException e) { + LOGGER.error("Get ExtActivities from sdc failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @param activitySpecs + * @return + */ + private ExtActivity[] convert2ExtActivities(ActivitySpec[] activitySpecs) { + ExtActivity[] extendActivities = new ExtActivity[activitySpecs.length]; + for (int i = 0; i < activitySpecs.length; i++) { + extendActivities[i] = convert2ExtActivity(activitySpecs[i]); + } + return extendActivities; + } + + /** + * @param activitySpec + * @return + */ + private ExtActivity convert2ExtActivity(ActivitySpec activitySpec) { + ExtActivity extActivity = new ExtActivity(); + extActivity.setId(activitySpec.getId()); + extActivity.setDisplayName(new I18nString(activitySpec.getName(), activitySpec.getName())); + extActivity.setDescription( + new I18nString(activitySpec.getDescription(), activitySpec.getDescription())); + extActivity.setType(activitySpec.getType()); + extActivity.setContent(buildContent(activitySpec)); + return extActivity; + } + + /** + * @param activitySpec + * @return + */ + private Content buildContent(ActivitySpec activitySpec) { + Content content = new Content(); + content.setScript(activitySpec.getContent()); + content.setInputs(convert2InputOutputs(activitySpec.getInputs())); + content.setOutputs(convert2InputOutputs(activitySpec.getOutputs())); + return content; + } + + /** + * @param parameters + * @return + */ + private Map convert2InputOutputs(Parameter[] parameters) { + Map inputOutputs = new HashMap<>(); + for (Parameter parameter : parameters) { + inputOutputs.put(parameter.getName(), convert2InputOutput(parameter)); + } + return inputOutputs; + } + + /** + * @param parameter + * @return + */ + private InputOutput convert2InputOutput(Parameter parameter) { + InputOutput inputOutput = new InputOutput(); + inputOutput.setDisplayName(new I18nString(parameter.getName(), parameter.getName())); + inputOutput.setType(parameter.getType()); + inputOutput.setDefault(parameter.getDefault()); + inputOutput.setValue(parameter.getValue()); + return inputOutput; + } + + + @Path("/displayInfo") + @GET + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Get Extend Activities DisplayInfo", + response = ExtActivityDisplayInfo.class) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", + response = String.class), + @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, + message = "Unprocessable MicroServiceInfo Entity ", response = String.class), + @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", + response = String.class)}) + @Timed + public Response getDisplayInfo(@ApiParam(value = "sence") @QueryParam("sence") String sence) { + if (AppConfig.isSDCAdapter()) { + return getDisplayInfofromSDC(); + } else { + return getDisplayInfofromLocal(sence); + } + } + + /** + * @param sence + * @return + */ + private Response getDisplayInfofromLocal(String sence) { + try { + ExtActivityDisplayInfo displayInfo = retriveDisplayInfo(sence); + return Response.status(Response.Status.OK).entity(displayInfo).build(); + } catch (IOException e) { + LOGGER.error("Get Extend Activities DisplayInfo from failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @return + */ + private Response getDisplayInfofromSDC() { + try { + ActivitySpecServiceProxy proxy = new ActivitySpecServiceProxy(); + ActivitySpec[] activitySpecs = proxy.getActivitySpecs(); + ExtActivityDisplayInfo displayInfo = convert2ExtActivityDisplayInfo(activitySpecs); + return Response.status(Response.Status.OK).entity(displayInfo).build(); + } catch (ActivitySpecProxyException e) { + LOGGER.error("Get Extend Activities DisplayInfo from sdc failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @param activitySpecs + * @return + */ + private ExtActivityDisplayInfo convert2ExtActivityDisplayInfo(ActivitySpec[] activitySpecs) { + ExtActivityDisplayInfo displayInfo = new ExtActivityDisplayInfo(); + + for (ActivitySpec activitySpec : activitySpecs) { + displayInfo.getNodes().put(activitySpec.getId(), buildNodeCategory(activitySpec)); + } + + displayInfo.getCategoryData().put(EXTENSION_TASK_CATEGORY_CATEGORY_ID, EXTENSION_TASK_CATEGORY); + + return displayInfo; + } + + /** + * @param activitySpec + * @return + */ + private NodeCategory buildNodeCategory(ActivitySpec activitySpec) { + NodeCategory nodeCategory = new NodeCategory(); + nodeCategory.setCategory(EXTENSION_TASK_CATEGORY_CATEGORY_ID); + + return nodeCategory; + } + + /** + * @param sence + * @return + * @throws IOException + */ + private ExtActivityDisplayInfo retriveDisplayInfo(String sence) throws IOException { + String json = FileCommonUtils.readString(EXT_ACTIVITIES_DISPLAY_INFO_FILE_NAME); + return JsonUtils.fromJson(json, ExtActivityDisplayInfo.class); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java new file mode 100644 index 00000000..263ac73d --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflowdesigner.resources; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.eclipse.jetty.http.HttpStatus; +import com.codahale.metrics.annotation.Timed; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +@Path("/healthCheck") +@Api(tags = {" Health Check "}) +public class HealthCheckResource { + + @GET + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = " Health Check ") + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", + response = String.class), + @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, + message = "Unprocessable MicroServiceInfo Entity ", response = String.class), + @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error", + response = String.class)}) + @Timed + public Response queryEmsList() { + return Response.ok("hello world !").build(); + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java new file mode 100644 index 00000000..c08fcef5 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java @@ -0,0 +1,267 @@ +/** + * Copyright (c) 2017-2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.resources; + +import java.io.IOException; +import java.net.URI; +import java.nio.file.Paths; +import java.util.List; +import java.util.UUID; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.dom4j.Comment; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.eclipse.jetty.http.HttpStatus; +import org.onap.sdc.workflowdesigner.common.SDCProxyException; +import org.onap.sdc.workflowdesigner.config.AppConfig; +import org.onap.sdc.workflowdesigner.externalservice.sdc.SDCServiceProxy; +import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; +import org.onap.sdc.workflowdesigner.model.Process; +import org.onap.sdc.workflowdesigner.parser.Bpmn4ToscaJsonParser; +import org.onap.sdc.workflowdesigner.resources.entity.WorkflowInfo; +import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; +import org.onap.sdc.workflowdesigner.utils.JsonUtils; +import org.onap.sdc.workflowdesigner.utils.RestUtils; +import org.onap.sdc.workflowdesigner.utils.ToolUtils; +import org.onap.sdc.workflowdesigner.writer.BpmnPlanArtefactWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.codahale.metrics.annotation.Timed; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +/** + * Workflow Modeler Resource. + * + */ +@Path("/models") +@Api(tags = {"Workflow Modeler"}) +public class WorkflowModelerResource { + private static final Logger logger = LoggerFactory.getLogger(WorkflowModelerResource.class); + + private static final String WORKFLOW_JSON_TEMP_FILE_NAME = "temp_workflow.json"; + private static final String WORKFLOW_XML_TEMP_FILE_NAME = "temp_workflow.xml"; + + + /** + * + * @return Response + */ + @Path("/{id}") + @GET + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Get Model", response = WorkflowInfo.class) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", + response = String.class), + @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, + message = "Unprocessable MicroServiceInfo Entity ", response = String.class), + @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", + response = String.class)}) + @Timed + public Response getModel(@ApiParam(value = "id") @PathParam("id") String id, + @ApiParam(value = "name") @QueryParam("name") String name, + @ApiParam(value = "uuid") @QueryParam("uuid") String uuid, + @ApiParam(value = "operationId") @QueryParam("operationId") String operationId) { + if (AppConfig.isSDCAdapter()) { + return getModelfromSDC(uuid, operationId, id, name); + } else { + return getModelfromLocal(); + } + + } + + /** + * @return + */ + private Response getModelfromLocal() { + try { + String json = FileCommonUtils.readString(WORKFLOW_JSON_TEMP_FILE_NAME); + return Response.status(Response.Status.OK).entity(json).build(); + } catch (IOException e) { + logger.error("get workflow from local failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + + /** + * @param uuid + * @param operationId + * @param id + * @param name + * @return + */ + private Response getModelfromSDC(String uuid, String operationId, String id, String name) { + try { + SDCServiceProxy sdcProxy = new SDCServiceProxy(); + WorkflowArtifactInfo wai = sdcProxy.getWorkflowArtifact(uuid, operationId, id); + String bpmn = wai.getPayloadData(); + String json = readJsonfromBPMN(bpmn); + if (ToolUtils.isEmpty(json)) { + WorkflowInfo wfi = newEmptyWorkflowInfo(uuid, operationId, id, name); + return Response.status(Response.Status.OK).entity(wfi).build(); + } + return Response.status(Response.Status.OK).entity(json).build(); + } catch (SDCProxyException e) { + logger.error("get workflow from sdc failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } catch (DocumentException e) { + logger.error("get workflow from sdc failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @param id + * @param operationId + * @param uuid + * @param name + * @return + */ + private WorkflowInfo newEmptyWorkflowInfo(String uuid, String operationId, String id, + String name) { + WorkflowInfo wfi = new WorkflowInfo(); + wfi.setId(id); + wfi.setName(name); + wfi.setUuid(uuid); + wfi.setOperationId(operationId); + + return wfi; + } + + + + @Path("/{id}") + @PUT + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Save Model", response = String.class) + @ApiResponses(value = { + @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", + response = String.class), + @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, + message = "Unprocessable MicroServiceInfo Entity ", response = String.class), + @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", + response = String.class)}) + @Timed + public Response saveModel(@ApiParam(value = "id") @PathParam("id") String id, + @ApiParam(value = "Model Content", required = true) String json) { + try { + FileCommonUtils.write(WORKFLOW_JSON_TEMP_FILE_NAME, json); + + URI srcUri = Paths.get(".", WORKFLOW_JSON_TEMP_FILE_NAME).toUri(); + String processName = "plan_" + UUID.randomUUID().toString(); + String bpmn = buildBPMN(srcUri, processName); + String jsonBpmn = insertJson2Bpmn(json, bpmn); + + if (AppConfig.isSDCAdapter()) { + save2SDC(json, jsonBpmn); + } + FileCommonUtils.write(WORKFLOW_XML_TEMP_FILE_NAME, jsonBpmn); + + return Response.status(Response.Status.OK).entity(json).build(); + } catch (IOException e) { + logger.error("save workflow failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } catch (Exception e) { + logger.error("convert workflow from json to bpmn failed.", e); + throw RestUtils.newInternalServerErrorException(e); + } + } + + /** + * @param json + * @param bpmn + * @return + */ + protected String insertJson2Bpmn(String json, String bpmn) { + StringBuffer sb = new StringBuffer(bpmn); + sb.append("\n"); + + return sb.toString(); + } + + /** + * + * @return + * @throws DocumentException + */ + protected String readJsonfromBPMN(String bpmn) throws DocumentException { + if (ToolUtils.isEmpty(bpmn)) { + return null; + } + + Document doc = DocumentHelper.parseText(bpmn); + List elementList = doc.content(); + for (Object object : elementList) { + if (object instanceof Comment) { + Comment comment = (Comment) object; + return comment.getText().trim(); + } + } + + return null; + } + + + /** + * @param json + * @param bpmn + * @throws SDCProxyException + */ + private void save2SDC(String json, String bpmn) throws SDCProxyException { + WorkflowInfo workflowInfo = JsonUtils.fromJson(json, WorkflowInfo.class); + WorkflowArtifactInfo workflowArtifactInfo = + new WorkflowArtifactInfo(workflowInfo.getName(), workflowInfo.getDescription(), bpmn); + + SDCServiceProxy sdcProxy = new SDCServiceProxy(); + sdcProxy.saveWorkflowArtifact(workflowInfo.getUuid(), workflowInfo.getOperationId(), + workflowInfo.getId(), workflowArtifactInfo); + } + + /** + * + * @param srcUri + * @param processName + * @return + * @throws IOException + * @throws Exception + */ + protected String buildBPMN(URI srcUri, String processName) throws IOException, Exception { + Bpmn4ToscaJsonParser parser = new Bpmn4ToscaJsonParser(); + Process process = parser.parse(processName, srcUri); + + // transform bpmn template + BpmnPlanArtefactWriter writer = new BpmnPlanArtefactWriter(process); + return writer.completePlanTemplate(); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java new file mode 100644 index 00000000..04ce29ea --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +/** + * + */ +public class CategoryData { + private I18nString displayName; + + private boolean collapse; + + /** + * + */ + public CategoryData() { + super(); + } + + /** + * @param displayName + */ + public CategoryData(I18nString displayName) { + super(); + this.displayName = displayName; + } + + /** + * @return the displayName + */ + public I18nString getDisplayName() { + return displayName; + } + + /** + * @param displayName the displayName to set + */ + public void setDisplayName(I18nString displayName) { + this.displayName = displayName; + } + + /** + * @return the collapse + */ + public boolean isCollapse() { + return collapse; + } + + /** + * @param collapse the collapse to set + */ + public void setCollapse(boolean collapse) { + this.collapse = collapse; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java new file mode 100644 index 00000000..a2b814d8 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; + +/** + * + */ +@JsonInclude(Include.NON_NULL) +public class Content { + @JsonProperty(value="class") // for dropwizard's Jackson + @SerializedName("class") // for Gson + public String clazz; + + private String script; + + private String scriptFormat; + + private Map inputs; + + private Map outputs; + + + /** + * @return the script + */ + public String getScript() { + return script; + } + + /** + * @param script the script to set + */ + public void setScript(String script) { + this.script = script; + } + + /** + * @return the scriptFormat + */ + public String getScriptFormat() { + return scriptFormat; + } + + /** + * @param scriptFormat the scriptFormat to set + */ + public void setScriptFormat(String scriptFormat) { + this.scriptFormat = scriptFormat; + } + + /** + * @return the inputs + */ + public Map getInputs() { + return inputs; + } + + /** + * @param inputs the inputs to set + */ + public void setInputs(Map inputs) { + this.inputs = inputs; + } + + /** + * @return the outputs + */ + public Map getOutputs() { + return outputs; + } + + /** + * @param outputs the outputs to set + */ + public void setOutputs(Map outputs) { + this.outputs = outputs; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java new file mode 100644 index 00000000..ca63bebe --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; + +/** + * + */ +@JsonInclude(Include.NON_NULL) +public class ExtActivity { + private String id; + + private I18nString displayName; + + private I18nString description; + + private String type; + + private IconData icon; + + private Content content; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the icon + */ + public IconData getIcon() { + return icon; + } + + /** + * @param icon the icon to set + */ + public void setIcon(IconData icon) { + this.icon = icon; + } + + /** + * @return the content + */ + public Content getContent() { + return content; + } + + /** + * @param content the content to set + */ + public void setContent(Content content) { + this.content = content; + } + + /** + * @return the displayName + */ + public I18nString getDisplayName() { + return displayName; + } + + /** + * @param displayName the displayName to set + */ + public void setDisplayName(I18nString displayName) { + this.displayName = displayName; + } + + /** + * @return the description + */ + public I18nString getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(I18nString description) { + this.description = description; + } + + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java new file mode 100644 index 00000000..ac91a771 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +import java.util.HashMap; +import java.util.Map; + +/** + * + */ +public class ExtActivityDisplayInfo { + private Map nodes = new HashMap<>(); + + private Map categoryData = new HashMap<>(); + + /** + * @return the nodes + */ + public Map getNodes() { + return nodes; + } + + /** + * @param nodes the nodes to set + */ + public void setNodes(Map nodes) { + this.nodes = nodes; + } + + /** + * @return the categoryData + */ + public Map getCategoryData() { + return categoryData; + } + + /** + * @param categoryData the categoryData to set + */ + public void setCategoryData(Map categoryData) { + this.categoryData = categoryData; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java new file mode 100644 index 00000000..faddfaa1 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +/** + * + */ +public class I18nString { + private String en_US; + + private String zh_CN; + + /** + * + */ + public I18nString() { + super(); + } + + /** + * @param en_US + * @param zh_CN + */ + public I18nString(String en_US, String zh_CN) { + super(); + this.en_US = en_US; + this.zh_CN = zh_CN; + } + + /** + * @return the en_US + */ + public String getEn_US() { + return en_US; + } + + /** + * @param en_US the en_US to set + */ + public void setEn_US(String en_US) { + this.en_US = en_US; + } + + /** + * @return the zh_CN + */ + public String getZh_CN() { + return zh_CN; + } + + /** + * @param zh_CN the zh_CN to set + */ + public void setZh_CN(String zh_CN) { + this.zh_CN = zh_CN; + } + + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java new file mode 100644 index 00000000..731ad7c9 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +/** + * + */ +public class IconData { + private String name; + + private int width; + + private int height; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the width + */ + public int getWidth() { + return width; + } + + /** + * @param width the width to set + */ + public void setWidth(int width) { + this.width = width; + } + + /** + * @return the height + */ + public int getHeight() { + return height; + } + + /** + * @param height the height to set + */ + public void setHeight(int height) { + this.height = height; + } + + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java new file mode 100644 index 00000000..1d5c34a7 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +import com.google.gson.annotations.SerializedName; + +/** + * + */ +public class InputOutput { + private String type; + + @SerializedName("default") + private String defaultValue; + + private boolean required; + + private I18nString displayName; + + private boolean show = true; + + private boolean editable = true; + + private String value; + + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the defaultValue + */ + public String getDefault() { + return defaultValue; + } + + /** + * @param defaultValue the defaultValue to set + */ + public void setDefault(String defaultValue) { + this.defaultValue = defaultValue; + } + + /** + * @return the required + */ + public boolean isRequired() { + return required; + } + + /** + * @param required the required to set + */ + public void setRequired(boolean required) { + this.required = required; + } + + /** + * @return the displayName + */ + public I18nString getDisplayName() { + return displayName; + } + + /** + * @param displayName the displayName to set + */ + public void setDisplayName(I18nString displayName) { + this.displayName = displayName; + } + + /** + * @return the show + */ + public boolean isShow() { + return show; + } + + /** + * @param show the show to set + */ + public void setShow(boolean show) { + this.show = show; + } + + /** + * @return the editable + */ + public boolean isEditable() { + return editable; + } + + /** + * @param editable the editable to set + */ + public void setEditable(boolean editable) { + this.editable = editable; + } + + /** + * @return the value + */ + public String getValue() { + return value; + } + + /** + * @param value the value to set + */ + public void setValue(String value) { + this.value = value; + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java new file mode 100644 index 00000000..bb1ce7c0 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +/** + * + */ +public class NodeCategory { + private String category; + + /** + * @return the category + */ + public String getCategory() { + return category; + } + + /** + * @param category the category to set + */ + public void setCategory(String category) { + this.category = category; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java new file mode 100644 index 00000000..b4747162 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java @@ -0,0 +1,133 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.resources.entity; + +import com.google.gson.JsonObject; + +/** + * + */ +public class WorkflowInfo { + private String uuid; + + private String operationId; + + private String id; + + private String name; + + private String description; + + private String scene; + + private JsonObject data; + + /** + * @return the uuid + */ + public String getUuid() { + return uuid; + } + + /** + * @param uuid the uuid to set + */ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * @return the operationId + */ + public String getOperationId() { + return operationId; + } + + /** + * @param operationId the operationId to set + */ + public void setOperationId(String operationId) { + this.operationId = operationId; + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the scene + */ + public String getScene() { + return scene; + } + + /** + * @param scene the scene to set + */ + public void setScene(String scene) { + this.scene = scene; + } + + /** + * @return the data + */ + public JsonObject getData() { + return data; + } + + /** + * @param data the data to set + */ + public void setData(JsonObject data) { + this.data = data; + } + + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java new file mode 100644 index 00000000..fdf11959 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.utils; + +/** + * + */ +public interface FileCommonConstants { + String DEFAULT_CHARSET_NAME = "UTF-8"; + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java new file mode 100644 index 00000000..0f07dc50 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java @@ -0,0 +1,287 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.utils; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * common utility class. + * + */ +public class FileCommonUtils { + private static final Logger logger = LoggerFactory.getLogger(FileCommonUtils.class); + + /** + * @param ins + */ + public static void closeInputStream(InputStream ins) { + if (ins != null) { + try { + ins.close(); + } catch (IOException e) { + logger.info("Close InputStream failed.", e); + } + } + } + + + /** + * + * @param os + */ + public static void closeOutputStream(OutputStream os) { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + logger.info("Close OutputStream failed.", e); + } + } + } + + + /** + * @param reader + */ + public static void closeReader(Reader reader) { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + logger.info("Close Reader failed.", e); + } + } + } + + + /** + * + * @param writer + */ + public static void closeWriter(Writer writer) { + if (writer != null) { + try { + writer.close(); + } catch (IOException e) { + logger.info("Close Writer failed.", e); + } + } + } + + + /** + * + * @param ins + * @return + * @throws IOException + */ + public static String[] readLines(InputStream ins) throws IOException { + InputStreamReader insReader = new InputStreamReader(ins); + BufferedReader reader = new BufferedReader(insReader); + + List lineList = new ArrayList<>(); + String line; + try { + while ((line = reader.readLine()) != null) { + lineList.add(line); + } + } finally { + closeReader(reader); + closeReader(insReader); + } + + return lineList.toArray(new String[0]); + } + + + /** + * + * @param ins + * @return + * @throws IOException + */ + public static String readString(InputStream ins) throws IOException { + return IOUtils.toString(ins, "UTF-8"); + } + + + /** + * + * @param filePath + * @return + * @throws IOException + */ + public static String readString(String filePath) throws IOException { + InputStream ins = null; + try { + ins = Files.newInputStream(Paths.get(filePath)); + return readString(ins); + } finally { + closeInputStream(ins); + } + } + + + /** + * + * @param ins + * @param path + * @param fileName + * @return + * @throws IOException + */ + public static String saveFile(InputStream ins, String path, String fileName) throws IOException { + File tmpPath = new File(path); + if (!tmpPath.exists()) { + tmpPath.mkdirs(); + } + + File file = new File(path + File.separator + fileName); + OutputStream os = null; + try { + int read = 0; + byte[] bytes = new byte[1024]; + os = new FileOutputStream(file, false); + while ((read = ins.read(bytes)) != -1) { + os.write(bytes, 0, read); + } + os.flush(); + return file.getAbsolutePath(); + } finally { + closeOutputStream(os); + } + } + + + /** + * + * @param path + * @param fileName + * @param content + * @throws IOException + */ + public static void writetoAbsoluteFile(String path, String fileName, String content) + throws IOException { + writetoAbsoluteFile(path, fileName, content, FileCommonConstants.DEFAULT_CHARSET_NAME); + } + + + /** + * + * @param path + * @param fileName + * @param content + * @param charsetName + * @throws IOException + */ + public static void writetoAbsoluteFile(String path, String fileName, String content, + String charsetName) throws IOException { + write(path, fileName, content, charsetName); + } + + + /** + * + * @param fileName + * @param s + * @throws IOException + */ + public static void write(String fileName, String s) throws IOException { + write(".", fileName, s, FileCommonConstants.DEFAULT_CHARSET_NAME); + + } + + + /** + * + * @param path + * @param fileName + * @param s + * @param charsetName + * @throws IOException + */ + public static void write(String path, String fileName, String s, String charsetName) + throws IOException { + File tmpPath = new File(path); + if (!tmpPath.exists()) { + tmpPath.mkdirs(); + } + + String absolutePath = path + File.separator + fileName; + FileOutputStream out = null; + try { + out = new FileOutputStream(absolutePath); + out.write(s.getBytes(charsetName)); + out.close(); + } finally { + closeOutputStream(out); + } + } + + + /** + * + * @param fileName + * @param s + * @param charsetName + * @throws IOException + */ + public static void write(String fileName, String s, String charsetName) throws IOException { + write(".", fileName, s, charsetName); + } + + + /** + * + * @param fileName + * @param ss + * @throws IOException + */ + public static void write(String fileName, String[] ss) throws IOException { + write(fileName, ss, FileCommonConstants.DEFAULT_CHARSET_NAME); + } + + + /** + * + * @param fileName + * @param ss + * @param charsetName + * @throws IOException + */ + public static void write(String fileName, String[] ss, String charsetName) throws IOException { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < ss.length; i++) { + sb.append(ss[i]).append(System.lineSeparator()); + } + + write(fileName, sb.toString(), charsetName); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java new file mode 100644 index 00000000..ee8a35e0 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.utils; + +import com.google.gson.Gson; + +/** + * + */ +public class JsonUtils { + /** + * + * @param json + * @param clazz + * @return + */ + public static T fromJson(String json, Class clazz) { + Gson gson = new Gson(); + return gson.fromJson(json, clazz); + } + + /** + * + * @param t + * @return + */ + public static String toJson(T t) { + Gson gson = new Gson(); + return gson.toJson(t); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java new file mode 100644 index 00000000..b8ba428c --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.utils; + +import javax.ws.rs.InternalServerErrorException; +import javax.ws.rs.core.Response; + +import org.onap.sdc.workflowdesigner.utils.entity.CommonErrorResponse; + +/** + * + */ +public class RestUtils { + public static InternalServerErrorException newInternalServerErrorException(Exception e) { + return new InternalServerErrorException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) + .entity(new CommonErrorResponse(e.getMessage())).build(), e); + } +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java new file mode 100644 index 00000000..ea13cf8a --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.utils; + +/** + * + */ +public class ToolUtils { + /** + * @param val + * @return + */ + public static boolean isEmpty(String val) { + return val == null || val.trim().isEmpty(); + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java new file mode 100644 index 00000000..5983a5a5 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ + +package org.onap.sdc.workflowdesigner.utils.entity; + +public class CommonErrorResponse { + private String code; + private String message; + + public static Object failure(String message) { + return message; + } + + public CommonErrorResponse(String message) { + super(); + this.message = message; + } + + /** + * @return the code + */ + public String getCode() { + return code; + } + + /** + * @param code the code to set + */ + public void setCode(String code) { + this.code = code; + } + + /** + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * @param message the message to set + */ + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java new file mode 100644 index 00000000..4b369ff3 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2017 ZTE Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the Apache License, Version 2.0 + * and the Eclipse Public License v1.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * ZTE - initial API and implementation and/or initial documentation + */ +package org.onap.sdc.workflowdesigner.writer; + +import java.io.StringWriter; + +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.exception.ParseErrorException; +import org.apache.velocity.exception.ResourceNotFoundException; +import org.onap.sdc.workflowdesigner.config.Config; +import org.onap.sdc.workflowdesigner.model.Process; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class BpmnPlanArtefactWriter { + + private Process process; + + private final static String TEMPLATE_PATH = Config.PROPERTIES.getProperty(Config.TEMPLATE_PATH); + + private static Logger log = LoggerFactory.getLogger(BpmnPlanArtefactWriter.class); + + public BpmnPlanArtefactWriter(Process process) throws Exception { + this.process = process; + Velocity.init(); + } + + public String completePlanTemplate() throws ResourceNotFoundException, ParseErrorException, Exception { + log.debug("Completing BPMN process template..."); + + VelocityContext context = new VelocityContext(); + + VelocityEngine ve = new VelocityEngine(); + ve.setProperty("resource.loader", "class"); + ve.setProperty("class.resource.loader.class", + "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); + Template planTemplate = ve.getTemplate(TEMPLATE_PATH + "bpmn_template.xml"); + + context.put("process", process); + context.put("templatePath", TEMPLATE_PATH); + StringWriter planWriter = new StringWriter(); + planTemplate.merge(context, planWriter); + + String bpmnProcessContent = planWriter.toString(); + + log.debug("Completed BPMN process template" + bpmnProcessContent); + + return bpmnProcessContent; + + } + +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/META-INF/MANIFEST.MF b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/META-INF/MANIFEST.MF new file mode 100644 index 00000000..eaf90a94 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Created-By: 1.7.0_72 (Oracle Corporation) + diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/WEB-INF/web.xml b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/WEB-INF/web.xml new file mode 100644 index 00000000..2a5346c4 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/WEB-INF/web.xml @@ -0,0 +1,41 @@ + + + + + + ZENAP API-DOC. + + ZENAP API-DOC + + + + + index.html + index.xhtml + index.htm + index.jsp + + + + diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/reset.css b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/reset.css new file mode 100644 index 00000000..2e116124 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/reset.css @@ -0,0 +1,140 @@ +/** + * Copyright 2016 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/screen.css b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/screen.css new file mode 100644 index 00000000..2b982c22 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/screen.css @@ -0,0 +1,1271 @@ +/** + * Copyright 2016 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section #api_information_panel { + position: absolute; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section #api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section #api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -7px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 14px; +} +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo_small.png) no-repeat left center; + padding: 20px 0 20px 40px; + color: white; +} +.swagger-section #header form#api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #header form#api_selector .input { + display: block; + clear: none; + float: left; + margin: 0 10px 0 0; +} +.swagger-section #header form#api_selector .input input#input_apiKey { + width: 200px; +} +.swagger-section #header form#api_selector .input input#input_baseUrl { + width: 400px; +} +.swagger-section #header form#api_selector .input a#explore { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #header form#api_selector .input a#explore:hover { + background-color: #547f00; +} +.swagger-section #header form#api_selector .input input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/typography.css b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/typography.css new file mode 100644 index 00000000..991427a6 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/css/typography.css @@ -0,0 +1,41 @@ +/** + * Copyright 2016 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* droid-sans-regular - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans'), local('DroidSans'), + url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ +} +/* droid-sans-700 - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans Bold'), local('DroidSans-Bold'), + url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ +} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot new file mode 100644 index 00000000..2250b71a Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.eot differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 00000000..a54bbbbf --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 00000000..523cb92d Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.ttf differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 00000000..67e3e25f Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 00000000..1e726a7c Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-700.woff2 differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 00000000..ac2698e8 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.eot differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg new file mode 100644 index 00000000..d9f2a214 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf new file mode 100644 index 00000000..76aede27 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.ttf differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff new file mode 100644 index 00000000..abf19899 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 new file mode 100644 index 00000000..9f93f74c Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/fonts/droid-sans-v6-latin-regular.woff2 differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/explorer_icons.png b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/explorer_icons.png new file mode 100644 index 00000000..ed9d2fff Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/explorer_icons.png differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/logo_small.png b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/logo_small.png new file mode 100644 index 00000000..5496a655 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/logo_small.png differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/pet_store_api.png b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/pet_store_api.png new file mode 100644 index 00000000..f9f9cd4a Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/pet_store_api.png differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/throbber.gif b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/throbber.gif new file mode 100644 index 00000000..06393889 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/throbber.gif differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/wordnik_api.png b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/wordnik_api.png new file mode 100644 index 00000000..dca4f145 Binary files /dev/null and b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/images/wordnik_api.png differ diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/index.html b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/index.html new file mode 100644 index 00000000..c8e06410 --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/index.html @@ -0,0 +1,115 @@ + + + + + Swagger UI + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+
+ + diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/backbone-min.js b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/backbone-min.js new file mode 100644 index 00000000..c66d3a5a --- /dev/null +++ b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/resources/api-doc/lib/backbone-min.js @@ -0,0 +1,30 @@ +/* + * Copyright 2016 ZTE Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Backbone.js 1.1.2 + +(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('