From 025301d08b061482c1f046d562bf017c8cbcfe8d Mon Sep 17 00:00:00 2001 From: ChrisC Date: Tue, 31 Jan 2017 11:40:03 +0100 Subject: Initial OpenECOMP MSO commit Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d Signed-off-by: ChrisC --- ...rg.camunda.bpm.cockpit.plugin.spi.CockpitPlugin | 1 + .../camunda/bpm/plugin/urnmap/queries/urnMap.xml | 64 ++++++++++ bpmn/MSOURN-plugin/src/main/resources/mappings.xml | 32 +++++ .../plugin-webapp/urnMap-plugin/app/dashboard.html | 63 ++++++++++ .../plugin-webapp/urnMap-plugin/app/plugin.js | 132 +++++++++++++++++++++ .../resources/plugin-webapp/urnMap-plugin/info.txt | 1 + 6 files changed, 293 insertions(+) create mode 100644 bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin create mode 100644 bpmn/MSOURN-plugin/src/main/resources/com/att/camunda/bpm/plugin/urnmap/queries/urnMap.xml create mode 100644 bpmn/MSOURN-plugin/src/main/resources/mappings.xml create mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html create mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js create mode 100644 bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt (limited to 'bpmn/MSOURN-plugin/src/main/resources') diff --git a/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin b/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin new file mode 100644 index 0000000000..1e207d8022 --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/META-INF/services/org.camunda.bpm.cockpit.plugin.spi.CockpitPlugin @@ -0,0 +1 @@ +com.att.camunda.bpm.plugin.urnmap.URNMapPlugin \ No newline at end of file diff --git a/bpmn/MSOURN-plugin/src/main/resources/com/att/camunda/bpm/plugin/urnmap/queries/urnMap.xml b/bpmn/MSOURN-plugin/src/main/resources/com/att/camunda/bpm/plugin/urnmap/queries/urnMap.xml new file mode 100644 index 0000000000..ed610305ac --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/com/att/camunda/bpm/plugin/urnmap/queries/urnMap.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + insert into ATT_URN_MAPPING (NAME_, VALUE_, REV_) + values ( + #{URNName}, #{URNValue}, 1 + ) + + + + + + + + + + + update ATT_URN_MAPPING set + NAME_ = #{URNName}, + VALUE_ = #{URNValue}, + REV_ = 1 + where NAME_=#{URNName} + + diff --git a/bpmn/MSOURN-plugin/src/main/resources/mappings.xml b/bpmn/MSOURN-plugin/src/main/resources/mappings.xml new file mode 100644 index 0000000000..d0a9177b7e --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/mappings.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html new file mode 100644 index 0000000000..cc794e5518 --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/dashboard.html @@ -0,0 +1,63 @@ + + +
+
+
+

Process Engine - URN Mapping

+
+
+
+ + + + + + + +
+
+ + + + + + + +
+
+ + + + + + +
+
+
+
+
+
+
+
diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js new file mode 100644 index 0000000000..9f3398605f --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/app/plugin.js @@ -0,0 +1,132 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +define(['angular'], function(angular) { + + var DashboardController = ["$scope", "$http", "Uri", function($scope, $http, Uri) { + + $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) + .success(function(data) { + $scope.UrnDataMap = data; + }); + + //enable saveRow button + $scope.enableButton=function(urnData) + { + document.getElementById("btn_" + urnData.urnname + "_key").disabled = false; + }; + + $scope.enableAddRowBtn=function() + { + if(document.getElementById("new_key").value.trim().length >0) + document.getElementById("addRow_BTN").disabled = false; + else + document.getElementById("addRow_BTN").disabled = true; + }; + + + $scope.addNewRow = function() + { + var newKey = document.getElementById("new_key").value.trim(); + var newValue = document.getElementById("new_value").value.trim(); + var x; + + for (var i=0;i<$scope.UrnDataMap.length;i++) + { + var n = $scope.UrnDataMap[i].urnname.localeCompare(newKey); + if(n == 0){ + x = "match"; + } + } + + if(Boolean(x)) + { + alert("URN Name already exists, please check the KEY!"); + } + else + { + if(newKey.length >0 ) + { + + var temp = newKey + "|" + newValue; + + $http.put(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance"), temp); + + document.getElementById("new_key").value = ""; + document.getElementById("new_value").value = ""; + + } + + } + //this.enableAddRowBtn; + document.getElementById("addRow_BTN").disabled = true; + + $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) + .success(function(data) { + $scope.UrnDataMap = data; + }); + + + } + + $scope.retrieveData = function() { + + $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) + .success(function(data) { + $scope.UrnDataMap = data; + }); + } + + $scope.SaveRow = function(user) + { + $http.post(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance"), user); + + document.getElementById("btn_" + user.urnname + "_key").disabled = true; + document.getElementById(user.urnname + "_status").style.display = ""; + this.enableAddRowBtn; + + $http.get(Uri.appUri("plugin://urnMap-plugin/:engine/process-instance")) + .success(function(data) { + $scope.UrnDataMap = data; + }); + + }; + }]; + + var Configuration = ['ViewsProvider', function(ViewsProvider) { + + ViewsProvider.registerDefaultView('cockpit.dashboard', { + id: 'process-definitions', + label: 'Deployed Processes', + url: 'plugin://urnMap-plugin/static/app/dashboard.html', + controller: DashboardController, + // make sure we have a higher priority than the default plugin + priority: 12 + }); + }]; +//START +//END + + var ngModule = angular.module('cockpit.plugin.urnMap-plugin', []); + + ngModule.config(Configuration); + + return ngModule; +}); diff --git a/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt new file mode 100644 index 0000000000..09b62620e6 --- /dev/null +++ b/bpmn/MSOURN-plugin/src/main/resources/plugin-webapp/urnMap-plugin/info.txt @@ -0,0 +1 @@ +# Client side assets of the urnMap-plugin \ No newline at end of file -- cgit 1.2.3-korg