2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
28 var app = angular.module('clds-app', ['ngRoute',
30 'angularjs-dropdown-multiselect',
31 'angularjs-dropdown-multiselect-new',
34 'angular-loading-bar',
38 'ui.grid.resizeColumns',
51 .config([ 'cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
53 cfpLoadingBarProvider.includeBar = true;
54 cfpLoadingBarProvider.includeSpinner = true;
57 function($httpProvider) {
59 $httpProvider.responseInterceptors
60 .push('myHttpInterceptor');
62 var spinnerFunction = function spinnerFunction(data,
68 $httpProvider.defaults.transformRequest
69 .push(spinnerFunction);
76 'cfpLoadingBarProvider',
77 function($routeProvider, $locationProvider,
78 cfpLoadingBarProvider, $timeout, dialogs,
81 .log("$routeProvider','$locationProvider', '$compileProvider','cfpLoadingBarProvider','md5'")
82 $locationProvider.html5Mode(false);
87 templateUrl : 'please_wait.html',
88 controller : QueryParamsHandlerCtrl
91 // when('/dashboard_submit', { templateUrl:
92 // 'partials/portfolios/dashboard_submit.html',
93 // controller: CreateNewPrjCtrl }).
97 templateUrl : 'partials/portfolios/clds_modelling.html',
98 controller : DashboardCtrl
101 // when('/dashboard_upload', { templateUrl:
102 // 'partials/portfolios/dashboard_upload.html',
103 // controller: DashboardCtrl }).
105 '/activity_modelling',
107 templateUrl : 'partials/portfolios/clds_modelling.html',
108 controller : DashboardCtrl
109 }).when('/authenticate', {
110 templateUrl : 'authenticate.html',
111 controller : AuthenticateCtrl
112 }).when('/invalidlogin', {
113 templateUrl : 'invalid_login.html',
114 controller : PageUnderConstructionCtrl
116 redirectTo : '/otherwise'
122 function($scope, $rootScope, $timeout, dialogs) {
126 $scope.lang = 'en-US';
127 $scope.language = 'English';
132 $scope.confirmed = 'No confirmation yet!';
135 val : 'Initial Value'
138 // -- Listeners & Watchers --//
140 $scope.$watch('lang', function(val, old) {
144 $scope.language = 'English';
147 $scope.language = 'Spanish';
153 $rootScope.testCaseRequirements = [];
154 $rootScope.validTestRequirements = [];
155 /* $rootScope.testCaseValue=[]; */
156 $scope.setLanguage = function(lang) {
159 $translate.use(lang);
162 $rootScope.launch = function(which) {
170 // dialogs.wait(undefined,undefined,_progress);
171 // _fakeWaitProgress();
174 // var dlg = dialogs.wait('Custom Wait
175 // Header','Custom Wait Message',_progress);
176 // _fakeWaitProgress();
182 var dlg = dialogs.confirm();
183 dlg.result.then(function(btn) {
185 $scope.confirmed = 'You confirmed "Yes."';
188 $scope.confirmed = 'You confirmed "No."';
192 var dlg = dialogs.create('/dialogs/custom.html',
193 'customDialogCtrl', {}, {
197 windowClass : 'my-class'
207 if (angular.equals($scope.name,
209 $scope.name = 'You did not enter in your name!';
213 var dlg = dialogs.create('/dialogs/custom2.html',
214 'customDialogCtrl2', $scope.custom, {
222 'All is not supported, Please select interface(s)/version(s) to fetch real time federated coverage report.');
228 'You are about to fetch real time federated coverage report.This may take sometime!!!.');
229 dlg.result.then(function(btn) {
231 $scope.confirmed = 'You confirmed "Yes."';
234 $scope.confirmed = 'You confirmed "No."';
238 var dlg = dialogs.notify('Success',
239 'Request has been successfully processed.');
242 var dlg = dialogs.notify('Message',
243 'Please type Testscenario Name');
248 var _fakeWaitProgress = function() {
250 $timeout(function() {
252 if (_progress < 100) {
254 $rootScope.$broadcast('dialogs.wait.progress',
256 'progress' : _progress
260 $rootScope.$broadcast('dialogs.wait.complete');
276 'userPreferencesService',
278 'cldsTemplateService',
279 'extraUserInfoService',
280 function($scope, $rootScope, $timeout, dialogs,
281 $location, MenuService, Datafactory,
282 userPreferencesService, cldsModelService,
283 cldsTemplateService, extraUserInfoService) {
284 console.log("MenuCtrl");
285 $rootScope.screenName = "Universal Test Modeler";
286 $rootScope.testSet = null;
287 $rootScope.isNew = false;
288 var testingType = "";
289 $rootScope.contactUs = function() {
290 console.log("contactUs");
291 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.";
292 window.location.href = link;
299 $scope.userInfo = pars;
300 if (!($scope.userInfo["permissionUpdateTemplate"])) {
304 if (!($scope.userInfo["permissionUpdateCl"])) {
310 $scope.emptyMenuClick = function(value, name) {
312 && (name != "Save Template"
313 && name != "Close Template" && name != "Template Properties")) {
314 saveConfirmationNotificationPopUp();
315 } else if ($rootScope.isNewClosed
317 && name != "Close Model"
318 && name != "Properties CL") {
319 saveConfirmationNotificationPopUp();
324 function saveConfirmationNotificationPopUp() {
326 .saveConfirmationNotificationPopUp(function(
329 if ($rootScope.isNewClosed) {
330 isSaveCheck("Save CL");
332 isSaveCheck("Save Template");
334 $rootScope.isNewClosed = false;
335 $rootScope.isNew = false;
342 function isSaveCheck(name) {
343 if (name == "User Info") {
344 $scope.extraUserInfo();
345 } else if (name == "Wiki") {
347 } else if (name == "Contact Us") {
348 $rootScope.contactUs();
349 } else if (name == "Log Out") {
351 } else if (name == "Revert Template Changes") {
352 $scope.cldsRevertTemplate();
353 } else if (name == "Revert Model Changes") {
354 $scope.cldsRevertModel();
355 } else if (name == "Create Template") {
356 $rootScope.isNew = true;
357 $scope.cldsCreateTemplate();
358 } else if (name == "Open Template") {
359 $scope.cldsOpenTemplate();
360 } else if (name == "Save Template") {
362 .cldsTemplatePerformAction("SAVE");
363 $rootScope.isNewClosed = false;
364 $rootScope.isNew = false;
365 } else if (name == "Template Properties") {
366 $scope.cldsOpenTemplateProperties();
367 } else if (name == "Close Model"
368 || name == "Close Template") {
370 } else if (name == "Refresh ASDC") {
371 $scope.cldsRefreshASDC();
372 } else if (name == "Create CL") {
373 $rootScope.isNewClosed = true;
374 $scope.cldsCreateModel();
375 } else if (name == "Open CL") {
376 $scope.cldsOpenModel();
377 } else if (name == "Save CL") {
378 $rootScope.isNewClosed = false;
379 $rootScope.isNew = false;
380 $scope.cldsPerformAction("SAVE");
381 } else if (name == "Validation Test") {
382 $scope.cldsPerformAction("TEST");
383 } else if (name == "Submit") {
385 .cldsConfirmPerformAction("SUBMIT");
386 } else if (name == "Resubmit") {
388 .cldsConfirmPerformAction("RESUBMIT");
389 } else if (name == "Update") {
391 .cldsConfirmPerformAction("UPDATE");
392 } else if (name.toLowerCase() == "delete") {
394 .manageConfirmPerformAction("DELETE");
395 } else if (name == "Stop") {
396 $scope.cldsConfirmPerformAction("STOP");
397 } else if (name == "Restart") {
399 .cldsConfirmPerformAction("RESTART");
400 } else if (name == "Refresh Status") {
401 $scope.cldsPerformAction("REFRESH");
402 } else if (name == "Properties CL") {
403 $scope.cldsOpenModelProperties();
404 } else if (name == "Deploy") {
406 .cldsConfirmToggleDeployPerformAction("Deploy");
407 } else if (name == "UnDeploy") {
409 .cldsConfirmToggleDeployPerformAction("UnDeploy");
411 $rootScope.screenName = name;
412 $scope.updatebreadcrumb(value);
413 $location.path(value);
418 $rootScope.impAlerts = function() {
424 link : "/cldsCreateTemplate",
425 name : "Create Template"
427 link : "/cldsOpenTemplate",
428 name : "Open Template"
430 link : "/cldsSaveTemplate",
431 name : "Save Template"
433 link : "/cldsOpenTemplateProperties",
434 name : "Template Properties"
436 link : "/RevertChanges",
437 name : "Revert Template Changes"
440 name : "Close Template"
444 link : "/cldsCreateModel",
447 link : "/cldsOpenModel",
450 link : "/cldsSaveModel",
453 link : "/cldsOpenModelProperties",
454 name : "Properties CL"
456 link : "/RevertChanges",
457 name : "Revert Model Changes"
463 link : "/cldsTestActivate",
464 name : "Validation Test"
466 link : "/cldsSubmit",
469 link : "/cldsResubmit",
472 link : "/cldsUpdate",
478 link : "/cldsRestart",
481 link : "/cldsDelete",
484 link : "/cldsDeploy",
487 link : "/cldsUnDeploy",
491 link : "/refreshStatus",
492 name : "Refresh Status"
494 link : "/refreshASDCProperties",
495 name : "Refresh ASDC"
498 link : "http://wiki.onap.org",
501 link : "/contact_us",
504 link : "/extraUserInfo",
508 link : "/log_out.html",
514 Object.keys = function(obj) {
517 for ( var i in obj) {
518 if (obj.hasOwnProperty(i)) {
525 $scope.keyList = Object.keys($scope.tabs);
527 $scope.keyList = Object.keys($scope.tabs);
530 $scope.updatebreadcrumb = function(path) {
532 var currentURL = $location.path();
533 if (path != undefined) {
537 if (currentURL == "/dashboard") {
538 $rootScope.screenName = "Universal Test Modeler";
539 $rootScope.parentMenu = "Home";
540 $rootScope.rightTabName = "UTM Build Configuration";
543 * else if(currentURL=="/quicksearch") {
544 * $rootScope.screenName = "Quick Search";
545 * $rootScope.parentMenu = "Home"; }
553 function(value, key) {
556 $rootScope.parentMenu = value;
565 if (currentURL == value.link) {
566 $rootScope.screenName = value.name;
575 $scope.updatebreadcrumb();
577 $scope.createNewProject = function() {
579 if ($rootScope.projectName != null) {
582 'Do you want to over-write the project ?');
588 $scope.clearProject();
591 'partials/portfolios/create_new_project.html',
598 windowClass : 'my-class'
607 // if(angular.equals($scope.name,''))
617 // $modalInstance.close("closed");
623 'partials/portfolios/create_new_project.html',
630 windowClass : 'my-class'
632 dlg.result.then(function(name) {
634 // $scope.name = name;
637 // if(angular.equals($scope.name,''))
638 // $scope.name = 'You did not enter in
645 $scope.clearProject = function() {
647 $rootScope.projectName = null;
648 $rootScope.revision = -1;
649 // $rootScope.models.length=0;
650 $rootScope.utmModels = $rootScope.$new(true);
651 $rootScope.serviceInfo = $rootScope.$new(true);
652 $rootScope.serviceInfo = null;
653 $rootScope.serviceInputPartInfo = $rootScope
655 $rootScope.serviceOutputPartInfo = $rootScope
657 $rootScope.servicefaultPartInfo = $rootScope
659 $rootScope.isModel = false;
660 $("#paletteDiv").load(
661 './modeler/dist/index.html');
662 $rootScope.isPalette = false;
663 $rootScope.isTestset = false;
664 $rootScope.isRequirementCoverage = false;
665 $rootScope.ispropertyExplorer = false;
666 // $("#propertyDiv").load('./partials/portfolios/Property_Explorer.html');
667 $rootScope.modelName = "";
668 // document.getElementById('propertyExplorer').classList.remove('visible');
669 document.getElementById("modeler_name").textContent = "Activity Modeler";
670 // $( "#propertyExplorer" ).prev().css(
671 // "display", "block" );
672 $("#activity_modeler").prev().css("display",
674 $('div').find('.k-expand-next').click();
680 $scope.homePage = function() {
682 $location.path('/dashboard');
684 $scope.propertyExplorerErrorMessage = function(msg) {
686 var dlg = dialogs.notify('Error', msg);
689 // $scope.fromTstMultipleFlag=false;
690 /* onclicking of review testset / generate testset */
692 $scope.reviewTestSet = function() {
694 $rootScope.modeltestset = list_model_test_sets[selected_model];
696 $rootScope.isPalette = false;
697 $rootScope.isTestset = true;
698 $rootScope.isRequirementCoverage = false;
699 document.getElementById("modeler_name").textContent = "UTM Test Set";
700 // document.getElementById('propertyExplorer').classList.add('visible');
702 // $( "#propertyExplorer" ).prev().css(
703 // "display", "none" );
704 $('div').find('.k-collapse-next').click();
706 // $rootScope.$apply();
709 $scope.requirementCoverage = function() {
711 $rootScope.testCaseRequirements = [];
712 $rootScope.validTestRequirementArray = [];
713 $rootScope.validTestRequirements = {};
714 $rootScope.modeltestset = list_model_test_sets[selected_model];
715 var allPathDetails = [];
716 $scope.currentSelectedModel = {};
717 // $scope.getPathDetails($rootScope.utmModels,selected_model);
718 // $scope.populatePathDetails(allPathDetails,$scope.currentSelectedModel);
719 $rootScope.pathDetailsList = list_model_path_details[selected_model];
721 * for(var p=0;p<100;p++){
722 * $rootScope.testCaseRequirements.push("Requirement"+p); }
723 * for(var p=0;p<100;p++){
724 * $rootScope.testCaseValue.push("TestCase"+p); }
726 for (var x = 0; x < allPathDetails.length; x++) {
727 var tempPathDetails = allPathDetails[x];
728 if (tempPathDetails != null) {
729 for (var i = 0; i < tempPathDetails.length; i++) {
730 var pathDetails = tempPathDetails[i];
731 if (pathDetails.requirement !== ''
732 && pathDetails.requirement !== null) {
733 $rootScope.testCaseRequirements
734 .push(pathDetails.requirement);
738 * for (var j = 0; j <
739 * pathDetails.decisionIdentifiers.length;
741 * if(pathDetails.decisionIdentifiers[j].requirement
743 * pathDetails.decisionIdentifiers[j].requirement
745 * $rootScope.testCaseRequirements.push(pathDetails.decisionIdentifiers[j].requirement); } }
751 for (var p = 0; p < $rootScope.modeltestset.activityTestCases.length; p++) {
752 var activityTestCases = $rootScope.modeltestset.activityTestCases[p];
753 if (activityTestCases.mappedRequirements != null) {
754 for (var i = 0; i < activityTestCases.mappedRequirements.length; i++) {
755 // $rootScope.testCaseRequirements
756 // .push(activityTestCases.mappedRequirements[i]);
757 var testCaseNames = $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]];
758 if (testCaseNames == null) {
761 if (activityTestCases.version != null)
762 var testCase = activityTestCases.testCaseName
764 + activityTestCases.version;
766 var testCase = activityTestCases.testCaseName;
767 testCaseNames.push(testCase);
768 $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]] = testCaseNames;
773 $rootScope.isPalette = false;
774 $rootScope.isTestset = false;
775 $rootScope.isRequirementCoverage = true;
776 document.getElementById("modeler_name").textContent = "Test Case / Requirement Coverage";
777 // document.getElementById('propertyExplorer').classList.add('visible');
778 // console.log("modeltestset"+JSON.stringify($rootScope.modeltestset));
779 // $( "#propertyExplorer" ).prev().css(
780 // "display", "none" );
781 $('div').find('.k-collapse-next').click();
782 // $rootScope.$apply();
786 $scope.activityModelling = function() {
788 // window.open("./bpmn-js-examples-master/modeler/dist/index.html",
790 // $location.path('/activity_modelling');
793 * $scope.openProject = function(){
794 * $location.path('/dashboard_upload'); };
796 $rootScope.cldsOpenTemplateProperties = function() {
800 'partials/portfolios/global_template_properties.html',
801 'CldsOpenTemplateCtrl', {}, {
805 windowClass : 'my-class'
808 dlg.result.then(function(name) {
810 // $scope.modelName =modelName;
812 // selected_model).addClass("selectedcolor");
813 // alert ("model name:"+$scope.modelName);
816 // if(angular.equals($scope.name,''))
817 // $scope.name = 'You did not enter in your
822 $scope.cldsClose = function() {
826 'partials/portfolios/confirmation_window.html',
827 'CldsOpenTemplateCtrl', {
834 windowClass : 'my-class'
837 dlg.result.then(function(name) {
839 // $scope.name = name;
842 // if(angular.equals($scope.name,''))
843 // $scope.name = 'You did not enter in your
847 $scope.cldsOpenTemplate = function() {
851 'partials/portfolios/clds_open_template.html',
852 'CldsOpenTemplateCtrl', {
859 windowClass : 'my-class'
862 dlg.result.then(function(name) {
864 // $scope.name = name;
867 // if(angular.equals($scope.name,''))
868 // $scope.name = 'You did not enter in your
872 $scope.saveConfirmationNotificationPopUp = function(
877 'partials/portfolios/save_confirmation.html',
878 'saveConfirmationModalPopUpCtrl',
886 windowClass : 'my-class'
889 dlg.result.then(function(name) {
896 $scope.cldsCreateTemplate = function() {
900 'partials/portfolios/clds_create_template.html',
901 'CldsOpenTemplateCtrl', {
908 windowClass : 'my-class'
911 dlg.result.then(function(name) {
913 // $scope.name = name;
916 // if(angular.equals($scope.name,''))
917 // $scope.name = 'You did not enter in your
922 $scope.cldsRefreshASDC = function() {
926 'partials/portfolios/refresh_asdc.html',
927 'CldsOpenModelCtrl', {
934 windowClass : 'my-class'
936 dlg.result.then(function(name) {
938 // $scope.name = name;
941 // if(angular.equals($scope.name,''))
942 // $scope.name = 'You did not enter in your
946 $scope.cldsRevertModel = function() {
950 'partials/portfolios/ConfirmRevertChanges.html',
951 'CldsOpenModelCtrl', {
958 windowClass : 'my-class'
961 dlg.result.then(function(name) {
963 // $scope.name = name;
966 // if(angular.equals($scope.name,''))
967 // $scope.name = 'You did not enter in your
973 $scope.cldsRevertTemplate = function() {
977 'partials/portfolios/ConfirmRevertChanges.html',
978 'CldsOpenTemplateCtrl', {
985 windowClass : 'my-class'
988 dlg.result.then(function(name) {
990 // $scope.name = name;
993 // if(angular.equals($scope.name,''))
994 // $scope.name = 'You did not enter in your
999 $scope.cldsTemplatePerformAction = function(
1002 var modelName = selected_model;
1003 var controlNamePrefix = "ClosedLoop-";
1004 var bpmnText = modelXML;
1005 // serialize model properties
1006 var propText = JSON.stringify(elementMap);
1009 console.log(abootDiagram.saveSVG({
1011 }, function(err, xml) {
1014 console.log("error")
1019 console.log("cldsTemplatePerformAction: "
1020 + uiAction + " modelName=" + modelName);
1021 console.log("cldsTemplatePerformAction: "
1022 + uiAction + " controlNamePrefix="
1023 + controlNamePrefix);
1024 console.log("cldsTemplatePerformAction: "
1025 + uiAction + " bpmnText=" + bpmnText);
1026 console.log("cldsTemplatePerformAction: "
1027 + uiAction + " propText=" + propText);
1029 .processAction(uiAction, modelName,
1030 controlNamePrefix, bpmnText,
1035 .log("processAction");
1037 .log("cldsTemplatePerformAction: pars="
1040 .processActionResponse(
1045 // alert("setModel failed: "
1050 $rootScope.cldsOpenModelProperties = function() {
1054 'partials/portfolios/global_properties.html',
1055 'GlobalPropertiesCtrl', {}, {
1058 backdrop : 'static',
1059 windowClass : 'my-class'
1062 dlg.result.then(function(name) {
1067 $scope.cldsOpenModel = function() {
1071 'partials/portfolios/clds_open_model.html',
1072 'CldsOpenModelCtrl', {
1078 backdrop : 'static',
1079 windowClass : 'my-class'
1082 dlg.result.then(function(name) {
1084 // $scope.name = name;
1087 // if(angular.equals($scope.name,''))
1088 // $scope.name = 'You did not enter in your
1092 $scope.cldsCreateModel = function() {
1096 'partials/portfolios/clds_create_model_off_Template.html',
1097 'CldsOpenModelCtrl', {
1103 backdrop : 'static',
1104 windowClass : 'my-class'
1107 dlg.result.then(function(name) {
1109 // $scope.name = name;
1112 // if(angular.equals($scope.name,''))
1113 // $scope.name = 'You did not enter in your
1118 $scope.extraUserInfo = function() {
1122 'partials/portfolios/extra_user_info.html',
1123 'ExtraUserInfoCtrl', {
1129 backdrop : 'static',
1130 windowClass : 'my-class'
1133 dlg.result.then(function(name) {
1138 $scope.cldsPerformAction = function(uiAction) {
1140 var modelName = selected_model;
1141 var controlNamePrefix = "ClosedLoop-";
1142 var bpmnText = modelXML;
1143 // serialize model properties
1144 var propText = JSON.stringify(elementMap);
1145 var templateName = selected_template
1148 console.log(abootDiagram.saveSVG({
1150 }, function(err, xml) {
1152 console.log("error")
1157 console.log("cldsPerformAction: " + uiAction
1158 + " modelName=" + modelName);
1159 console.log("cldsPerformAction: " + uiAction
1160 + " controlNamePrefix="
1161 + controlNamePrefix);
1162 console.log("cldsPerformAction: " + uiAction
1163 + " bpmnText=" + bpmnText);
1164 console.log("cldsPerformAction: " + uiAction
1165 + " propText=" + propText);
1166 console.log("cldsPerformAction: " + uiAction
1167 + " typeID=" + typeID);
1168 console.log("cldsPerformAction: " + uiAction
1169 + " deploymentId=" + deploymentId);
1171 .processAction(uiAction, modelName,
1172 controlNamePrefix, bpmnText,
1173 propText, svgXml, templateName,
1174 typeID, deploymentId)
1178 .log("cldsPerformAction: pars="
1181 .processRefresh(pars);
1184 // alert("setModel failed: "
1189 $scope.cldsConfirmPerformAction = function(uiAction) {
1190 var dlg = dialogs.confirm('Message',
1192 + uiAction.toLowerCase()
1193 + ' the closed loop?');
1194 dlg.result.then(function(btn) {
1196 $scope.cldsPerformAction(uiAction);
1199 // $modalInstance.close("closed");
1203 $scope.cldsConfirmToggleDeployPerformAction = function(
1206 var dlg = dialogs.confirm('Message',
1208 + uiAction.toLowerCase()
1209 + ' the closed loop?');
1210 dlg.result.then(function(btn) {
1211 cldsToggleDeploy(uiAction.toLowerCase());
1214 // $modalInstance.close("closed");
1217 function cldsToggleDeploy(uiAction) {
1218 var modelName = selected_model;
1219 var controlNamePrefix = "ClosedLoop-";
1220 var bpmnText = modelXML;
1221 // serialize model properties
1222 var propText = JSON.stringify(elementMap);
1223 var templateName = selected_template;
1226 console.log(abootDiagram.saveSVG({
1228 }, function(err, xml) {
1230 console.log("error")
1235 console.log("cldsPerformAction: " + uiAction
1236 + " modelName=" + modelName);
1237 console.log("cldsPerformAction: " + uiAction
1238 + " controlNamePrefix="
1239 + controlNamePrefix);
1240 console.log("cldsPerformAction: " + uiAction
1241 + " bpmnText=" + bpmnText);
1242 console.log("cldsPerformAction: " + uiAction
1243 + " propText=" + propText);
1244 console.log("cldsPerformAction: " + uiAction
1245 + " modelEventService="
1246 + modelEventService);
1247 console.log("cldsPerformAction: " + uiAction
1248 + " typeID=" + typeID);
1249 console.log("cldsPerformAction: " + uiAction
1250 + " deploymentId=" + deploymentId);
1252 .toggleDeploy(uiAction, modelName,
1253 controlNamePrefix, bpmnText,
1254 propText, svgXml, templateName,
1255 typeID, controlNameUuid,
1256 modelEventService, deploymentId)
1259 typeID = pars.typeId;
1260 controlNameUuid = pars.controlNameUuid;
1261 selected_template = pars.templateName;
1262 modelEventService = pars.event;
1264 // pars.event.actionCd;
1265 actionStateCd = pars.event.actionStateCd;
1266 deploymentId = pars.deploymentId;
1268 .processActionResponse(
1276 $scope.managePerformAction = function(action) {
1277 if (action.toLowerCase() === "delete") {
1281 "805b9f83-261f-48d9-98c7-8011fc2cc8e8",
1282 "ClosedLoop-ABCD-0000.yml")
1283 .then(function(pars) {
1287 // alert("setModel failed: " +
1292 $scope.manageConfirmPerformAction = function(
1295 var dlg = dialogs.confirm('Message',
1297 + uiAction.toLowerCase()
1298 + ' the closed loop?');
1299 dlg.result.then(function(btn) {
1301 $scope.managePerformAction(uiAction);
1304 // $modalInstance.close("closed");
1307 $scope.CollectorsWindow = function(collectorsWin) {
1312 'partials/portfolios/Template_model.html',
1322 backdrop : 'static',
1323 windowClass : 'my-class'
1325 dlg.result.then(function(name) {
1329 // if(angular.equals($scope.name,''))
1330 // $scope.name = 'You did not enter in
1336 'partials/portfolios/Collector_properties.html',
1345 backdrop : 'static',
1346 windowClass : 'my-class'
1348 dlg.result.then(function(name) {
1352 // if(angular.equals($scope.name,''))
1353 // $scope.name = 'You did not enter in
1360 $scope.StringMatchWindow = function(stringMatch) {
1365 'partials/portfolios/Template_model.html',
1375 backdrop : 'static',
1376 windowClass : 'my-class'
1378 dlg.result.then(function(name) {
1382 // if(angular.equals($scope.name,''))
1383 // $scope.name = 'You did not enter in
1390 'partials/portfolios/stringMatch_properties.html',
1399 backdrop : 'static',
1400 windowClass : 'my-class'
1403 dlg.result.then(function(name) {
1405 // $scope.name = name;
1408 // if(angular.equals($scope.name,''))
1409 // $scope.name = 'You did not enter in
1415 $scope.VesCollectorWindow = function(vesCollector) {
1420 'partials/portfolios/Template_model.html',
1430 backdrop : 'static',
1431 windowClass : 'my-class'
1433 dlg.result.then(function(name) {
1439 } else { // if (isTemplate)
1443 'partials/portfolios/vesCollector_properties.html',
1452 backdrop : 'static',
1453 windowClass : 'my-class'
1456 dlg.result.then(function(name) {
1465 $scope.HolmesWindow = function(holmes) {
1468 var partial = 'partials/portfolios/Template_model.html'
1470 var partial = 'partials/portfolios/holmes_properties.html'
1485 backdrop : 'static',
1486 windowClass : 'my-class'
1490 $scope.TCAWindow = function(tca) {
1494 'partials/portfolios/Template_model.html',
1504 backdrop : 'static',
1505 windowClass : 'my-class'
1507 dlg.result.then(function(name) {
1509 // if(angular.equals($scope.name,''))
1510 // $scope.name = 'You did not enter in
1516 'partials/portfolios/tca_properties.html',
1525 backdrop : 'static',
1526 windowClass : 'my-class'
1529 dlg.result.then(function(name) {
1530 // $scope.name = name;
1532 // if(angular.equals($scope.name,''))
1533 // $scope.name = 'You did not enter in
1539 $scope.PolicyWindow = function(policy) {
1544 'partials/portfolios/Template_model.html',
1554 backdrop : 'static',
1555 windowClass : 'my-class'
1557 dlg.result.then(function(name) {
1561 // if(angular.equals($scope.name,''))
1562 // $scope.name = 'You did not enter in
1568 'partials/portfolios/PolicyWindow_properties.html',
1577 backdrop : 'static',
1578 windowClass : 'my-class'
1581 dlg.result.then(function(name) {
1583 // $scope.name = name;
1586 // if(angular.equals($scope.name,''))
1587 // $scope.name = 'You did not enter in
1596 app.service('MenuService', [ '$http', '$q', function($http, $q) {
1599 * this.generateMDTTestSet = function(utmMDTRequest, generateTestSetMDTURL){
1601 * console.log("generateMDTTestSet"); //alert("In generateMDTTestSet :: " +
1602 * JSON.stringify(utmMDTRequest)); var def = $q.defer(); var sets = [];
1604 * $http.post(generateTestSetMDTURL, utmMDTRequest) .success(function(data){
1605 * console.log("success"); sets = data; def.resolve(data); })
1606 * .error(function(data){ console.log("error");
1607 * def.reject("GenerateMDTTestSet not successful"); });
1609 * return def.promise; };
1613 app.directive('focus', function($timeout) {
1619 link : function(scope, element) {
1620 scope.$watch('trigger', function(value) {
1622 if (value === "true") {
1623 $timeout(function() {
1632 app.directive('draggable', function($document) {
1634 return function(scope, element, attr) {
1636 var startX = 0, startY = 0, x = 0, y = 0;
1638 position : 'relative',
1640 backgroundColor : 'white',
1645 element.on('mousedown', function(event) {
1647 // Prevent default dragging of selected content
1648 // event.preventDefault();
1649 startX = event.screenX - x;
1650 startY = event.screenY - y;
1651 $document.on('mousemove', mousemove);
1652 $document.on('mouseup', mouseup);
1655 function mousemove(event) {
1657 y = event.screenY - startY;
1658 x = event.screenX - startX;
1665 function mouseup() {
1667 $document.off('mousemove', mousemove);
1668 $document.off('mouseup', mouseup);
1673 app.factory('myHttpInterceptor', function($q, $window) {
1675 return function(promise) {
1677 return promise.then(function(response) {
1680 }, function(response) {
1682 return $q.reject(response);
1687 app.run([ '$route', function($route) {
1691 function TestCtrl($scope) {
1693 $scope.msg = "Hello from a controller method.";
1694 $scope.returnHello = function() {
1699 function importshema() {
1701 angular.element(document.getElementById('navbar')).scope().importSchema();
1705 function CollectorsWindow(collectorsWin) {
1707 angular.element(document.getElementById('navbar')).scope()
1708 .CollectorsWindow(collectorsWin);
1711 function VesCollectorWindow(vesCollectorWin) {
1712 angular.element(document.getElementById('navbar')).scope()
1713 .VesCollectorWindow(vesCollectorWin);
1716 function HolmesWindow(holmesWin) {
1717 angular.element(document.getElementById('navbar')).scope()
1718 .HolmesWindow(holmesWin);
1721 function F5Window() {
1723 angular.element(document.getElementById('navbar')).scope().F5Window();
1727 function StringMatchWindow(stringMatch) {
1729 angular.element(document.getElementById('navbar')).scope()
1730 .StringMatchWindow(stringMatch);
1733 function TCAWindow(tca) {
1735 angular.element(document.getElementById('navbar')).scope().TCAWindow(tca);
1738 function GOCWindow() {
1740 angular.element(document.getElementById('navbar')).scope().GOCWindow();
1743 function PolicyWindow(PolicyWin) {
1745 angular.element(document.getElementById('navbar')).scope().PolicyWindow(
1750 function pathDetails(bpmnElementID, bpmnElementName, pathIdentifiers) {
1752 angular.element(document.getElementById('navbar')).scope().pathDetails(
1753 bpmnElementID, bpmnElementName, pathIdentifiers);
1756 function setdefaultvalue() {
1758 angular.element(document.getElementById('navbar')).scope()
1762 function upgradeSchemaVersion() {
1764 angular.element(document.getElementById('navbar')).scope()
1765 .upgradeSchemaVersion();
1768 function saveProject() {
1770 angular.element(document.getElementById('navbar')).scope().saveProject();
1773 function modifySchema() {
1775 angular.element(document.getElementById('navbar')).scope().modifySchema();
1779 function definePID() {
1781 angular.element(document.getElementById('navbar')).scope().definePID();
1784 function defineServiceAcronym() {
1786 angular.element(document.getElementById('navbar')).scope()
1787 .defineServiceAcronym();
1790 function errorProperty(msg) {
1792 angular.element(document.getElementById('navbar')).scope()
1793 .propertyExplorerErrorMessage(msg);
1795 function invisiblepropertyExplorer() {
1797 angular.element(document.getElementById('navbar')).scope()
1798 .invisibleproperty();
1800 function updateDecisionLabel(originalLabel, newLabel) {
1802 angular.element(document.getElementById('navbar')).scope()
1803 .updateDecisionLabels(originalLabel, newLabel);
1806 // Used to logout the session , when browser window was closed
1807 window.onunload = function() {
1808 window.localStorage.removeItem("isAuth");
1809 window.localStorage.removeItem("loginuser");