From: Anaël Closson Date: Mon, 4 Sep 2017 15:49:07 +0000 (+0200) Subject: Add VES Collector GUI X-Git-Tag: v1.1.0~104 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=clamp.git;a=commitdiff_plain;h=14b66478a7b6622f9249fc8e538f4afb6a501c71 Add VES Collector GUI Add support for VES Collector in the GUI Change-Id: Id1420844ccd882e440cd19098251943eb02c4184 Issue-Id: CLAMP-19 Signed-off-by: Anaël Closson --- diff --git a/src/main/resources/META-INF/resources/designer/css/app.css b/src/main/resources/META-INF/resources/designer/css/app.css index 95d5d582..44733b6f 100644 --- a/src/main/resources/META-INF/resources/designer/css/app.css +++ b/src/main/resources/META-INF/resources/designer/css/app.css @@ -181,6 +181,7 @@ svg:not(:root) { } /* 'î ¡' */ .icon-initial-node:before{ content: url('../images/InitialProcess.png'); } /* 'î ¡' */ .icon-collector-node:before{ content: url('../images/clds-collector-icon.png'); } /* 'î ¡' */ +.icon-ves-collector-node:before{ content: url('../images/clds-ves-collector-icon.png'); } /* 'î ¡' */ .icon-stringmatch-node:before{ content: url('../images/clds-string-match-icon.png'); } /* 'î ¡' */ .icon-tca-node:before{ content: url('../images/clds-tca-icon.png'); } /* 'î ¡' */ .icon-policy-node:before{ content: url('../images/clds-policy-icon.png'); } /* 'î ¡' */ diff --git a/src/main/resources/META-INF/resources/designer/images/clds-ves-collector-icon.png b/src/main/resources/META-INF/resources/designer/images/clds-ves-collector-icon.png new file mode 100644 index 00000000..c96bf505 Binary files /dev/null and b/src/main/resources/META-INF/resources/designer/images/clds-ves-collector-icon.png differ diff --git a/src/main/resources/META-INF/resources/designer/index.js b/src/main/resources/META-INF/resources/designer/index.js index 15425dd0..a0e91873 100644 --- a/src/main/resources/META-INF/resources/designer/index.js +++ b/src/main/resources/META-INF/resources/designer/index.js @@ -1503,7 +1503,64 @@ function visibility_model() }, - 'bpmn:StringMatch': function(p, element) { + 'bpmn:VesCollector': function(p, element) { + var lane = renderer('bpmn:Lane')(p, element, { + fill: 'White' + }); + + var expandedPool = DiUtil.isExpanded(element); + + if (expandedPool) { + drawLine(p, [{ + x: element.width, + y: 80 + }, { + x: element.width, + y: 20 + }]); + + drawLine(p, [{ + x: 20, + y: 0 + }, { + x: 20, + y: element.height + }]); + + textUtil.createText(p, "V", { align: 'left-top', 'padding': {top:0, left:5, right:element.width - 20, bottom:0} }); + textUtil.createText(p, "E", { align: 'left-top', 'padding': {top:12, left:5, right:element.width - 20, bottom:0} }); + textUtil.createText(p, "S", { align: 'left-top', 'padding': {top:24, left:5, right:element.width - 20, bottom:0} }); + + var text2 = getSemantic(element).name; + if(text2 == undefined ) + { + text2 = 'VesCollector'; + } + + renderLabel(p, text2, { + box: element, + align: 'center-middle' + }); + + } else { + // Collapsed pool draw text inline + var text2 = getSemantic(element).name; + renderLabel(p, text2, { + box: element, + align: 'center-middle' + }); + } + + var participantMultiplicity = !!(getSemantic(element).participantMultiplicity); + + if (participantMultiplicity) { + renderer('ParticipantMultiplicityMarker')(p, element); + } + + return lane; + }, + + 'bpmn:StringMatch': function(p, element) { var lane = renderer('bpmn:Lane')(p, element, { fill: 'White' }); @@ -1511,8 +1568,6 @@ function visibility_model() var expandedPool = DiUtil.isExpanded(element); if (expandedPool) { - - drawLine(p, [{ x: 0, @@ -1530,7 +1585,7 @@ function visibility_model() box: element, align: 'center-middle' }); - + } else { // Collapsed pool draw text inline var text2 = getSemantic(element).name; @@ -1549,7 +1604,8 @@ function visibility_model() return lane; - }, + }, + 'bpmn:TCA': function(p, element) { var lane = renderer('bpmn:Lane')(p, element, { fill: 'White' @@ -3764,7 +3820,8 @@ function visibility_model() } } }); - } + } + if (bpmnElement.$instanceOf('bpmn:TCA')) { assign(actions, { 'Properties': { @@ -4897,7 +4954,14 @@ function visibility_model() width: 120, height: 80 }; + } + if (semantic.$instanceOf('bpmn:VesCollector')) { + return { + width: 120, + height: 80 + }; } + if (semantic.$instanceOf('bpmn:TCA')) { return { @@ -6413,7 +6477,11 @@ function visibility_model() ), 'create.String-Match': createAction( 'bpmn:StringMatch', 'event', 'icon-stringmatch-node', 'String Match' + ), + 'create.ves-collector': createAction( + 'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector' ), + 'create.TCA': createAction( 'bpmn:TCA', 'event', 'icon-tca-node', 'TCA' ), @@ -14253,7 +14321,15 @@ function visibility_model() "Activity", "InteractionNode" ] + }, + { + "name": "VesCollector", + "superClass": [ + "Activity", + "InteractionNode" + ] }, + { "name": "TCA", "superClass": [ diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/vesCollector_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/vesCollector_properties.html new file mode 100644 index 00000000..eabe35cd --- /dev/null +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/vesCollector_properties.html @@ -0,0 +1,39 @@ + + + +
+ + + + + +
diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js index c2b4f673..86fedc9a 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js +++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js @@ -24,17 +24,19 @@ app.service('cldsModelService', ['alertService','$http', '$q', function (alertService,$http, $q) { function checkIfElementType(name){ + //This will open the methods located in the app.js + mapping = { + 'stringmatch': StringMatchWindow, + 'tca': TCAWindow, + 'policy': PolicyWindow, + 'collector': CollectorsWindow, + 'vescollector': VesCollectorWindow, + }; - //This will open the methods located in the app.js - if (name.toLowerCase().indexOf("stringmatch")>=0) - StringMatchWindow(); - else if (name.toLowerCase().indexOf("tca")>=0) - TCAWindow(); - else if(name.toLowerCase().indexOf("policy")>=0) - PolicyWindow(); - else if(name.toLowerCase().indexOf("collector")>=0) - CollectorsWindow(); - + key = name.split('_')[0].toLowerCase() + if (key in mapping) { + mapping[key](); + } } this.toggleDeploy = function (uiAction, modelName, controlNamePrefixIn, diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index 401489ca..3b1ffe94 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -1412,6 +1412,55 @@ var app = angular.module('clds-app', ['ngRoute', } }; + $scope.VesCollectorWindow = function(vesCollector) { + + if (isTemplate) { + var dlg = dialogs + .create( + 'partials/portfolios/Template_model.html', + 'ImportSchemaCtrl', + vesCollector, + { + closable : true, + draggable : true + }, + { + size : 'lg', + keyboard : true, + backdrop : 'static', + windowClass : 'my-class' + }); + dlg.result.then(function(name) { + + }, function() { + + + }); + } else { // if (isTemplate) + + var dlg = dialogs + .create( + 'partials/portfolios/vesCollector_properties.html', + 'ImportSchemaCtrl', + { + closable : true, + draggable : true + }, + { + size : 'lg', + keyboard : true, + backdrop : 'static', + windowClass : 'my-class' + }); + + dlg.result.then(function(name) { + + }, function() { + + }); + + } + }; $scope.TCAWindow = function(tca) { if (isTemplate) { @@ -1634,6 +1683,10 @@ function CollectorsWindow(collectorsWin) { .CollectorsWindow(collectorsWin); } +function VesCollectorWindow(vesCollectorWin) { + angular.element(document.getElementById('navbar')).scope() + .VesCollectorWindow(vesCollectorWin); +} function F5Window() {