Add VES Collector GUI 35/10235/1
authorAnaël Closson <ac2550@intl.att.com>
Mon, 4 Sep 2017 15:49:07 +0000 (17:49 +0200)
committerAnaël Closson <ac2550@intl.att.com>
Mon, 4 Sep 2017 15:49:07 +0000 (17:49 +0200)
Add support for VES Collector in the GUI

Change-Id: Id1420844ccd882e440cd19098251943eb02c4184
Issue-Id: CLAMP-19
Signed-off-by: Anaël Closson <ac2550@intl.att.com>
src/main/resources/META-INF/resources/designer/css/app.css
src/main/resources/META-INF/resources/designer/images/clds-ves-collector-icon.png [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/index.js
src/main/resources/META-INF/resources/designer/partials/portfolios/vesCollector_properties.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
src/main/resources/META-INF/resources/designer/scripts/app.js

index 95d5d58..44733b6 100644 (file)
@@ -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 (file)
index 0000000..c96bf50
Binary files /dev/null and b/src/main/resources/META-INF/resources/designer/images/clds-ves-collector-icon.png differ
index 15425dd..a0e9187 100644 (file)
@@ -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 (file)
index 0000000..eabe35c
--- /dev/null
@@ -0,0 +1,39 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+<style>
+</style>
+
+<div attribute-test="vescollectorproperties" id="configure-widgets"  >
+      <div attribute-test="cldsopentemplateh" class="modal-header">
+        <button type="button" class="close" ng-click="close(false)" aria-hidden="true" style="margin-top: -3px">&times;</button>
+        <h4>VES Collector</h4>
+      </div>
+
+      <div attribute-test="cldsopentemplateb" class="modal-body" style="height: 280px">
+        No parameter can be configured.
+      </div>
+
+      <div class="modal-footer">
+        <button ng-click="close(true)" id="close_button" class="btn btn-primary">Close</button>
+      </div>
+</div>
index c2b4f67..86fedc9 100644 (file)
 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, 
index 401489c..3b1ffe9 100644 (file)
@@ -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() {