2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 function AutosaveProject($scope,$rootScope,$resource, $http, $timeout, $location, $interval, $q, Datafactory)
26 console.log("//////////Autosaveproject");
27 $scope.saveProjectToUrl = function(UTMMDTProject,svnUploadURL){
28 console.log("saveProjectURL");
29 console.log('Autosaveproject Enter == ' + new Date().getTime());
30 console.log(new Date());
33 $http.post(svnUploadURL, UTMMDTProject)
34 .success(function(data){
35 console.log("success");
38 .error(function(data){
40 def.reject("Autosave unsuccessful");
47 $scope.autosave = function(){
48 console.log("autosave");
50 var saveProjectURL = "/utm-service/project_administration/autoSaveProject";
52 var UTMProjectExplorer = {};
53 UTMProjectExplorer.projectName = $rootScope.projectName;
54 UTMProjectExplorer.utmModels = $rootScope.utmModels;
55 UTMProjectExplorer.revision = autoSaveRevision;
56 UTMProjectExplorer.utmDepthValueMap = $rootScope.depthElementKeyMap;
57 UTMProjectExplorer.utmCountValueMap = $rootScope.countElementKeyMap;
60 $rootScope.populateUTMModelArray(utm_models,$rootScope.utmModels);
62 var UTMMDTProject = {};
63 UTMMDTProject.utmProjectExplorer = UTMProjectExplorer;
64 UTMMDTProject.utmModels = utm_models;
65 UTMMDTProject.almqcdata = $rootScope.almqcData;
66 UTMMDTProject.wsdlInfo = null;
67 UTMMDTProject.schemaLocation = null;
69 if ($rootScope.wsdlInfo != null) {
70 UTMMDTProject.schemaLocation = $rootScope.wsdlInfo.schemaLocation;
71 UTMMDTProject.oldSchemaLocation = $rootScope.wsdlInfo.oldSchemaLocation;
72 UTMMDTProject.schemaUpgradedFlag = $rootScope.wsdlInfo.schemaUpgradedFlag;
75 UTMMDTProject.revision=$rootScope.revision;
76 console.log(UTMMDTProject.revision);
78 UTMMDTProject.checkOutPath=$rootScope.checkOutPath;
79 UTMMDTProject.oldNewModelNameMap = old_new_model_name;
80 UTMMDTProject.automationDetails={};
82 UTMMDTProject.automationDetails.projectPreferenceInfo = Datafactory.getProjectPreferenceInfo();
83 UTMMDTProject.automationDetails.environmentData = $rootScope.environmentData;
84 UTMMDTProject.automationDetails.pythonScriptList = Datafactory.getCommonPythonScriptList();
85 UTMMDTProject.automationDetails.dbToolRequestList = Datafactory.getDbToolProjectLevelList();
86 UTMMDTProject.automationDetails.runtimePythonScriptList = Datafactory.getRuntimePythonScriptProjectLevelList();
87 UTMMDTProject.automationDetails.xmlValidatorList = Datafactory.getXmlValidatorList();
88 UTMMDTProject.automationDetails.fileWriterList = Datafactory.getWriteFileDataList();
89 UTMMDTProject.automationDetails.fileStreamWriterList = Datafactory.getFileStreamWriterList();
93 if($rootScope.openedProject != null){
94 console.log('opened project...')
95 var existingData = JSON.stringify($rootScope.openedProject);
96 var currentgData = JSON.stringify(UTMMDTProject);
97 if(angular.equals(existingData, currentgData)){
99 console.log('No changes found.');
101 console.log('Changes found.');
102 $scope.saveProjectToUrl(UTMMDTProject,saveProjectURL)
103 .then(function(pars) {
112 console.log('autosaving project...')
113 $scope.saveProjectToUrl(UTMMDTProject,saveProjectURL)
114 .then(function(pars) {