555b31c55c3840ed462e5d1a17266d0f03f49652
[clamp.git] / src / main / resources / META-INF / resources / designer / scripts / app.js
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP CLAMP
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights
6  *                             reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END============================================
20  * ===================================================================
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  */
23
24 'use strict';
25
26 /* App Module */
27
28 var app = angular.module('clds-app', ['ngRoute',
29     'ngResource',
30     'angularjs-dropdown-multiselect',
31     'angularjs-dropdown-multiselect-new',
32     'hljs',
33     'ui.bootstrap',
34     'angular-loading-bar',
35     'ngAnimate',
36     'dialogs.main',
37     'ui.grid',
38     'ui.grid.resizeColumns',
39     'ui.grid.paging',
40     'ui.grid.selection',
41     'ui.grid.cellNav',
42     'ui.grid.pinning',
43     'ngSanitize',
44     'ngCookies',
45     'ui.bootstrap.modal',
46     'ui.grid.exporter',
47     'angucomplete',
48     'kendo.directives',
49     'angular-md5'
50   ])
51   .config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
52
53     cfpLoadingBarProvider.includeBar = true;
54     cfpLoadingBarProvider.includeSpinner = true;
55   }])
56   .config(
57     function($httpProvider) {
58
59       $httpProvider.responseInterceptors
60         .push('myHttpInterceptor');
61
62       var spinnerFunction = function spinnerFunction(data,
63         headersGetter) {
64
65         return data;
66       };
67
68       $httpProvider.defaults.transformRequest
69         .push(spinnerFunction);
70     })
71   .config(
72     [
73       '$routeProvider',
74       '$locationProvider',
75       '$compileProvider',
76       'cfpLoadingBarProvider',
77       function($routeProvider, $locationProvider,
78         cfpLoadingBarProvider, $timeout, dialogs,
79         $cookies) {
80         console
81           .log("$routeProvider','$locationProvider', '$compileProvider','cfpLoadingBarProvider','md5'")
82         $locationProvider.html5Mode(false);
83         // alert("App.js");
84
85         $routeProvider
86           .when('/otherwise', {
87             templateUrl: 'please_wait.html',
88             controller: QueryParamsHandlerCtrl
89           })
90           .
91         // when('/dashboard_submit', { templateUrl:
92         // 'partials/portfolios/dashboard_submit.html',
93         // controller: CreateNewPrjCtrl }).
94         when(
95             '/dashboard', {
96               templateUrl: 'partials/portfolios/clds_modelling.html',
97               controller: DashboardCtrl
98             })
99           .
100         // when('/dashboard_upload', { templateUrl:
101         // 'partials/portfolios/dashboard_upload.html',
102         // controller: DashboardCtrl }).
103         when(
104           '/activity_modelling', {
105             templateUrl: 'partials/portfolios/clds_modelling.html',
106             controller: DashboardCtrl
107           }).when('/authenticate', {
108           templateUrl: 'authenticate.html',
109           controller: AuthenticateCtrl
110         }).when('/invalidlogin', {
111           templateUrl: 'invalid_login.html',
112           controller: PageUnderConstructionCtrl
113         }).otherwise({
114           redirectTo: '/otherwise'
115         });
116
117       }
118     ])
119   .controller(
120     'dialogCtrl',
121     function($scope, $rootScope, $timeout, dialogs) {
122
123       // -- Variables --//
124
125       $scope.lang = 'en-US';
126       $scope.language = 'English';
127
128       var _progress = 100;
129
130       $scope.name = '';
131       $scope.confirmed = 'No confirmation yet!';
132
133       $scope.custom = {
134         val: 'Initial Value'
135       };
136
137       // -- Listeners & Watchers --//
138
139       $scope.$watch('lang', function(val, old) {
140
141         switch (val) {
142           case 'en-US':
143             $scope.language = 'English';
144             break;
145           case 'es':
146             $scope.language = 'Spanish';
147             break;
148         }
149       });
150
151       // -- Methods --//
152       $rootScope.testCaseRequirements = [];
153       $rootScope.validTestRequirements = [];
154       /* $rootScope.testCaseValue=[]; */
155       $scope.setLanguage = function(lang) {
156
157         $scope.lang = lang;
158         $translate.use(lang);
159       };
160
161       $rootScope.launch = function(which) {
162
163         switch (which) {
164           case 'error':
165             dialogs.error();
166             break;
167           case 'wait':
168             // var dlg =
169             // dialogs.wait(undefined,undefined,_progress);
170             // _fakeWaitProgress();
171             break;
172           case 'customwait':
173             // var dlg = dialogs.wait('Custom Wait
174             // Header','Custom Wait Message',_progress);
175             // _fakeWaitProgress();
176             break;
177           case 'notify':
178             dialogs.notify();
179             break;
180           case 'confirm':
181             var dlg = dialogs.confirm();
182             dlg.result.then(function(btn) {
183
184               $scope.confirmed = 'You confirmed "Yes."';
185             }, function(btn) {
186
187               $scope.confirmed = 'You confirmed "No."';
188             });
189             break;
190           case 'custom':
191             var dlg = dialogs.create('/dialogs/custom.html',
192               'customDialogCtrl', {}, {
193                 size: 'lg',
194                 keyboard: true,
195                 backdrop: 'static',
196                 windowClass: 'my-class'
197               });
198             dlg.result
199               .then(
200                 function(name) {
201
202                   $scope.name = name;
203                 },
204                 function() {
205
206                   if (angular.equals($scope.name,
207                       ''))
208                     $scope.name = 'You did not enter in your name!';
209                 });
210             break;
211           case 'custom2':
212             var dlg = dialogs.create('/dialogs/custom2.html',
213               'customDialogCtrl2', $scope.custom, {
214                 size: 'lg'
215               });
216             break;
217           case 'custom3':
218             var dlg = dialogs
219               .notify(
220                 'Message',
221                 'All is not supported, Please select interface(s)/version(s) to fetch real time federated coverage report.');
222             break;
223           case 'custom4':
224             var dlg = dialogs
225               .confirm(
226                 'Message',
227                 'You are about to fetch real time federated coverage report.This may take sometime!!!.');
228             dlg.result.then(function(btn) {
229
230               $scope.confirmed = 'You confirmed "Yes."';
231             }, function(btn) {
232
233               $scope.confirmed = 'You confirmed "No."';
234             });
235             break;
236           case 'custom5':
237             var dlg = dialogs.notify('Success',
238               'Request has been successfully processed.');
239             break;
240           case 'custom6':
241             var dlg = dialogs.notify('Message',
242               'Please type Testscenario Name');
243             break;
244         }
245       }; // end launch
246
247       var _fakeWaitProgress = function() {
248
249         $timeout(function() {
250
251           if (_progress < 100) {
252             _progress += 33;
253             $rootScope.$broadcast('dialogs.wait.progress', {
254               'progress': _progress
255             });
256             _fakeWaitProgress();
257           } else {
258             $rootScope.$broadcast('dialogs.wait.complete');
259             _progress = 0;
260           }
261         }, 1000);
262       };
263     })
264   .controller(
265     'MenuCtrl', [
266       '$scope',
267       '$rootScope',
268       '$timeout',
269       'dialogs',
270       '$location',
271       'MenuService',
272       'Datafactory',
273       'userPreferencesService',
274       'cldsModelService',
275       'cldsTemplateService',
276       'extraUserInfoService',
277       function($scope, $rootScope, $timeout, dialogs,
278         $location, MenuService, Datafactory,
279         userPreferencesService, cldsModelService,
280         cldsTemplateService, extraUserInfoService) {
281         console.log("MenuCtrl");
282         $rootScope.screenName = "Universal Test Modeler";
283         $rootScope.testSet = null;
284         $rootScope.isNew = false;
285         var testingType = "";
286         $rootScope.contactUs = function() {
287           console.log("contactUs");
288           var link = "mailto:onap-discuss@lists.onap.org?subject=CLAMP&body=Please send us suggestions or feature enhancements or defect. If possible, please send us the steps to replicate any defect.";
289           window.location.href = link;
290         };
291
292         extraUserInfoService
293           .getUserInfo()
294           .then(
295             function(pars) {
296               $scope.userInfo = pars;
297               if (!($scope.userInfo["permissionUpdateTemplate"])) {
298                 readTOnly = true;
299               };
300               if (!($scope.userInfo["permissionUpdateCl"])) {
301                 readMOnly = true;
302               };
303             });
304
305         $scope.emptyMenuClick = function(value, name) {
306           if ($rootScope.isNew &&
307             (name != "Save Template" &&
308               name != "Close Template" && name != "Template Properties")) {
309             saveConfirmationNotificationPopUp();
310           } else if ($rootScope.isNewClosed &&
311             name != "Save CL" &&
312             name != "Close Model" &&
313             name != "Properties CL") {
314             saveConfirmationNotificationPopUp();
315           } else {
316             isSaveCheck(name);
317           }
318
319           function saveConfirmationNotificationPopUp() {
320             $scope
321               .saveConfirmationNotificationPopUp(function(
322                 data) {
323                 if (data) {
324                   if ($rootScope.isNewClosed) {
325                     isSaveCheck("Save CL");
326                   } else {
327                     isSaveCheck("Save Template");
328                   }
329                   $rootScope.isNewClosed = false;
330                   $rootScope.isNew = false;
331                 } else {
332                   return false;
333                 }
334               });
335           }
336
337           function isSaveCheck(name) {
338             if (name == "User Info") {
339               $scope.extraUserInfo();
340             } else if (name == "Wiki") {
341               window.open(value);
342             } else if (name == "Contact Us") {
343               $rootScope.contactUs();
344             } else if (name == "Log Out") {
345               $scope.logout();
346             } else if (name == "Revert Template Changes") {
347               $scope.cldsRevertTemplate();
348             } else if (name == "Revert Model Changes") {
349               $scope.cldsRevertModel();
350             } else if (name == "Create Template") {
351               $rootScope.isNew = true;
352               $scope.cldsCreateTemplate();
353             } else if (name == "Open Template") {
354               $scope.cldsOpenTemplate();
355             } else if (name == "Save Template") {
356               $scope
357                 .cldsTemplatePerformAction("SAVE");
358               $rootScope.isNewClosed = false;
359               $rootScope.isNew = false;
360             } else if (name == "Template Properties") {
361               $scope.cldsOpenTemplateProperties();
362             } else if (name == "Close Model" ||
363               name == "Close Template") {
364               $scope.cldsClose();
365             } else if (name == "Refresh ASDC") {
366               $scope.cldsRefreshASDC();
367             } else if (name == "Create CL") {
368               $rootScope.isNewClosed = true;
369               $scope.cldsCreateModel();
370             } else if (name == "Open CL") {
371               $scope.cldsOpenModel();
372             } else if (name == "Save CL") {
373               $rootScope.isNewClosed = false;
374               $rootScope.isNew = false;
375               $scope.cldsPerformAction("SAVE");
376             } else if (name == "Validation Test") {
377               $scope.cldsPerformAction("TEST");
378             } else if (name == "Submit") {
379               $scope
380                 .cldsConfirmPerformAction("SUBMIT");
381             } else if (name == "Resubmit") {
382               $scope
383                 .cldsConfirmPerformAction("RESUBMIT");
384             } else if (name == "Update") {
385               $scope
386                 .cldsConfirmPerformAction("UPDATE");
387             } else if (name.toLowerCase() == "delete") {
388               $scope
389                 .manageConfirmPerformAction("DELETE");
390             } else if (name == "Stop") {
391               $scope.cldsConfirmPerformAction("STOP");
392             } else if (name == "Restart") {
393               $scope
394                 .cldsConfirmPerformAction("RESTART");
395             } else if (name == "Refresh Status") {
396               $scope.cldsPerformAction("REFRESH");
397             } else if (name == "Properties CL") {
398               $scope.cldsOpenModelProperties();
399             } else if (name == "Deploy") {
400               $scope
401                 .cldsConfirmToggleDeployPerformAction("Deploy");
402             } else if (name == "UnDeploy") {
403               $scope
404                 .cldsConfirmToggleDeployPerformAction("UnDeploy");
405             } else {
406               $rootScope.screenName = name;
407               $scope.updatebreadcrumb(value);
408               $location.path(value);
409             }
410           }
411         };
412
413         $rootScope.impAlerts = function() {
414
415         };
416
417         $scope.tabs = {
418           "Template": [{
419             link: "/cldsCreateTemplate",
420             name: "Create Template"
421           }, {
422             link: "/cldsOpenTemplate",
423             name: "Open Template"
424           }, {
425             link: "/cldsSaveTemplate",
426             name: "Save Template"
427           }, {
428             link: "/cldsOpenTemplateProperties",
429             name: "Template Properties"
430           }, {
431             link: "/RevertChanges",
432             name: "Revert Template Changes"
433           }, {
434             link: "/Close",
435             name: "Close Template"
436           }],
437
438           "Closed Loop": [{
439             link: "/cldsCreateModel",
440             name: "Create CL"
441           }, {
442             link: "/cldsOpenModel",
443             name: "Open CL"
444           }, {
445             link: "/cldsSaveModel",
446             name: "Save CL"
447           }, {
448             link: "/cldsOpenModelProperties",
449             name: "Properties CL"
450           }, {
451             link: "/RevertChanges",
452             name: "Revert Model Changes"
453           }, {
454             link: "/Close",
455             name: "Close Model"
456           }],
457           "Manage": [{
458             link: "/cldsTestActivate",
459             name: "Validation Test"
460           }, {
461             link: "/cldsSubmit",
462             name: "Submit"
463           }, {
464             link: "/cldsResubmit",
465             name: "Resubmit"
466           }, {
467             link: "/cldsUpdate",
468             name: "Update"
469           }, {
470             link: "/cldsStop",
471             name: "Stop"
472           }, {
473             link: "/cldsRestart",
474             name: "Restart"
475           }, {
476             link: "/cldsDelete",
477             name: "Delete"
478           }, {
479             link: "/cldsDeploy",
480             name: "Deploy"
481           }, {
482             link: "/cldsUnDeploy",
483             name: "UnDeploy"
484           }],
485           "View": [{
486             link: "/refreshStatus",
487             name: "Refresh Status"
488           }, {
489             link: "/refreshASDCProperties",
490             name: "Refresh ASDC"
491           }],
492           "Help": [{
493             link: "http://wiki.onap.org",
494             name: "Wiki"
495           }, {
496             link: "/contact_us",
497             name: "Contact Us"
498           }, {
499             link: "/extraUserInfo",
500             name: "User Info"
501           }],
502           "Log Out": [{
503             link: "/log_out.html",
504             name: "Log Out"
505           }]
506         };
507
508         if (!Object.keys) {
509           Object.keys = function(obj) {
510             var keys = [];
511
512             for (var i in obj) {
513               if (obj.hasOwnProperty(i)) {
514                 keys.push(i);
515               }
516             }
517
518             return keys;
519           };
520           $scope.keyList = Object.keys($scope.tabs);
521         } else {
522           $scope.keyList = Object.keys($scope.tabs);
523         }
524
525         $scope.updatebreadcrumb = function(path) {
526
527           var currentURL = $location.path();
528           if (path != undefined) {
529             currentURL = path;
530           }
531
532           if (currentURL == "/dashboard") {
533             $rootScope.screenName = "Universal Test Modeler";
534             $rootScope.parentMenu = "Home";
535             $rootScope.rightTabName = "UTM Build Configuration";
536           }
537           /*
538            * else if(currentURL=="/quicksearch") {
539            * $rootScope.screenName = "Quick Search";
540            * $rootScope.parentMenu = "Home"; }
541            */
542           else {
543             var found = false;
544
545             angular
546               .forEach(
547                 $scope.keyList,
548                 function(value, key) {
549
550                   if (!found) {
551                     $rootScope.parentMenu = value;
552
553                     angular
554                       .forEach(
555                         $scope.tabs[value],
556                         function(
557                           value,
558                           key) {
559
560                           if (currentURL == value.link) {
561                             $rootScope.screenName = value.name;
562                             found = true;
563                           }
564                         });
565                   }
566                 });
567           }
568         };
569
570         $scope.updatebreadcrumb();
571
572         $scope.createNewProject = function() {
573
574           if ($rootScope.projectName != null) {
575             var dlg = dialogs
576               .confirm('Message',
577                 'Do you want to over-write  the project ?');
578
579             dlg.result
580               .then(
581                 function(btn) {
582
583                   $scope.clearProject();
584                   var dlg1 = dialogs
585                     .create(
586                       'partials/portfolios/create_new_project.html',
587                       'CreateNewPrjCtrl', {}, {
588                         size: 'sm',
589                         keyboard: true,
590                         backdrop: false,
591                         windowClass: 'my-class'
592                       });
593                   dlg1.result.then(
594                     function(name) {
595
596                       // $scope.name
597                       // = name;
598                     },
599                     function() {
600
601                       // if(angular.equals($scope.name,''))
602                       // $scope.name
603                       // = 'You
604                       // did not
605                       // enter in
606                       // your
607                       // name!';
608                     });
609                 },
610                 function(btn) {
611
612                   // $modalInstance.close("closed");
613                 });
614
615           } else {
616             var dlg = dialogs
617               .create(
618                 'partials/portfolios/create_new_project.html',
619                 'CreateNewPrjCtrl', {}, {
620                   size: 'lg',
621                   keyboard: true,
622                   backdrop: false,
623                   windowClass: 'my-class'
624                 });
625             dlg.result.then(function(name) {
626
627               // $scope.name = name;
628             }, function() {
629
630               // if(angular.equals($scope.name,''))
631               // $scope.name = 'You did not enter in
632               // your name!';
633             });
634
635           }
636         };
637
638         $scope.clearProject = function() {
639
640           $rootScope.projectName = null;
641           $rootScope.revision = -1;
642           // $rootScope.models.length=0;
643           $rootScope.utmModels = $rootScope.$new(true);
644           $rootScope.serviceInfo = $rootScope.$new(true);
645           $rootScope.serviceInfo = null;
646           $rootScope.serviceInputPartInfo = $rootScope
647             .$new(true);
648           $rootScope.serviceOutputPartInfo = $rootScope
649             .$new(true);
650           $rootScope.servicefaultPartInfo = $rootScope
651             .$new(true);
652           $rootScope.isModel = false;
653           $("#paletteDiv").load(
654             './modeler/dist/index.html');
655           $rootScope.isPalette = false;
656           $rootScope.isTestset = false;
657           $rootScope.isRequirementCoverage = false;
658           $rootScope.ispropertyExplorer = false;
659           // $("#propertyDiv").load('./partials/portfolios/Property_Explorer.html');
660           $rootScope.modelName = "";
661           // document.getElementById('propertyExplorer').classList.remove('visible');
662           document.getElementById("modeler_name").textContent = "Activity Modeler";
663           // $( "#propertyExplorer" ).prev().css(
664           // "display", "block" );
665           $("#activity_modeler").prev().css("display",
666             "block");
667           $('div').find('.k-expand-next').click();
668
669           $rootScope.$apply();
670
671         };
672
673         $scope.homePage = function() {
674
675           $location.path('/dashboard');
676         };
677         $scope.propertyExplorerErrorMessage = function(msg) {
678
679           var dlg = dialogs.notify('Error', msg);
680         }
681
682         // $scope.fromTstMultipleFlag=false;
683         /* onclicking of review testset / generate testset */
684
685         $scope.reviewTestSet = function() {
686
687           $rootScope.modeltestset = list_model_test_sets[selected_model];
688
689           $rootScope.isPalette = false;
690           $rootScope.isTestset = true;
691           $rootScope.isRequirementCoverage = false;
692           document.getElementById("modeler_name").textContent = "UTM Test Set";
693           // document.getElementById('propertyExplorer').classList.add('visible');
694
695           // $( "#propertyExplorer" ).prev().css(
696           // "display", "none" );
697           $('div').find('.k-collapse-next').click();
698
699           // $rootScope.$apply();
700
701         };
702         $scope.requirementCoverage = function() {
703
704           $rootScope.testCaseRequirements = [];
705           $rootScope.validTestRequirementArray = [];
706           $rootScope.validTestRequirements = {};
707           $rootScope.modeltestset = list_model_test_sets[selected_model];
708           var allPathDetails = [];
709           $scope.currentSelectedModel = {};
710           // $scope.getPathDetails($rootScope.utmModels,selected_model);
711           // $scope.populatePathDetails(allPathDetails,$scope.currentSelectedModel);
712           $rootScope.pathDetailsList = list_model_path_details[selected_model];
713           /*
714            * for(var p=0;p<100;p++){
715            * $rootScope.testCaseRequirements.push("Requirement"+p); }
716            * for(var p=0;p<100;p++){
717            * $rootScope.testCaseValue.push("TestCase"+p); }
718            */
719           for (var x = 0; x < allPathDetails.length; x++) {
720             var tempPathDetails = allPathDetails[x];
721             if (tempPathDetails != null) {
722               for (var i = 0; i < tempPathDetails.length; i++) {
723                 var pathDetails = tempPathDetails[i];
724                 if (pathDetails.requirement !== '' &&
725                   pathDetails.requirement !== null) {
726                   $rootScope.testCaseRequirements
727                     .push(pathDetails.requirement);
728                 }
729
730                 /*
731                  * for (var j = 0; j <
732                  * pathDetails.decisionIdentifiers.length;
733                  * j++) {
734                  * if(pathDetails.decisionIdentifiers[j].requirement
735                  * !== '' &&
736                  * pathDetails.decisionIdentifiers[j].requirement
737                  * !== null){
738                  * $rootScope.testCaseRequirements.push(pathDetails.decisionIdentifiers[j].requirement); } }
739                  */
740               }
741             }
742
743           }
744           for (var p = 0; p < $rootScope.modeltestset.activityTestCases.length; p++) {
745             var activityTestCases = $rootScope.modeltestset.activityTestCases[p];
746             if (activityTestCases.mappedRequirements != null) {
747               for (var i = 0; i < activityTestCases.mappedRequirements.length; i++) {
748                 // $rootScope.testCaseRequirements
749                 // .push(activityTestCases.mappedRequirements[i]);
750                 var testCaseNames = $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]];
751                 if (testCaseNames == null) {
752                   testCaseNames = [];
753                 }
754                 if (activityTestCases.version != null)
755                   var testCase = activityTestCases.testCaseName +
756                     "_" +
757                     activityTestCases.version;
758                 else
759                   var testCase = activityTestCases.testCaseName;
760                 testCaseNames.push(testCase);
761                 $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]] = testCaseNames;
762               }
763             }
764           }
765
766           $rootScope.isPalette = false;
767           $rootScope.isTestset = false;
768           $rootScope.isRequirementCoverage = true;
769           document.getElementById("modeler_name").textContent = "Test Case / Requirement Coverage";
770           // document.getElementById('propertyExplorer').classList.add('visible');
771           // console.log("modeltestset"+JSON.stringify($rootScope.modeltestset));
772           // $( "#propertyExplorer" ).prev().css(
773           // "display", "none" );
774           $('div').find('.k-collapse-next').click();
775           // $rootScope.$apply();
776
777         };
778
779         $scope.activityModelling = function() {
780
781           // window.open("./bpmn-js-examples-master/modeler/dist/index.html",
782           // "_self");
783           // $location.path('/activity_modelling');
784         };
785         /*
786          * $scope.openProject = function(){
787          * $location.path('/dashboard_upload'); };
788          */
789         $rootScope.cldsOpenTemplateProperties = function() {
790
791           var dlg = dialogs
792             .create(
793               'partials/portfolios/global_template_properties.html',
794               'CldsOpenTemplateCtrl', {}, {
795                 size: 'lg',
796                 keyboard: true,
797                 backdrop: 'static',
798                 windowClass: 'my-class'
799               });
800
801           dlg.result.then(function(name) {
802
803             // $scope.modelName =modelName;
804             // $("#" +
805             // selected_model).addClass("selectedcolor");
806             // alert ("model name:"+$scope.modelName);
807           }, function() {
808
809             // if(angular.equals($scope.name,''))
810             // $scope.name = 'You did not enter in your
811             // name!';
812           });
813         }
814
815         $scope.cldsClose = function() {
816
817           var dlg = dialogs
818             .create(
819               'partials/portfolios/confirmation_window.html',
820               'CldsOpenTemplateCtrl', {
821                 closable: true,
822                 draggable: true
823               }, {
824                 size: 'lg',
825                 keyboard: true,
826                 backdrop: 'static',
827                 windowClass: 'my-class'
828               });
829
830           dlg.result.then(function(name) {
831
832             // $scope.name = name;
833           }, function() {
834
835             // if(angular.equals($scope.name,''))
836             // $scope.name = 'You did not enter in your
837             // name!';
838           });
839         };
840         $scope.cldsOpenTemplate = function() {
841
842           var dlg = dialogs
843             .create(
844               'partials/portfolios/clds_open_template.html',
845               'CldsOpenTemplateCtrl', {
846                 closable: true,
847                 draggable: true
848               }, {
849                 size: 'lg',
850                 keyboard: true,
851                 backdrop: 'static',
852                 windowClass: 'my-class'
853               });
854
855           dlg.result.then(function(name) {
856
857             // $scope.name = name;
858           }, function() {
859
860             // if(angular.equals($scope.name,''))
861             // $scope.name = 'You did not enter in your
862             // name!';
863           });
864         };
865         $scope.saveConfirmationNotificationPopUp = function(
866           callBack) {
867
868           var dlg = dialogs
869             .create(
870               'partials/portfolios/save_confirmation.html',
871               'saveConfirmationModalPopUpCtrl', {
872                 closable: true,
873                 draggable: true
874               }, {
875                 size: 'lg',
876                 keyboard: true,
877                 backdrop: 'static',
878                 windowClass: 'my-class'
879               });
880
881           dlg.result.then(function(name) {
882             callBack("OK");
883           }, function() {
884             callBack(null);
885           });
886
887         };
888         $scope.cldsCreateTemplate = function() {
889
890           var dlg = dialogs
891             .create(
892               'partials/portfolios/clds_create_template.html',
893               'CldsOpenTemplateCtrl', {
894                 closable: true,
895                 draggable: true
896               }, {
897                 size: 'lg',
898                 keyboard: true,
899                 backdrop: 'static',
900                 windowClass: 'my-class'
901               });
902
903           dlg.result.then(function(name) {
904
905             // $scope.name = name;
906           }, function() {
907
908             // if(angular.equals($scope.name,''))
909             // $scope.name = 'You did not enter in your
910             // name!';
911           });
912
913         };
914         $scope.cldsRefreshASDC = function() {
915
916           var dlg = dialogs
917             .create(
918               'partials/portfolios/refresh_asdc.html',
919               'CldsOpenModelCtrl', {
920                 closable: true,
921                 draggable: true
922               }, {
923                 size: 'lg',
924                 keyboard: true,
925                 backdrop: 'static',
926                 windowClass: 'my-class'
927               });
928           dlg.result.then(function(name) {
929
930             // $scope.name = name;
931           }, function() {
932
933             // if(angular.equals($scope.name,''))
934             // $scope.name = 'You did not enter in your
935             // name!';
936           });
937         }
938         $scope.cldsRevertModel = function() {
939
940           var dlg = dialogs
941             .create(
942               'partials/portfolios/ConfirmRevertChanges.html',
943               'CldsOpenModelCtrl', {
944                 closable: true,
945                 draggable: true
946               }, {
947                 size: 'lg',
948                 keyboard: true,
949                 backdrop: 'static',
950                 windowClass: 'my-class'
951               });
952
953           dlg.result.then(function(name) {
954
955             // $scope.name = name;
956           }, function() {
957
958             // if(angular.equals($scope.name,''))
959             // $scope.name = 'You did not enter in your
960             // name!';
961           });
962
963         };
964
965         $scope.cldsRevertTemplate = function() {
966
967           var dlg = dialogs
968             .create(
969               'partials/portfolios/ConfirmRevertChanges.html',
970               'CldsOpenTemplateCtrl', {
971                 closable: true,
972                 draggable: true
973               }, {
974                 size: 'lg',
975                 keyboard: true,
976                 backdrop: 'static',
977                 windowClass: 'my-class'
978               });
979
980           dlg.result.then(function(name) {
981
982             // $scope.name = name;
983           }, function() {
984
985             // if(angular.equals($scope.name,''))
986             // $scope.name = 'You did not enter in your
987             // name!';
988           });
989
990         };
991         $scope.cldsTemplatePerformAction = function(
992           uiAction) {
993
994           var modelName = selected_model;
995           var controlNamePrefix = "ClosedLoop-";
996           var bpmnText = modelXML;
997           // serialize model properties
998           var propText = JSON.stringify(elementMap);
999
1000           var svgXml = "";
1001           console.log(abootDiagram.saveSVG({
1002             format: true
1003           }, function(err, xml) {
1004
1005             if (err)
1006               console.log("error")
1007             else
1008               console.log(xml)
1009             svgXml = xml;
1010           }));
1011           console.log("cldsTemplatePerformAction: " +
1012             uiAction + " modelName=" + modelName);
1013           console.log("cldsTemplatePerformAction: " +
1014             uiAction + " controlNamePrefix=" +
1015             controlNamePrefix);
1016           console.log("cldsTemplatePerformAction: " +
1017             uiAction + " bpmnText=" + bpmnText);
1018           console.log("cldsTemplatePerformAction: " +
1019             uiAction + " propText=" + propText);
1020           cldsTemplateService
1021             .processAction(uiAction, modelName,
1022               controlNamePrefix, bpmnText,
1023               propText, svgXml)
1024             .then(
1025               function(pars) {
1026                 console
1027                   .log("processAction");
1028                 console
1029                   .log("cldsTemplatePerformAction: pars=" +
1030                     pars);
1031                 cldsTemplateService
1032                   .processActionResponse(
1033                     modelName,
1034                     pars);
1035               },
1036               function(data) {
1037
1038                 // alert("setModel failed: "
1039                 // + data);
1040               });
1041         };
1042
1043         $rootScope.cldsOpenModelProperties = function() {
1044
1045           var dlg = dialogs
1046             .create(
1047               'partials/portfolios/global_properties.html',
1048               'GlobalPropertiesCtrl', {}, {
1049                 size: 'lg',
1050                 keyboard: true,
1051                 backdrop: 'static',
1052                 windowClass: 'my-class'
1053               });
1054
1055           dlg.result.then(function(name) {}, function() {});
1056         };
1057
1058         $scope.cldsOpenModel = function() {
1059
1060           var dlg = dialogs
1061             .create(
1062               'partials/portfolios/clds_open_model.html',
1063               'CldsOpenModelCtrl', {
1064                 closable: true,
1065                 draggable: true
1066               }, {
1067                 size: 'lg',
1068                 keyboard: true,
1069                 backdrop: 'static',
1070                 windowClass: 'my-class'
1071               });
1072
1073           dlg.result.then(function(name) {
1074
1075             // $scope.name = name;
1076           }, function() {
1077
1078             // if(angular.equals($scope.name,''))
1079             // $scope.name = 'You did not enter in your
1080             // name!';
1081           });
1082         };
1083         $scope.cldsCreateModel = function() {
1084
1085           var dlg = dialogs
1086             .create(
1087               'partials/portfolios/clds_create_model_off_Template.html',
1088               'CldsOpenModelCtrl', {
1089                 closable: true,
1090                 draggable: true
1091               }, {
1092                 size: 'lg',
1093                 keyboard: true,
1094                 backdrop: 'static',
1095                 windowClass: 'my-class'
1096               });
1097
1098           dlg.result.then(function(name) {
1099
1100             // $scope.name = name;
1101           }, function() {
1102
1103             // if(angular.equals($scope.name,''))
1104             // $scope.name = 'You did not enter in your
1105             // name!';
1106           });
1107
1108         };
1109         $scope.extraUserInfo = function() {
1110
1111           var dlg = dialogs
1112             .create(
1113               'partials/portfolios/extra_user_info.html',
1114               'ExtraUserInfoCtrl', {
1115                 closable: true,
1116                 draggable: true
1117               }, {
1118                 size: 'lg',
1119                 keyboard: true,
1120                 backdrop: 'static',
1121                 windowClass: 'my-class'
1122               });
1123
1124           dlg.result.then(function(name) {}, function() {});
1125
1126         };
1127         $scope.cldsPerformAction = function(uiAction) {
1128
1129           var modelName = selected_model;
1130           var controlNamePrefix = "ClosedLoop-";
1131           var bpmnText = modelXML;
1132           // serialize model properties
1133           var propText = JSON.stringify(elementMap);
1134           var templateName = selected_template
1135
1136           var svgXml = "";
1137           console.log(abootDiagram.saveSVG({
1138             format: true
1139           }, function(err, xml) {
1140             if (err)
1141               console.log("error")
1142             else
1143               console.log(xml)
1144             svgXml = xml;
1145           }));
1146           console.log("cldsPerformAction: " + uiAction +
1147             " modelName=" + modelName);
1148           console.log("cldsPerformAction: " + uiAction +
1149             " controlNamePrefix=" +
1150             controlNamePrefix);
1151           console.log("cldsPerformAction: " + uiAction +
1152             " bpmnText=" + bpmnText);
1153           console.log("cldsPerformAction: " + uiAction +
1154             " propText=" + propText);
1155           console.log("cldsPerformAction: " + uiAction +
1156             " typeID=" + typeID);
1157           console.log("cldsPerformAction: " + uiAction +
1158             " deploymentId=" + deploymentId);
1159           cldsModelService
1160             .processAction(uiAction, modelName,
1161               controlNamePrefix, bpmnText,
1162               propText, svgXml, templateName,
1163               typeID, deploymentId)
1164             .then(
1165               function(pars) {
1166                 console
1167                   .log("cldsPerformAction: pars=" +
1168                     pars);
1169                 cldsModelService
1170                   .processRefresh(pars);
1171               },
1172               function(data) {
1173
1174                 // alert("setModel failed: "
1175                 // + data);
1176               });
1177         };
1178
1179         $scope.cldsConfirmPerformAction = function(uiAction) {
1180           var dlg = dialogs.confirm('Message',
1181             'Do you want to ' +
1182             uiAction.toLowerCase() +
1183             ' the closed loop?');
1184           dlg.result.then(function(btn) {
1185
1186             $scope.cldsPerformAction(uiAction);
1187           }, function(btn) {
1188
1189             // $modalInstance.close("closed");
1190           });
1191         };
1192
1193         $scope.cldsConfirmToggleDeployPerformAction = function(
1194           uiAction) {
1195
1196           var dlg = dialogs.confirm('Message',
1197             'Do you want to ' +
1198             uiAction.toLowerCase() +
1199             ' the closed loop?');
1200           dlg.result.then(function(btn) {
1201             cldsToggleDeploy(uiAction.toLowerCase());
1202           }, function(btn) {
1203
1204             // $modalInstance.close("closed");
1205           });
1206         };
1207
1208         function cldsToggleDeploy(uiAction) {
1209           var modelName = selected_model;
1210           var controlNamePrefix = "ClosedLoop-";
1211           var bpmnText = modelXML;
1212           // serialize model properties
1213           var propText = JSON.stringify(elementMap);
1214           var templateName = selected_template;
1215           var svgXml = "";
1216
1217           console.log(abootDiagram.saveSVG({
1218             format: true
1219           }, function(err, xml) {
1220             if (err)
1221               console.log("error")
1222             else
1223               console.log(xml)
1224             svgXml = xml;
1225           }));
1226           console.log("cldsPerformAction: " + uiAction +
1227             " modelName=" + modelName);
1228           console.log("cldsPerformAction: " + uiAction +
1229             " controlNamePrefix=" +
1230             controlNamePrefix);
1231           console.log("cldsPerformAction: " + uiAction +
1232             " bpmnText=" + bpmnText);
1233           console.log("cldsPerformAction: " + uiAction +
1234             " propText=" + propText);
1235           console.log("cldsPerformAction: " + uiAction +
1236             " modelEventService=" +
1237             modelEventService);
1238           console.log("cldsPerformAction: " + uiAction +
1239             " typeID=" + typeID);
1240           console.log("cldsPerformAction: " + uiAction +
1241             " deploymentId=" + deploymentId);
1242           cldsModelService
1243             .toggleDeploy(uiAction, modelName,
1244               controlNamePrefix, bpmnText,
1245               propText, svgXml, templateName,
1246               typeID, controlNameUuid,
1247               modelEventService, deploymentId)
1248             .then(
1249               function(pars) {
1250                 typeID = pars.typeId;
1251                 controlNameUuid = pars.controlNameUuid;
1252                 selected_template = pars.templateName;
1253                 modelEventService = pars.event;
1254                 // actionCd =
1255                 // pars.event.actionCd;
1256                 actionStateCd = pars.event.actionStateCd;
1257                 deploymentId = pars.deploymentId;
1258                 cldsModelService
1259                   .processActionResponse(
1260                     modelName,
1261                     pars);
1262
1263               },
1264               function(data) {
1265
1266               });
1267         }
1268         $scope.managePerformAction = function(action) {
1269           if (action.toLowerCase() === "delete") {
1270             cldsModelService
1271               .manageAction(
1272                 selected_model,
1273                 "805b9f83-261f-48d9-98c7-8011fc2cc8e8",
1274                 "ClosedLoop-ABCD-0000.yml")
1275               .then(function(pars) {
1276
1277               }, function(data) {
1278
1279                 // alert("setModel failed: " +
1280                 // data);
1281               });
1282           }
1283         };
1284         $scope.manageConfirmPerformAction = function(
1285           uiAction) {
1286
1287           var dlg = dialogs.confirm('Message',
1288             'Do you want to ' +
1289             uiAction.toLowerCase() +
1290             ' the closed loop?');
1291           dlg.result.then(function(btn) {
1292
1293             $scope.managePerformAction(uiAction);
1294           }, function(btn) {
1295
1296             // $modalInstance.close("closed");
1297           });
1298         };
1299         $scope.CollectorsWindow = function(collectorsWin) {
1300
1301           if (isTemplate) {
1302             var dlg = dialogs
1303               .create(
1304                 'partials/portfolios/Template_model.html',
1305                 'ImportSchemaCtrl',
1306                 collectorsWin, {
1307                   closable: true,
1308                   draggable: true
1309                 }, {
1310                   size: 'lg',
1311                   keyboard: true,
1312                   backdrop: 'static',
1313                   windowClass: 'my-class'
1314                 });
1315             dlg.result.then(function(name) {
1316
1317             }, function() {
1318
1319               // if(angular.equals($scope.name,''))
1320               // $scope.name = 'You did not enter in
1321               // your name!';
1322             });
1323           } else {
1324             var dlg = dialogs
1325               .create(
1326                 'partials/portfolios/Collector_properties.html',
1327                 'ImportSchemaCtrl', {
1328                   closable: true,
1329                   draggable: true
1330                 }, {
1331                   size: 'lg',
1332                   keyboard: true,
1333                   backdrop: 'static',
1334                   windowClass: 'my-class'
1335                 });
1336             dlg.result.then(function(name) {
1337
1338             }, function() {
1339
1340               // if(angular.equals($scope.name,''))
1341               // $scope.name = 'You did not enter in
1342               // your name!';
1343             });
1344
1345           }
1346
1347         };
1348         $scope.StringMatchWindow = function(stringMatch) {
1349
1350           if (isTemplate) {
1351             var dlg = dialogs
1352               .create(
1353                 'partials/portfolios/Template_model.html',
1354                 'ImportSchemaCtrl',
1355                 stringMatch, {
1356                   closable: true,
1357                   draggable: true
1358                 }, {
1359                   size: 'lg',
1360                   keyboard: true,
1361                   backdrop: 'static',
1362                   windowClass: 'my-class'
1363                 });
1364             dlg.result.then(function(name) {
1365
1366             }, function() {
1367
1368               // if(angular.equals($scope.name,''))
1369               // $scope.name = 'You did not enter in
1370               // your name!';
1371             });
1372           } else {
1373
1374             var dlg = dialogs
1375               .create(
1376                 'partials/portfolios/stringMatch_properties.html',
1377                 'ImportSchemaCtrl', {
1378                   closable: true,
1379                   draggable: true
1380                 }, {
1381                   size: 'lg',
1382                   keyboard: true,
1383                   backdrop: 'static',
1384                   windowClass: 'my-class'
1385                 });
1386
1387             dlg.result.then(function(name) {
1388
1389               // $scope.name = name;
1390             }, function() {
1391
1392               // if(angular.equals($scope.name,''))
1393               // $scope.name = 'You did not enter in
1394               // your name!';
1395             });
1396
1397           }
1398         };
1399         $scope.VesCollectorWindow = function(vesCollector) {
1400
1401           if (isTemplate) {
1402             var dlg = dialogs
1403               .create(
1404                 'partials/portfolios/Template_model.html',
1405                 'ImportSchemaCtrl',
1406                 vesCollector, {
1407                   closable: true,
1408                   draggable: true
1409                 }, {
1410                   size: 'lg',
1411                   keyboard: true,
1412                   backdrop: 'static',
1413                   windowClass: 'my-class'
1414                 });
1415             dlg.result.then(function(name) {
1416
1417             }, function() {
1418
1419
1420             });
1421           } else { // if (isTemplate)
1422
1423             var dlg = dialogs
1424               .create(
1425                 'partials/portfolios/vesCollector_properties.html',
1426                 'ImportSchemaCtrl', {
1427                   closable: true,
1428                   draggable: true
1429                 }, {
1430                   size: 'lg',
1431                   keyboard: true,
1432                   backdrop: 'static',
1433                   windowClass: 'my-class'
1434                 });
1435
1436             dlg.result.then(function(name) {
1437
1438             }, function() {
1439
1440             });
1441
1442           }
1443         };
1444
1445         $scope.HolmesWindow = function(holmes) {
1446
1447           if (isTemplate) {
1448             var partial = 'partials/portfolios/Template_model.html'
1449           } else {
1450             var partial = 'partials/portfolios/holmes_properties.html'
1451           }
1452
1453           var dlg = dialogs
1454             .create(
1455               partial,
1456               'ImportSchemaCtrl',
1457               holmes, {
1458                 closable: true,
1459                 draggable: true
1460               }, {
1461                 size: 'lg',
1462                 keyboard: true,
1463                 backdrop: 'static',
1464                 windowClass: 'my-class'
1465               });
1466         };
1467
1468         $scope.TCAWindow = function(tca) {
1469           if (isTemplate) {
1470             var dlg = dialogs
1471               .create(
1472                 'partials/portfolios/Template_model.html',
1473                 'ImportSchemaCtrl',
1474                 tca, {
1475                   closable: true,
1476                   draggable: true
1477                 }, {
1478                   size: 'lg',
1479                   keyboard: true,
1480                   backdrop: 'static',
1481                   windowClass: 'my-class'
1482                 });
1483             dlg.result.then(function(name) {}, function() {
1484               // if(angular.equals($scope.name,''))
1485               // $scope.name = 'You did not enter in
1486               // your name!';
1487             });
1488           } else {
1489             var dlg = dialogs
1490               .create(
1491                 'partials/portfolios/tca_properties.html',
1492                 'ImportSchemaCtrl', {
1493                   closable: true,
1494                   draggable: true
1495                 }, {
1496                   size: 'lg',
1497                   keyboard: true,
1498                   backdrop: 'static',
1499                   windowClass: 'my-class'
1500                 });
1501
1502             dlg.result.then(function(name) {
1503               // $scope.name = name;
1504             }, function() {
1505               // if(angular.equals($scope.name,''))
1506               // $scope.name = 'You did not enter in
1507               // your name!';
1508             });
1509           }
1510         };
1511
1512         $scope.PolicyWindow = function(policy) {
1513
1514           if (isTemplate) {
1515             var dlg = dialogs
1516               .create(
1517                 'partials/portfolios/Template_model.html',
1518                 'ImportSchemaCtrl',
1519                 policy, {
1520                   closable: true,
1521                   draggable: true
1522                 }, {
1523                   size: 'lg',
1524                   keyboard: true,
1525                   backdrop: 'static',
1526                   windowClass: 'my-class'
1527                 });
1528             dlg.result.then(function(name) {
1529
1530             }, function() {
1531
1532               // if(angular.equals($scope.name,''))
1533               // $scope.name = 'You did not enter in
1534               // your name!';
1535             });
1536           } else {
1537             var dlg = dialogs
1538               .create(
1539                 'partials/portfolios/PolicyWindow_properties.html',
1540                 'ImportSchemaCtrl', {
1541                   closable: true,
1542                   draggable: true
1543                 }, {
1544                   size: 'lg',
1545                   keyboard: true,
1546                   backdrop: 'static',
1547                   windowClass: 'my-class'
1548                 });
1549
1550             dlg.result.then(function(name) {
1551
1552               // $scope.name = name;
1553             }, function() {
1554
1555               // if(angular.equals($scope.name,''))
1556               // $scope.name = 'You did not enter in
1557               // your name!';
1558             });
1559
1560           }
1561         };
1562
1563       }
1564     ]);
1565
1566 app.service('MenuService', ['$http', '$q', function($http, $q) {
1567
1568   /*
1569    * this.generateMDTTestSet = function(utmMDTRequest, generateTestSetMDTURL){
1570    *
1571    * console.log("generateMDTTestSet"); //alert("In generateMDTTestSet :: " +
1572    * JSON.stringify(utmMDTRequest)); var def = $q.defer(); var sets = [];
1573    *
1574    * $http.post(generateTestSetMDTURL, utmMDTRequest) .success(function(data){
1575    * console.log("success"); sets = data; def.resolve(data); })
1576    * .error(function(data){ console.log("error");
1577    * def.reject("GenerateMDTTestSet not successful"); });
1578    *
1579    * return def.promise; };
1580    */
1581 }]);
1582
1583 app.directive('focus', function($timeout) {
1584
1585   return {
1586     scope: {
1587       trigger: '@focus'
1588     },
1589     link: function(scope, element) {
1590       scope.$watch('trigger', function(value) {
1591
1592         if (value === "true") {
1593           $timeout(function() {
1594
1595             element[0].focus();
1596           });
1597         }
1598       });
1599     }
1600   };
1601 });
1602 app.directive('draggable', function($document) {
1603
1604   return function(scope, element, attr) {
1605
1606     var startX = 0,
1607       startY = 0,
1608       x = 0,
1609       y = 0;
1610     element.css({
1611       position: 'relative',
1612
1613       backgroundColor: 'white',
1614       cursor: 'move',
1615       display: 'block',
1616
1617     });
1618     element.on('mousedown', function(event) {
1619
1620       // Prevent default dragging of selected content
1621       // event.preventDefault();
1622       startX = event.screenX - x;
1623       startY = event.screenY - y;
1624       $document.on('mousemove', mousemove);
1625       $document.on('mouseup', mouseup);
1626     });
1627
1628     function mousemove(event) {
1629
1630       y = event.screenY - startY;
1631       x = event.screenX - startX;
1632       element.css({
1633         top: y + 'px',
1634         left: x + 'px'
1635       });
1636     }
1637
1638     function mouseup() {
1639
1640       $document.off('mousemove', mousemove);
1641       $document.off('mouseup', mouseup);
1642     }
1643   };
1644 });
1645
1646 app.factory('myHttpInterceptor', function($q, $window) {
1647
1648   return function(promise) {
1649
1650     return promise.then(function(response) {
1651
1652       return response;
1653     }, function(response) {
1654
1655       return $q.reject(response);
1656     });
1657   };
1658 });
1659
1660 app.run(['$route', function($route) {
1661
1662   $route.reload();
1663 }]);
1664
1665 function TestCtrl($scope) {
1666
1667   $scope.msg = "Hello from a controller method.";
1668   $scope.returnHello = function() {
1669
1670     return $scope.msg;
1671   }
1672 }
1673
1674 function importshema() {
1675
1676   angular.element(document.getElementById('navbar')).scope().importSchema();
1677
1678 }
1679
1680 function CollectorsWindow(collectorsWin) {
1681
1682   angular.element(document.getElementById('navbar')).scope()
1683     .CollectorsWindow(collectorsWin);
1684
1685 }
1686
1687 function VesCollectorWindow(vesCollectorWin) {
1688   angular.element(document.getElementById('navbar')).scope()
1689     .VesCollectorWindow(vesCollectorWin);
1690 }
1691
1692 function HolmesWindow(holmesWin) {
1693   angular.element(document.getElementById('navbar')).scope()
1694     .HolmesWindow(holmesWin);
1695 }
1696
1697 function F5Window() {
1698
1699   angular.element(document.getElementById('navbar')).scope().F5Window();
1700
1701 }
1702
1703 function StringMatchWindow(stringMatch) {
1704
1705   angular.element(document.getElementById('navbar')).scope()
1706     .StringMatchWindow(stringMatch);
1707
1708 }
1709
1710 function TCAWindow(tca) {
1711
1712   angular.element(document.getElementById('navbar')).scope().TCAWindow(tca);
1713
1714 }
1715
1716 function GOCWindow() {
1717
1718   angular.element(document.getElementById('navbar')).scope().GOCWindow();
1719
1720 }
1721
1722 function PolicyWindow(PolicyWin) {
1723
1724   angular.element(document.getElementById('navbar')).scope().PolicyWindow(
1725     PolicyWin);
1726
1727 }
1728
1729 function pathDetails(bpmnElementID, bpmnElementName, pathIdentifiers) {
1730
1731   angular.element(document.getElementById('navbar')).scope().pathDetails(
1732     bpmnElementID, bpmnElementName, pathIdentifiers);
1733
1734 }
1735
1736 function setdefaultvalue() {
1737
1738   angular.element(document.getElementById('navbar')).scope()
1739     .setDefaultValue();
1740
1741 }
1742
1743 function upgradeSchemaVersion() {
1744
1745   angular.element(document.getElementById('navbar')).scope()
1746     .upgradeSchemaVersion();
1747
1748 }
1749
1750 function saveProject() {
1751
1752   angular.element(document.getElementById('navbar')).scope().saveProject();
1753
1754 }
1755
1756 function modifySchema() {
1757
1758   angular.element(document.getElementById('navbar')).scope().modifySchema();
1759
1760 }
1761
1762 function definePID() {
1763
1764   angular.element(document.getElementById('navbar')).scope().definePID();
1765
1766 }
1767
1768 function defineServiceAcronym() {
1769
1770   angular.element(document.getElementById('navbar')).scope()
1771     .defineServiceAcronym();
1772
1773 }
1774
1775 function errorProperty(msg) {
1776
1777   angular.element(document.getElementById('navbar')).scope()
1778     .propertyExplorerErrorMessage(msg);
1779 }
1780
1781 function invisiblepropertyExplorer() {
1782
1783   angular.element(document.getElementById('navbar')).scope()
1784     .invisibleproperty();
1785 }
1786
1787 function updateDecisionLabel(originalLabel, newLabel) {
1788
1789   angular.element(document.getElementById('navbar')).scope()
1790     .updateDecisionLabels(originalLabel, newLabel);
1791 }
1792
1793 // Used to logout the session , when browser window was closed
1794 window.onunload = function() {
1795   window.localStorage.removeItem("isAuth");
1796   window.localStorage.removeItem("loginuser");
1797 };