You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 14:50:15 UTC

svn commit: r1418956 [6/8] - in /incubator/ambari/branches/AMBARI-666/ambari-web/app: ./ assets/data/apps/ assets/data/dashboard/ assets/data/wizard/stack/hdp/version01/ controllers/ controllers/global/ controllers/main/ controllers/main/admin/ control...

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/wizard/stack/hdp/version01/ZOOKEEPER.json
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/wizard/stack/hdp/version01/ZOOKEEPER.json?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/wizard/stack/hdp/version01/ZOOKEEPER.json (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/wizard/stack/hdp/version01/ZOOKEEPER.json Sun Dec  9 13:50:03 2012
@@ -1,27 +1,25 @@
 {
-  "name": "ZOOKEEPER",
-  "version": "1.0",
-  "user": "root",
-  "comment": "This is comment for ZOOKEEPER service",
-  "properties": [ ],
-  "components": [
-    {
-      "name": "ZOOKEEPER_SERVER",
-      "category": "MASTER",
-      "client": false,
-      "master": true
-    },
-    {
-      "name": "ZOOKEEPER_CLIENT",
-      "category": "CLIENT",
-      "client": true,
-      "master": false
-    }
-  ],
-  "clientComponent": {
-    "name": "ZOOKEEPER_CLIENT",
-    "category": "CLIENT",
-    "client": true,
-    "master": false
+  "name" : "ZOOKEEPER",
+  "version" : "3.4.5.1-1",
+  "user" : "root",
+  "comment" : "This is comment for ZOOKEEPER service",
+  "properties" : [ ],
+  "components" : [ {
+    "name" : "ZOOKEEPER_SERVER",
+    "category" : "MASTER",
+    "client" : false,
+    "master" : true
+  }, {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
+  } ],
+  "clientOnlyService" : false,
+  "clientComponent" : {
+    "name" : "ZOOKEEPER_CLIENT",
+    "category" : "CLIENT",
+    "client" : true,
+    "master" : false
   }
 }
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/background_operations_controller.js Sun Dec  9 13:50:03 2012
@@ -82,7 +82,7 @@ App.BackgroundOperationsController = Em.
   generateUrl: function(){
     var url = App.testMode ?
       '/data/background_operations/list_on_start.json' :
-      '/api/clusters/' + App.router.getClusterName() + '/requests/?fields=tasks/*&tasks/Tasks/status!=COMPLETED';
+      App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/requests/?fields=tasks/*&tasks/Tasks/status!=COMPLETED';
 
     this.set('url', url);
     return url;
@@ -100,6 +100,14 @@ App.BackgroundOperationsController = Em.
     }
     var self = this;
 
+    if(!App.router.getClusterName()){
+      console.log('clusterName is undefined')
+      setTimeout(function(){
+        self.loadOperations();
+      },1000);
+      return;
+    }
+
     var url = this.get('url');
     if(!url){
       url = this.generateUrl();
@@ -109,7 +117,7 @@ App.BackgroundOperationsController = Em.
       type: "GET",
       url: url,
       dataType: 'json',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         //refresh model
         self.updateBackgroundOperations(data);
@@ -125,8 +133,6 @@ App.BackgroundOperationsController = Em.
       error: function (request, ajaxOptions, error) {
         console.log('cannot load background operations array');
 
-        //next code is temporary code to fix testMode issues
-        self.set('url', '/data/background_operations/list_on_start.json');
         //load data again if isWorking = true
         if(self.get('isWorking')){
           setTimeout(function(){

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js Sun Dec  9 13:50:03 2012
@@ -19,57 +19,61 @@
 var App = require('app');
 
 App.ClusterController = Em.Controller.extend({
-  name: 'clusterController',
+  name:'clusterController',
   cluster:null,
-  isLoaded: false,
-  updateLoadStatus: function(item){
+  isLoaded:false,
+  updateLoadStatus:function (item) {
     var loadList = this.get('dataLoadList');
     var loaded = true;
     loadList.set(item, true);
-    for(var i in loadList){
-      if(loadList.hasOwnProperty(i) && !loadList[i] && loaded){
+    for (var i in loadList) {
+      if (loadList.hasOwnProperty(i) && !loadList[i] && loaded) {
         loaded = false;
       }
     }
     this.set('isLoaded', loaded);
   },
-  dataLoadList: Em.Object.create({
-    'hosts': false,
-    'runs': false,
-    'services': false,
-    'cluster' : false,
-    'racks' : false,
-    'alerts' : false,
-    'users' : false
+
+  dataLoadList:Em.Object.create({
+    'hosts':false,
+    'services':false,
+    'cluster':false,
+    'racks':false,
+    'alerts':false,
+    'users':false
   }),
+
+  postLoadList:{
+    'runs':false
+  },
   /**
    * load cluster name
    */
-  loadClusterName: function(reload){
-    if(this.get('clusterName') && !reload){
+  loadClusterName:function (reload) {
+    if (this.get('clusterName') && !reload) {
       return;
     }
     var self = this;
-    var url = (App.testMode) ? '/data/clusters/info.json' : '/api/clusters';
+    var url = (App.testMode) ? '/data/clusters/info.json' : App.apiPrefix + '/clusters';
     $.ajax({
-      async: false,
-      type: "GET",
-      url: url,
-      dataType: 'json',
-      timeout: 5000,
-      success: function (data) {
+      async:false,
+      type:"GET",
+      url:url,
+      dataType:'json',
+      timeout:App.timeout,
+      success:function (data) {
         self.set('cluster', data.items[0]);
       },
-      error: function (request, ajaxOptions, error) {
+      error:function (request, ajaxOptions, error) {
         console.log('failed on loading cluster name');
         self.set('isLoaded', true);
       },
-      statusCode: require('data/statusCodes')
+      statusCode:require('data/statusCodes')
     });
   },
 
-  getUrl: function(testUrl, url){
-    return (App.testMode) ? testUrl: '/api/clusters/' + this.get('clusterName') + url;
+  getUrl:function (testUrl, url) {
+    return (App.testMode) ? testUrl : App.apiPrefix + '/clusters/' + this.get('clusterName') + url;
   },
 
   /**
@@ -79,7 +83,7 @@ App.ClusterController = Em.Controller.ex
    *
    * If null is returned, it means NAGIOS service is not installed.
    */
-  nagiosUrl: function () {
+  nagiosUrl:function () {
     if (App.testMode) {
       return 'http://nagiosserver/nagios';
     } else {
@@ -90,10 +94,11 @@ App.ClusterController = Em.Controller.ex
         var svcComponents = nagiosSvc.get('components');
         if (svcComponents) {
           var nagiosSvcComponent = svcComponents.findProperty("componentName", "NAGIOS_SERVER");
-          if(nagiosSvcComponent){
+          if (nagiosSvcComponent) {
             var hostName = nagiosSvcComponent.get('host.hostName');
-            if(hostName){
-              return "http://"+hostName+"/nagios";
+            if (hostName) {
+              return null;
+              //return "http://"+hostName+"/nagios";
             }
           }
         }
@@ -102,13 +107,13 @@ App.ClusterController = Em.Controller.ex
     }
   }.property('dataLoadList.services'),
 
-  isNagiosInstalled: function(){
-    if(App.testMode){
+  isNagiosInstalled:function () {
+    if (App.testMode) {
       return true;
-    }else{
+    } else {
       var svcs = App.Service.find();
       var nagiosSvc = svcs.findProperty("serviceName", "NAGIOS");
-      return nagiosSvc!=null;
+      return nagiosSvc != null;
     }
   }.property('dataLoadList.services'),
 
@@ -116,7 +121,7 @@ App.ClusterController = Em.Controller.ex
    * Sorted list of alerts.
    * Changes whenever alerts are loaded.
    */
-  alerts: function () {
+  alerts:function () {
     var alerts = App.Alert.find();
     var alertsArray = alerts.toArray();
     var sortedArray = alertsArray.sort(function (left, right) {
@@ -133,12 +138,29 @@ App.ClusterController = Em.Controller.ex
     return sortedArray;
   }.property('dataLoadList.alerts'),
 
+  loadRuns: function(){
+    if(this.get('postLoadList.runs')){
+      return;
+    }
+
+    var self= this;
+    var runsUrl = App.testMode ? "/data/apps/runs.json" : App.apiPrefix + "/jobhistory/workflow";
+
+    App.HttpClient.get(runsUrl, App.runsMapper, {
+      complete:function (jqXHR, textStatus) {
+        self.set('postLoadList.runs', true);
+      }
+    }, function(){
+      self.set('postLoadList.runs', true);
+    });
+  },
+
   /**
    * This method automatically loads alerts when Nagios URL
    * changes. Once done it will trigger dataLoadList.alerts
    * property, which will trigger the alerts property.
    */
-  loadAlerts: function () {
+  loadAlerts:function () {
     var nagiosUrl = this.get('nagiosUrl');
     if (nagiosUrl) {
       var lastSlash = nagiosUrl.lastIndexOf('/');
@@ -147,10 +169,10 @@ App.ClusterController = Em.Controller.ex
       }
       var dataUrl;
       var ajaxOptions = {
-        dataType: "jsonp",
-        jsonp: "jsonp",
-        context: this,
-        complete: function (jqXHR, textStatus) {
+        dataType:"jsonp",
+        jsonp:"jsonp",
+        context:this,
+        complete:function (jqXHR, textStatus) {
           this.updateLoadStatus('alerts')
         }
       };
@@ -171,58 +193,48 @@ App.ClusterController = Em.Controller.ex
    *
    *  load all data and update load status
    */
-  loadClusterData: function(){
+  loadClusterData:function () {
     var self = this;
-    if(!this.get('clusterName')){
-        return;
+    if (!this.get('clusterName')) {
+      return;
     }
 
-     var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
-     var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*');
-     var servicesUrl1 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*');
-     var servicesUrl2 = this.getUrl('/data/dashboard/serviceComponents.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo');
-     var usersUrl = App.testMode ? '/data/users/users.json' : '/api/users/?fields=*';
-     var runsUrl = App.testMode ? "/data/apps/runs.json" : "/api/jobhistory/workflow";
-
-     var racksUrl = "/data/racks/racks.json";
+    var clusterUrl = this.getUrl('/data/clusters/cluster.json', '?fields=Clusters');
+    var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*');
+    var servicesUrl1 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*');
+    var servicesUrl2 = this.getUrl('/data/dashboard/serviceComponents.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/ServiceComponentInfo');
+    var usersUrl = App.testMode ? '/data/users/users.json' : App.apiPrefix + '/users/?fields=*';
+    var racksUrl = "/data/racks/racks.json";
 
-    App.HttpClient.get(racksUrl, App.racksMapper,{
-      complete:function(jqXHR, textStatus){
+    App.HttpClient.get(racksUrl, App.racksMapper, {
+      complete:function (jqXHR, textStatus) {
         self.updateLoadStatus('racks');
       }
-    },function(jqXHR, textStatus){
+    }, function (jqXHR, textStatus) {
       self.updateLoadStatus('racks');
     });
 
-    App.HttpClient.get(clusterUrl, App.clusterMapper,{
-      complete:function(jqXHR, textStatus){
+    App.HttpClient.get(clusterUrl, App.clusterMapper, {
+      complete:function (jqXHR, textStatus) {
         self.updateLoadStatus('cluster');
       }
-    },function(jqXHR, textStatus){
+    }, function (jqXHR, textStatus) {
       self.updateLoadStatus('cluster');
     });
 
-    App.HttpClient.get(runsUrl, App.runsMapper,{
-      complete:function(jqXHR, textStatus) {
-        self.updateLoadStatus('runs');
-      }
-    },function(jqXHR, textStatus){
-      self.updateLoadStatus('runs');
-    });
-
-    App.HttpClient.get(hostsUrl, App.hostsMapper,{
-      complete:function(jqXHR, textStatus){
+    App.HttpClient.get(hostsUrl, App.hostsMapper, {
+      complete:function (jqXHR, textStatus) {
         self.updateLoadStatus('hosts');
       }
-    },function(jqXHR, textStatus){
+    }, function (jqXHR, textStatus) {
       self.updateLoadStatus('hosts');
     });
 
-    App.HttpClient.get(usersUrl, App.usersMapper,{
-      complete:function(jqXHR, textStatus){
+    App.HttpClient.get(usersUrl, App.usersMapper, {
+      complete:function (jqXHR, textStatus) {
         self.updateLoadStatus('users');
       }
-    },function(jqXHR, textStatus){
+    }, function (jqXHR, textStatus) {
       self.updateLoadStatus('users');
     });
 
@@ -232,12 +244,12 @@ App.ClusterController = Em.Controller.ex
     var metricsJson = null;
     var serviceComponentJson = null;
     var metricsMapper = {
-        map: function(data){
-          metricsJson = data;
-        }
+      map:function (data) {
+        metricsJson = data;
+      }
     };
     var serviceComponentMapper = {
-      map: function (data) {
+      map:function (data) {
         serviceComponentJson = data;
         if (metricsJson != null && serviceComponentJson != null) {
           var hdfsSvc1 = null;
@@ -330,10 +342,10 @@ App.ClusterController = Em.Controller.ex
         }
       }
     }
-    App.HttpClient.get(servicesUrl1, metricsMapper,{
-      complete:function(jqXHR, textStatus){
-        App.HttpClient.get(servicesUrl2, serviceComponentMapper,{
-          complete:function(jqXHR, textStatus){
+    App.HttpClient.get(servicesUrl1, metricsMapper, {
+      complete:function (jqXHR, textStatus) {
+        App.HttpClient.get(servicesUrl2, serviceComponentMapper, {
+          complete:function (jqXHR, textStatus) {
           }
         });
       }
@@ -344,7 +356,7 @@ App.ClusterController = Em.Controller.ex
 
   },
 
-  clusterName: function(){
+  clusterName:function () {
     return (this.get('cluster')) ? this.get('cluster').Clusters.cluster_name : null;
   }.property('cluster')
 })

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/installer.js Sun Dec  9 13:50:03 2012
@@ -224,7 +224,6 @@ App.InstallerController = Em.Controller.
     services: null,
     hostsInfo: [],
     slaveComponentHosts: null,
-    hostSlaveComponents: null,
     masterComponentHosts: null,
     serviceConfigProperties: null,
     advancedServiceConfig: null,
@@ -390,7 +389,7 @@ App.InstallerController = Em.Controller.
    * Will be used at <code>Assign Masters(step5)</code> step
    */
   loadConfirmedHosts: function () {
-    this.set('content.hostsInfo', App.db.getHosts());
+    this.set('content.hostsInfo', App.db.getHosts() || []);
   },
 
   /**
@@ -440,6 +439,7 @@ App.InstallerController = Em.Controller.
     var servicesInfo = App.db.getService();
     servicesInfo.forEach(function (item, index) {
       servicesInfo[index] = Em.Object.create(item);
+      servicesInfo[index].isInstalled = false;
     });
     this.set('content.services', servicesInfo);
     console.log('installerController.loadServices: loaded data ', servicesInfo);
@@ -474,6 +474,7 @@ App.InstallerController = Em.Controller.
         display_name: _component.get('display_name'),
         component: _component.get('component_name'),
         hostName: _component.get('selectedHost'),
+        serviceId: _component.get('serviceId'),
         isInstalled: false
       });
     });
@@ -487,7 +488,7 @@ App.InstallerController = Em.Controller.
    * Load master component hosts data for using in required step controllers
    */
   loadMasterComponentHosts: function () {
-    var masterComponentHosts = App.db.getMasterComponentHosts();
+    var masterComponentHosts = App.db.getMasterComponentHosts() || [];
     this.set("content.masterComponentHosts", masterComponentHosts);
     console.log("InstallerController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
   },
@@ -502,9 +503,6 @@ App.InstallerController = Em.Controller.
     var isMrSelected = stepController.get('isMrSelected');
     var isHbSelected = stepController.get('isHbSelected');
 
-    App.db.setHostSlaveComponents(hosts);
-    this.set('content.hostSlaveComponents', hosts);
-
     var dataNodeHosts = [];
     var taskTrackerHosts = [];
     var regionServerHosts = [];
@@ -514,25 +512,29 @@ App.InstallerController = Em.Controller.
       if (host.get('isDataNode')) {
         dataNodeHosts.push({
           hostName: host.hostName,
-          group: 'Default'
+          group: 'Default',
+          isInstalled : false
         });
       }
       if (isMrSelected && host.get('isTaskTracker')) {
         taskTrackerHosts.push({
           hostName: host.hostName,
-          group: 'Default'
+          group: 'Default',
+          isInstalled : false
         });
       }
       if (isHbSelected && host.get('isRegionServer')) {
         regionServerHosts.push({
           hostName: host.hostName,
-          group: 'Default'
+          group: 'Default',
+          isInstalled : false
         });
       }
       if (host.get('isClient')) {
         clientHosts.pushObject({
           hostName: host.hostName,
-          group: 'Default'
+          group: 'Default',
+          isInstalled : false
         });
       }
     }, this);
@@ -565,26 +567,16 @@ App.InstallerController = Em.Controller.
 
     App.db.setSlaveComponentHosts(slaveComponentHosts);
     this.set('content.slaveComponentHosts', slaveComponentHosts);
+    console.log("InstallerController.saveSlaveComponentHosts: saved hosts ", slaveComponentHosts);
   },
 
   /**
    * Load master component hosts data for using in required step controllers
    */
   loadSlaveComponentHosts: function () {
-    var slaveComponentHosts = App.db.getSlaveComponentHosts();
-    if (slaveComponentHosts !== undefined) {
-      this.set("content.slaveComponentHosts", slaveComponentHosts);
-      console.log("InstallerController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
-    } else {
-      this.set("content.slaveComponentHosts", null);
-    }
-    var hostSlaveComponents = App.db.getHostSlaveComponents();
-    if (hostSlaveComponents !== undefined) {
-      this.set('content.hostSlaveComponents', hostSlaveComponents);
-      console.log("InstallerController.loadSlaveComponentHosts: loaded hosts ", hostSlaveComponents);
-    } else {
-      this.set("content.hostSlaveComponents", null);
-    }
+    var slaveComponentHosts = App.db.getSlaveComponentHosts() || null;
+    this.set("content.slaveComponentHosts", slaveComponentHosts);
+    console.log("InstallerController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
   },
 
   /**
@@ -624,6 +616,8 @@ App.InstallerController = Em.Controller.
     var serviceConfigProperties = App.db.getServiceConfigProperties();
     this.set('content.serviceConfigProperties', serviceConfigProperties);
     console.log("InstallerController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
+
+    this.set('content.advancedServiceConfig', App.db.getAdvancedServiceConfig());
   },
 
   /**
@@ -648,7 +642,8 @@ App.InstallerController = Em.Controller.
       if (client) {
         clients.pushObject({
           component_name: client.component_name,
-          display_name: client.display_name
+          display_name: client.display_name,
+          isInstalled: false
         });
       }
     }, this);
@@ -693,13 +688,13 @@ App.InstallerController = Em.Controller.
   loadComponents: function (stepController) {
     var self = this;
     var method = 'GET';
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version0.1.json' : '/api/stacks/HDP/version/1.2.0'; // TODO: get this url from the stack selected by the user in Install Options page
+    var url = (App.testMode) ? '/data/wizard/stack/hdp/version0.1.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0'; // TODO: get this url from the stack selected by the user in Install Options page
     $.ajax({
       type: method,
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep5 -> In success function for the getServiceComponents call");
@@ -736,14 +731,14 @@ App.InstallerController = Em.Controller.
 
   loadAdvancedConfig: function (serviceName) {
     var self = this;
-    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : '/api/stacks/HDP/version/1.2.0/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
+    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
     var method = 'GET';
     $.ajax({
       type: method,
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: Step6 submit -> In success function for the loadAdvancedConfig call");
@@ -780,7 +775,7 @@ App.InstallerController = Em.Controller.
   installServices: function () {
     var self = this;
     var clusterName = this.get('content.cluster.name');
-    var url = (App.testMode) ? '/data/wizard/deploy/poll_1.json' : '/api/clusters/' + clusterName + '/services?state=INIT';
+    var url = (App.testMode) ? '/data/wizard/deploy/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/services?state=INIT';
     var method = (App.testMode) ? 'GET' : 'PUT';
     var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
     $.ajax({
@@ -789,7 +784,7 @@ App.InstallerController = Em.Controller.
       data: data,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         var installSartTime = new Date().getTime();
@@ -836,6 +831,9 @@ App.InstallerController = Em.Controller.
   finish: function(){
     this.setCurrentStep('1', false);
     App.db.setService(undefined); //not to use this data at AddService page
+    App.db.setHosts(undefined);
+    App.db.setMasterComponentHosts(undefined);
+    App.db.setSlaveComponentHosts(undefined);
   }
 
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/admin/user.js Sun Dec  9 13:50:03 2012
@@ -68,7 +68,7 @@ App.MainAdminUserController = Em.Control
   sendCommandToServer : function(url, method, postData, callback){
     var url =  (App.testMode) ?
         '/data/wizard/deploy/poll_1.json' : //content is the same as ours
-        '/api/' + url;
+        App.apiPrefix + '/' + url;
 
     var method = App.testMode ? 'GET' : method;
 
@@ -77,7 +77,7 @@ App.MainAdminUserController = Em.Control
       url: url,
       data: JSON.stringify(postData),
       dataType: 'json',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function(data){
         if(data && data.Requests){
           callback(data.Requests.id);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps/item_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps/item_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps/item_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps/item_controller.js Sun Dec  9 13:50:03 2012
@@ -39,7 +39,7 @@ App.MainAppsItemController = Em.Controll
     var self = this;
 
     var url = App.testMode ? '/data/apps/jobs.json' :
-      "/api/jobhistory/job?workflowId=" + currentId;
+      App.apiPrefix + "/jobhistory/job?workflowId=" + currentId;
 
     App.HttpClient.get(url, App.jobsMapper,{
       complete:function(jqXHR, textStatus) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/apps_controller.js Sun Dec  9 13:50:03 2012
@@ -22,7 +22,9 @@ require('utils/jquery.unique');
 App.MainAppsController = Em.ArrayController.extend({
 
   name:'mainAppsController',
-  content: App.Run.find(),
+  content: function(){
+    return App.Run.find();
+  }.property('App.router.clusterController.postLoadList.runs'),
 
   staredRuns: [],
   filteredRuns: [],

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host.js Sun Dec  9 13:50:03 2012
@@ -27,35 +27,55 @@ App.MainHostController = Em.ArrayControl
   content:[],
   fullContent:App.Host.find(),
   clusters:App.Cluster.find(),
-  componentsForFilter:App.Component.find(),
+  //componentsForFilter: App.Component.find(),
+  componentsForFilter:function() {
+    var components = App.Component.find();
+    ret = new Array();
+    if (!components) {
+      return ret;
+    }
+    components.forEach(function(item) {
+      var o = Ember.Object.create({
+        id: item.get('id'),
+        isMaster: item.get('isMaster'),
+        displayName: item.get('displayName'),
+        componentName: item.get('componentName'),
+        checkedForHostFilter: item.get('checkedForHostFilter')
+      });
+      console.log(o);
+      ret.push(o);
+    });
+    return ret;
+  }.property(),
+
   totalBinding:'fullContent.length',
   filters:{components:[]},
   pageSize: 25,
   pageSizeRange:[10, 25, 50, 100, 'all'],
   rangeStart:0,
-  allChecked:false,
-  selectedHostsIds:[],
+//  allChecked:false,
+//  selectedHostsIds:[],
   selectedRack:null,
 
-  assignHostsToRack:function () {
-    var selectedRack = this.get('selectedRack');
-    var sureMessage = this.t('hosts.assignToRack.sure');
-    var hostsIds = this.get('selectedHostsIds');
-
-    var hostString = hostsIds.length + " " + this.t(hostsIds.length > 1 ? "host.plural" : "host.singular");
-
-    if (selectedRack.constructor == 'App.Cluster' && hostsIds.length
-      && confirm(sureMessage.format(hostString, selectedRack.get('clusterName')))) {
-      this.get('content').forEach(function (host) {
-        if (host.get('isChecked')) {
-          host.set('cluster', selectedRack);
-          host.set('isChecked', false);
-        }
-      })
-      this.set('selectedHostsIds', []);
-    }
-
-  },
+//  assignHostsToRack:function () {
+//    var selectedRack = this.get('selectedRack');
+//    var sureMessage = this.t('hosts.assignToRack.sure');
+//    var hostsIds = this.get('selectedHostsIds');
+//
+//    var hostString = hostsIds.length + " " + this.t(hostsIds.length > 1 ? "host.plural" : "host.singular");
+//
+//    if (selectedRack.constructor == 'App.Cluster' && hostsIds.length
+//      && confirm(sureMessage.format(hostString, selectedRack.get('clusterName')))) {
+//      this.get('content').forEach(function (host) {
+//        if (host.get('isChecked')) {
+//          host.set('cluster', selectedRack);
+//          host.set('isChecked', false);
+//        }
+//      })
+//      this.set('selectedHostsIds', []);
+//    }
+//
+//  },
 
   sortingAsc:true,
   isSort:false,
@@ -83,7 +103,7 @@ App.MainHostController = Em.ArrayControl
   slaveComponents:function () {
     var components = [];
     this.get('componentsForFilter').forEach(function (component) {
-      if (component.get('isSlave')) {
+      if (!component.get('isMaster')) {
         components.push(component);
       }
     });
@@ -94,37 +114,37 @@ App.MainHostController = Em.ArrayControl
     return 5;
   }.property(),
 
-  onAllChecked:function () {
-    var hosts = this.get('content');
-    hosts.setEach('isChecked', this.get('allChecked'));
-    this.set('isDisabled', !this.get('allChecked'));
-    var selectedHostsIds = this.get('allChecked') ? hosts.getEach('id') : [];
-    this.set('selectedHostsIds', selectedHostsIds);
-  }.observes('allChecked'),
-
-  onHostChecked:function (host) {
-    var selected = this.get('selectedHostsIds');
-    host.set('isChecked', !host.get('isChecked'));
-    if (host.get('isChecked')) {
-      selected.push(host.get('id'));
-    } else {
-      var index = selected.indexOf(host.get('id'));
-      if (index != -1) selected.splice(index, 1);
-    }
-    this.set('isDisabled', selected.length == 0);
-    this.propertyDidChange('selectedHostsIds');
-  },
-
-  changeSelectedHosts:function () {
-    var visibleHosts = this.get('content');
-    var selectedHosts = visibleHosts.filterProperty('isChecked', true);
-    this.get('fullContent').forEach(function (item) {
-      var index = visibleHosts.getEach('id').indexOf(item.get('id'));
-      if (index == -1) item.set('isChecked', false);
-    });
-    this.set('isDisabled', selectedHosts.length == 0);
-    this.set('selectedHostsIds', selectedHosts.getEach('id'));
-  },
+//  onAllChecked:function () {
+//    var hosts = this.get('content');
+//    hosts.setEach('isChecked', this.get('allChecked'));
+//    this.set('isDisabled', !this.get('allChecked'));
+//    var selectedHostsIds = this.get('allChecked') ? hosts.getEach('id') : [];
+//    this.set('selectedHostsIds', selectedHostsIds);
+//  }.observes('allChecked'),
+//
+//  onHostChecked:function (host) {
+//    var selected = this.get('selectedHostsIds');
+//    host.set('isChecked', !host.get('isChecked'));
+//    if (host.get('isChecked')) {
+//      selected.push(host.get('id'));
+//    } else {
+//      var index = selected.indexOf(host.get('id'));
+//      if (index != -1) selected.splice(index, 1);
+//    }
+//    this.set('isDisabled', selected.length == 0);
+//    this.propertyDidChange('selectedHostsIds');
+//  },
+//
+//  changeSelectedHosts:function () {
+//    var visibleHosts = this.get('content');
+//    var selectedHosts = visibleHosts.filterProperty('isChecked', true);
+//    this.get('fullContent').forEach(function (item) {
+//      var index = visibleHosts.getEach('id').indexOf(item.get('id'));
+//      if (index == -1) item.set('isChecked', false);
+//    });
+//    this.set('isDisabled', selectedHosts.length == 0);
+//    this.set('selectedHostsIds', selectedHosts.getEach('id'));
+//  },
 
   checkedComponentsIds:function () {
     var checked = [];
@@ -151,9 +171,14 @@ App.MainHostController = Em.ArrayControl
   },
 
   filterByComponent:function (component) {
-    this.get('componentsForFilter').setEach('isChecked', false);
-    component.set('isChecked', true);
+    var id = component.get('id');
+    /*this.get('componentsForFilter').setEach('isChecked', false);
+    component.set('isChecked', true);*/
+    this.get('componentsForFilter').setEach('checkedForHostFilter', false);
+    this.get('componentsForFilter').filterProperty('id', id).setEach('checkedForHostFilter', true);
+    //component.set('checkedForHostFilter', true);
     this.set('filters.components', [component.get('id')]);
+    console.log(this.get('filters.components').objectAt(0));
     this.changeContent();
   },
 
@@ -203,7 +228,8 @@ App.MainHostController = Em.ArrayControl
         if (inFilters) {
           items.push(item);
         }
-      } else {
+      }
+      else {
         items.push(item);
       }
     });
@@ -213,7 +239,7 @@ App.MainHostController = Em.ArrayControl
 
     var content = items.slice(this.get('rangeStart'), this.get('rangeStop'));
     this.replace(0, this.get('length'), content);
-    this.changeSelectedHosts();
+//    this.changeSelectedHosts();
   }.observes('rangeStart', 'rangeStop', 'total'),
 
   showNextPage:function () {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/add_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/add_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/add_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/add_controller.js Sun Dec  9 13:50:03 2012
@@ -40,7 +40,6 @@ App.AddHostController = Em.Controller.ex
     services: null,
     hostsInfo: null,
     slaveComponentHosts: null,
-    hostSlaveComponents: null,
     masterComponentHosts: null,
     serviceConfigProperties: null
   }),
@@ -462,9 +461,6 @@ App.AddHostController = Em.Controller.ex
     var isMrSelected = stepController.get('isMrSelected');
     var isHbSelected = stepController.get('isHbSelected');
 
-    App.db.setHostSlaveComponents(hosts);
-    this.set('content.hostSlaveComponents', hosts);
-
     var dataNodeHosts = [];
     var taskTrackerHosts = [];
     var regionServerHosts = [];
@@ -534,10 +530,6 @@ App.AddHostController = Em.Controller.ex
     var slaveComponentHosts = App.db.getSlaveComponentHosts();
     this.set("content.slaveComponentHosts", slaveComponentHosts);
     console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
-
-    var hostSlaveComponents = App.db.getHostSlaveComponents();
-    this.set('content.hostSlaveComponents', hostSlaveComponents);
-    console.log("AddHostController.loadSlaveComponentHosts: loaded hosts ", hostSlaveComponents);
   },
 
   /**
@@ -637,7 +629,7 @@ App.AddHostController = Em.Controller.ex
   installServices: function () {
     var self = this;
     var clusterName = this.get('content.cluster.name');
-    var url = '/api/clusters/' + clusterName + '/services?state=INIT';
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services?state=INIT';
     var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
     $.ajax({
       type: 'PUT',
@@ -645,7 +637,7 @@ App.AddHostController = Em.Controller.ex
       data: data,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for the installService call");

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/host/details.js Sun Dec  9 13:50:03 2012
@@ -39,7 +39,7 @@ App.MainHostDetailsController = Em.Contr
   sendCommandToServer : function(url, postData, callback){
     var url =  (App.testMode) ?
       '/data/wizard/deploy/poll_1.json' : //content is the same as ours
-      '/api/clusters/' + App.router.getClusterName() + url;
+      App.apiPrefix + '/clusters/' + App.router.getClusterName() + url;
 
     var method = App.testMode ? 'GET' : 'PUT';
 
@@ -48,7 +48,7 @@ App.MainHostDetailsController = Em.Contr
       url: url,
       data: JSON.stringify(postData),
       dataType: 'json',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function(data){
         if(data && data.Requests){
           callback(data.Requests.id);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/add_controller.js Sun Dec  9 13:50:03 2012
@@ -30,7 +30,7 @@ App.AddServiceController = Em.Controller
    * hosts - hosts, ssh key, repo info, etc.
    * services - services list
    * hostsInfo - list of selected hosts
-   * slaveComponentHosts, hostSlaveComponents - info about slave hosts
+   * slaveComponentHosts, - info about slave hosts
    * masterComponentHosts - info about master hosts
    * config??? - to be described later
    */
@@ -40,9 +40,9 @@ App.AddServiceController = Em.Controller
     services: null,
     hostsInfo: null,
     slaveComponentHosts: null,
-    hostSlaveComponents: null,
     masterComponentHosts: null,
     serviceConfigProperties: null,
+    advancedServiceConfig: null,
     controllerName: 'addServiceController'
   }),
 
@@ -166,26 +166,16 @@ App.AddServiceController = Em.Controller
    * Load clusterInfo(step1) to model
    */
   loadClusterInfo: function(){
-    var cStatus = App.db.getClusterStatus() || {status: "", isCompleted: false};
     var cluster = {
-      name: App.db.getClusterName() || "",
-      status: cStatus.status,
-      isCompleted: cStatus.isCompleted
+      name: App.router.getClusterName(),
+      status: "",
+      isCompleted: true
     };
     this.set('content.cluster', cluster);
     console.log("AddServiceController:loadClusterInfo: loaded data ", cluster);
   },
 
   /**
-   * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
-   * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
-   */
-  saveClusterStatus: function (clusterStatus) {
-    this.set('content.cluster', clusterStatus);
-    App.db.setClusterStatus(clusterStatus);
-  },
-
-  /**
    * Temporary function for wizardStep9, before back-end integration
    */
   setInfoForStep9: function () {
@@ -203,6 +193,8 @@ App.AddServiceController = Em.Controller
    * Will be used at <code>Assign Masters(step5)</code> step
    */
   loadConfirmedHosts: function(){
+    var hosts = App.db.getHosts();
+    if(!hosts){
     var hosts = {};
 
     App.Host.find().forEach(function(item){
@@ -214,8 +206,10 @@ App.AddServiceController = Em.Controller
         isInstalled: true
       };
     });
+    }
 
     this.set('content.hostsInfo', hosts);
+    console.log('AddServiceController.loadConfirmedHosts: loaded hosts', hosts);
   },
 
   /**
@@ -268,6 +262,7 @@ App.AddServiceController = Em.Controller
       servicesInfo.forEach(function(item, index){
         servicesInfo[index].isSelected = App.Service.find().someProperty('id', item.serviceName);
         servicesInfo[index].isDisabled = servicesInfo[index].isSelected;
+        servicesInfo[index].isInstalled = servicesInfo[index].isSelected;
       });
     }
 
@@ -276,7 +271,7 @@ App.AddServiceController = Em.Controller
     });
     this.set('content.services', servicesInfo);
     console.log('AddServiceController.loadServices: loaded data ', servicesInfo);
-    console.log('selected services ', servicesInfo.filterProperty('isSelected', true).mapProperty('serviceName'));
+    console.log('selected services ', servicesInfo.filterProperty('isSelected', true).filterProperty('isDisabled', false).mapProperty('serviceName'));
   },
 
   /**
@@ -285,15 +280,14 @@ App.AddServiceController = Em.Controller
    */
   saveServices: function (stepController) {
     var serviceNames = [];
-    // we can also do it without stepController since all data,
-    // changed at page, automatically changes in model(this.content.services)
     App.db.setService(stepController.get('content'));
-    stepController.filterProperty('isSelected', true).filterProperty('isDisabled', false).forEach(function (item) {
+    console.log('AddServiceController.saveServices: saved data', stepController.get('content'));
+    stepController.filterProperty('isSelected', true).filterProperty('isInstalled', false).forEach(function (item) {
       serviceNames.push(item.serviceName);
     });
     this.set('content.selectedServiceNames', serviceNames);
     App.db.setSelectedServiceNames(serviceNames);
-    console.log('AddServiceController.saveServices: saved data ', serviceNames);
+    console.log('AddServiceController.selectedServiceNames:', serviceNames);
   },
 
   /**
@@ -306,14 +300,13 @@ App.AddServiceController = Em.Controller
     var installedComponents = App.Component.find();
 
     obj.forEach(function (_component) {
-      if(!installedComponents.someProperty('componentName', _component.component_name)){
         masterComponentHosts.push({
           display_name: _component.display_name,
           component: _component.component_name,
           hostName: _component.selectedHost,
-          isInstalled: false
+          serviceId: _component.serviceId,
+          isInstalled: installedComponents.someProperty('componentName', _component.component_name)
         });
-      }
     });
 
     console.log("AddServiceController.saveMasterComponentHosts: saved hosts ", masterComponentHosts);
@@ -325,15 +318,18 @@ App.AddServiceController = Em.Controller
    * Load master component hosts data for using in required step controllers
    */
   loadMasterComponentHosts: function () {
-    var masterComponentHosts = App.db.getMasterComponentHosts() || [];
+    var masterComponentHosts = App.db.getMasterComponentHosts();
+    if(!masterComponentHosts){
+      masterComponentHosts = [];
     App.Component.find().filterProperty('isMaster', true).forEach(function(item){
       masterComponentHosts.push({
         component: item.get('componentName'),
-        display_name: item.get('displayName'),
         hostName: item.get('host.hostName'),
         isInstalled: true
       })
     });
+
+    }
     this.set("content.masterComponentHosts", masterComponentHosts);
     console.log("AddServiceController.loadMasterComponentHosts: loaded hosts ", masterComponentHosts);
   },
@@ -348,44 +344,39 @@ App.AddServiceController = Em.Controller
     var isMrSelected = stepController.get('isMrSelected');
     var isHbSelected = stepController.get('isHbSelected');
 
-    App.db.setHostSlaveComponents(hosts);
-    this.set('content.hostSlaveComponents', hosts);
-
     var dataNodeHosts = [];
     var taskTrackerHosts = [];
     var regionServerHosts = [];
     var clientHosts = [];
 
-    var installedComponents = App.Component.find();
-
     hosts.forEach(function (host) {
 
       if (host.get('isDataNode')) {
         dataNodeHosts.push({
           hostName: host.hostName,
           group: 'Default',
-          isInstalled: installedComponents.someProperty('componentName', 'DATANODE')
+          isInstalled: host.get('isDataNodeInstalled')
         });
       }
       if (isMrSelected && host.get('isTaskTracker')) {
         taskTrackerHosts.push({
           hostName: host.hostName,
           group: 'Default',
-          isInstalled: installedComponents.someProperty('componentName', 'TASKTRACKER')
+          isInstalled: host.get('isTaskTrackerInstalled')
         });
       }
       if (isHbSelected && host.get('isRegionServer')) {
         regionServerHosts.push({
           hostName: host.hostName,
           group: 'Default',
-          isInstalled: installedComponents.someProperty('componentName', 'HBASE_REGIONSERVER')
+          isInstalled: host.get('isRegionServerInstalled')
         });
       }
       if (host.get('isClient')) {
         clientHosts.pushObject({
           hostName: host.hostName,
           group: 'Default',
-          isInstalled: installedComponents.someProperty('componentName', 'CLIENT')
+          isInstalled: host.get('isClientInstalled')
         });
       }
     }, this);
@@ -417,20 +408,85 @@ App.AddServiceController = Em.Controller
     });
 
     App.db.setSlaveComponentHosts(slaveComponentHosts);
+    console.log('addServiceController.slaveComponentHosts: saved hosts', slaveComponentHosts);
     this.set('content.slaveComponentHosts', slaveComponentHosts);
   },
+  /**
+   * return slaveComponents bound to hosts
+   * @return {Array}
+   */
+  getSlaveComponentHosts: function () {
+    var components = [{
+      name : 'DATANODE',
+      service : 'HDFS'
+    },
+    {
+      name: 'TASKTRACKER',
+      service: 'MAPREDUCE'
+    },{
+      name: 'HBASE_REGIONSERVER',
+      service: 'HBASE'
+    }];
+
+    var result = [];
+    var services = App.Service.find();
+    var selectedServices = this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName');
+    for(var index=0; index < components.length; index++){
+      var comp = components[index];
+      if(!selectedServices.contains(comp.service)){
+        continue;
+      }
+
 
+      var service = services.findProperty('id', comp.service);
+      var hosts = [];
+
+      service.get('hostComponents').filterProperty('componentName', comp.name).forEach(function (host_component) {
+          hosts.push({
+            group: "Default",
+            hostName: host_component.get('host.id'),
+            isInstalled: true
+          });
+      }, this);
+
+      result.push({
+        componentName: comp.name,
+        displayName: App.format.role(comp.name),
+        hosts: hosts,
+        isInstalled: true
+      })
+    }
+
+    var clientsHosts = App.HostComponent.find().filterProperty('componentName', 'HDFS_CLIENT');
+    var hosts = [];
+
+    clientsHosts.forEach(function (host_component) {
+        hosts.push({
+          group: "Default",
+          hostName: host_component.get('host.id'),
+          isInstalled: true
+        });
+    }, this);
+
+    result.push({
+      componentName: 'CLIENT',
+      displayName: 'client',
+      hosts: hosts,
+      isInstalled: true
+    })
+
+    return result;
+  },
   /**
    * Load master component hosts data for using in required step controllers
    */
   loadSlaveComponentHosts: function () {
     var slaveComponentHosts = App.db.getSlaveComponentHosts();
+    if(!slaveComponentHosts){
+      slaveComponentHosts = this.getSlaveComponentHosts();
+    }
     this.set("content.slaveComponentHosts", slaveComponentHosts);
     console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", slaveComponentHosts);
-
-    var hostSlaveComponents = App.db.getHostSlaveComponents();
-    this.set('content.hostSlaveComponents', hostSlaveComponents);
-    console.log("AddServiceController.loadSlaveComponentHosts: loaded hosts ", hostSlaveComponents);
   },
 
   /**
@@ -480,13 +536,15 @@ App.AddServiceController = Em.Controller
   saveClients: function(stepController){
     var clients = [];
     var serviceComponents = require('data/service_components');
+    var hostComponents = App.HostComponent.find();
 
     stepController.get('content').filterProperty('isSelected',true).forEach(function (_service) {
       var client = serviceComponents.filterProperty('service_name', _service.serviceName).findProperty('isClient', true);
       if (client) {
         clients.pushObject({
           component_name: client.component_name,
-          display_name: client.display_name
+          display_name: client.display_name,
+          isInstalled: hostComponents.filterProperty('componentName', client.component_name).length > 0
         });
       }
     }, this);
@@ -518,6 +576,55 @@ App.AddServiceController = Em.Controller
     }
   },
 
+  loadAdvancedConfigs: function () {
+    App.db.getSelectedServiceNames().forEach(function (_serviceName) {
+      this.loadAdvancedConfig(_serviceName);
+    }, this);
+  },
+  /**
+   * Generate serviceProperties save it to localdata
+   * called form stepController step6WizardController
+   */
+
+  loadAdvancedConfig: function (serviceName) {
+    var self = this;
+    var url = (App.testMode) ? '/data/wizard/stack/hdp/version01/' + serviceName + '.json' : App.apiPrefix + '/stacks/HDP/version/1.2.0/services/' + serviceName; // TODO: get this url from the stack selected by the user in Install Options page
+    var method = 'GET';
+    $.ajax({
+      type: method,
+      url: url,
+      async: false,
+      dataType: 'text',
+      timeout: App.timeout,
+      success: function (data) {
+        var jsonData = jQuery.parseJSON(data);
+        console.log("TRACE: Step6 submit -> In success function for the loadAdvancedConfig call");
+        console.log("TRACE: Step6 submit -> value of the url is: " + url);
+        var serviceComponents = jsonData.properties;
+        serviceComponents.setEach('serviceName', serviceName);
+        var configs;
+        if (App.db.getAdvancedServiceConfig()) {
+          configs = App.db.getAdvancedServiceConfig();
+        } else {
+          configs = [];
+        }
+        configs = configs.concat(serviceComponents);
+        self.set('content.advancedServiceConfig', configs);
+        App.db.setAdvancedServiceConfig(configs);
+        console.log('TRACE: servicename: ' + serviceName);
+      },
+
+      error: function (request, ajaxOptions, error) {
+        console.log("TRACE: STep6 submit -> In error function for the loadAdvancedConfig call");
+        console.log("TRACE: STep6 submit-> value of the url is: " + url);
+        console.log("TRACE: STep6 submit-> error code status is: " + request.status);
+        console.log('Step6 submit: Error message is: ' + request.responseText);
+      },
+
+      statusCode: require('data/statusCodes')
+    });
+  },
+
   /**
    * Generate clients list for selected services and save it to model
    * @param stepController step8WizardController or step9WizardController
@@ -525,7 +632,7 @@ App.AddServiceController = Em.Controller
   installServices: function () {
     var self = this;
     var clusterName = this.get('content.cluster.name');
-    var url = (App.testMode) ? '/data/wizard/deploy/poll_1.json' : '/api/clusters/' + clusterName + '/services?state=INIT';
+    var url = (App.testMode) ? '/data/wizard/deploy/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/services?state=INIT';
     var method = (App.testMode) ? 'GET' : 'PUT';
     var data = '{"ServiceInfo": {"state": "INSTALLED"}}';
     $.ajax({
@@ -534,7 +641,7 @@ App.AddServiceController = Em.Controller
       data: data,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         var installSartTime = new Date().getTime();
@@ -551,7 +658,7 @@ App.AddServiceController = Em.Controller
             isCompleted: false,
             installStartTime: installSartTime
           };
-          self.saveClusterStatus(clusterStatus);
+          //self.saveClusterStatus(clusterStatus);
         } else {
           console.log('ERROR: Error occurred in parsing JSON data');
         }
@@ -567,7 +674,7 @@ App.AddServiceController = Em.Controller
           isInstallError: true,
           isCompleted: false
         };
-        self.saveClusterStatus(clusterStatus);
+        //self.saveClusterStatus(clusterStatus);
       },
 
       statusCode: require('data/statusCodes')
@@ -582,6 +689,17 @@ App.AddServiceController = Em.Controller
   clearAllSteps: function () {
     this.clearHosts();
     //todo it)
+  },
+
+  /**
+   * Clear all temporary data
+   */
+  finish: function(){
+    this.setCurrentStep('1', false);
+    App.db.setService(undefined); //not to use this data at AddService page
+    App.db.setHosts(undefined);
+    App.db.setMasterComponentHosts(undefined);
+    App.db.setSlaveComponentHosts(undefined);
   }
 
 });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/info/configs.js Sun Dec  9 13:50:03 2012
@@ -30,8 +30,10 @@ App.MainServiceInfoConfigsController = E
   }.property('stepConfigs.@each.errorCount'),
 
   slaveComponentHosts : function(){
-    console.log('slaveComponentHosts');
-    console.log(App.db.getSlaveComponentHosts());
+    if(!this.get('content')){
+      return;
+    }
+    console.log('slaveComponentHosts', App.db.getSlaveComponentHosts());
     return App.db.getSlaveComponentHosts();
   }.property('content'),
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main/service/item.js Sun Dec  9 13:50:03 2012
@@ -29,7 +29,7 @@ App.MainServiceItemController = Em.Contr
   sendCommandToServer : function(url, method,postData, callback){
     var url =  (App.testMode) ?
       '/data/wizard/deploy/poll_1.json' : //content is the same as ours
-      '/api/clusters/' + App.router.getClusterName() + url;
+      App.apiPrefix + '/clusters/' + App.router.getClusterName() + url;
 
     method = App.testMode ? 'GET' : method;
 
@@ -38,7 +38,7 @@ App.MainServiceItemController = Em.Contr
       url: url,
       data: JSON.stringify(postData),
       dataType: 'json',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function(data){
         if(data && data.Requests){
           callback(data.Requests.id);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/slave_component_groups_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/slave_component_groups_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/slave_component_groups_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/slave_component_groups_controller.js Sun Dec  9 13:50:03 2012
@@ -42,6 +42,10 @@ App.SlaveComponentGroupsController = Em.
 
   }.property('App.router.wizardStep7Controller.selectedService'),
 
+  selectedComponentDisplayName: function() {
+    return App.format.role(this.get('selectedComponentName'));
+  }.property('selectedComponentName'),
+
   selectedSlaveComponent: function () {
     var selectedComponentName = this.get('selectedComponentName');
     if (selectedComponentName) {
@@ -111,7 +115,7 @@ App.SlaveComponentGroupsController = Em.
       onPrimary: function (event) {
         if (component.tempSelectedGroups && component.tempSelectedGroups.length) {
           component.tempSelectedGroups.forEach(function (item) {
-            var changed = component.hosts.filterProperty('hostname', item.hostName);
+            var changed = component.hosts.filterProperty('hostName', item.hostName);
             changed.setEach('group', item.groupName);
           })
         }
@@ -139,9 +143,9 @@ App.SlaveComponentGroupsController = Em.
     if (component.tempSelectedGroups === undefined) {
       component.tempSelectedGroups = [];
     }
-    var values = component.tempSelectedGroups.filterProperty('hostName', host.hostname);
+    var values = component.tempSelectedGroups.filterProperty('hostName', host.hostName);
     if (values.length === 0)
-      component.tempSelectedGroups.pushObject({hostName: host.hostname, groupName: groupName});
+      component.tempSelectedGroups.pushObject({hostName: host.hostName, groupName: groupName});
     else
       values.setEach('groupName', groupName);
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step10_controller.js Sun Dec  9 13:50:03 2012
@@ -43,7 +43,7 @@ App.WizardStep10Controller = Em.Controll
     slaveHosts.forEach(function (_hosts) {
       hostObj = hostObj.concat(_hosts.hosts);
     }, this);
-    slaveHosts = hostObj.mapProperty('hostname').uniq();
+    slaveHosts = hostObj.mapProperty('hostName').uniq();
     var registeredHosts = masterHosts.concat(slaveHosts).uniq();
     var registerHostsStatement = registeredHosts.length + ' hosts registered to the cluster.';
     var registerHostsObj = Ember.Object.create({
@@ -153,7 +153,8 @@ App.WizardStep10Controller = Em.Controll
           this.loadJt(component);
           break;
         case 'ZOOKEEPER_SERVER' :
-          this.loadZk(component);
+          // TODO: Fix this; redundant entries and wrong number
+          //this.loadZk(component);
           break;
         case 'HBASE_MASTER':
           this.loadHb(component);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step2_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step2_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step2_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step2_controller.js Sun Dec  9 13:50:03 2012
@@ -146,20 +146,20 @@ App.WizardStep2Controller = Em.Controlle
     }
 
     var method = App.testMode ? 'GET' : 'POST';
-    var url = App.testMode ? '/data/wizard/bootstrap/bootstrap.json' : '/api/bootstrap';
+    var url = App.testMode ? '/data/wizard/bootstrap/bootstrap.json' : App.apiPrefix + '/bootstrap';
 
     $.ajax({
       type: method,
       url: url,
       data: bootStrapData,
-      timeout: 10000,
+      timeout: App.timeout,
       contentType: 'application/json',
       success: function () {
-        console.log("TRACE: POST /api/bootstrap succeeded");
+        console.log("TRACE: POST bootstrap succeeded");
         App.router.send('next');
       },
       error: function () {
-        console.log("ERROR: POST /api/bootstrap failed");
+        console.log("ERROR: POST bootstrap failed");
         alert('Bootstrap call failed.  Please try again.');
       }
     });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step3_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step3_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step3_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step3_controller.js Sun Dec  9 13:50:03 2012
@@ -196,11 +196,11 @@ App.WizardStep3Controller = Em.Controlle
   doBootstrap: function () {
     this.numPolls++;
     var self = this;
-    var url = App.testMode ? '/data/wizard/bootstrap/poll_' + this.numPolls + '.json' : '/api/bootstrap/1';
+    var url = App.testMode ? '/data/wizard/bootstrap/poll_' + this.numPolls + '.json' : App.apiPrefix + '/bootstrap/1';
     $.ajax({
       type: 'GET',
       url: url,
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         if (data.hostsStatus !== null) {
           // in case of bootstrapping just one server, the server returns an object rather than an array...

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step5_controller.js Sun Dec  9 13:50:03 2012
@@ -42,6 +42,11 @@ App.WizardStep5Controller = Em.Controlle
     this.clearStep();
     this.renderHostInfo();
     this.renderComponents(this.loadComponents());
+
+    if(!this.get("selectedServicesMasters").filterProperty('isInstalled', false).length){
+      console.log('no master components to add');
+      App.router.send('next');
+    }
   },
 
   /**
@@ -74,46 +79,69 @@ App.WizardStep5Controller = Em.Controlle
   loadComponents: function () {
 
     var services = this.get('content.services')
-      .filterProperty('isSelected', true).mapProperty('serviceName');
+      .filterProperty('isSelected', true).mapProperty('serviceName'); //list of shown services
 
     services.forEach(function (item) {
       this.get("selectedServices").pushObject(Ember.Object.create({service_name: item}));
     }, this);
 
-    var masterHosts = this.get('content.masterComponentHosts');
+    var masterHosts = this.get('content.masterComponentHosts'); //saved to local storadge info
 
-    var components = new Ember.Set();
-    if (!masterHosts) {
+    var resultComponents = new Ember.Set();
 
-      var masterComponents = this.get('components').filterProperty('isMaster', true);
-      for (var index in services) {
-        var componentInfo = masterComponents.filterProperty('service_name', services[index]);
-        componentInfo.forEach(function (_componentInfo) {
-          console.log("TRACE: master component name is: " + _componentInfo.display_name);
+    var masterComponents = this.get('components').filterProperty('isMaster', true); //get full list from mock data
+
+    var servicesLength = services.length;
+    for (var index =0; index < servicesLength; index++) {
+      var componentInfo = masterComponents.filterProperty('service_name', services[index]);
+
+      componentInfo.forEach(function (_componentInfo) {
+
+        if(_componentInfo.component_name == 'ZOOKEEPER_SERVER'){
+          var savedComponents = masterHosts.filterProperty('component', _componentInfo.component_name);
+          if(savedComponents.length){
+
+            savedComponents.forEach(function(item){
+              var zooKeeperHost = {};
+              zooKeeperHost.display_name = _componentInfo.display_name;
+              zooKeeperHost.component_name = _componentInfo.component_name;
+              zooKeeperHost.selectedHost = item.hostName;
+              zooKeeperHost.availableHosts = [];
+              zooKeeperHost.serviceId = services[index];
+              zooKeeperHost.isInstalled = item.isInstalled;
+              resultComponents.add(zooKeeperHost);
+            })
+
+          } else{
+
+            var zooHosts = this.selectHost(_componentInfo.component_name);
+            zooHosts.forEach(function (_host) {
+              var zooKeeperHost = {};
+              zooKeeperHost.display_name = _componentInfo.display_name;
+              zooKeeperHost.component_name = _componentInfo.component_name;
+              zooKeeperHost.selectedHost = _host;
+              zooKeeperHost.availableHosts = [];
+              zooKeeperHost.serviceId = services[index];
+              zooKeeperHost.isInstalled = false;
+              resultComponents.add(zooKeeperHost);
+            });
+
+          }
+        } else {
+          var savedComponent = masterHosts.findProperty('component', _componentInfo.component_name);
           var componentObj = {};
           componentObj.component_name = _componentInfo.component_name;
           componentObj.display_name = _componentInfo.display_name;
-          componentObj.selectedHost = this.selectHost(_componentInfo.component_name);   // call the method that plays selectNode algorithm or fetches from server
-          componentObj.isInstalled = App.Component.find().someProperty('componentName', _componentInfo.component_name);
+          componentObj.selectedHost = savedComponent ? savedComponent.hostName : this.selectHost(_componentInfo.component_name);   // call the method that plays selectNode algorithm or fetches from server
+          componentObj.isInstalled = savedComponent ? savedComponent.isInstalled : App.Component.find().someProperty('componentName', _componentInfo.component_name);
+          componentObj.serviceId = services[index];
           componentObj.availableHosts = [];
-          components.add(componentObj);
-        }, this);
-      }
-
-    } else {
-
-      masterHosts.forEach(function (_masterComponentHost) {
-        var componentObj = {};
-        componentObj.component_name = _masterComponentHost.component;
-        componentObj.display_name = _masterComponentHost.display_name;
-        componentObj.selectedHost = _masterComponentHost.hostName;
-        componentObj.isInstalled = _masterComponentHost.isInstalled;
-        componentObj.availableHosts = [];
-        components.add(componentObj);
+          resultComponents.add(componentObj);
+        }
       }, this);
-
     }
-    return components;
+
+    return resultComponents;
   },
 
   /**
@@ -127,7 +155,6 @@ App.WizardStep5Controller = Em.Controlle
       this.set('selectedServicesMasters', []);
     }
 
-
     masterComponents.forEach(function (item) {
       //add the zookeeper component at the end if exists
       console.log("TRACE: render master component name is: " + item.component_name);
@@ -150,6 +177,7 @@ App.WizardStep5Controller = Em.Controlle
         this.get("selectedServicesMasters").pushObject(componentObj);
       }
     }, this);
+
   },
 
   getKerberosServer: function (noOfHosts) {
@@ -337,20 +365,7 @@ App.WizardStep5Controller = Em.Controlle
     } else if (componentName === 'TEMPLETON_SERVER') {
       return this.getTempletonServer(noOfHosts).host_name;
     } else if (componentName === 'ZOOKEEPER_SERVER') {
-      var zhosts = this.getZooKeeperServer(noOfHosts);
-      var extraHosts = zhosts.slice(0, zhosts.length - 1);
-      var zooKeeperHosts = new Ember.Set();
-      extraHosts.forEach(function (_host) {
-        var zooKeeperHost = {};
-        zooKeeperHost.display_name = 'ZooKeeper';
-        zooKeeperHost.component_name = 'ZOOKEEPER';
-        zooKeeperHost.selectedHost = _host;
-        zooKeeperHost.availableHosts = [];
-        zooKeeperHosts.add(zooKeeperHost);
-      });
-      this.renderComponents(zooKeeperHosts);
-      var lastHost = zhosts[zhosts.length - 1];
-      return lastHost;
+      return this.getZooKeeperServer(noOfHosts);
     } else if (componentName === 'GANGLIA_SERVER') {
       return this.getGangliaServer(noOfHosts);
     } else if (componentName === 'NAGIOS_SERVER') {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step6_controller.js Sun Dec  9 13:50:03 2012
@@ -28,7 +28,6 @@ var db = require('utils/db');
  *   masterComponentHosts: App.db.masterComponentHosts (master-components-to-hosts mapping the user selected in Step 5)
  *
  * Step 6 will set the following information in App.db:
- *   hostSlaveComponents: App.db.hostSlaveComponents (hosts-to-slave-components mapping the user selected in Steo 6)
  *   slaveComponentHosts: App.db.slaveComponentHosts (slave-components-to-hosts mapping the user selected in Step 6)
  *
  */
@@ -105,35 +104,43 @@ App.WizardStep6Controller = Em.Controlle
   },
 
   selectAllDataNodes: function () {
-    this.get('hosts').setEach('isDataNode', true);
+    var forFilter = this.get('hosts').filterProperty('isDataNodeInstalled', false);
+    forFilter.setEach('isDataNode', true);
   },
 
   selectAllTaskTrackers: function () {
-    this.get('hosts').setEach('isTaskTracker', true);
+    var forFilter = this.get('hosts').filterProperty('isTaskTrackerInstalled', false);
+    forFilter.setEach('isTaskTracker', true);
   },
 
   selectAllRegionServers: function () {
-    this.get('hosts').setEach('isRegionServer', true);
+    var forFilter = this.get('hosts').filterProperty('isRegionServerInstalled', false);
+    forFilter.setEach('isRegionServer', true);
   },
 
   selectAllClients: function () {
-    this.get('hosts').setEach('isClient', true);
+    var forFilter = this.get('hosts').filterProperty('isClientInstalled', false);
+    forFilter.setEach('isClient', true);
   },
 
   deselectAllDataNodes: function () {
-    this.get('hosts').setEach('isDataNode', false);
+    var forFilter = this.get('hosts').filterProperty('isDataNodeInstalled', false);
+    forFilter.setEach('isDataNode', false);
   },
 
   deselectAllTaskTrackers: function () {
-    this.get('hosts').setEach('isTaskTracker', false);
+    var forFilter = this.get('hosts').filterProperty('isTaskTrackerInstalled', false);
+    forFilter.setEach('isTaskTracker', false);
   },
 
   deselectAllRegionServers: function () {
-    this.get('hosts').setEach('isRegionServer', false);
+    var forFilter = this.get('hosts').filterProperty('isRegionServerInstalled', false);
+    forFilter.setEach('isRegionServer', false);
   },
 
   deselectAllClients: function () {
-    this.get('hosts').setEach('isClient', false);
+    var forFilter = this.get('hosts').filterProperty('isClientInstalled', false);
+    forFilter.setEach('isClient', false);
   },
 
   clearStep: function () {
@@ -169,7 +176,7 @@ App.WizardStep6Controller = Em.Controlle
     var hostsObj = Em.Set.create();
     var allHosts = this.getHostNames();
     var maxNoofHostComponents = 9;
-    var slaveHosts = this.get('content.slaveComponentHosts');
+    var slaveComponents = this.get('content.slaveComponentHosts');
 
     allHosts.forEach(function (_hostName) {
       hostsObj.push(Em.Object.create({
@@ -178,11 +185,15 @@ App.WizardStep6Controller = Em.Controlle
         isDataNode: false,
         isTaskTracker: false,
         isRegionServer: false,
-        isClient: false
+        isClient: false,
+        isDataNodeInstalled: false,
+        isTaskTrackerInstalled: false,
+        isRegionServerInstalled: false,
+        isClientInstalled: false
       }));
     });
 
-    if (!slaveHosts) { // we are at this page for the first time
+    if (!slaveComponents) { // we are at this page for the first time
       if (allHosts.length > 3) {             //multiple nodes scenario
         hostsObj.forEach(function (host) {
           host.isMaster = this.hasMasterComponents(host.hostName);
@@ -215,39 +226,43 @@ App.WizardStep6Controller = Em.Controlle
 
     } else {
 
-      var dataNodes = slaveHosts.findProperty('componentName', 'DATANODE');
+      var dataNodes = slaveComponents.findProperty('componentName', 'DATANODE');
       dataNodes.hosts.forEach(function (_dataNode) {
         var dataNode = hostsObj.findProperty('hostName', _dataNode.hostName);
         if (dataNode) {
           dataNode.set('isDataNode', true);
+          dataNode.set('isDataNodeInstalled', true);
         }
       });
 
       if (this.get('isMrSelected')) {
-        var taskTrackers = slaveHosts.findProperty('componentName', 'TASKTRACKER');
+        var taskTrackers = slaveComponents.findProperty('componentName', 'TASKTRACKER');
         taskTrackers.hosts.forEach(function (_taskTracker) {
           var taskTracker = hostsObj.findProperty('hostName', _taskTracker.hostName);
           if (taskTracker) {
             taskTracker.set('isTaskTracker', true);
+            taskTracker.set('isTaskTrackerInstalled', true);
           }
         });
       }
 
       if (this.get('isHbSelected')) {
-        var regionServers = slaveHosts.findProperty('componentName', 'HBASE_REGIONSERVER');
+        var regionServers = slaveComponents.findProperty('componentName', 'HBASE_REGIONSERVER');
         regionServers.hosts.forEach(function (_regionServer) {
           var regionServer = hostsObj.findProperty('hostName', _regionServer.hostName);
           if (regionServer) {
             regionServer.set('isRegionServer', true);
+            regionServer.set('isRegionServerInstalled', true);
           }
         });
       }
 
-      var clients = slaveHosts.findProperty('componentName', 'CLIENT');
+      var clients = slaveComponents.findProperty('componentName', 'CLIENT');
       clients.hosts.forEach(function (_client) {
         var client = hostsObj.findProperty('hostName', _client.hostName);
         if (client) {
           client.set('isClient', true);
+          client.set('isClientInstalled', true);
         }
       }, this);
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step8_controller.js Sun Dec  9 13:50:03 2012
@@ -29,10 +29,6 @@ App.WizardStep8Controller = Em.Controlle
   configMapping: require('data/config_mapping'),
 
   selectedServices: function () {
-    var services = App.Service.find();
-    this.get('content.services').forEach(function (item) {
-      item.set('isInstalled', services.someProperty('serviceName', item.get('serviceName')));
-    });
     return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false);
   }.property('content.services').cacheable(),
 
@@ -624,7 +620,7 @@ App.WizardStep8Controller = Em.Controlle
     }
 
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName;
+    var url = App.apiPrefix + '/clusters/' + clusterName;
     $.ajax({
       type: 'POST',
       url: url,
@@ -632,7 +628,7 @@ App.WizardStep8Controller = Em.Controlle
       //accepts: 'text',
       dataType: 'text',
       data: '{"Clusters": {"version" : "HDP-1.2.0"}}',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for createCluster call");
@@ -660,13 +656,13 @@ App.WizardStep8Controller = Em.Controlle
 
   createService: function (service, httpMethod) {
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/services/' + service;
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + service;
     $.ajax({
       type: httpMethod,
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for the createService call");
@@ -685,27 +681,27 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   createComponents: function () {
-    //TODO: Uncomment following after hooking up with all services.
+
     var serviceComponents = require('data/service_components');
     var services = this.get('selectedServices').mapProperty('serviceName');
     services.forEach(function (_service) {
       var components = serviceComponents.filterProperty('service_name', _service);
       components.forEach(function (_component) {
-        console.log("value of component is: " + _component.component_name);
         this.createComponent(_service, _component.component_name);
       }, this);
     }, this);
+
   },
 
   createComponent: function (service, component) {
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/services/' + service + '/components/' + component;
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + service + '/components/' + component;
     $.ajax({
       type: 'POST',
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for createComponent");
@@ -734,13 +730,13 @@ App.WizardStep8Controller = Em.Controlle
 
   registerHostToCluster: function (hostName) {
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/hosts/' + hostName;
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/hosts/' + hostName;
     $.ajax({
       type: 'POST',
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for registerHostToCluster");
@@ -780,11 +776,12 @@ App.WizardStep8Controller = Em.Controlle
           this.createHostComponent(slaveObj);
         }, this);
       } else {
+        //: todo
         this.get('content.clients').forEach(function (_client) {
           slaveObj.component = _client.component_name;
           _slaveHosts.hosts.forEach(function (_slaveHost) {
             slaveObj.hostName = _slaveHost.hostName;
-            slaveObj.isInstalled = _slaveHost.isInstalled;
+            slaveObj.isInstalled = _slaveHost.isInstalled && _client.isInstalled;
             this.createHostComponent(slaveObj);
           }, this);
         }, this);
@@ -800,20 +797,20 @@ App.WizardStep8Controller = Em.Controlle
   },
 
   createHostComponent: function (hostComponent) {
-    console.log(hostComponent);
+    console.log('try to install', hostComponent.component, 'on host',  hostComponent.hostName, 'isInstalled', hostComponent.isInstalled);
     if (hostComponent.isInstalled) {
       return false;
     }
 
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/hosts/' + hostComponent.hostName + '/host_components/' + hostComponent.component;
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/hosts/' + hostComponent.hostName + '/host_components/' + hostComponent.component;
 
     $.ajax({
       type: 'POST',
       url: url,
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for the createComponent with new host call");
@@ -841,7 +838,6 @@ App.WizardStep8Controller = Em.Controlle
       this.createConfigSite(this.createMrSiteObj('MAPREDUCE'));
     }
     if (selectedServices.someProperty('serviceName', 'HBASE')) {
-      // TODO
       this.createConfigSite(this.createHbaseSiteObj('HBASE'));
     }
     if (selectedServices.someProperty('serviceName', 'OOZIE')) {
@@ -856,14 +852,14 @@ App.WizardStep8Controller = Em.Controlle
   createConfigSite: function (data) {
     console.log("Inside createConfigSite");
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/configurations';
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/configurations';
     $.ajax({
       type: 'POST',
       url: url,
       data: JSON.stringify(data),
       async: false,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for the createConfigSite");
@@ -942,6 +938,10 @@ App.WizardStep8Controller = Em.Controlle
     configs.forEach(function (_configProperty) {
       hbaseProperties[_configProperty.name] = _configProperty.value;
     }, this);
+    var masterHosts = App.db.getMasterComponentHosts();
+    // TODO: should filter on "component" but that gives unexpected results
+    var zkServers = masterHosts.filterProperty('display_name', 'ZooKeeper').mapProperty('hostName');
+    hbaseProperties['hbase.zookeeper.quorum'] = zkServers.join(',');
     return {type: 'hbase-site', tag: 'version1', properties: hbaseProperties};
   },
 
@@ -951,6 +951,11 @@ App.WizardStep8Controller = Em.Controlle
     configs.forEach(function (_configProperty) {
       oozieProperties[_configProperty.name] = _configProperty.value;
     }, this);
+    var baseUrl = oozieProperties['oozie.base.url'];
+    oozieProperties = {
+      "oozie.service.JPAService.jdbc.password" : " ", "oozie.db.schema.name" : "oozie", "oozie.service.JPAService.jdbc.url" : "jdbc:derby:/var/data/oozie/oozie-db;create=true", "oozie.service.JPAService.jdbc.driver" : "org.apache.derby.jdbc.EmbeddedDriver", "oozie.service.WorkflowAppService.system.libpath" : "/user/oozie/share/lib", "oozie.service.JPAService.jdbc.username" : "sa", "oozie.service.SchemaService.wf.ext.schemas" : "shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd", "oozie.service.JPAService.create.db.schema" : "false",   "use.system.libpath.for.mapreduce.and.pig.jobs" : "false", "oozie.service.ActionService.executor.ext.classes" : "org.apache.oozie.action.email.EmailActionExecutor,org.apache.oozie.action.hadoop.HiveActionExecutor,org.apache.oozie.action.hadoop.ShellActionExecutor,org.apache.oozie.action.hadoop.SqoopActionExecutor,org.apache.oozie.action.hadoop.DistcpActionExecutor", "oozi
 e.service.HadoopAccessorService.hadoop.configurations" : "*=/etc/hadoop/conf"
+    };
+    oozieProperties['oozie.base.url'] = baseUrl;
     return {type: 'oozie-site', tag: 'version1', properties: oozieProperties};
   },
 
@@ -974,7 +979,7 @@ App.WizardStep8Controller = Em.Controlle
   applyCreatedConfToService: function (service, httpMethod, data) {
     console.log("Inside applyCreatedConfToService");
     var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value;
-    var url = '/api/clusters/' + clusterName + '/services/' + service;
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services/' + service;
 
     $.ajax({
       type: httpMethod,
@@ -982,7 +987,7 @@ App.WizardStep8Controller = Em.Controlle
       async: false,
       dataType: 'text',
       data: JSON.stringify(data),
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: STep8 -> In success function for the applyCreatedConfToService call");

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js?rev=1418956&r1=1418955&r2=1418956&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/wizard/step9_controller.js Sun Dec  9 13:50:03 2012
@@ -196,7 +196,7 @@ App.WizardStep9Controller = Em.Controlle
   launchStartServices: function () {
     var self = this;
     var clusterName = this.get('content.cluster.name');
-    var url = '/api/clusters/' + clusterName + '/services?state=INSTALLED';
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/services?state=INSTALLED';
     var data = '{"ServiceInfo": {"state": "STARTED"}}';
     var method = 'PUT';
 
@@ -213,7 +213,7 @@ App.WizardStep9Controller = Em.Controlle
       async: false,
       data: data,
       dataType: 'text',
-      timeout: 5000,
+      timeout: App.timeout,
       success: function (data) {
         var jsonData = jQuery.parseJSON(data);
         console.log("TRACE: Step9 -> In success function for the startService call");
@@ -343,8 +343,10 @@ App.WizardStep9Controller = Em.Controlle
   setHostsStatus: function (hostNames, status) {
     hostNames.forEach(function (_hostName) {
       var host = this.hosts.findProperty('name', _hostName);
-      host.set('status', status);
-      host.set('progress', '100');
+      if(host){
+        host.set('status', status)
+            .set('progress', '100');
+      }
     }, this);
   },
 
@@ -371,7 +373,7 @@ App.WizardStep9Controller = Em.Controlle
           if (this.isStepFailed(polledData)) {
             clusterStatus.status = 'START FAILED';      // 'START FAILED' implies to step10 that installation was successful but start failed
             this.set('status', 'failed');
-            this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData));
+            this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
           }
         }
         App.router.get(this.get('content.controllerName')).saveClusterStatus(clusterStatus);
@@ -490,7 +492,7 @@ App.WizardStep9Controller = Em.Controlle
   getUrl: function () {
     var clusterName = this.get('content.cluster.name');
     var requestId = App.db.getClusterStatus().requestId;
-    var url = '/api/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
+    var url = App.apiPrefix + '/clusters/' + clusterName + '/requests/' + requestId + '?fields=tasks/*';
     console.log("URL for step9 is: " + url);
     return url;
   },
@@ -517,7 +519,7 @@ App.WizardStep9Controller = Em.Controlle
       type: 'GET',
       url: url,
       async: true,
-      timeout: 10000,
+      timeout: App.timeout,
       dataType: 'text',
       success: function (data) {
         console.log("TRACE: In success function for the GET bootstrap call");