Add holmes GUI without properties 63/10363/1
authorAnaël Closson <ac2550@intl.att.com>
Tue, 5 Sep 2017 11:33:34 +0000 (13:33 +0200)
committerAnaël Closson <ac2550@intl.att.com>
Tue, 5 Sep 2017 11:36:02 +0000 (13:36 +0200)
Change-Id: Ie961076abf2d57e3e917cab0012f6799bbe7762a
Issue-Id: CLAMP-27
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/css/diagram-js.css
src/main/resources/META-INF/resources/designer/images/clds-holmes-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/holmes_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 44733b6..333c966 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-holmes-node:before{ content: url('../images/clds-holmes-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'); } /* '' */
index 8796603..77fcd51 100644 (file)
@@ -231,7 +231,7 @@ svg.drop-not-ok {
   x: 400px;
   y: 10px;
   height: 50px;
-  width: 326px;
+  width: 400px;
 }
 
 .djs-palette:not(.open) {
diff --git a/src/main/resources/META-INF/resources/designer/images/clds-holmes-icon.png b/src/main/resources/META-INF/resources/designer/images/clds-holmes-icon.png
new file mode 100644 (file)
index 0000000..f928ddf
Binary files /dev/null and b/src/main/resources/META-INF/resources/designer/images/clds-holmes-icon.png differ
index a0e9187..75c175a 100644 (file)
@@ -1560,6 +1560,45 @@ function visibility_model()
                     return lane;
                 },
 
+                'bpmn:Holmes': function(p, element) {
+                    var lane = renderer('bpmn:Lane')(p, element, {
+                        fill: 'White'
+                    });
+
+                    var expandedPool = DiUtil.isExpanded(element);
+
+                    var instanceName = getSemantic(element).name;
+                    if (expandedPool) {
+
+                        if (instanceName == undefined) {
+                            instanceName = 'Holmes';
+                        }
+
+                        // add holmes 'icon'
+                        var attrs = computeStyle({}, {
+                            stroke: 'black',
+                            strokeWidth: 1,
+                            fill: 'white'
+                        });
+                        p.circle(15, 15, 10).attr(attrs)
+                        textUtil.createText(p, "H", { align: 'left-top', 'padding': { top:6, left:11 } });
+                    }
+
+                    renderLabel(p, instanceName, {
+                        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'
@@ -3821,7 +3860,22 @@ function visibility_model()
                     }
                 });
       }
-            
+                       if (bpmnElement.$instanceOf('bpmn:Holmes')) {
+                assign(actions, {
+                    'Properties': {
+                        group: 'clds',
+                        label: 'Edit Properties',
+                        className: 'clds-edit-properties',
+                        title: 'Properties',
+                        action: {
+                            click: function(event) {
+                               lastElementSelected=bpmnElement.id
+                               HolmesWindow(bpmnElement);
+                            }
+                        }
+                    }
+                });
+      }
                        if (bpmnElement.$instanceOf('bpmn:TCA')) {
                 assign(actions, {
                     'Properties': {
@@ -4961,8 +5015,12 @@ function visibility_model()
                     height: 80
                 };
             }
-            
-                       
+                       if (semantic.$instanceOf('bpmn:Holmes')) {
+                return {
+                    width: 120,
+                    height: 80
+                };
+            }
                        if (semantic.$instanceOf('bpmn:TCA')) {
                 return {
                     width: 120,
@@ -6480,7 +6538,11 @@ function visibility_model()
           ),
                                        'create.ves-collector': createAction(
                         'bpmn:VesCollector', 'event', 'icon-ves-collector-node', 'Ves Collector'
-                    ),
+          ),
+                                       'create.holmes': createAction(
+                        'bpmn:Holmes', 'event', 'icon-holmes-node', 'Holmes'
+          ),
+
                 
                     'create.TCA': createAction(
                        'bpmn:TCA', 'event', 'icon-tca-node', 'TCA'
@@ -14328,6 +14390,13 @@ function visibility_model()
                     "Activity",
                     "InteractionNode"
                 ]
+      },
+                       {
+                "name": "Holmes",
+                "superClass": [
+                    "Activity",
+                    "InteractionNode"
+                ]
             },
                       
             {
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/holmes_properties.html
new file mode 100644 (file)
index 0000000..f4c3d67
--- /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="holmesproperties" 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>Holmes</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 86fedc9..12d2d05 100644 (file)
@@ -31,6 +31,7 @@ app.service('cldsModelService', ['alertService','$http', '$q', function (alertSe
           'policy': PolicyWindow,
           'collector': CollectorsWindow,
           'vescollector': VesCollectorWindow,
+          'holmes': HolmesWindow,
       };
 
       key = name.split('_')[0].toLowerCase()
index 3b1ffe9..8c2d3c3 100644 (file)
@@ -1462,6 +1462,34 @@ var app = angular.module('clds-app', ['ngRoute',
                                                                }
                                                        };
 
+                                                       $scope.HolmesWindow = function(holmes) {
+
+                                                                 if (isTemplate) {
+                      var partial = 'partials/portfolios/Template_model.html'
+                  } else {
+                      var partial = 'partials/portfolios/holmes_properties.html'
+                  }
+                  
+                                                                       var dlg = dialogs
+                                                                                       .create(
+                                                                                                       partial,
+                                                                                                       'ImportSchemaCtrl',
+                                                                                                       holmes,
+                                                                                                       {
+                                                                                                                 closable : true,
+                                                                                                                 draggable : true
+                                                                                                       },
+                                                                                                       {
+                                                                                                                 size : 'lg',
+                                                                                                                 keyboard : true,
+                                                                                                                 backdrop : 'static',
+                                                                                                                 windowClass : 'my-class'
+                                                                                                       });
+                  
+                  dlg.result()
+                                                       };
+                
+                
                                                        $scope.TCAWindow = function(tca) {
                                                                if (isTemplate) {
                                                                        var dlg = dialogs
@@ -1688,6 +1716,11 @@ function VesCollectorWindow(vesCollectorWin) {
         .VesCollectorWindow(vesCollectorWin);
 }
 
+function HolmesWindow(holmesWin) {
+    angular.element(document.getElementById('navbar')).scope()
+        .HolmesWindow(holmesWin);
+}
+
 function F5Window() {
 
        angular.element(document.getElementById('navbar')).scope().F5Window();