wizard.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.WizardController = Em.Controller.extend({
  20. isStepDisabled: null,
  21. init: function () {
  22. this.set('isStepDisabled', []);
  23. this.clusters = App.Cluster.find();
  24. this.isStepDisabled.pushObject(Ember.Object.create({
  25. step: 1,
  26. value: false
  27. }));
  28. for (var i = 2; i <= this.get('totalSteps'); i++) {
  29. this.isStepDisabled.pushObject(Ember.Object.create({
  30. step: i,
  31. value: true
  32. }));
  33. }
  34. // window.onbeforeunload = function () {
  35. // return "You have not saved your document yet. If you continue, your work will not be saved."
  36. //}
  37. },
  38. setStepsEnable: function () {
  39. for (var i = 1; i <= this.totalSteps; i++) {
  40. var step = this.get('isStepDisabled').findProperty('step', i);
  41. if (i <= this.get('currentStep')) {
  42. step.set('value', false);
  43. } else {
  44. step.set('value', true);
  45. }
  46. }
  47. }.observes('currentStep'),
  48. setLowerStepsDisable: function (stepNo) {
  49. for (var i = 1; i < stepNo; i++) {
  50. var step = this.get('isStepDisabled').findProperty('step', i);
  51. step.set('value', true);
  52. }
  53. },
  54. /**
  55. * Set current step to new value.
  56. * Method moved from App.router.setInstallerCurrentStep
  57. * @param currentStep
  58. * @param completed
  59. */
  60. currentStep: function () {
  61. return App.get('router').getWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10));
  62. }.property(),
  63. /**
  64. * Set current step to new value.
  65. * Method moved from App.router.setInstallerCurrentStep
  66. * @param currentStep
  67. * @param completed
  68. */
  69. setCurrentStep: function (currentStep, completed) {
  70. App.db.setWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10), currentStep, completed);
  71. this.set('currentStep', currentStep);
  72. },
  73. clusters: null,
  74. isStep1: function () {
  75. return this.get('currentStep') == 1;
  76. }.property('currentStep'),
  77. isStep2: function () {
  78. return this.get('currentStep') == 2;
  79. }.property('currentStep'),
  80. isStep3: function () {
  81. return this.get('currentStep') == 3;
  82. }.property('currentStep'),
  83. isStep4: function () {
  84. return this.get('currentStep') == 4;
  85. }.property('currentStep'),
  86. isStep5: function () {
  87. return this.get('currentStep') == 5;
  88. }.property('currentStep'),
  89. isStep6: function () {
  90. return this.get('currentStep') == 6;
  91. }.property('currentStep'),
  92. isStep7: function () {
  93. return this.get('currentStep') == 7;
  94. }.property('currentStep'),
  95. isStep8: function () {
  96. return this.get('currentStep') == 8;
  97. }.property('currentStep'),
  98. isStep9: function () {
  99. return this.get('currentStep') == 9;
  100. }.property('currentStep'),
  101. isStep10: function () {
  102. return this.get('currentStep') == 10;
  103. }.property('currentStep'),
  104. gotoStep: function (step) {
  105. if (this.get('isStepDisabled').findProperty('step', step).get('value') !== false) {
  106. return;
  107. }
  108. // if going back from Step 9 in Install Wizard, delete the checkpoint so that the user is not redirected
  109. // to Step 9
  110. if (this.get('content.controllerName') == 'installerController' && this.get('currentStep') === '9' && step < 9) {
  111. App.clusterStatus.setClusterStatus({
  112. clusterName: this.get('clusterName'),
  113. clusterState: 'CLUSTER_NOT_CREATED_1',
  114. wizardControllerName: 'installerController',
  115. localdb: App.db.data
  116. });
  117. }
  118. if ((this.get('currentStep') - step) > 1) {
  119. App.ModalPopup.show({
  120. header: Em.I18n.t('installer.navigation.warning.header'),
  121. onPrimary: function () {
  122. App.router.send('gotoStep' + step);
  123. this.hide();
  124. },
  125. body: "If you proceed to go back to Step " + step + ", you will lose any changes you have made beyond this step"
  126. });
  127. } else {
  128. App.router.send('gotoStep' + step);
  129. }
  130. },
  131. gotoStep1: function () {
  132. this.gotoStep(1);
  133. },
  134. gotoStep2: function () {
  135. this.gotoStep(2);
  136. },
  137. gotoStep3: function () {
  138. this.gotoStep(3);
  139. },
  140. gotoStep4: function () {
  141. this.gotoStep(4);
  142. },
  143. gotoStep5: function () {
  144. this.gotoStep(5);
  145. },
  146. gotoStep6: function () {
  147. this.gotoStep(6);
  148. },
  149. gotoStep7: function () {
  150. this.gotoStep(7);
  151. },
  152. gotoStep8: function () {
  153. this.gotoStep(8);
  154. },
  155. gotoStep9: function () {
  156. this.gotoStep(9);
  157. },
  158. gotoStep10: function () {
  159. this.gotoStep(10);
  160. },
  161. /**
  162. * Initialize host status info for step9
  163. */
  164. setInfoForStep9: function () {
  165. var hostInfo = App.db.getHosts();
  166. for (var index in hostInfo) {
  167. hostInfo[index].status = "pending";
  168. hostInfo[index].message = 'Waiting';
  169. hostInfo[index].logTasks = [];
  170. hostInfo[index].tasks = [];
  171. hostInfo[index].progress = '0';
  172. }
  173. App.db.setHosts(hostInfo);
  174. },
  175. /**
  176. * Remove all data for installOptions step
  177. */
  178. clearInstallOptions: function () {
  179. var installOptions = jQuery.extend({}, this.get('installOptionsTemplate'));
  180. this.set('content.installOptions', installOptions);
  181. this.save('installOptions');
  182. this.set('content.hosts', []);
  183. this.save('hosts');
  184. },
  185. toObject: function(object){
  186. var result = {};
  187. for(var i in object){
  188. if(object.hasOwnProperty(i)){
  189. result[i] = object[i];
  190. }
  191. }
  192. return result;
  193. },
  194. /**
  195. * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
  196. * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
  197. */
  198. saveClusterStatus: function (clusterStatus) {
  199. var oldStatus = this.toObject(this.get('content.cluster'));
  200. clusterStatus = jQuery.extend(oldStatus, clusterStatus);
  201. if (clusterStatus.requestId &&
  202. clusterStatus.oldRequestsId.indexOf(clusterStatus.requestId) === -1){
  203. clusterStatus.oldRequestsId.push(clusterStatus.requestId);
  204. }
  205. this.set('content.cluster', clusterStatus);
  206. this.save('cluster');
  207. },
  208. /**
  209. * Invoke installation of selected services to the server and saves the request id returned by the server.
  210. * @param isRetry
  211. */
  212. installServices: function (isRetry) {
  213. // clear requests since we are installing services
  214. // and we don't want to get tasks for previous install attempts
  215. this.set('content.cluster.oldRequestsId', []);
  216. var clusterName = this.get('content.cluster.name');
  217. var data;
  218. var name;
  219. switch (this.get('content.controllerName')) {
  220. case 'addHostController':
  221. var hostnames = [];
  222. for (var hostname in App.db.getHosts()) {
  223. hostnames.push(hostname);
  224. }
  225. if (isRetry) {
  226. name = 'wizard.install_services.add_host_controller.is_retry';
  227. }
  228. else {
  229. name = 'wizard.install_services.add_host_controller.not_is_retry';
  230. }
  231. data = {
  232. "RequestInfo": {
  233. "context": Em.I18n.t('requestInfo.installComponents'),
  234. "query": "HostRoles/host_name.in(" + hostnames.join(',') + ")"
  235. },
  236. "Body": {
  237. "HostRoles": {"state": "INSTALLED"}
  238. }
  239. };
  240. data = JSON.stringify(data);
  241. break;
  242. case 'installerController':
  243. default:
  244. if (isRetry) {
  245. name = 'wizard.install_services.installer_controller.is_retry';
  246. data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
  247. }
  248. else {
  249. name = 'wizard.install_services.installer_controller.not_is_retry';
  250. data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installServices') +'"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
  251. }
  252. break;
  253. }
  254. App.ajax.send({
  255. name: name,
  256. sender: this,
  257. data: {
  258. data: data,
  259. cluster: clusterName
  260. },
  261. success: 'installServicesSuccessCallback',
  262. error: 'installServicesErrorCallback'
  263. });
  264. },
  265. installServicesSuccessCallback: function (jsonData) {
  266. var installStartTime = new Date().getTime();
  267. console.log("TRACE: In success function for the installService call");
  268. if (jsonData) {
  269. var requestId = jsonData.Requests.id;
  270. console.log('requestId is: ' + requestId);
  271. var clusterStatus = {
  272. status: 'PENDING',
  273. requestId: requestId,
  274. isInstallError: false,
  275. isCompleted: false,
  276. installStartTime: installStartTime
  277. };
  278. this.saveClusterStatus(clusterStatus);
  279. } else {
  280. console.log('ERROR: Error occurred in parsing JSON data');
  281. }
  282. },
  283. installServicesErrorCallback: function (request, ajaxOptions, error) {
  284. console.log("TRACE: In error function for the installService call");
  285. console.log("TRACE: error code status is: " + request.status);
  286. console.log('Error message is: ' + request.responseText);
  287. var clusterStatus = {
  288. status: 'PENDING',
  289. requestId: this.get('content.cluster.requestId'),
  290. isInstallError: true,
  291. isCompleted: false
  292. };
  293. this.saveClusterStatus(clusterStatus);
  294. App.showAlertPopup(Em.I18n.t('common.errorPopup.header'), request.responseText);
  295. },
  296. bootstrapRequestId: null,
  297. /*
  298. Bootstrap selected hosts.
  299. */
  300. launchBootstrap: function (bootStrapData) {
  301. App.ajax.send({
  302. name: 'wizard.launch_bootstrap',
  303. sender: this,
  304. data: {
  305. bootStrapData: bootStrapData
  306. },
  307. success: 'launchBootstrapSuccessCallback',
  308. error: 'launchBootstrapErrorCallback'
  309. });
  310. return this.get('bootstrapRequestId');
  311. },
  312. launchBootstrapSuccessCallback: function (data) {
  313. console.log("TRACE: POST bootstrap succeeded");
  314. this.set('bootstrapRequestId', data.requestId);
  315. },
  316. launchBootstrapErrorCallback: function () {
  317. console.log("ERROR: POST bootstrap failed");
  318. alert('Bootstrap call failed. Please try again.');
  319. },
  320. /**
  321. * Load <code>content.<name></code> variable from localStorage, if wasn't loaded before.
  322. * If you specify <code>reload</code> to true - it will reload it.
  323. * @param name
  324. * @param reload
  325. * @return {Boolean}
  326. */
  327. load: function (name, reload) {
  328. if (this.get('content.' + name) && !reload) {
  329. return false;
  330. }
  331. var result = App.db['get' + name.capitalize()]();
  332. if (!result){
  333. result = this['get' + name.capitalize()]();
  334. App.db['set' + name.capitalize()](result);
  335. console.log(this.get('name') + ": created " + name, result);
  336. }
  337. this.set('content.' + name, result);
  338. console.log(this.get('name') + ": loaded " + name, result);
  339. },
  340. save: function(name){
  341. var value = this.toObject(this.get('content.' + name));
  342. App.db['set' + name.capitalize()](value);
  343. console.log(this.get('name') + ": saved " + name, value);
  344. },
  345. clear: function () {
  346. this.set('content', Ember.Object.create({
  347. 'controllerName': this.get('content.controllerName')
  348. }));
  349. this.set('currentStep', 0);
  350. this.clearStorageData();
  351. },
  352. clusterStatusTemplate : {
  353. name: "",
  354. status: "PENDING",
  355. isCompleted: false,
  356. requestId: null,
  357. installStartTime: null,
  358. installTime: null,
  359. isInstallError: false,
  360. isStartError: false,
  361. oldRequestsId: []
  362. },
  363. clearStorageData: function(){
  364. App.db.setService(undefined); //not to use this data at AddService page
  365. App.db.setHosts(undefined);
  366. App.db.setMasterComponentHosts(undefined);
  367. App.db.setSlaveComponentHosts(undefined);
  368. App.db.setCluster(undefined);
  369. App.db.setAllHostNames(undefined);
  370. App.db.setSlaveProperties(undefined);
  371. App.db.setInstallOptions(undefined);
  372. App.db.setAllHostNamesPattern(undefined);
  373. },
  374. installOptionsTemplate: {
  375. hostNames: "", //string
  376. manualInstall: false, //true, false
  377. useSsh: true, //bool
  378. isJavaHome : false, //bool
  379. javaHome: App.defaultJavaHome, //string
  380. localRepo: false, //true, false
  381. sshKey: "", //string
  382. bootRequestId: null //string
  383. },
  384. loadedServiceComponents: null,
  385. /**
  386. * Generate serviceComponents as pr the stack definition and save it to localdata
  387. * called form stepController step4WizardController
  388. */
  389. loadServiceComponents: function () {
  390. App.ajax.send({
  391. name: 'wizard.service_components',
  392. sender: this,
  393. data: {
  394. stackUrl: App.get('stack2VersionURL')
  395. },
  396. success: 'loadServiceComponentsSuccessCallback',
  397. error: 'loadServiceComponentsErrorCallback'
  398. });
  399. return this.get('loadedServiceComponents');
  400. },
  401. loadServiceComponentsSuccessCallback: function (jsonData) {
  402. var displayOrderConfig = require('data/services');
  403. console.log("TRACE: getService ajax call -> In success function for the getServiceComponents call");
  404. console.log("TRACE: jsonData.services : " + jsonData.items);
  405. // Creating Model
  406. var Service = Ember.Object.extend({
  407. serviceName: null,
  408. displayName: null,
  409. isDisabled: true,
  410. isSelected: true,
  411. isInstalled: false,
  412. description: null,
  413. version: null
  414. });
  415. var data = [];
  416. // loop through all the service components
  417. for (var i = 0; i < displayOrderConfig.length; i++) {
  418. var entry = jsonData.items.findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
  419. if (entry) {
  420. var myService = Service.create({
  421. serviceName: entry.StackServices.service_name,
  422. displayName: displayOrderConfig[i].displayName,
  423. isDisabled: i === 0,
  424. isSelected: displayOrderConfig[i].isSelected,
  425. canBeSelected: displayOrderConfig[i].canBeSelected,
  426. isInstalled: false,
  427. isHidden: displayOrderConfig[i].isHidden,
  428. description: entry.StackServices.comments,
  429. version: entry.StackServices.service_version
  430. });
  431. data.push(myService);
  432. }
  433. else {
  434. console.warn('Service not found - ', displayOrderConfig[i].serviceName);
  435. }
  436. }
  437. this.set('loadedServiceComponents', data);
  438. console.log('TRACE: service components: ' + JSON.stringify(data));
  439. },
  440. loadServiceComponentsErrorCallback: function (request, ajaxOptions, error) {
  441. console.log("TRACE: STep5 -> In error function for the getServiceComponents call");
  442. console.log("TRACE: STep5 -> error code status is: " + request.status);
  443. console.log('Step8: Error message is: ' + request.responseText);
  444. },
  445. loadServicesFromServer: function() {
  446. var services = App.db.getService();
  447. if (services) {
  448. return;
  449. }
  450. var apiService = this.loadServiceComponents();
  451. this.set('content.services', apiService);
  452. App.db.setService(apiService);
  453. },
  454. registerErrPopup: function (header, message) {
  455. App.ModalPopup.show({
  456. header: header,
  457. secondary: false,
  458. onPrimary: function () {
  459. this.hide();
  460. },
  461. bodyClass: Ember.View.extend({
  462. template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
  463. message: message
  464. })
  465. });
  466. },
  467. /**
  468. * Save hosts that the user confirmed to proceed with from step 3
  469. * @param stepController App.WizardStep3Controller
  470. */
  471. saveConfirmedHosts: function (stepController) {
  472. var hostInfo = {};
  473. stepController.get('content.hosts').forEach(function (_host) {
  474. hostInfo[_host.name] = {
  475. name: _host.name,
  476. cpu: _host.cpu,
  477. memory: _host.memory,
  478. disk_info: _host.disk_info,
  479. bootStatus: _host.bootStatus,
  480. isInstalled: false
  481. };
  482. });
  483. console.log('wizardController:saveConfirmedHosts: save hosts ', hostInfo);
  484. App.db.setHosts(hostInfo);
  485. this.set('content.hosts', hostInfo);
  486. },
  487. /**
  488. * Save data after installation to main controller
  489. * @param stepController App.WizardStep9Controller
  490. */
  491. saveInstalledHosts: function (stepController) {
  492. var hosts = stepController.get('hosts');
  493. var hostInfo = App.db.getHosts();
  494. for (var index in hostInfo) {
  495. hostInfo[index].status = "pending";
  496. var host = hosts.findProperty('name', hostInfo[index].name);
  497. if (host) {
  498. hostInfo[index].status = host.status;
  499. hostInfo[index].message = host.message;
  500. hostInfo[index].progress = host.progress;
  501. }
  502. }
  503. this.set('content.hosts', hostInfo);
  504. this.save('hosts');
  505. console.log('wizardController:saveInstalledHosts: save hosts ', hostInfo);
  506. },
  507. /**
  508. * Save slaveHostComponents to main controller
  509. * @param stepController
  510. */
  511. saveSlaveComponentHosts: function (stepController) {
  512. var hosts = stepController.get('hosts');
  513. var headers = stepController.get('headers');
  514. var formattedHosts = Ember.Object.create();
  515. headers.forEach(function(header) {
  516. formattedHosts.set(header.get('name'), []);
  517. });
  518. hosts.forEach(function (host) {
  519. var checkboxes = host.get('checkboxes');
  520. headers.forEach(function(header) {
  521. var cb = checkboxes.findProperty('title', header.get('label'));
  522. if (cb.get('checked')) {
  523. formattedHosts.get(header.get('name')).push({
  524. hostName: host.hostName,
  525. group: 'Default',
  526. isInstalled: cb.get('isInstalled')
  527. });
  528. }
  529. });
  530. });
  531. var slaveComponentHosts = [];
  532. headers.forEach(function(header) {
  533. slaveComponentHosts.push({
  534. componentName: header.get('name'),
  535. displayName: header.get('label').replace(/\s/g, ''),
  536. hosts: formattedHosts.get(header.get('name'))
  537. });
  538. });
  539. App.db.setSlaveComponentHosts(slaveComponentHosts);
  540. console.log('wizardController.slaveComponentHosts: saved hosts', slaveComponentHosts);
  541. this.set('content.slaveComponentHosts', slaveComponentHosts);
  542. },
  543. /**
  544. * Return true if cluster data is loaded and false otherwise.
  545. * This is used for all wizard controllers except for installer wizard.
  546. */
  547. dataLoading: function(){
  548. var dfd = $.Deferred();
  549. this.connectOutlet('loading');
  550. if (App.router.get('clusterController.isLoaded')){
  551. dfd.resolve();
  552. } else{
  553. var interval = setInterval(function(){
  554. if (App.router.get('clusterController.isLoaded')){
  555. dfd.resolve();
  556. clearInterval(interval);
  557. }
  558. },50);
  559. }
  560. return dfd.promise();
  561. },
  562. /**
  563. * Save cluster status before going to deploy step
  564. * @param name cluster state. Unique for every wizard
  565. */
  566. saveClusterState: function(name){
  567. App.clusterStatus.setClusterStatus({
  568. clusterName: this.get('content.cluster.name'),
  569. clusterState: name,
  570. wizardControllerName: this.get('content.controllerName'),
  571. localdb: App.db.data
  572. });
  573. },
  574. /**
  575. * load advanced configs from server
  576. */
  577. loadAdvancedConfigs: function () {
  578. var configs = (App.db.getAdvancedServiceConfig()) ? App.db.getAdvancedServiceConfig() : [];
  579. this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName').forEach(function (_serviceName) {
  580. var serviceComponents = App.config.loadAdvancedConfig(_serviceName);
  581. if(serviceComponents){
  582. configs = configs.concat(serviceComponents);
  583. }
  584. }, this);
  585. this.set('content.advancedServiceConfig', configs);
  586. App.db.setAdvancedServiceConfig(configs);
  587. },
  588. /**
  589. * Load serviceConfigProperties to model
  590. */
  591. loadServiceConfigProperties: function () {
  592. var serviceConfigProperties = App.db.getServiceConfigProperties();
  593. this.set('content.serviceConfigProperties', serviceConfigProperties);
  594. console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
  595. },
  596. /**
  597. * Save config properties
  598. * @param stepController Step7WizardController
  599. */
  600. saveServiceConfigProperties: function (stepController) {
  601. var serviceConfigProperties = [];
  602. stepController.get('stepConfigs').forEach(function (_content) {
  603. _content.get('configs').forEach(function (_configProperties) {
  604. var displayType = _configProperties.get('displayType');
  605. if (displayType === 'directories' || displayType === 'directory') {
  606. var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
  607. _configProperties.set('value', value);
  608. }
  609. var overrides = _configProperties.get('overrides');
  610. var overridesArray = [];
  611. if(overrides!=null){
  612. overrides.forEach(function(override){
  613. var overrideEntry = {
  614. value: override.get('value'),
  615. hosts: []
  616. };
  617. override.get('selectedHostOptions').forEach(function(host){
  618. overrideEntry.hosts.push(host);
  619. });
  620. overridesArray.push(overrideEntry);
  621. });
  622. }
  623. overridesArray = (overridesArray.length) ? overridesArray : null;
  624. var configProperty = {
  625. id: _configProperties.get('id'),
  626. name: _configProperties.get('name'),
  627. value: _configProperties.get('value'),
  628. defaultValue: _configProperties.get('defaultValue'),
  629. serviceName: _configProperties.get('serviceName'),
  630. domain: _configProperties.get('domain'),
  631. filename: _configProperties.get('filename'),
  632. overrides: overridesArray
  633. };
  634. serviceConfigProperties.push(configProperty);
  635. }, this);
  636. }, this);
  637. App.db.setServiceConfigProperties(serviceConfigProperties);
  638. this.set('content.serviceConfigProperties', serviceConfigProperties);
  639. }
  640. })