aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-08-08 03:12:26 -0700
committerSébastien Determe <sd378r@intl.att.com>2017-08-08 12:36:08 +0000
commit5359df130922118780a7220353cf2bfb0325489d (patch)
tree169d53d8ebe03baf26293443c5e4b5efa25278ef /src
parentc5a577a1cc00ace7964ff53dd2862a7dd2325411 (diff)
Rework the javascript file of the UI (part3)
Rework the javascript file of the UI (part3) Change-Id: I9fd6eab33f1c222c0bd61218ee31fece7a5e7af3 Issue-Id: CLAMP-1 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js3
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js23
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js24
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/SetDefaultValueCtrl.js30
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js90
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/app.js2899
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/authcontroller.js58
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/common_variables.js4
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js3
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/propertyExplorerCtrl.js195
10 files changed, 1751 insertions, 1578 deletions
diff --git a/src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js b/src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js
index 7cfa7a975..51c8971e2 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/FileUploadService.js
@@ -20,7 +20,6 @@
* ===================================================================
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-
app.directive('fileModel', ['$parse', function ($parse) {
console.log("////////fileModel");
return {
@@ -96,4 +95,4 @@ app.service('fileUpload', ['$http', '$q', function ($http, $q) {
return def.promise;
};
-}]);
+}]); \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js
index efd127fab..fb8100276 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js
@@ -20,31 +20,34 @@
* ===================================================================
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-
app.controller('GlobalPropertiesCtrl',
['$scope', '$rootScope', '$modalInstance','cldsModelService', '$location', 'dialogs','cldsTemplateService',
- function($scope, $rootScope, $modalInstance, cldsModelService, $location,dialogs,cldsTemplateService) {
- console.log("////////GlobalPropertiesCtrl");
+ function($scope, $rootScope, $modalInstance, cldsModelService, $location,dialogs,cldsTemplateService) {
//cldsModelService.getASDCServices().then(function(pars) {
$scope.$watch('name', function(newValue, oldValue) {
- console.log("name");
- if(readOnly){
- $("select,input,.nav-tabs .close").attr("disabled","");
- }
var services=asdc_Services
- console.log(asdc_Services)
setASDCFields()
for(k in services){
$("#service").append("<option value="+k+">"+services[k]+"</option>")
}
var el = elementMap["global"];
- console.log(elementMap["global"])
if (el !== undefined) {
for (var i = 0; i < el.length; i++) {
$("#" + el[i].name).val(el[i].value);
}
}
setMultiSelect();
+
+ if(readOnly||readMOnly){
+ $("#savePropsBtn").attr("disabled", "");
+ $('select[multiple] option').each(function() {
+ var input = $('input[value="' + $(this).val() + '"]');
+ input.prop('disabled', true);
+ input.parent('li').addClass('disabled');
+ });
+ $('input[value="multiselect-all"]').prop('disabled', true).parent('li').addClass('disabled');
+ ($("select:not([multiple])")).multiselect("disable");
+ }
});
$scope.retry = function(){
console.log("retry");
@@ -56,4 +59,4 @@ app.controller('GlobalPropertiesCtrl',
};
}
]
-);
+); \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js
index 839eefe93..bbe2c3b55 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/ImportSchemaCtrl.js
@@ -36,10 +36,30 @@ app.controller('ImportSchemaCtrl', ['$scope', '$rootScope','$modalInstance','dat
$rootScope.updateServiceFault;
$rootScope.updateServiceInputPartInfo;
$rootScope.updateSchemElemant1;
+
+
+// Below code is added to get the policyNames
+ for ( var polElement in elementMap) {
+ if (polElement.indexOf('Policy_') === 0) {
+ var obj = elementMap[polElement];
+ if (!($.isEmptyObject(obj))) {
+ allPolicies = jQuery.extend({}, obj);
+ $scope.policyNames = [];
+ for ( var policy in allPolicies) {
+ $scope.policyNames.push(policy);
+ }
+ }
+ break;
+ }
+ }
+
+ setTimeout(function(){
+ console.log("setTimeout");
+ setMultiSelect(); }, 100);
$scope.init = function() {
console.log("init");
- $scope.schemaLocation = 'svn://svnrepo:3690';
+ $scope.schemaLocation = 'svn://svnrepo:3690';
$scope.upgrade_schemaLocation = 'svn://svnrepo:3690';
$scope.userID = 'user_id';
$scope.password = 'password';
@@ -312,4 +332,4 @@ app.controller('ImportSchemaCtrl', ['$scope', '$rootScope','$modalInstance','dat
};
-}]);
+}]); \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/SetDefaultValueCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/SetDefaultValueCtrl.js
index 4aaf595b2..ed81a1522 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/SetDefaultValueCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/SetDefaultValueCtrl.js
@@ -174,33 +174,3 @@ app.directive('inputInfoDVClassMember', function ($compile) {
}
}
});
-
-/*app.controller('SetDefaultValueCtrl', ['$scope', '$rootScope','$modalInstance','$location', function($scope,$rootScope,$modalInstance,$location){
- console.log("SetDefaultValueCtrl");
- $scope.utmSchemaExts = {};
-
- $scope.init = function () {
- console.log("init");
- //console.log("$rootScope.defValuesObject :: " + JSON.stringify(list_model_schema_extensions[selected_model]));
- if(list_model_schema_extensions[selected_model] != null && list_model_schema_extensions[selected_model].utmSchemaExtentionMap != null) {
- $scope.utmSchemaExts = list_model_schema_extensions[selected_model].utmSchemaExtentionMap;
- $scope.previous_utmSchemaExts = angular.copy($scope.utmSchemaExts);
- //console.log("$scope.defaultValuesObject :: " + $scope.utmSchemaExts);
- }
- };
-
- $scope.init();
-
- $scope.setDefaultValue= function(){
- console.log("setDefaultValue");
- list_model_schema_extensions[selected_model].utmSchemaExtentionMap = $scope.utmSchemaExts;
- $rootScope.isModel = true;
- $modalInstance.close("closed");
- };
-
- $scope.close = function(){
- console.log("close");
- list_model_schema_extensions[selected_model].utmSchemaExtentionMap = $scope.previous_utmSchemaExts;
- $modalInstance.close("closed");
- };
-}]);*/
diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
index 6c58570ab..f97ed1fa2 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js
@@ -59,27 +59,42 @@ var isObject = function(a) {
return (!!a) && (a.constructor === Object);
};
-function loadPropertyWindow(type) {
- if (readOnly) {
+function loadPropertyWindow(type) {
+ if (readOnly||readMOnly) {
if ($("#add_one_more").length == 1) {
$("#add_one_more").off();
$("#add_one_more").click(function(event) {
event.preventDefault();
})
}
- $("select,input").attr("disabled", "");
+ $("input,#savePropsBtn").attr("disabled", "");
+ $(".modal-body button").attr("disabled", "");
+ ($("select:not([multiple])")).multiselect("disable");
+ }
+
+ if (readTOnly){
+ $("textarea").attr("disabled","");
+ $("#savePropsBtn").attr("disabled", "");
}
var props = defaults_props[type];
for (p in props) {
- if (isObject(props[p])) {
+ if (isObject(props[p])) {
var mySelect = $('#' + p);
- $.each(props[p], function(val, text) {
- mySelect.append(
- $('<option></option>').val(val).html(text)
- );
- });
+ if (p=="operator"){
+ $.each(props[p], function(val, text) {
+ mySelect.append(
+ $('<option></option>').val(val).html(val)
+ );
+ });
+ } else {
+ $.each(props[p], function(val, text) {
+ mySelect.append(
+ $('<option></option>').val(val).html(text)
+ );
+ });
+ }
} else {
if (p=="pname"){
var ms = new Date().getTime();
@@ -89,8 +104,9 @@ function loadPropertyWindow(type) {
}
}
setTimeout(function(){
-
- setMultiSelect(type); }, 100);
+ setMultiSelect(type); }, 100);
+
+
}
@@ -153,18 +169,18 @@ function setMultiSelect() {
//refeshMultiSelect();
}
function loadSharedPropertyByService(onChangeUUID,refresh, callBack) {
- var uuid = onChangeUUID
+ var uuid = onChangeUUID;
if (uuid === undefined){
uuid = elementMap["global"] && elementMap["global"].length>0 ?
elementMap["global"][0].value : "";
} else if (uuid === "") {
vf_Services = null
if ($("#vf").length > 0)
- $("#vf").empty();
+ $("#vf").empty().multiselect("refresh");
if ($("#location").length > 0)
- $("#location").empty();
+ $("#location").empty().multiselect("refresh");
if ($("#alarmCondition").length > 0)
- $("#alarmCondition").empty();
+ $("#alarmCondition").empty().multiselect("refresh");
return true;
}
var share = null,
@@ -180,10 +196,10 @@ function loadSharedPropertyByService(onChangeUUID,refresh, callBack) {
success: function(data) {
vf_Services = data;
setASDCFields()
- if(refresh){
+ if(refresh){
$("#paramsWarnrefresh").hide();
}
- if($("#paramsWarn")){
+ if($("#paramsWarn")){
$("#paramsWarn").hide();
}
if(callBack && _.isFunction(callBack)){
@@ -209,6 +225,7 @@ function loadSharedPropertyByService(onChangeUUID,refresh, callBack) {
timeout: 100000
});
+
//vf_Services=share['shared']['byService'][uuid];
//location_values = share['global']['location'];
}
@@ -241,42 +258,60 @@ function setASDCFields() {
loadSharedPropertyByService()
} else {
try {
- $("#vf").empty();
- $("#location").empty();
- $("#vfc").empty();
+ $("#vf").empty().multiselect("refresh");
+ $("#location").empty().multiselect("refresh");
+ $("#actionSet").empty().multiselect("refresh");
+ $("#vfc").empty().multiselect("refresh");
$("#paramsWarn").hide();
var uuid = Object.keys(vf_Services['shared']['byService'])[0];
+
var vf_values = vf_Services['shared']['byService'][uuid] &&
vf_Services['shared']['byService'][uuid]['vf'] &&
_.keys(vf_Services['shared']['byService'][uuid]['vf']).length > 0 ?
vf_Services['shared']['byService'][uuid]['vf'] : null;
+
var selectedVF = {}
for (let e in elementMap["global"]) {
if (elementMap['global'][e].name === "vf") {
selectedVF = elementMap['global'][e].value[0]
}
}
- var location_values = vf_Services['global']['location'];
+
var vfc_values2 = selectedVF &&
vf_Services['shared']['byVf'][selectedVF] &&
vf_Services['shared']['byVf'][selectedVF]['vfc'] &&
_.keys(vf_Services['shared']['byVf'][selectedVF]['vfc']).length > 0 ?
vf_Services['shared']['byVf'][selectedVF]['vfc'] : null;
-
+
if (vf_values) {
for (key in vf_values) {
if ($("#vf").length > 0) {
$("#vf").append("<option value=\"" + key + "\">" + vf_values[key] + "</opton>")
}
}
+ $("#vf").multiselect("rebuild");
}
+
+ var location_values = vf_Services['global']['location'];
if (location_values) {
for (key in location_values) {
if ($("#location").length > 0) {
$("#location").append("<option value=\"" + key + "\">" + location_values[key] + "</opton>")
}
}
- }
+ $("#location").multiselect("rebuild");
+ }
+
+ var actionSet_values = vf_Services['global']['actionSet'];
+ if (actionSet_values) {
+ for (key in actionSet_values) {
+ if ($("#actionSet").length > 0) {
+ $("#actionSet").append("<option value=\"" + key + "\">" + actionSet_values[key] + "</opton>")
+ }
+ }
+ $("#actionSet").multiselect("rebuild");
+ }
+
if (vfc_values2) {
$("#vfc").append("<option value=\"\"></opton>");
for (key in vfc_values2) {
@@ -284,6 +319,7 @@ function setASDCFields() {
$("#vfc").append("<option value=\"" + key.split("\"").join("") + "\">" + vfc_values2[key] + "</opton>")
}
}
+ $("#vfc").multiselect("rebuild");
}
if($("#vfc").length > 0 && !vfc_values2){
showWarn();
@@ -310,7 +346,6 @@ function reloadDefaultVariables(isTemp) {
isTemplate = isTemp;
vf_Services = null;
readOnly = false;
- runningInstances = {}
}
$(window).load(function() {
@@ -318,7 +353,7 @@ $(window).load(function() {
dataType: "json",
url: '/restservices/clds/v1/clds/properties',
success: function(data) {
- console.log("success");
+
defaults_props = data;
},
error: function(s, a, err) {
@@ -328,7 +363,4 @@ $(window).load(function() {
},
timeout: 100000
});
-
-
-
-})
+}) \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js
index 3d8e30eb3..401489ca1 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/app.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/app.js
@@ -25,7 +25,6 @@
/* App Module */
-
var app = angular.module('clds-app', ['ngRoute',
'ngResource',
'angularjs-dropdown-multiselect',
@@ -46,1381 +45,1683 @@ var app = angular.module('clds-app', ['ngRoute',
'ui.bootstrap.modal',
'ui.grid.exporter',
'angucomplete',
- 'kendo.directives'
+ 'kendo.directives',
+ 'angular-md5'
])
-.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider)
-{
- console.log("///////////////cfpLoadingBarProvider");
- cfpLoadingBarProvider.includeBar = true;
- cfpLoadingBarProvider.includeSpinner = true;
- }])
-.config(function ($httpProvider) {
- console.log("config");
- $httpProvider.responseInterceptors.push('myHttpInterceptor');
-
- var spinnerFunction = function spinnerFunction(data, headersGetter)
- {
- console.log("spinnerFunction");
- return data;
- };
-
- $httpProvider.defaults.transformRequest.push(spinnerFunction);
-})
-.config(['$routeProvider','$locationProvider', '$compileProvider','cfpLoadingBarProvider',function(
- $routeProvider,
- $locationProvider,
- cfpLoadingBarProvider,
- $timeout,
- dialogs,
- $cookies)
-{
- console.log("$routeProvider','$locationProvider', '$compileProvider','cfpLoadingBarProvider'")
- $locationProvider.html5Mode(false);
- //alert("App.js");
-
- $routeProvider.
- when('/otherwise', {templateUrl: 'partials/please_wait.html', controller: QueryParamsHandlerCtrl }).
- //when('/dashboard_submit', { templateUrl: 'partials/portfolios/dashboard_submit.html', controller: CreateNewPrjCtrl }).
- when('/dashboard', { templateUrl: 'partials/portfolios/clds_modelling.html', controller: DashboardCtrl }).
- //when('/dashboard_upload', { templateUrl: 'partials/portfolios/dashboard_upload.html', controller: DashboardCtrl }).
- when('/activity_modelling', { templateUrl: 'partials/portfolios/clds_modelling.html', controller: DashboardCtrl }).
- when('/authenticate', { templateUrl: 'authenticate.html', controller: AuthenticateCtrl }).
- when('/invalidlogin', { templateUrl: 'partials/invalid_login.html', controller: PageUnderConstructionCtrl }).
- otherwise({redirectTo: '/otherwise'});
-
-}]).controller('dialogCtrl',function($scope,$rootScope,$timeout,dialogs){
-
- //-- Variables --//
- console.log("dialogCtrl");
- $scope.lang = 'en-US';
- $scope.language = 'English';
-
- var _progress = 100;
-
- $scope.name = '';
- $scope.confirmed = 'No confirmation yet!';
-
- $scope.custom = {
- val: 'Initial Value'
- };
-
- //-- Listeners & Watchers --//
-
- $scope.$watch('lang',function(val,old){
- console.log("lang");
- switch(val){
- case 'en-US':
- $scope.language = 'English';
- break;
- case 'es':
- $scope.language = 'Spanish';
- break;
- }
- });
-
- //-- Methods --//
-$rootScope.testCaseRequirements=[];
-$rootScope.validTestRequirements=[];
-/*$rootScope.testCaseValue=[];*/
- $scope.setLanguage = function(lang)
- {
- console.log("setLanguage");
-
- $scope.lang = lang;
- $translate.use(lang);
- };
+ .config([ 'cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
+
+ cfpLoadingBarProvider.includeBar = true;
+ cfpLoadingBarProvider.includeSpinner = true;
+ } ])
+ .config(
+ function($httpProvider) {
+
+ $httpProvider.responseInterceptors
+ .push('myHttpInterceptor');
+
+ var spinnerFunction = function spinnerFunction(data,
+ headersGetter) {
+
+ return data;
+ };
+
+ $httpProvider.defaults.transformRequest
+ .push(spinnerFunction);
+ })
+ .config(
+ [
+ '$routeProvider',
+ '$locationProvider',
+ '$compileProvider',
+ 'cfpLoadingBarProvider',
+ function($routeProvider, $locationProvider,
+ cfpLoadingBarProvider, $timeout, dialogs,
+ $cookies) {
+ console
+ .log("$routeProvider','$locationProvider', '$compileProvider','cfpLoadingBarProvider','md5'")
+ $locationProvider.html5Mode(false);
+ // alert("App.js");
+
+ $routeProvider
+ .when('/otherwise', {
+ templateUrl : 'please_wait.html',
+ controller : QueryParamsHandlerCtrl
+ })
+ .
+ // when('/dashboard_submit', { templateUrl:
+ // 'partials/portfolios/dashboard_submit.html',
+ // controller: CreateNewPrjCtrl }).
+ when(
+ '/dashboard',
+ {
+ templateUrl : 'partials/portfolios/clds_modelling.html',
+ controller : DashboardCtrl
+ })
+ .
+ // when('/dashboard_upload', { templateUrl:
+ // 'partials/portfolios/dashboard_upload.html',
+ // controller: DashboardCtrl }).
+ when(
+ '/activity_modelling',
+ {
+ templateUrl : 'partials/portfolios/clds_modelling.html',
+ controller : DashboardCtrl
+ }).when('/authenticate', {
+ templateUrl : 'authenticate.html',
+ controller : AuthenticateCtrl
+ }).when('/invalidlogin', {
+ templateUrl : 'invalid_login.html',
+ controller : PageUnderConstructionCtrl
+ }).otherwise({
+ redirectTo : '/otherwise'
+ });
+
+ } ])
+ .controller(
+ 'dialogCtrl',
+ function($scope, $rootScope, $timeout, dialogs) {
+
+ // -- Variables --//
+
+ $scope.lang = 'en-US';
+ $scope.language = 'English';
+
+ var _progress = 100;
+
+ $scope.name = '';
+ $scope.confirmed = 'No confirmation yet!';
+
+ $scope.custom = {
+ val : 'Initial Value'
+ };
+
+ // -- Listeners & Watchers --//
+
+ $scope.$watch('lang', function(val, old) {
+
+ switch (val) {
+ case 'en-US':
+ $scope.language = 'English';
+ break;
+ case 'es':
+ $scope.language = 'Spanish';
+ break;
+ }
+ });
- $rootScope.launch = function(which){
- console.log("launch");
- switch(which){
- case 'error':
- dialogs.error();
- break;
- case 'wait':
- //var dlg = dialogs.wait(undefined,undefined,_progress);
- //_fakeWaitProgress();
- break;
- case 'customwait':
- //var dlg = dialogs.wait('Custom Wait Header','Custom Wait Message',_progress);
- //_fakeWaitProgress();
- break;
- case 'notify':
- dialogs.notify();
- break;
- case 'confirm':
- var dlg = dialogs.confirm();
- dlg.result.then(function(btn){
- console.log("dlg.result");
- $scope.confirmed = 'You confirmed "Yes."';
- },function(btn){
- console.log("btn");
- $scope.confirmed = 'You confirmed "No."';
- });
- break;
- case 'custom':
- var dlg = dialogs.create('/dialogs/custom.html','customDialogCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.name = name;
- },function(){
- console.log("custom");
- if(angular.equals($scope.name,''))
- $scope.name = 'You did not enter in your name!';
- });
- break;
- case 'custom2':
- var dlg = dialogs.create('/dialogs/custom2.html','customDialogCtrl2',$scope.custom,{size:'lg'});
- break;
- case 'custom3':
- var dlg = dialogs.notify('Message','All is not supported, Please select interface(s)/version(s) to fetch real time federated coverage report.');
- break;
- case 'custom4':
- var dlg = dialogs.confirm('Message','You are about to fetch real time federated coverage report.This may take sometime!!!.');
- dlg.result.then(function(btn){
- console.log("dlg.result");
- $scope.confirmed = 'You confirmed "Yes."';
- },function(btn){
- console.log("btn");
- $scope.confirmed = 'You confirmed "No."';
- });
- break;
- case 'custom5':
- var dlg = dialogs.notify('Success','Request has been successfully processed.');
- break;
- case 'custom6':
- var dlg = dialogs.notify('Message','Please type Testscenario Name');
- break;
- }
- }; // end launch
-
- var _fakeWaitProgress = function()
- {
- console.log("_fakeWaitProgress");
- $timeout(function()
- {
- console.log("timeout");
- if(_progress < 100)
- {
- _progress += 33;
- $rootScope.$broadcast('dialogs.wait.progress',{'progress' : _progress});
- _fakeWaitProgress();
- }
- else
- {
- $rootScope.$broadcast('dialogs.wait.complete');
- _progress = 0;
- }
- },1000);
- };
-}).controller('MenuCtrl',['$scope', '$rootScope','$timeout','dialogs','$location','MenuService','Datafactory',
-'userPreferencesService','cldsModelService','cldsTemplateService',function($scope,$rootScope,$timeout,dialogs,
- $location, MenuService,Datafactory,userPreferencesService,cldsModelService,cldsTemplateService)
-{
- console.log("MenuCtrl");
- $rootScope.screenName="Universal Test Modeler";
- $rootScope.testSet = null;
- $rootScope.isNew= false;
- var testingType="";
- $rootScope.contactUs= function()
- {
- console.log("contactUs");
- 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.";
- window.location.href = link;
- };
-
-$scope.emptyMenuClick = function(value, name) {
- if ($rootScope.isNew && (name != "Save Template" && name != "Close Template" &&
- name != "Template Properties")) {
- saveConfirmationNotificationPopUp();
- } else if ($rootScope.isNewClosed && name != "Save CL" && name != "Close Model" &&
- name != "Properties CL") {
- saveConfirmationNotificationPopUp();
- } else {
- isSaveCheck(name);
- }
-
- function saveConfirmationNotificationPopUp() {
- $scope.saveConfirmationNotificationPopUp(function(data) {
- console.log("saveConfirmationNotificationPopUp");
- if (data) {
- if ($rootScope.isNewClosed) {
- isSaveCheck("Save CL");
- } else {
- isSaveCheck("Save Template");
- }
- $rootScope.isNewClosed = false;
- $rootScope.isNew = false;
- } else {
- return false;
- }
- });
- }
-
- function isSaveCheck(name) {
- console.log("isSaveCheck");
- if (name == "Wiki") {
- window.open(value);
- } else if (name == "Contact Us") {
- $rootScope.contactUs();
- } else if (name == "Revert Template Changes") {
- $scope.cldsRevertTemplate();
- } else if (name == "Revert Model Changes") {
- $scope.cldsRevertModel();
- } else if (name == "Create Template") {
- $rootScope.isNew = true;
- $scope.cldsCreateTemplate();
- } else if (name == "Open Template") {
- $scope.cldsOpenTemplate();
- } else if (name == "Save Template") {
- $scope.cldsTemplatePerformAction("SAVE");
- $rootScope.isNewClosed = false;
- $rootScope.isNew = false;
- } else if (name == "Template Properties") {
- $scope.cldsOpenTemplateProperties();
- } else if (name == "Close Model" || name == "Close Template") {
- $scope.cldsClose();
- } else if (name == "Refresh ASDC") {
- $scope.cldsRefreshASDC();
- } else if (name == "Create CL") {
- $rootScope.isNewClosed = true;
- $scope.cldsCreateModel();
- } else if (name == "Open CL") {
- $scope.cldsOpenModel();
- } else if (name == "Save CL") {
- $rootScope.isNewClosed = false;
- $rootScope.isNew = false;
- $scope.cldsPerformAction("SAVE");
- } else if (name == "Test") {
- $scope.cldsPerformAction("TEST");
- } else if (name == "Submit") {
- $scope.cldsConfirmPerformAction("SUBMIT");
- } else if (name == "Resubmit") {
- $scope.cldsConfirmPerformAction("RESUBMIT");
- } else if (name == "Update") {
- $scope.cldsConfirmPerformAction("UPDATE");
- } else if (name == "Delete") {
- $scope.cldsConfirmPerformAction("DELETE");
- } else if (name == "Stop") {
- $scope.cldsConfirmPerformAction("STOP");
- } else if (name == "Restart") {
- $scope.cldsConfirmPerformAction("RESTART");
- } else if (name == "Refresh Status") {
- $scope.cldsPerformAction("REFRESH");
- } else if (name == "Properties CL") {
- $scope.cldsOpenModelProperties();
- } else if (name === "Running Instances") {
- $scope.cldsShowRunningInstances();
- } else {
- $rootScope.screenName = name;
- $scope.updatebreadcrumb(value);
- $location.path(value);
- }
- }
-};
+ // -- Methods --//
+ $rootScope.testCaseRequirements = [];
+ $rootScope.validTestRequirements = [];
+ /* $rootScope.testCaseValue=[]; */
+ $scope.setLanguage = function(lang) {
+
+ $scope.lang = lang;
+ $translate.use(lang);
+ };
+
+ $rootScope.launch = function(which) {
+
+ switch (which) {
+ case 'error':
+ dialogs.error();
+ break;
+ case 'wait':
+ // var dlg =
+ // dialogs.wait(undefined,undefined,_progress);
+ // _fakeWaitProgress();
+ break;
+ case 'customwait':
+ // var dlg = dialogs.wait('Custom Wait
+ // Header','Custom Wait Message',_progress);
+ // _fakeWaitProgress();
+ break;
+ case 'notify':
+ dialogs.notify();
+ break;
+ case 'confirm':
+ var dlg = dialogs.confirm();
+ dlg.result.then(function(btn) {
+
+ $scope.confirmed = 'You confirmed "Yes."';
+ }, function(btn) {
+
+ $scope.confirmed = 'You confirmed "No."';
+ });
+ break;
+ case 'custom':
+ var dlg = dialogs.create('/dialogs/custom.html',
+ 'customDialogCtrl', {}, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result
+ .then(
+ function(name) {
+
+ $scope.name = name;
+ },
+ function() {
+
+ if (angular.equals($scope.name,
+ ''))
+ $scope.name = 'You did not enter in your name!';
+ });
+ break;
+ case 'custom2':
+ var dlg = dialogs.create('/dialogs/custom2.html',
+ 'customDialogCtrl2', $scope.custom, {
+ size : 'lg'
+ });
+ break;
+ case 'custom3':
+ var dlg = dialogs
+ .notify(
+ 'Message',
+ 'All is not supported, Please select interface(s)/version(s) to fetch real time federated coverage report.');
+ break;
+ case 'custom4':
+ var dlg = dialogs
+ .confirm(
+ 'Message',
+ 'You are about to fetch real time federated coverage report.This may take sometime!!!.');
+ dlg.result.then(function(btn) {
+
+ $scope.confirmed = 'You confirmed "Yes."';
+ }, function(btn) {
+
+ $scope.confirmed = 'You confirmed "No."';
+ });
+ break;
+ case 'custom5':
+ var dlg = dialogs.notify('Success',
+ 'Request has been successfully processed.');
+ break;
+ case 'custom6':
+ var dlg = dialogs.notify('Message',
+ 'Please type Testscenario Name');
+ break;
+ }
+ }; // end launch
+
+ var _fakeWaitProgress = function() {
+
+ $timeout(function() {
+
+ if (_progress < 100) {
+ _progress += 33;
+ $rootScope.$broadcast('dialogs.wait.progress',
+ {
+ 'progress' : _progress
+ });
+ _fakeWaitProgress();
+ } else {
+ $rootScope.$broadcast('dialogs.wait.complete');
+ _progress = 0;
+ }
+ }, 1000);
+ };
+ })
+ .controller(
+ 'MenuCtrl',
+ [
+ '$scope',
+ '$rootScope',
+ '$timeout',
+ 'dialogs',
+ '$location',
+ 'MenuService',
+ 'Datafactory',
+ 'userPreferencesService',
+ 'cldsModelService',
+ 'cldsTemplateService',
+ 'extraUserInfoService',
+ function($scope, $rootScope, $timeout, dialogs,
+ $location, MenuService, Datafactory,
+ userPreferencesService, cldsModelService,
+ cldsTemplateService, extraUserInfoService) {
+ console.log("MenuCtrl");
+ $rootScope.screenName = "Universal Test Modeler";
+ $rootScope.testSet = null;
+ $rootScope.isNew = false;
+ var testingType = "";
+ $rootScope.contactUs = function() {
+ console.log("contactUs");
+ 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.";
+ window.location.href = link;
+ };
+
+ extraUserInfoService
+ .getUserInfo()
+ .then(
+ function(pars) {
+ $scope.userInfo = pars;
+ if (!($scope.userInfo["permissionUpdateTemplate"])) {
+ readTOnly = true;
+ }
+ ;
+ if (!($scope.userInfo["permissionUpdateCl"])) {
+ readMOnly = true;
+ }
+ ;
+ });
+
+ $scope.emptyMenuClick = function(value, name) {
+ if ($rootScope.isNew
+ && (name != "Save Template"
+ && name != "Close Template" && name != "Template Properties")) {
+ saveConfirmationNotificationPopUp();
+ } else if ($rootScope.isNewClosed
+ && name != "Save CL"
+ && name != "Close Model"
+ && name != "Properties CL") {
+ saveConfirmationNotificationPopUp();
+ } else {
+ isSaveCheck(name);
+ }
-
-
-
- $rootScope.impAlerts= function()
- {
- console.log("impAlerts");
- };
-
- $scope.tabs = {
- "Template": [
- {
- link: "/cldsCreateTemplate",
- name: "Create Template"
- }, {
- link: "/cldsOpenTemplate",
- name: "Open Template"
- }, {
- link: "/cldsSaveTemplate",
- name: "Save Template"
- },
- {
- link: "/cldsOpenTemplateProperties",
- name: "Template Properties"
- },
- {
- link: "/RevertChanges",
- name: "Revert Template Changes"
- },
- {
- link: "/Close",
- name: "Close Template"
- }
- ],
-
- "Closed Loop": [
- {
- link: "/cldsCreateModel",
- name: "Create CL"
- }, {
- link: "/cldsOpenModel",
- name: "Open CL"
- }, {
- link: "/cldsSaveModel",
- name: "Save CL"
- },
- {
- link: "/cldsOpenModelProperties",
- name: "Properties CL"
- },
- {
- link: "/RevertChanges",
- name: "Revert Model Changes"
- },
- {
- link: "/Close",
- name: "Close Model"
- }
- ],
- "Manage": [
- {
- link: "/cldsTestActivate",
- name: "Test"
- },
- {
- link: "/cldsSubmit",
- name: "Submit"
- },
- {
- link: "/cldsResubmit",
- name: "Resubmit"
- },
- {
- link: "/cldsUpdate",
- name: "Update"
- },
- {
- link: "/cldsStop",
- name: "Stop"
- },
- {
- link: "/cldsRestart",
- name: "Restart"
- },
- {
- link: "/cldsDelete",
- name: "Delete"
- }
- ],
- "View": [
- {
- link: "/refreshStatus",
- name: "Refresh Status"
- },
- {
- link:"/refreshASDCProperties",
- name:"Refresh ASDC"
- },
- {
- link:"/viewRunningInstances",
- name:"Running Instances"
- }
- ],
- "Help": [
- {
- link: "http://wiki.onap.org",
- name: "Wiki"
- }, {
- link: "/contact_us",
- name: "Contact Us"
- }
-
-
- ]
- };
-
-
- if (!Object.keys)
- {
- Object.keys = function(obj)
- {
- console.log("keys");
- console.log("keys");
- var keys = [];
-
- for (var i in obj) {
- if (obj.hasOwnProperty(i)) {
- keys.push(i);
- }
- }
-
- return keys;
- };
- $scope.keyList = Object.keys($scope.tabs);
- } else
- {
- $scope.keyList = Object.keys($scope.tabs);
- }
-
- $scope.updatebreadcrumb = function(path)
- {
- console.log("updatebreadcrumb");
- var currentURL = $location.path();
- if(path!=undefined)
- {
- currentURL = path;
- }
-
- if(currentURL=="/dashboard")
- {
- $rootScope.screenName = "Universal Test Modeler";
- $rootScope.parentMenu = "Home";
- $rootScope.rightTabName="UTM Build Configuration";
- }
- /*else if(currentURL=="/quicksearch")
- {
- $rootScope.screenName = "Quick Search";
- $rootScope.parentMenu = "Home";
- }*/
- else
- {
- var found = false;
-
- angular.forEach($scope.keyList, function(value, key)
- {
- console.log("foreachfunction");
- if(!found)
- {
- $rootScope.parentMenu = value;
-
- angular.forEach($scope.tabs[value], function(value, key)
- {
- console.log("tebvalue");
- if(currentURL==value.link)
- {
- $rootScope.screenName=value.name;
- found=true;
- }
- });
- }
- });
- }
- };
-
- $scope.updatebreadcrumb();
-
- $scope.createNewProject = function(){
- console.log("createNewProject");
- if($rootScope.projectName != null){
- var dlg = dialogs.confirm('Message','Do you want to over-write the project ?');
-
- dlg.result.then(function(btn){
- console.log("dlg.result");
- $scope.clearProject();
- var dlg1 = dialogs.create('partials/portfolios/create_new_project.html','CreateNewPrjCtrl',{},{size:'sm',keyboard: true,backdrop: false,windowClass: 'my-class'});
- dlg1.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- },function(btn){
- console.log("btn");
- //$modalInstance.close("closed");
- });
-
- }else{
- var dlg = dialogs.create('partials/portfolios/create_new_project.html','CreateNewPrjCtrl',{},{size:'lg',keyboard: true,backdrop: false,windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- }
- };
-
- $scope.clearProject= function(){
- console.log("clearProject");
- $rootScope.projectName= null;
- $rootScope.revision = -1;
- //$rootScope.models.length=0;
- $rootScope.utmModels=$rootScope.$new(true);
- $rootScope.serviceInfo = $rootScope.$new(true);
- $rootScope.serviceInfo= null;
- $rootScope.serviceInputPartInfo = $rootScope.$new(true);
- $rootScope.serviceOutputPartInfo=$rootScope.$new(true);
- $rootScope.servicefaultPartInfo =$rootScope.$new(true);
- $rootScope.isModel = false;
- $("#paletteDiv").load('./modeler/dist/index.html');
- $rootScope.isPalette = false;
- $rootScope.isTestset = false;
- $rootScope.isRequirementCoverage = false;
- $rootScope.ispropertyExplorer = false;
- // $("#propertyDiv").load('./partials/portfolios/Property_Explorer.html');
- $rootScope.modelName="";
- //document.getElementById('propertyExplorer').classList.remove('visible');
- document.getElementById("modeler_name").textContent="Activity Modeler";
- //$( "#propertyExplorer" ).prev().css( "display", "block" );
- $( "#activity_modeler" ).prev().css( "display", "block" );
- $( 'div' ).find('.k-expand-next').click();
-
- $rootScope.$apply();
-
- };
-
- $scope.homePage=function(){
- console.log("homePage");
- $location.path('/dashboard');
- };
- $scope.propertyExplorerErrorMessage = function(msg)
- {
- console.log("propertyExplorerErrorMessage");
- var dlg = dialogs.notify('Error',msg);
- }
-
- //$scope.fromTstMultipleFlag=false;
- /*onclicking of review testset / generate testset */
- $scope.generateTestSet=function(testingType){
- console.log("generateTestSet");
- var errorMessage="";
- var generateTestSetMDTURL = "/utm-service/test_generation/generateMDTTestSet";
-
- var UTMProjectExplorer = {};
- UTMProjectExplorer.projectName = $rootScope.projectName;
- UTMProjectExplorer.utmModels = $rootScope.utmModels;
-
- UTMProjectExplorer.utmDepthValueMap = $rootScope.depthElementKeyMap;
- UTMProjectExplorer.utmCountValueMap = $rootScope.countElementKeyMap;
-
- var utmMDTRequest = {};
- utmMDTRequest.mainProcessName = selected_model;
- var utm_models = [];
- $rootScope.populateUTMModelArray(utm_models,$rootScope.utmModels);
- utmMDTRequest.utmModels = utm_models;
-
- utmMDTRequest.testingType=testingType;
-
- utmMDTRequest.utmProjectExplorer = UTMProjectExplorer;
- if ($rootScope.wsdlInfo != null) {
- utmMDTRequest.schemaLocation = $rootScope.wsdlInfo.schemaLocation;
- }
-
- utmMDTRequest.dbToolRequests = Datafactory.getDbToolProjectLevelList();
- utmMDTRequest.runtimePythonScriptProjectLevelList = Datafactory.getRuntimePythonScriptProjectLevelList();
- utmMDTRequest.xmlValidatorList = Datafactory.getXmlValidatorList();
- utmMDTRequest.modelPreferenceInfo = Datafactory.getModelPreferenceInfo();
- MenuService.generateMDTTestSet(utmMDTRequest, generateTestSetMDTURL)
- .then(function(pars) {
- list_model_test_sets[selected_model] = pars;
-
- //populate test sets of other models
- for(var i = 0; i < utm_models.length; i++){
- var model_test_set = {};
- model_test_set.activityTestCases = [];
- model_test_set.invalidModelException = pars.invalidModelException;
- model_test_set.serviceName = pars.serviceName;
- for(var y = 0; y < pars.activityTestCases.length; y++){
- for(var z = 0; z < pars.activityTestCases[y].modelElements.length; z++){
- if(pars.activityTestCases[y].modelElements[z].modelName == utm_models[i].modelName){
- model_test_set.activityTestCases.push(pars.activityTestCases[y]);
- break;
- }
- }
- }
- list_model_test_sets[utm_models[i].modelName] = model_test_set;
- }
-
- list_model_test_sets[selected_model] = pars;
-
- if(pars.invalidModelException.invalidModelElementExceptions.length>0){
- for(var i=0;i<pars.invalidModelException.invalidModelElementExceptions.length;i++){
- errorMessage = errorMessage +"\n"+"["+(i+1)+"]." + " "+pars.invalidModelException.invalidModelElementExceptions[i].message+"\n";
- console.log("error Message:"+errorMessage);
- }
-
- var dlg = dialogs.notify('Failure',errorMessage);
-
- }else{
-
- $rootScope.modeltestset = pars;
-
- if(!$scope.fromTstMultipleFlag){
- $rootScope.isPalette = false;
- $rootScope.isTestset = true;
- $rootScope.isRequirementCoverage = false;
- document.getElementById("modeler_name").textContent="UTM Test Set";
- //document.getElementById('propertyExplorer').classList.add('visible');
- $('div').find('.k-collapse-next').click();
- //$( "#propertyExplorer" ).prev().css( "display", "none" );
- //$rootScope.$apply();
- document.getElementById("Review/Validate Test Set").classList.remove('ThisLink');
-
- document.getElementById("Export to Excel").classList.remove('ThisLink');
- /*document.getElementById("Export Test Set").classList.remove('ThisLink');*/
- document.getElementById("Test Case / Requirement Coverage").classList.remove('ThisLink');
- //$rootScope.$apply();
- }
- }
-
- },
- function(data) {
- console.log("data");
-
- });
-
-
- };
- $scope.reviewTestSet=function(){
-
- console.log("reviewTestSet");
- $rootScope.modeltestset = list_model_test_sets[selected_model];
-
- $rootScope.isPalette = false;
- $rootScope.isTestset = true;
- $rootScope.isRequirementCoverage = false;
- document.getElementById("modeler_name").textContent="UTM Test Set";
- //document.getElementById('propertyExplorer').classList.add('visible');
-
- //$( "#propertyExplorer" ).prev().css( "display", "none" );
- $('div').find('.k-collapse-next').click();
- console.log($rootScope.modeltestset);
- //$rootScope.$apply();
-
-
-
- };
- $scope.requirementCoverage=function(){
- console.log("requirementCoverage");
- $rootScope.testCaseRequirements=[];
- $rootScope.validTestRequirementArray=[];
- $rootScope.validTestRequirements={};
- $rootScope.modeltestset = list_model_test_sets[selected_model];
- var allPathDetails=[];
- $scope.currentSelectedModel = {};
- $scope.getPathDetails($rootScope.utmModels,selected_model);
- $scope.populatePathDetails(allPathDetails,$scope.currentSelectedModel);
- $rootScope.pathDetailsList = list_model_path_details[selected_model];
- /*for(var p=0;p<100;p++){
- $rootScope.testCaseRequirements.push("Requirement"+p);
- }
- for(var p=0;p<100;p++){
- $rootScope.testCaseValue.push("TestCase"+p);
- }*/
- for(var x=0;x<allPathDetails.length;x++){
- var tempPathDetails = allPathDetails[x];
- if(tempPathDetails != null){
- for (var i = 0; i < tempPathDetails.length; i++) {
- var pathDetails = tempPathDetails[i];
- if(pathDetails.requirement !=='' && pathDetails.requirement !== null ){
- $rootScope.testCaseRequirements.push(pathDetails.requirement);
- }
-
- /*for (var j = 0; j < pathDetails.decisionIdentifiers.length; j++) {
- if(pathDetails.decisionIdentifiers[j].requirement !== '' && pathDetails.decisionIdentifiers[j].requirement !== null){
- $rootScope.testCaseRequirements.push(pathDetails.decisionIdentifiers[j].requirement);
- }
- }*/
- }
- }
-
- }
- /*console.log("path details "+JSON.stringify($rootScope.pathDetailsList));
- console.log("modeltestset "+$rootScope.modeltestset);*/
- for(var p=0;p<$rootScope.modeltestset.activityTestCases.length;p++)
- {
- var activityTestCases = $rootScope.modeltestset.activityTestCases[p];
- if (activityTestCases.mappedRequirements !=null) {
- for (var i = 0; i < activityTestCases.mappedRequirements.length; i++) {
- //$rootScope.testCaseRequirements
- //.push(activityTestCases.mappedRequirements[i]);
- var testCaseNames = $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]];
- if(testCaseNames == null){
- testCaseNames = [];
+ function saveConfirmationNotificationPopUp() {
+ $scope
+ .saveConfirmationNotificationPopUp(function(
+ data) {
+ if (data) {
+ if ($rootScope.isNewClosed) {
+ isSaveCheck("Save CL");
+ } else {
+ isSaveCheck("Save Template");
+ }
+ $rootScope.isNewClosed = false;
+ $rootScope.isNew = false;
+ } else {
+ return false;
+ }
+ });
+ }
+
+ function isSaveCheck(name) {
+ if (name == "User Info") {
+ $scope.extraUserInfo();
+ } else if (name == "Wiki") {
+ window.open(value);
+ } else if (name == "Contact Us") {
+ $rootScope.contactUs();
+ } else if (name == "Log Out") {
+ $scope.logout();
+ } else if (name == "Revert Template Changes") {
+ $scope.cldsRevertTemplate();
+ } else if (name == "Revert Model Changes") {
+ $scope.cldsRevertModel();
+ } else if (name == "Create Template") {
+ $rootScope.isNew = true;
+ $scope.cldsCreateTemplate();
+ } else if (name == "Open Template") {
+ $scope.cldsOpenTemplate();
+ } else if (name == "Save Template") {
+ $scope
+ .cldsTemplatePerformAction("SAVE");
+ $rootScope.isNewClosed = false;
+ $rootScope.isNew = false;
+ } else if (name == "Template Properties") {
+ $scope.cldsOpenTemplateProperties();
+ } else if (name == "Close Model"
+ || name == "Close Template") {
+ $scope.cldsClose();
+ } else if (name == "Refresh ASDC") {
+ $scope.cldsRefreshASDC();
+ } else if (name == "Create CL") {
+ $rootScope.isNewClosed = true;
+ $scope.cldsCreateModel();
+ } else if (name == "Open CL") {
+ $scope.cldsOpenModel();
+ } else if (name == "Save CL") {
+ $rootScope.isNewClosed = false;
+ $rootScope.isNew = false;
+ $scope.cldsPerformAction("SAVE");
+ } else if (name == "Validation Test") {
+ $scope.cldsPerformAction("TEST");
+ } else if (name == "Submit") {
+ $scope
+ .cldsConfirmPerformAction("SUBMIT");
+ } else if (name == "Resubmit") {
+ $scope
+ .cldsConfirmPerformAction("RESUBMIT");
+ } else if (name == "Update") {
+ $scope
+ .cldsConfirmPerformAction("UPDATE");
+ } else if (name.toLowerCase() == "delete") {
+ $scope
+ .manageConfirmPerformAction("DELETE");
+ } else if (name == "Stop") {
+ $scope.cldsConfirmPerformAction("STOP");
+ } else if (name == "Restart") {
+ $scope
+ .cldsConfirmPerformAction("RESTART");
+ } else if (name == "Refresh Status") {
+ $scope.cldsPerformAction("REFRESH");
+ } else if (name == "Properties CL") {
+ $scope.cldsOpenModelProperties();
+ } else if (name == "Deploy") {
+ $scope
+ .cldsConfirmToggleDeployPerformAction("Deploy");
+ } else if (name == "UnDeploy") {
+ $scope
+ .cldsConfirmToggleDeployPerformAction("UnDeploy");
+ } else {
+ $rootScope.screenName = name;
+ $scope.updatebreadcrumb(value);
+ $location.path(value);
}
- if(activityTestCases.version !=null)
- var testCase= activityTestCases.testCaseName + "_" +activityTestCases.version;
- else
- var testCase= activityTestCases.testCaseName;
- testCaseNames.push(testCase);
- $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]]=testCaseNames;
}
+ };
+
+ $rootScope.impAlerts = function() {
+
+ };
+
+ $scope.tabs = {
+ "Template" : [ {
+ link : "/cldsCreateTemplate",
+ name : "Create Template"
+ }, {
+ link : "/cldsOpenTemplate",
+ name : "Open Template"
+ }, {
+ link : "/cldsSaveTemplate",
+ name : "Save Template"
+ }, {
+ link : "/cldsOpenTemplateProperties",
+ name : "Template Properties"
+ }, {
+ link : "/RevertChanges",
+ name : "Revert Template Changes"
+ }, {
+ link : "/Close",
+ name : "Close Template"
+ } ],
+
+ "Closed Loop" : [ {
+ link : "/cldsCreateModel",
+ name : "Create CL"
+ }, {
+ link : "/cldsOpenModel",
+ name : "Open CL"
+ }, {
+ link : "/cldsSaveModel",
+ name : "Save CL"
+ }, {
+ link : "/cldsOpenModelProperties",
+ name : "Properties CL"
+ }, {
+ link : "/RevertChanges",
+ name : "Revert Model Changes"
+ }, {
+ link : "/Close",
+ name : "Close Model"
+ } ],
+ "Manage" : [ {
+ link : "/cldsTestActivate",
+ name : "Validation Test"
+ }, {
+ link : "/cldsSubmit",
+ name : "Submit"
+ }, {
+ link : "/cldsResubmit",
+ name : "Resubmit"
+ }, {
+ link : "/cldsUpdate",
+ name : "Update"
+ }, {
+ link : "/cldsStop",
+ name : "Stop"
+ }, {
+ link : "/cldsRestart",
+ name : "Restart"
+ }, {
+ link : "/cldsDelete",
+ name : "Delete"
+ }, {
+ link : "/cldsDeploy",
+ name : "Deploy"
+ }, {
+ link : "/cldsUnDeploy",
+ name : "UnDeploy"
+ } ],
+ "View" : [ {
+ link : "/refreshStatus",
+ name : "Refresh Status"
+ }, {
+ link : "/refreshASDCProperties",
+ name : "Refresh ASDC"
+ } ],
+ "Help" : [ {
+ link : "http://wiki.onap.org",
+ name : "Wiki"
+ }, {
+ link : "/contact_us",
+ name : "Contact Us"
+ }, {
+ link : "/extraUserInfo",
+ name : "User Info"
+ } ],
+ "Log Out" : [ {
+ link : "/log_out.html",
+ name : "Log Out"
+ } ]
+ };
+
+ if (!Object.keys) {
+ Object.keys = function(obj) {
+ var keys = [];
+
+ for ( var i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ keys.push(i);
+ }
+ }
+
+ return keys;
+ };
+ $scope.keyList = Object.keys($scope.tabs);
+ } else {
+ $scope.keyList = Object.keys($scope.tabs);
+ }
+
+ $scope.updatebreadcrumb = function(path) {
+
+ var currentURL = $location.path();
+ if (path != undefined) {
+ currentURL = path;
+ }
+
+ if (currentURL == "/dashboard") {
+ $rootScope.screenName = "Universal Test Modeler";
+ $rootScope.parentMenu = "Home";
+ $rootScope.rightTabName = "UTM Build Configuration";
+ }
+ /*
+ * else if(currentURL=="/quicksearch") {
+ * $rootScope.screenName = "Quick Search";
+ * $rootScope.parentMenu = "Home"; }
+ */
+ else {
+ var found = false;
+
+ angular
+ .forEach(
+ $scope.keyList,
+ function(value, key) {
+
+ if (!found) {
+ $rootScope.parentMenu = value;
+
+ angular
+ .forEach(
+ $scope.tabs[value],
+ function(
+ value,
+ key) {
+
+ if (currentURL == value.link) {
+ $rootScope.screenName = value.name;
+ found = true;
+ }
+ });
+ }
+ });
+ }
+ };
+
+ $scope.updatebreadcrumb();
+
+ $scope.createNewProject = function() {
+
+ if ($rootScope.projectName != null) {
+ var dlg = dialogs
+ .confirm('Message',
+ 'Do you want to over-write the project ?');
+
+ dlg.result
+ .then(
+ function(btn) {
+
+ $scope.clearProject();
+ var dlg1 = dialogs
+ .create(
+ 'partials/portfolios/create_new_project.html',
+ 'CreateNewPrjCtrl',
+ {},
+ {
+ size : 'sm',
+ keyboard : true,
+ backdrop : false,
+ windowClass : 'my-class'
+ });
+ dlg1.result.then(
+ function(name) {
+
+ // $scope.name
+ // = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name
+ // = 'You
+ // did not
+ // enter in
+ // your
+ // name!';
+ });
+ }, function(btn) {
+
+ // $modalInstance.close("closed");
+ });
+
+ } else {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/create_new_project.html',
+ 'CreateNewPrjCtrl',
+ {},
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : false,
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+
+ }
+ };
+
+ $scope.clearProject = function() {
+
+ $rootScope.projectName = null;
+ $rootScope.revision = -1;
+ // $rootScope.models.length=0;
+ $rootScope.utmModels = $rootScope.$new(true);
+ $rootScope.serviceInfo = $rootScope.$new(true);
+ $rootScope.serviceInfo = null;
+ $rootScope.serviceInputPartInfo = $rootScope
+ .$new(true);
+ $rootScope.serviceOutputPartInfo = $rootScope
+ .$new(true);
+ $rootScope.servicefaultPartInfo = $rootScope
+ .$new(true);
+ $rootScope.isModel = false;
+ $("#paletteDiv").load(
+ './modeler/dist/index.html');
+ $rootScope.isPalette = false;
+ $rootScope.isTestset = false;
+ $rootScope.isRequirementCoverage = false;
+ $rootScope.ispropertyExplorer = false;
+ // $("#propertyDiv").load('./partials/portfolios/Property_Explorer.html');
+ $rootScope.modelName = "";
+ // document.getElementById('propertyExplorer').classList.remove('visible');
+ document.getElementById("modeler_name").textContent = "Activity Modeler";
+ // $( "#propertyExplorer" ).prev().css(
+ // "display", "block" );
+ $("#activity_modeler").prev().css("display",
+ "block");
+ $('div').find('.k-expand-next').click();
+
+ $rootScope.$apply();
+
+ };
+
+ $scope.homePage = function() {
+
+ $location.path('/dashboard');
+ };
+ $scope.propertyExplorerErrorMessage = function(msg) {
+
+ var dlg = dialogs.notify('Error', msg);
+ }
+
+ // $scope.fromTstMultipleFlag=false;
+ /* onclicking of review testset / generate testset */
+
+ $scope.reviewTestSet = function() {
+
+ $rootScope.modeltestset = list_model_test_sets[selected_model];
+
+ $rootScope.isPalette = false;
+ $rootScope.isTestset = true;
+ $rootScope.isRequirementCoverage = false;
+ document.getElementById("modeler_name").textContent = "UTM Test Set";
+ // document.getElementById('propertyExplorer').classList.add('visible');
+
+ // $( "#propertyExplorer" ).prev().css(
+ // "display", "none" );
+ $('div').find('.k-collapse-next').click();
+
+ // $rootScope.$apply();
+
+ };
+ $scope.requirementCoverage = function() {
+
+ $rootScope.testCaseRequirements = [];
+ $rootScope.validTestRequirementArray = [];
+ $rootScope.validTestRequirements = {};
+ $rootScope.modeltestset = list_model_test_sets[selected_model];
+ var allPathDetails = [];
+ $scope.currentSelectedModel = {};
+ // $scope.getPathDetails($rootScope.utmModels,selected_model);
+ // $scope.populatePathDetails(allPathDetails,$scope.currentSelectedModel);
+ $rootScope.pathDetailsList = list_model_path_details[selected_model];
+ /*
+ * for(var p=0;p<100;p++){
+ * $rootScope.testCaseRequirements.push("Requirement"+p); }
+ * for(var p=0;p<100;p++){
+ * $rootScope.testCaseValue.push("TestCase"+p); }
+ */
+ for (var x = 0; x < allPathDetails.length; x++) {
+ var tempPathDetails = allPathDetails[x];
+ if (tempPathDetails != null) {
+ for (var i = 0; i < tempPathDetails.length; i++) {
+ var pathDetails = tempPathDetails[i];
+ if (pathDetails.requirement !== ''
+ && pathDetails.requirement !== null) {
+ $rootScope.testCaseRequirements
+ .push(pathDetails.requirement);
+ }
+
+ /*
+ * for (var j = 0; j <
+ * pathDetails.decisionIdentifiers.length;
+ * j++) {
+ * if(pathDetails.decisionIdentifiers[j].requirement
+ * !== '' &&
+ * pathDetails.decisionIdentifiers[j].requirement
+ * !== null){
+ * $rootScope.testCaseRequirements.push(pathDetails.decisionIdentifiers[j].requirement); } }
+ */
+ }
+ }
+
+ }
+ for (var p = 0; p < $rootScope.modeltestset.activityTestCases.length; p++) {
+ var activityTestCases = $rootScope.modeltestset.activityTestCases[p];
+ if (activityTestCases.mappedRequirements != null) {
+ for (var i = 0; i < activityTestCases.mappedRequirements.length; i++) {
+ // $rootScope.testCaseRequirements
+ // .push(activityTestCases.mappedRequirements[i]);
+ var testCaseNames = $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]];
+ if (testCaseNames == null) {
+ testCaseNames = [];
+ }
+ if (activityTestCases.version != null)
+ var testCase = activityTestCases.testCaseName
+ + "_"
+ + activityTestCases.version;
+ else
+ var testCase = activityTestCases.testCaseName;
+ testCaseNames.push(testCase);
+ $rootScope.validTestRequirements[activityTestCases.mappedRequirements[i]] = testCaseNames;
+ }
+ }
+ }
+
+ $rootScope.isPalette = false;
+ $rootScope.isTestset = false;
+ $rootScope.isRequirementCoverage = true;
+ document.getElementById("modeler_name").textContent = "Test Case / Requirement Coverage";
+ // document.getElementById('propertyExplorer').classList.add('visible');
+ // console.log("modeltestset"+JSON.stringify($rootScope.modeltestset));
+ // $( "#propertyExplorer" ).prev().css(
+ // "display", "none" );
+ $('div').find('.k-collapse-next').click();
+ // $rootScope.$apply();
+
+ };
+
+ $scope.activityModelling = function() {
+
+ // window.open("./bpmn-js-examples-master/modeler/dist/index.html",
+ // "_self");
+ // $location.path('/activity_modelling');
+ };
+ /*
+ * $scope.openProject = function(){
+ * $location.path('/dashboard_upload'); };
+ */
+ $rootScope.cldsOpenTemplateProperties = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/global_template_properties.html',
+ 'CldsOpenTemplateCtrl', {}, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.modelName =modelName;
+ // $("#" +
+ // selected_model).addClass("selectedcolor");
+ // alert ("model name:"+$scope.modelName);
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+ }
+
+ $scope.cldsClose = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/confirmation_window.html',
+ 'CldsOpenTemplateCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+ };
+ $scope.cldsOpenTemplate = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/clds_open_template.html',
+ 'CldsOpenTemplateCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+ };
+ $scope.saveConfirmationNotificationPopUp = function(
+ callBack) {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/save_confirmation.html',
+ 'saveConfirmationModalPopUpCtrl',
+ {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+ callBack("OK");
+ }, function() {
+ callBack(null);
+ });
+
+ };
+ $scope.cldsCreateTemplate = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/clds_create_template.html',
+ 'CldsOpenTemplateCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+
+ };
+ $scope.cldsRefreshASDC = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/refresh_asdc.html',
+ 'CldsOpenModelCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
}
- }
-
-
-
-
-
-
- $rootScope.isPalette = false;
- $rootScope.isTestset = false;
- $rootScope.isRequirementCoverage = true;
- document.getElementById("modeler_name").textContent="Test Case / Requirement Coverage";
- //document.getElementById('propertyExplorer').classList.add('visible');
- console.log("modeltestset"+JSON.stringify($rootScope.modeltestset));
- //$( "#propertyExplorer" ).prev().css( "display", "none" );
- $('div').find('.k-collapse-next').click();
- //$rootScope.$apply();
-
-
-
- };
-
-
-
-
- $scope.activityModelling = function(){
- console.log(".activityModelling");
- //window.open("./bpmn-js-examples-master/modeler/dist/index.html", "_self");
- // $location.path('/activity_modelling');
- };
- /*$scope.openProject = function(){
- $location.path('/dashboard_upload');
- };*/
- $rootScope.cldsOpenTemplateProperties=function(){
- console.log("cldsOpenTemplateProperties");
- var dlg = dialogs.create('partials/portfolios/global_template_properties.html','CldsOpenTemplateCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.modelName =modelName;
- //$("#" + selected_model).addClass("selectedcolor");
- //alert ("model name:"+$scope.modelName);
- },function(){
- console.log("....emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
-
- $scope.cldsShowRunningInstances=function(){
- console.log("cldsShowRunningInstances");
- var localInstances;
- var modelName = selected_model;
- var dlg;
- cldsModelService.getRunningInstances(modelName).then(function(pars) {
- console.log("getRunningInstances");
- localInstances = pars;
- angular.forEach(localInstances.cldsModelInstanceList , function(element){
- console.log("cldsModelInstanceList");
- element.status = "Stopped";
- if ( localInstances.status == "ACTIVE" ) {
- element.status = "Running";
- }
- element.view = "";
- });
- runningInstances = localInstances.cldsModelInstanceList;
- dlg = dialogs.create('partials/portfolios/running_instances.html','CldsOpenModelCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.ressult");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- },
- function(data) {
- console.log("data");
- //alert("setModel failed: " + data);
- });
-
-
- };
-
- $scope.cldsClose = function(){
- console.log("cldsClose");
- var dlg = dialogs.create('partials/portfolios/confirmation_window.html','CldsOpenTemplateCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- };
- $scope.cldsOpenTemplate = function(){
- console.log("cldsOpenTemplate");
- var dlg = dialogs.create('partials/portfolios/clds_open_template.html','CldsOpenTemplateCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- };
- $scope.saveConfirmationNotificationPopUp = function(callBack) {
- console.log("saveConfirmationNotificationPopUp");
- var dlg = dialogs.create('partials/portfolios/save_confirmation.html', 'saveConfirmationModalPopUpCtrl', { closable: true, draggable: true }, { size: 'lg', keyboard: true, backdrop: 'static', windowClass: 'my-class' });
-
- dlg.result.then(function(name) {
- console.log("OK");
- console.log("MINA TEST OK BUTTON: " + callBack);
- callBack("OK");
- }, function() {
- console.log("CANCEL");
- callBack(null);
- });
-
- };
- $scope.cldsCreateTemplate=function(){
- console.log("cldsCreateTemplate");
- var dlg = dialogs.create('partials/portfolios/clds_create_template.html','CldsOpenTemplateCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- };
- $scope.cldsRefreshASDC=function(){
- console.log("cldsRefreshASDC");
- var dlg = dialogs.create('partials/portfolios/refresh_asdc.html','CldsOpenModelCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emtptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- $scope.cldsRevertModel=function(){
- console.log("cldsRevertModel");
- var dlg = dialogs.create('partials/portfolios/ConfirmRevertChanges.html','CldsOpenModelCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- };
-
- $scope.cldsRevertTemplate=function(){
- console.log("cldsRevertTemplate");
- var dlg = dialogs.create('partials/portfolios/ConfirmRevertChanges.html','CldsOpenTemplateCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("..emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- };
- $scope.cldsTemplatePerformAction = function(uiAction){
- console.log("cldsTemplatePerformAction");
- var modelName = selected_model;
- var controlNamePrefix = "ClosedLoop-";
- var bpmnText = modelXML;
- // serialize model properties
- var propText = JSON.stringify(elementMap);
-
- console.log("Generateing svg image");
- var svgXml = "";
- console.log(abootDiagram.saveSVG({format:true},function(err,xml){
-
- if(err)
- console.log("error")
- else
- console.log(xml)
- svgXml = xml;
- }));
- console.log("cldsTemplatePerformAction: " + uiAction + " modelName=" + modelName);
- console.log("cldsTemplatePerformAction: " + uiAction + " controlNamePrefix=" + controlNamePrefix);
- console.log("cldsTemplatePerformAction: " + uiAction + " bpmnText=" + bpmnText);
- console.log("cldsTemplatePerformAction: " + uiAction + " propText=" + propText);
- cldsTemplateService.processAction( uiAction, modelName, controlNamePrefix, bpmnText, propText,svgXml).then(function(pars) {
- console.log("processAction");
- console.log("cldsTemplatePerformAction: pars=" + pars);
- cldsTemplateService.processActionResponse(modelName, pars);
- },
- function(data) {
- console.log(".....emptyfunction");
- //alert("setModel failed: " + data);
- });
- };
-
-
-
- $rootScope.cldsOpenModelProperties=function(){
- console.log("cldsOpenModelProperties");
- var dlg = dialogs.create('partials/portfolios/global_properties.html','GlobalPropertiesCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.modelName =modelName;
- //$("#" + selected_model).addClass("selectedcolor");
- //alert ("model name:"+$scope.modelName);
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- $scope.cldsOpenModel = function(){
- console.log("cldsOpenModel");
- var dlg = dialogs.create('partials/portfolios/clds_open_model.html','CldsOpenModelCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- };
- $scope.cldsCreateModel=function(){
- console.log("cldsCreateModel");
- var dlg = dialogs.create('partials/portfolios/clds_create_model_off_Template.html','CldsOpenModelCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- };
- $scope.cldsPerformAction = function(uiAction){
- console.log("cldsPerformAction");
- var modelName = selected_model;
- var controlNamePrefix = "ClosedLoop-";
- var bpmnText = modelXML;
- // serialize model properties
- var propText = JSON.stringify(elementMap);
- var templateName=selected_template
- console.log("Generateing svg image");
- var svgXml = "";
- console.log(abootDiagram.saveSVG({format:true},function(err,xml){
- if(err)
- console.log("error")
- else
- console.log(xml)
- svgXml = xml;
- }));
- console.log("cldsPerformAction: " + uiAction + " modelName=" + modelName);
- console.log("cldsPerformAction: " + uiAction + " controlNamePrefix=" + controlNamePrefix);
- console.log("cldsPerformAction: " + uiAction + " bpmnText=" + bpmnText);
- console.log("cldsPerformAction: " + uiAction + " propText=" + propText);
- cldsModelService.processAction( uiAction, modelName, controlNamePrefix, bpmnText, propText,svgXml,templateName).then(function(pars) {
- console.log("cldsPerformAction: pars=" + pars);
- cldsModelService.processRefresh(pars);
- },
- function(data) {
- console.log("data");
- //alert("setModel failed: " + data);
- });
- };
-
- $scope.cldsConfirmPerformAction = function(uiAction){
-
- console.log("cldsConfirmPerformAction");
- var dlg = dialogs.confirm('Message', 'Do you want to ' + uiAction.toLowerCase() + ' the closed loop?');
- dlg.result.then(function (btn) {
- console.log("dlg.result");
- $scope.cldsPerformAction(uiAction);
- }, function (btn) {
- console.log("btn");
- //$modalInstance.close("closed");
- });
- };
-
- $scope.CollectorsWindow = function (collectorsWin) {
- console.log("CollectorsWindow");
-
- if (isTemplate){
- var dlg = dialogs.create('partials/portfolios/Template_model.html','ImportSchemaCtrl',collectorsWin,{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
-
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- else{
- var dlg = dialogs.create('partials/portfolios/Collector_properties.html','ImportSchemaCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
-
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- }
-
- };
- $scope.StringMatchWindow = function (stringMatch) {
- console.log("StringMatchWindow");
- if (isTemplate){
- var dlg = dialogs.create('partials/portfolios/Template_model.html','ImportSchemaCtrl',stringMatch,{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
-
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- else{
-
- var dlg = dialogs.create('partials/portfolios/stringMatch_properties.html','ImportSchemaCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- console.log("dlg.result");
- //$scope.name = name;
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- }
- };
-
- $scope.TCAWindow = function (tca) {
- if (isTemplate){
- var dlg = dialogs.create('partials/portfolios/Template_model.html','ImportSchemaCtrl',tca,{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- },function(){
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- else{
- var dlg = dialogs.create('partials/portfolios/tca_properties.html','ImportSchemaCtrl',{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
-
- dlg.result.then(function(name){
- //$scope.name = name;
- },function(){
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- };
-
- $scope.PolicyWindow=function (policy) {
- console.log("PolicyWindow");
- if (isTemplate){
- var dlg = dialogs.create('partials/portfolios/Template_model.html','ImportSchemaCtrl',policy,{closable:true,draggable:true},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
-
- },function(){
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
- }
- else {
- var dlg = dialogs.create('partials/portfolios/PolicyWindow_properties.html', 'ImportSchemaCtrl', {
- closable: true,
- draggable: true
- }, {size: 'lg', keyboard: true, backdrop: 'static', windowClass: 'my-class'});
-
- dlg.result.then(function (name) {
- console.log("dlg.result");
- //$scope.name = name;
- }, function () {
- console.log("...emptyfunction");
- //if(angular.equals($scope.name,''))
- //$scope.name = 'You did not enter in your name!';
- });
-
- }
- };
-
-
-
-
- $scope.populatePathDetails= function(allPathDetails,utmModels){
- console.log("populatePathDetails");
- if (utmModels != null && utmModels.name != null) {
- var pathDetails = {};
- pathDetails = list_model_path_details[utmModels.name];
- allPathDetails.push(pathDetails);
- if(utmModels.subModels != null && utmModels.subModels.length>0){
- for(var i=0 ; i<utmModels.subModels.length;i++) {
- var subModel = {};
- subModel = utmModels.subModels[i];
- $scope.populatePathDetails(allPathDetails,subModel);
- }
- }
-
- }
- };
-
- $scope.getPathDetails= function(utmModels,selectedModelName) {
- console.log("getPathDetails");
- if (utmModels != null && utmModels.name != null && utmModels.name===selectedModelName){
- $scope.currentSelectedModel = utmModels;
- }else if(utmModels.subModels != null && utmModels.subModels.length>0){
- for(var i=0 ; i<utmModels.subModels.length;i++) {
- var subModel = {};
- subModel = utmModels.subModels[i];
- $scope.getPathDetails(subModel,selectedModelName);
- }
- }
-
- };
-
-
-
-}]);
-
-app.service('MenuService', ['$http', '$q', function ($http, $q) {
- console.log("MenuService");
- this.generateMDTTestSet = function(utmMDTRequest, generateTestSetMDTURL){
-
- console.log("generateMDTTestSet");
- //alert("In generateMDTTestSet :: " + JSON.stringify(utmMDTRequest));
- var def = $q.defer();
- var sets = [];
-
- $http.post(generateTestSetMDTURL, utmMDTRequest)
- .success(function(data){
- console.log("success");
- sets = data;
- def.resolve(data);
-
- })
- .error(function(data){
- console.log("error");
- def.reject("GenerateMDTTestSet not successful");
- });
-
- return def.promise;
- };
-}]);
-
-app.directive('focus',
- function($timeout) {
- console.log("focus");
+ $scope.cldsRevertModel = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/ConfirmRevertChanges.html',
+ 'CldsOpenModelCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+
+ };
+
+ $scope.cldsRevertTemplate = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/ConfirmRevertChanges.html',
+ 'CldsOpenTemplateCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+
+ };
+ $scope.cldsTemplatePerformAction = function(
+ uiAction) {
+
+ var modelName = selected_model;
+ var controlNamePrefix = "ClosedLoop-";
+ var bpmnText = modelXML;
+ // serialize model properties
+ var propText = JSON.stringify(elementMap);
+
+ var svgXml = "";
+ console.log(abootDiagram.saveSVG({
+ format : true
+ }, function(err, xml) {
+
+ if (err)
+ console.log("error")
+ else
+ console.log(xml)
+ svgXml = xml;
+ }));
+ console.log("cldsTemplatePerformAction: "
+ + uiAction + " modelName=" + modelName);
+ console.log("cldsTemplatePerformAction: "
+ + uiAction + " controlNamePrefix="
+ + controlNamePrefix);
+ console.log("cldsTemplatePerformAction: "
+ + uiAction + " bpmnText=" + bpmnText);
+ console.log("cldsTemplatePerformAction: "
+ + uiAction + " propText=" + propText);
+ cldsTemplateService
+ .processAction(uiAction, modelName,
+ controlNamePrefix, bpmnText,
+ propText, svgXml)
+ .then(
+ function(pars) {
+ console
+ .log("processAction");
+ console
+ .log("cldsTemplatePerformAction: pars="
+ + pars);
+ cldsTemplateService
+ .processActionResponse(
+ modelName,
+ pars);
+ }, function(data) {
+
+ // alert("setModel failed: "
+ // + data);
+ });
+ };
+
+ $rootScope.cldsOpenModelProperties = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/global_properties.html',
+ 'GlobalPropertiesCtrl', {}, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+ }, function() {
+ });
+ };
+
+ $scope.cldsOpenModel = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/clds_open_model.html',
+ 'CldsOpenModelCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+ };
+ $scope.cldsCreateModel = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/clds_create_model_off_Template.html',
+ 'CldsOpenModelCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in your
+ // name!';
+ });
+
+ };
+ $scope.extraUserInfo = function() {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/extra_user_info.html',
+ 'ExtraUserInfoCtrl', {
+ closable : true,
+ draggable : true
+ }, {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+ }, function() {
+ });
+
+ };
+ $scope.cldsPerformAction = function(uiAction) {
+
+ var modelName = selected_model;
+ var controlNamePrefix = "ClosedLoop-";
+ var bpmnText = modelXML;
+ // serialize model properties
+ var propText = JSON.stringify(elementMap);
+ var templateName = selected_template
+
+ var svgXml = "";
+ console.log(abootDiagram.saveSVG({
+ format : true
+ }, function(err, xml) {
+ if (err)
+ console.log("error")
+ else
+ console.log(xml)
+ svgXml = xml;
+ }));
+ console.log("cldsPerformAction: " + uiAction
+ + " modelName=" + modelName);
+ console.log("cldsPerformAction: " + uiAction
+ + " controlNamePrefix="
+ + controlNamePrefix);
+ console.log("cldsPerformAction: " + uiAction
+ + " bpmnText=" + bpmnText);
+ console.log("cldsPerformAction: " + uiAction
+ + " propText=" + propText);
+ console.log("cldsPerformAction: " + uiAction
+ + " typeID=" + typeID);
+ console.log("cldsPerformAction: " + uiAction
+ + " deploymentId=" + deploymentId);
+ cldsModelService
+ .processAction(uiAction, modelName,
+ controlNamePrefix, bpmnText,
+ propText, svgXml, templateName,
+ typeID, deploymentId)
+ .then(
+ function(pars) {
+ console
+ .log("cldsPerformAction: pars="
+ + pars);
+ cldsModelService
+ .processRefresh(pars);
+ }, function(data) {
+
+ // alert("setModel failed: "
+ // + data);
+ });
+ };
+
+ $scope.cldsConfirmPerformAction = function(uiAction) {
+ var dlg = dialogs.confirm('Message',
+ 'Do you want to '
+ + uiAction.toLowerCase()
+ + ' the closed loop?');
+ dlg.result.then(function(btn) {
+
+ $scope.cldsPerformAction(uiAction);
+ }, function(btn) {
+
+ // $modalInstance.close("closed");
+ });
+ };
+
+ $scope.cldsConfirmToggleDeployPerformAction = function(
+ uiAction) {
+
+ var dlg = dialogs.confirm('Message',
+ 'Do you want to '
+ + uiAction.toLowerCase()
+ + ' the closed loop?');
+ dlg.result.then(function(btn) {
+ cldsToggleDeploy(uiAction.toLowerCase());
+ }, function(btn) {
+
+ // $modalInstance.close("closed");
+ });
+ };
+ function cldsToggleDeploy(uiAction) {
+ var modelName = selected_model;
+ var controlNamePrefix = "ClosedLoop-";
+ var bpmnText = modelXML;
+ // serialize model properties
+ var propText = JSON.stringify(elementMap);
+ var templateName = selected_template;
+ var svgXml = "";
+
+ console.log(abootDiagram.saveSVG({
+ format : true
+ }, function(err, xml) {
+ if (err)
+ console.log("error")
+ else
+ console.log(xml)
+ svgXml = xml;
+ }));
+ console.log("cldsPerformAction: " + uiAction
+ + " modelName=" + modelName);
+ console.log("cldsPerformAction: " + uiAction
+ + " controlNamePrefix="
+ + controlNamePrefix);
+ console.log("cldsPerformAction: " + uiAction
+ + " bpmnText=" + bpmnText);
+ console.log("cldsPerformAction: " + uiAction
+ + " propText=" + propText);
+ console.log("cldsPerformAction: " + uiAction
+ + " modelEventService="
+ + modelEventService);
+ console.log("cldsPerformAction: " + uiAction
+ + " typeID=" + typeID);
+ console.log("cldsPerformAction: " + uiAction
+ + " deploymentId=" + deploymentId);
+ cldsModelService
+ .toggleDeploy(uiAction, modelName,
+ controlNamePrefix, bpmnText,
+ propText, svgXml, templateName,
+ typeID, controlNameUuid,
+ modelEventService, deploymentId)
+ .then(
+ function(pars) {
+ typeID = pars.typeId;
+ controlNameUuid = pars.controlNameUuid;
+ selected_template = pars.templateName;
+ modelEventService = pars.event;
+ // actionCd =
+ // pars.event.actionCd;
+ actionStateCd = pars.event.actionStateCd;
+ deploymentId = pars.deploymentId;
+ cldsModelService
+ .processActionResponse(
+ modelName,
+ pars);
+
+ }, function(data) {
+
+ });
+ }
+ $scope.managePerformAction = function(action) {
+ if (action.toLowerCase() === "delete") {
+ cldsModelService
+ .manageAction(
+ selected_model,
+ "805b9f83-261f-48d9-98c7-8011fc2cc8e8",
+ "ClosedLoop-ABCD-0000.yml")
+ .then(function(pars) {
+
+ }, function(data) {
+
+ // alert("setModel failed: " +
+ // data);
+ });
+ }
+ };
+ $scope.manageConfirmPerformAction = function(
+ uiAction) {
+
+ var dlg = dialogs.confirm('Message',
+ 'Do you want to '
+ + uiAction.toLowerCase()
+ + ' the closed loop?');
+ dlg.result.then(function(btn) {
+
+ $scope.managePerformAction(uiAction);
+ }, function(btn) {
+
+ // $modalInstance.close("closed");
+ });
+ };
+ $scope.CollectorsWindow = function(collectorsWin) {
+
+ if (isTemplate) {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/Template_model.html',
+ 'ImportSchemaCtrl',
+ collectorsWin,
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+ } else {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/Collector_properties.html',
+ 'ImportSchemaCtrl',
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+
+ }
+
+ };
+ $scope.StringMatchWindow = function(stringMatch) {
+
+ if (isTemplate) {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/Template_model.html',
+ 'ImportSchemaCtrl',
+ stringMatch,
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+ } else {
+
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/stringMatch_properties.html',
+ 'ImportSchemaCtrl',
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+
+ }
+ };
+
+ $scope.TCAWindow = function(tca) {
+ if (isTemplate) {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/Template_model.html',
+ 'ImportSchemaCtrl',
+ tca,
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+ }, function() {
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+ } else {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/tca_properties.html',
+ 'ImportSchemaCtrl',
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+ // $scope.name = name;
+ }, function() {
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+ }
+ };
+
+ $scope.PolicyWindow = function(policy) {
+
+ if (isTemplate) {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/Template_model.html',
+ 'ImportSchemaCtrl',
+ policy,
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+ dlg.result.then(function(name) {
+
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+ } else {
+ var dlg = dialogs
+ .create(
+ 'partials/portfolios/PolicyWindow_properties.html',
+ 'ImportSchemaCtrl',
+ {
+ closable : true,
+ draggable : true
+ },
+ {
+ size : 'lg',
+ keyboard : true,
+ backdrop : 'static',
+ windowClass : 'my-class'
+ });
+
+ dlg.result.then(function(name) {
+
+ // $scope.name = name;
+ }, function() {
+
+ // if(angular.equals($scope.name,''))
+ // $scope.name = 'You did not enter in
+ // your name!';
+ });
+
+ }
+ };
+
+ } ]);
+
+app.service('MenuService', [ '$http', '$q', function($http, $q) {
+
+ /*
+ * this.generateMDTTestSet = function(utmMDTRequest, generateTestSetMDTURL){
+ *
+ * console.log("generateMDTTestSet"); //alert("In generateMDTTestSet :: " +
+ * JSON.stringify(utmMDTRequest)); var def = $q.defer(); var sets = [];
+ *
+ * $http.post(generateTestSetMDTURL, utmMDTRequest) .success(function(data){
+ * console.log("success"); sets = data; def.resolve(data); })
+ * .error(function(data){ console.log("error");
+ * def.reject("GenerateMDTTestSet not successful"); });
+ *
+ * return def.promise; };
+ */
+} ]);
+
+app.directive('focus', function($timeout) {
+
return {
scope : {
trigger : '@focus'
},
link : function(scope, element) {
scope.$watch('trigger', function(value) {
- console.log("trigger");
+
if (value === "true") {
$timeout(function() {
- console.log("timeout");
+
element[0].focus();
});
}
});
}
};
-}
-);
-app.directive('draggable', function($document) {
- console.log("draggable");
- return function(scope, element, attr) {
- console.log("return");
- var startX = 0, startY = 0, x = 0, y = 0;
- element.css({
- position: 'relative',
-
- backgroundColor: 'white',
- cursor: 'move',
- display: 'block',
-
- });
- element.on('mousedown', function(event) {
- console.log("mousedown");
- // Prevent default dragging of selected content
- //event.preventDefault();
- startX = event.screenX - x;
- startY = event.screenY - y;
- $document.on('mousemove', mousemove);
- $document.on('mouseup', mouseup);
- });
-
- function mousemove(event) {
- console.log("mousemove");
- y = event.screenY - startY;
- x = event.screenX - startX;
- element.css({
- top: y + 'px',
- left: x + 'px'
- });
- }
-
- function mouseup() {
- console.log("mouseup");
- $document.off('mousemove', mousemove);
- $document.off('mouseup', mouseup);
- }
- };
});
+app.directive('draggable', function($document) {
-app.factory('myHttpInterceptor', function ($q, $window)
-{
- console.log("myHttpInterceptor");
- return function (promise)
- {
- console.log("promise");
- return promise.then(function (response)
- {
- console.log("response");
- return response;
- },
- function (response)
- {
- console.log("response");
- return $q.reject(response);
- });
- };
+ return function(scope, element, attr) {
+
+ var startX = 0, startY = 0, x = 0, y = 0;
+ element.css({
+ position : 'relative',
+
+ backgroundColor : 'white',
+ cursor : 'move',
+ display : 'block',
+
+ });
+ element.on('mousedown', function(event) {
+
+ // Prevent default dragging of selected content
+ // event.preventDefault();
+ startX = event.screenX - x;
+ startY = event.screenY - y;
+ $document.on('mousemove', mousemove);
+ $document.on('mouseup', mouseup);
+ });
+
+ function mousemove(event) {
+
+ y = event.screenY - startY;
+ x = event.screenX - startX;
+ element.css({
+ top : y + 'px',
+ left : x + 'px'
+ });
+ }
+
+ function mouseup() {
+
+ $document.off('mousemove', mousemove);
+ $document.off('mouseup', mouseup);
+ }
+ };
});
+app.factory('myHttpInterceptor', function($q, $window) {
+
+ return function(promise) {
+
+ return promise.then(function(response) {
+
+ return response;
+ }, function(response) {
+
+ return $q.reject(response);
+ });
+ };
+});
+app.run([ '$route', function($route) {
-app.run(['$route', function($route) {
- console.log("route");
- $route.reload();
-}]);
+ $route.reload();
+} ]);
function TestCtrl($scope) {
- console.log("TestCtrl");
- $scope.msg = "Hello from a controller method.";
- $scope.returnHello = function() {
- console.log("returnHello");
- return $scope.msg ;
- }
+
+ $scope.msg = "Hello from a controller method.";
+ $scope.returnHello = function() {
+
+ return $scope.msg;
+ }
}
-function importshema()
-{
- console.log("importshema");
+function importshema() {
angular.element(document.getElementById('navbar')).scope().importSchema();
-
+
}
function CollectorsWindow(collectorsWin) {
- console.log("CollectorsWindow");
- angular.element(document.getElementById('navbar')).scope().CollectorsWindow(collectorsWin);
+ angular.element(document.getElementById('navbar')).scope()
+ .CollectorsWindow(collectorsWin);
}
function F5Window() {
- console.log("F5Window");
- angular.element(document.getElementById('navbar')).scope().F5Window();
+ angular.element(document.getElementById('navbar')).scope().F5Window();
}
function StringMatchWindow(stringMatch) {
- console.log("StringMatchWindow");
- angular.element(document.getElementById('navbar')).scope().StringMatchWindow(stringMatch);
+ angular.element(document.getElementById('navbar')).scope()
+ .StringMatchWindow(stringMatch);
}
function TCAWindow(tca) {
- angular.element(document.getElementById('navbar')).scope().TCAWindow(tca);
+ angular.element(document.getElementById('navbar')).scope().TCAWindow(tca);
}
function GOCWindow() {
- console.log("GOCWindow");
- angular.element(document.getElementById('navbar')).scope().GOCWindow();
+ angular.element(document.getElementById('navbar')).scope().GOCWindow();
}
function PolicyWindow(PolicyWin) {
- console.log("PolicyWin");
- angular.element(document.getElementById('navbar')).scope().PolicyWindow(PolicyWin);
-}
+ angular.element(document.getElementById('navbar')).scope().PolicyWindow(
+ PolicyWin);
+}
+function pathDetails(bpmnElementID, bpmnElementName, pathIdentifiers) {
-function pathDetails(bpmnElementID,bpmnElementName,pathIdentifiers)
-{
- console.log("pathDetails");
+ angular.element(document.getElementById('navbar')).scope().pathDetails(
+ bpmnElementID, bpmnElementName, pathIdentifiers);
- angular.element(document.getElementById('navbar')).scope().pathDetails(bpmnElementID,bpmnElementName,pathIdentifiers);
-
}
-function setdefaultvalue()
-{
- console.log("setDefaultValue");
+function setdefaultvalue() {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .setDefaultValue();
- angular.element(document.getElementById('navbar')).scope().setDefaultValue();
-
}
-function upgradeSchemaVersion()
-{
- console.log("upgradeSchemaVersion");
+function upgradeSchemaVersion() {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .upgradeSchemaVersion();
- angular.element(document.getElementById('navbar')).scope().upgradeSchemaVersion();
-
}
-function saveProject()
-{
- console.log("saveProject");
+function saveProject() {
angular.element(document.getElementById('navbar')).scope().saveProject();
-
+
}
-function modifySchema()
-{
- console.log("modifySchema");
+function modifySchema() {
angular.element(document.getElementById('navbar')).scope().modifySchema();
-
+
}
-function definePID()
-{
- console.log("definePID");
+function definePID() {
angular.element(document.getElementById('navbar')).scope().definePID();
-
+
}
-function defineServiceAcronym()
-{
- console.log("defineServiceAcronym");
+function defineServiceAcronym() {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .defineServiceAcronym();
- angular.element(document.getElementById('navbar')).scope().defineServiceAcronym();
-
}
-function errorProperty(msg)
-{
- console.log("errorProperty");
- angular.element(document.getElementById('navbar')).scope().propertyExplorerErrorMessage(msg);
+function errorProperty(msg) {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .propertyExplorerErrorMessage(msg);
}
-function invisiblepropertyExplorer()
-{
- console.log("invisiblepropertyExplorer");
-
- angular.element(document.getElementById('navbar')).scope().invisibleproperty();
+function invisiblepropertyExplorer() {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .invisibleproperty();
}
-function updateDecisionLabel(originalLabel, newLabel)
-{
- console.log("updateDecisionLabel");
- angular.element(document.getElementById('navbar')).scope().updateDecisionLabels(originalLabel, newLabel);
+function updateDecisionLabel(originalLabel, newLabel) {
+
+ angular.element(document.getElementById('navbar')).scope()
+ .updateDecisionLabels(originalLabel, newLabel);
}
+
+// Used to logout the session , when browser window was closed
+window.onunload = function() {
+ window.localStorage.removeItem("isAuth");
+ window.localStorage.removeItem("loginuser");
+};
diff --git a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
index fe3a7fd80..2c1ec1709 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/authcontroller.js
@@ -23,23 +23,57 @@
'use strict';
-
-function AuthenticateCtrl($scope,$rootScope, $resource, $http, $location,$cookies)
+function AuthenticateCtrl($scope,$rootScope,$window,$resource,$http,$location,$cookies,md5)
{
console.log("//////////AuthenticateCtrl");
$scope.getInclude = function()
{
- console.log("getInclude");
- return "utmdashboard.html";
+ console.log("getInclude011111111");
+ var invalidUser=$window.localStorage.getItem("isInvalidUser");
+ var isAuth=$window.localStorage.getItem("isAuth");
+
+ if(invalidUser != null && invalidUser == 'true')
+ {
+ console.log("Authentication failed");
+ $window.localStorage.removeItem("isInvalidUser");
+ window.location.href = "/designer/invalid_login.html";
+ }
+ else if(isAuth == null || isAuth == 'false')
+ {
+ return "authenticate.html";
+ }
+ // Reassign the login user info, to be used in menu.html
+ $rootScope.loginuser = $window.localStorage.getItem("loginuser");
+ return "utmdashboard.html";
};
-
- $scope.authenticate = function()
- {
- console.log("authenticate");
- $rootScope.isAuth = true;
- $rootScope.loginuser = "somebody";
- $rootScope.loginemailid = "somebody@somewhere.com";
- $rootScope.attuid = "m12349";
+ $scope.authenticate = function()
+ {
+ var username = $scope.username;
+ var pass =$scope.password;
+ if (!username || !pass) {
+ console.log("Invalid username/password");
+ $window.localStorage.setItem("isInvalidUser", true);
+ return;
+ }
+ var hashpass = md5.createHash(pass);
+ var headers = username ? {authorization : "Basic "
+ + btoa(username + ":" + hashpass)
+ } : {};
+ // send request to a test API with the username/password to verify the authorization
+ $http.get('/restservices/clds/v1/user/testUser', {headers : headers}).success(function(data) {
+ if (data) {
+ $window.localStorage.setItem("isAuth", true);
+ $window.localStorage.setItem("loginuser", $scope.username);
+ $rootScope.loginuser = $scope.username;
+ } else {
+ $window.localStorage.removeItem("isInvalidUser", true);
+ }
+ callback && callback();
+ }).error(function() {
+ $window.localStorage.removeItem("isInvalidUser", true);
+ callback && callback();
+ });
};
+
}
diff --git a/src/main/resources/META-INF/resources/designer/scripts/common_variables.js b/src/main/resources/META-INF/resources/designer/scripts/common_variables.js
index ad0e414a4..b0c7d9e50 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/common_variables.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/common_variables.js
@@ -51,4 +51,8 @@ var isTemplate=null;
var vf_Services=null;
var asdc_Services=null;
var readOnly=false;//for when the user select read only on clamp app
+var readMOnly=false;
+var readTOnly=false;
var runningInstances={}
+var typeID = '';
+var deploymentId = ''; \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js b/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js
index cf7353018..cf9510ace 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/importSchemaService.js
@@ -20,7 +20,6 @@
* ===================================================================
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-
app.service('svnservice', ['$http', '$q', function ($http, $q) {
console.log("//////svnservice");
this.SVNToUrl = function(schemaLocation, userID, password,svnURL,svnUploadURL){
@@ -47,4 +46,4 @@ app.service('svnservice', ['$http', '$q', function ($http, $q) {
return def.promise;
};
-}]);
+}]); \ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyExplorerCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/propertyExplorerCtrl.js
index 59ee1a3a6..a63cd5420 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/propertyExplorerCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/propertyExplorerCtrl.js
@@ -20,7 +20,6 @@
* ===================================================================
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
-
app.directive('opentext', function ($compile, dialogs, $rootScope){
console.log("//////////opentext");
return {
@@ -410,74 +409,7 @@ app.controller('propertyExplorerCtrl',['$scope','$rootScope','$location','$modal
Datafactory.setDbDataList(dbToolRequestList);
}
};
-
- /*$scope.openDbToolPath = function(pathDtls) {
- console.log("openDbToolPath");
- $scope.pathDetails=pathDtls;
- $scope.sendDbData($scope.pathDetails.dbToolRequestList);
-
- var dlg = dialogs.create('partials/SOA/dbTool_property_explorer.html','dbTool_property_explorer',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.pathDetails.dbToolRequestList=Datafactory.getDbDataList();
-
- var resetDbRequestList=[];
- Datafactory.setDbDataList(resetDbRequestList);
- //Datafactory.setDbDataFlag("");
-
- },function(){
-
- });
- };
-
- $scope.openDbToolDecision = function(DecisionDtls) {
- console.log("openDbToolDecision");
- $scope.decisionIdentifier=DecisionDtls;
- $scope.sendDbData($scope.decisionIdentifier.dbToolRequestList);
-
- var dlg = dialogs.create('partials/SOA/dbTool_property_explorer.html','dbTool_property_explorer',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.decisionIdentifier.dbToolRequestList=Datafactory.getDbDataList();
-
- var resetDbRequestList=[];
- Datafactory.setDbDataList(resetDbRequestList);
- },function(){
-
- });
- };*/
- //soap_client_option.html
- /*$scope.openXMLAsserterPath = function(pathDtls){
- $scope.pathDetails=pathDtls;
- $scope.sendAssertData($scope.pathDetails.xmlAsserter);
-
- var dlg = dialogs.create('partials/SOA/XML_Assertor.html','xmlAssertorCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- $scope.pathDetails.xmlAsserter = Datafactory.getXmlAsserter();
- var resetXmlAsserter ={};
- Datafactory.setXmlAsserter(resetXmlAsserter);
- },function(){
-
- });
- };*/
-
- /*$scope.openXMLAsserterDecision = function(DecisionDtls){
- console.log("openXMLAsserterDecision");
- $scope.decisionIdentifier=DecisionDtls;
- $scope.sendAssertData($scope.decisionIdentifier.xmlAsserter);
-
- var dlg = dialogs.create('partials/SOA/XML_Assertor.html','xmlAssertorCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.decisionIdentifier.xmlAsserter = Datafactory.getXmlAsserter();
- var resetXmlAsserter ={};
- Datafactory.setXmlAsserter(resetXmlAsserter);
-
- },function(){
-
- });
- };*/
-
+
$scope.sendAssertData = function(xmlAsserterRequest){
console.log("sendAssertData");
if(xmlAsserterRequest!=null){
@@ -488,9 +420,8 @@ app.controller('propertyExplorerCtrl',['$scope','$rootScope','$location','$modal
Datafactory.setXmlAsserter(xmlAsserterRequest);
}
- };
-
-
+ };
+
$scope.sendRuntimePythonScriptData = function(pathDtls){
console.log("sendRuntimePythonScriptData");
if(pathDtls!=null){
@@ -502,124 +433,4 @@ app.controller('propertyExplorerCtrl',['$scope','$rootScope','$location','$modal
}
};
-
- /*$scope.openRuntimePythonScriptDecision = function(decisionIdentifier) {
- console.log("openRuntimePythonScriptDecision");
- $scope.decisionIdentifier=decisionIdentifier;
- $scope.sendRuntimePythonScriptData($scope.decisionIdentifier.runtimePythonScriptList);
-
- var dlg = dialogs.create('partials/SOA/runtime_python_script.html','runtimePythonScriptCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- $scope.decisionIdentifier.runtimePythonScriptList = Datafactory.getRuntimePythonScriptList();
- var resetRuntimePythonScript =[];
- Datafactory.setRuntimePythonScriptList(resetRuntimePythonScript);
-
- },function(){
-
- });
- };*/
-
-
- /*$scope.openRuntimePythonScript = function(pathDtls) {
- console.log("openRuntimePythonScript");
- $scope.pathDetails=pathDtls;
- $scope.sendRuntimePythonScriptData($scope.pathDetails.runtimePythonScriptList);
-
- var dlg = dialogs.create('partials/SOA/runtime_python_script.html','runtimePythonScriptCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.pathDetails.runtimePythonScriptList = Datafactory.getRuntimePythonScriptList();
- var resetRuntimePythonScript =[];
- Datafactory.setRuntimePythonScriptList(resetRuntimePythonScript);
-
- },function(){
-
- });
- };
-
- $scope.getAsserter = function(){
- console.log("getAsserter");
- var dlg = dialogs.create('partials/SOA/XML_Assertor.html','xmlAssertorCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
-
- },function(){
-
- });
-
- };
-
- $scope.openXMLValidatorDecision = function(DecisionDtls){
- console.log("open xmlValidatorRequest");
- $scope.decisionIdentifier=DecisionDtls;
- $scope.sendValidatorData($scope.decisionIdentifier.xmlValidators);
-
- var dlg = dialogs.create('partials/SOA/xml_validator_decision.html','xmlValidatorDecisionLevelCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- $scope.decisionIdentifier.xmlValidators = Datafactory.getXmlValidatorDecisionLevel();
- var resetXmlValidators =[];
- Datafactory.setXmlValidatorDecisionLevel(resetXmlValidators);
-
- },function(){
-
- });
- };
-
- $scope.sendValidatorData = function(xmlValidatorRequest){
- console.log("sendValidatorData");
- if(xmlValidatorRequest!=null){
- Datafactory.setXmlValidatorDecisionLevel(xmlValidatorRequest);
- }
- else{
- xmlValidatorRequest=[];
- Datafactory.setXmlValidatorDecisionLevel(xmlValidatorRequest);
- }
-
- };
-
- $scope.sendDbSoapClientOption = function(soapClientOption){
- console.log("sendDbSoapClientOption");
- if(soapClientOption!=null){
- Datafactory.setSoapClientOption(soapClientOption);
- }
- else{
- soapClientOption={};
- Datafactory.setSoapClientOption(soapClientOption);
- }
- };
-
- $scope.openSoapClientOptionPath = function(pathDetails){
- console.log("openSoapClientOptionPath");
- $scope.pathDetails=pathDetails;
- $scope.sendDbSoapClientOption($scope.pathDetails.soapClientOption);
-
- var dlg = dialogs.create('partials/SOA/soap_client_option.html','soapClientOptionsCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.pathDetails.modelPreferenceInfo = Datafactory.getSoapClientOption();
- var resetSoapClientOption ={};
- Datafactory.setSoapClientOption(resetSoapClientOption);
-
- },function(){
-
- });
- };
-
- $scope.openSoapClientOptionDecision = function(decisionIdentifier){
- console.log("openSoapClientOptionDecision");
- $scope.decisionIdentifier=decisionIdentifier;
- $scope.sendDbSoapClientOption($scope.decisionIdentifier.soapClientOption);
-
- var dlg = dialogs.create('partials/SOA/soap_client_option.html','soapClientOptionsCtrl',{},{size:'lg',keyboard: true,backdrop: 'static',windowClass: 'my-class'});
- dlg.result.then(function(name){
- console.log("dlg.result");
- $scope.decisionIdentifier.modelPreferenceInfo=Datafactory.getSoapClientOption();
-
- var resetSoapClientOption=[];
- Datafactory.setSoapClientOption(resetSoapClientOption);
- },function(){
-
- });
- };*/
-
}]);
-