You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/01/20 13:23:20 UTC

[1/2] AMBARI-4348. Mirroring: New Dataset Dialog integration with API. ( akovalenko)

Updated Branches:
  refs/heads/trunk 78b63993b -> b26bca933


http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/edit_dataset.hbs b/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
new file mode 100644
index 0000000..48b11dd
--- /dev/null
+++ b/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
@@ -0,0 +1,121 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+<div class="row-fluid">
+  <form class="form-horizontal">
+    <div class="add-data-set">
+      <table>
+        <tr {{bindAttr class="errors.isNameError:error"}}>
+          <td class="percent25" colspan="1">
+            {{t mirroring.dataset.name}}
+          </td>
+          <td colspan="2" style="text-align: left">
+            {{view Ember.TextField valueBinding="formFields.datasetName" class="span4"}}
+            <span class="help-inline">{{errorMessages.name}}</span>
+          </td>
+        </tr>
+        <tr>
+          <td class="spacer" colspan="3"></td>
+        </tr>
+
+        <tr {{bindAttr class="errors.isTypeError:error"}}>
+          <td class="percent25" colspan="1">
+            {{t mirroring.dataset.type}}
+          </td>
+          <td colspan="2" style="text-align: left">
+            {{view Ember.Select selectionBinding="formFields.datasetType" contentBinding="view.datasetTypeOptions"}}
+            <span class="help-inline">{{errorMessages.type}}</span>
+          </td>
+        </tr>
+        <tr>
+          <td class="spacer" colspan="3"></td>
+        </tr>
+
+        <tr {{bindAttr class="errors.isSourceDirError:error"}}>
+          <td colspan="1">
+            {{t mirroring.dataset.sourceDir}}
+          </td>
+          <td colspan="2" style="text-align: left">
+            {{view Ember.TextField valueBinding="formFields.datasetSourceDir" class="span4"}}
+            <span class="help-inline">{{errorMessages.sourceDir}}</span>
+          </td>
+        </tr>
+        <tr>
+          <td class="spacer" colspan="3"></td>
+        </tr>
+        <tr {{bindAttr class="errors.isTargetClusterError:error"}}>
+          <td colspan="1">
+            {{t mirroring.dataset.target}}
+          </td>
+          <td colspan="2" style="text-align: left">
+            {{view view.targetClusterSelect selectionBinding="formFields.datasetTargetClusterName"}}
+            <span class="help-inline">{{errorMessages.targetCluster}}</span>
+          </td>
+        </tr>
+        <tr>
+          <td class="spacer" colspan="3"></td>
+        </tr>
+        <tr {{bindAttr class="errors.isTargetDirError:error"}}>
+          <td class="spacer" colspan="1">
+            {{t mirroring.dataset.targetDir}}
+          </td>
+          <td colspan="2" style="text-align: left">
+            {{view Ember.TextField valueBinding="formFields.datasetTargetDir" class="span4"}}
+            <span class="help-inline">{{errorMessages.targetDir}}</span>
+          </td>
+        </tr>
+        <tr>
+          <td class="spacer" colspan="3"></td>
+        </tr>
+        <tr>
+          <td colspan="1"> {{t mirroring.dataset.schedule}} </td>
+          <td colspan="2" style="text-align: left">
+            <div {{bindAttr class="errors.isStartDateError:error"}}>
+              {{view Ember.TextField valueBinding="formFields.datasetStartDate" class="input-small datepicker"}}
+              {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForStart" class="input-mini"}}
+              {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForStart" class="input-mini"}}
+              {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForStart" class="input-mini"}}
+              <span class="help-inline">{{errorMessages.startDate}}</span>
+            </div>
+            <div>
+              {{t mirroring.dataset.schedule.to}}
+            </div>
+            <div {{bindAttr class="errors.isEndDateError:error"}}>
+              {{view Ember.TextField valueBinding="formFields.datasetEndDate" class="input-small datepicker"}}
+              {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForEnd" class="input-mini"}}
+              {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForEnd" class="input-mini"}}
+              {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForEnd" class="input-mini"}}
+              <span class="help-inline">{{errorMessages.endDate}}</span>
+            </div>
+
+            <div {{bindAttr class=" :each-row errors.isFrequencyError:error"}}>
+              {{t mirroring.dataset.schedule.repeatEvery}}
+              {{view Ember.TextField valueBinding="formFields.datasetFrequency" class="input-mini"}}
+              {{view Ember.Select contentBinding="view.repeatOptions" selectionBinding="formFields.repeatOptionSelected" class="input-small"}}
+              <span class="help-inline">{{errorMessages.frequency}}</span>
+            </div>
+          </td>
+        </tr>
+      </table>
+    </div>
+  </form>
+</div>
+{{#if isPopupForEdit}}
+  <div class="pull-right dataset-delete">
+    <a {{action deleteDatasetClick target="controller"}} class="btn btn-danger">{{t common.delete}}</a>
+  </div>
+{{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 6563ad0..4421d31 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -1338,6 +1338,18 @@ var urls = {
   'mirroring.dataset.get_all_instances': {
     'real': 'falcon/instance/status/feed/{dataset}',
     'mock': '/data/mirroring/{dataset}_instances.json'
+  },
+
+  'mirroring.create_new_dataset': {
+    'real': '/falcon/entities/submitAndSchedule/feed',
+    'mock': '/data/mirroring/succeeded.json',
+    'type': 'POST',
+    'format': function (data) {
+      return {
+        contentType: 'text/xml',
+        data: data.dataset
+      }
+    }
   }
 };
 /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index f2df482..6c1be82 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -214,8 +214,7 @@ require('views/main/apps/item_view');
 require('views/main/apps/item/bar_view');
 require('views/main/apps/item/dag_view');
 require('views/main/mirroring_view');
-require('views/main/mirroring/dropdown_view');
-require('views/main/mirroring/dataset_view');
+require('views/main/mirroring/edit_dataset_view');
 require('views/main/mirroring/datasets_view');
 require('views/main/mirroring/jobs_view');
 require('views/main/mirroring/targetClusterView');

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/views/main/mirroring/dataset_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/dataset_view.js b/ambari-web/app/views/main/mirroring/dataset_view.js
deleted file mode 100644
index 3e677e0..0000000
--- a/ambari-web/app/views/main/mirroring/dataset_view.js
+++ /dev/null
@@ -1,370 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-var filters = require('views/common/filter_view');
-var sort = require('views/common/sort_view');
-var date = require('utils/date');
-
-App.MainMirroringDataSetView = Em.View.extend({
-  name: 'mainMirroringDataSetView',
-  templateName: require('templates/main/mirroring/dataset'),
-  repeatNumberSelected: null,
-  repeatOptions: Ember.Object.create({
-    repeatOptionSelected: function (key, value) {
-      if (value) {
-        // setter
-        var content = this.get('content');
-        for (var i = 0; i < content.length; i++) {
-          if (content.objectAt(i).get('value').toLowerCase() === value.get('value').toLowerCase())
-            return content.objectAt(i);
-        }
-      }
-      return this.get('content').objectAt(0);
-    }.property(),
-    content: function () {
-      return [
-        Ember.Object.create({ value: "Days"}),
-        Ember.Object.create({ value: "Weeks"}),
-        Ember.Object.create({ value: "Hours"}),
-        Ember.Object.create({ value: "Minutes"})
-      ];
-    }.property('controller.model.newDataSet')
-  }),
-  rawDataset: null,
-
-  targetClusterSelect: App.MainMirroringDropdownView.extend({
-
-    selected: function (key, manuallySelectedElement) {
-      // getter
-      if (arguments.length == 1) {
-        var targetClusterSelected = this.get('controller.model.newDataSet.targetCluster.clusterName');
-
-        if (targetClusterSelected && targetClusterSelected.trim() !== '') {
-          var newClusterOption = Ember.Object.create({title: targetClusterSelected, value: ''});
-          return newClusterOption;
-        }
-        else {
-          var defaultSelect = Ember.Object.create({title: Em.I18n.t('mirroring.dataset.selectTargetClusters'), value: ''});
-          return defaultSelect;
-        }
-      } else {
-        //setter ( if we manually change the dropdown option )
-        return manuallySelectedElement;
-
-      }
-    }.property('controller.model.newDataSet.targetCluster'),
-
-    controller: App.get('router.mainMirroringDataSetController'),
-
-    listOfOptions: function () {
-      var listOfTargetClusterNames = this.get('controller.model.listOfTargetClusterNames');
-      var returnValue = [];
-      if (listOfTargetClusterNames) {
-        listOfTargetClusterNames.forEach(
-          function (targetClusterName) {
-            returnValue.push({
-              title: targetClusterName,
-              value: ''
-            });
-
-          }, this);
-
-        returnValue.push({
-          title: Em.I18n.t('mirroring.dataset.addTargetCluster'),
-          value: ''
-        });
-
-      }
-      return returnValue;
-    }.property('controller.model.listOfTargetClusterNames'),
-
-    select: function (event) {
-      if (event.currentTarget.innerText === Em.I18n.t('mirroring.dataset.addTargetCluster')) {
-        this.get('controller').createTargetCluster();
-      }
-      else {
-        var selected = event.context;
-        this.set('selected', selected);
-        // var targetClusterRecord = App.TargetCluster.find({clusterName : selected.title});  NOT WORKING. Not sure. Why.
-        var targetClusterRecord = App.TargetCluster.find().findProperty("clusterName", selected.title); // WORKING
-        this.set('controller.model.newDataSet.targetCluster', targetClusterRecord);
-      }
-    }
-
-  }),
-
-  dayOrNightOptions: function (key, value) {
-    var obj = Ember.Object.create({
-      content: [
-        Ember.Object.create({name: "AM", value: 'AM'}),
-        Ember.Object.create({name: "PM", value: 'PM'})
-      ]
-    });
-
-    if (value) {
-      // setter
-      obj.set('selectedForStart', Ember.Object.create({name: value.selectedForStart, value: value.selectedForStart}));
-      obj.set('selectedForEnd', Ember.Object.create({name: value.selectedForEnd, value: value.selectedForEnd}));
-    } else {
-      obj.set('selectedForStart', obj.content.objectAt(0));
-      obj.set('selectedForEnd', obj.content.objectAt(0));
-    }
-
-    return obj;
-
-  }.property('controller.model.newDataSet'),
-
-  typeSelect: App.MainMirroringDropdownView.extend({
-
-    controller: App.get('router.mainMirroringDataSetController'),
-
-    select: function (event) {
-      var selected = event.context;
-      this.set('selected', selected);
-      this.set('controller.model.newDataSet.type', selected.value);
-    },
-
-    listOfOptions: function () {
-      return [
-        {
-          title: Em.I18n.t('mirroring.dataset.type.HDFS'),
-          value: 'HDFS'
-        },
-        {
-          title: Em.I18n.t('mirroring.dataset.type.Hive'),
-          value: 'Hive'
-        }
-      ]
-    }.property()
-
-  }),
-
-  hourOptions: Ember.Object.create({
-    selectedForStart: function (key, value) {
-      if (value) {
-        var content = this.get('content');
-        for (var i = 0; i < content.length; i++) {
-          if (parseInt(content.objectAt(i).get('value')) === parseInt(value.get('value')))
-            return content.objectAt(i);
-        }
-      }
-      return this.get('content').objectAt(0);
-    }.property('controller.model.newDataSet'),
-
-    selectedForEnd: function (key, value) {
-      if (value) {
-        var content = this.get('content');
-        for (var i = 0; i < content.length; i++) {
-          if (parseInt(content.objectAt(i).get('value')) === parseInt(value.get('value')))
-            return content.objectAt(i);
-        }
-      }
-      return this.get('content').objectAt(0);
-    }.property('controller.model.newDataSet'),
-
-    content: function () {
-      var values = [];
-      for (var i = 0; i < 12; i++) {
-        if (i == 0)
-          values.push(Ember.Object.create({value: '12'}));
-        else
-          values.push(Ember.Object.create({value: (i < 10 ? '0' + i : '' + i)}));
-      }
-      return values;
-    }.property()
-  }),
-
-  minuteOptions: Ember.Object.create({
-    selectedForStart: function (key, value) {
-      if (value) {
-        var content = this.get('content');
-        for (var i = 0; i < content.length; i++) {
-          if (parseInt(content.objectAt(i).get('value')) === parseInt(value.get('value')))
-            return content.objectAt(i);
-        }
-      }
-      return this.get('content').objectAt(0);
-    }.property('controller.model.newDataSet'),
-
-    selectedForEnd: function (key, value) {
-      if (value) {
-        var content = this.get('content');
-        for (var i = 0; i < content.length; i++) {
-          if (parseInt(content.objectAt(i).get('value')) === parseInt(value.get('value')))
-            return content.objectAt(i);
-        }
-      }
-      return this.get('content').objectAt(0);
-    }.property('controller.model.newDataSet'),
-
-    content: function () {
-      var values = [];
-      for (var i = 0; i < 60; i += 5) {
-        values.push(Ember.Object.create({value: (i < 10 ? '0' + i : '' + i)}));
-      }
-      return values;
-    }.property()
-  }),
-
-  /*
-   // May be used in future
-   timeOptions: Ember.Object.create({
-
-   selectedForStart: 1,
-   selectedForEnd: 1,
-   content: function () {
-   var values = [];
-   for (var i = 0; i < 24; i++) {
-   var j = i;
-   if (j == 0) {
-   j = 12;
-   }
-   else if (j > 12) {
-   j = j % 12;
-   }
-
-   values.push((j < 10 ? '0' + j : '' + j) + (i < 12 ? ':00am' : ':00pm'));
-   values.push((j < 10 ? '0' + j : '' + j) + (i < 12 ? ':30am' : ':30pm'));
-
-   }
-   return values;
-   }.property()
-   }),
-
-   */
-
-  /*
-   idChanged: function() {
-   var newDataSet = this.get('newDataSet');
-   if( newDataSet && newDataSet.name ){
-   var re = new RegExp(" ", "g");
-   newDataSet.id = newDataSet.name.replace(re, "_");
-   var schedule = newDataSet.getSchedule();
-   schedule.set('id',newDataSet.id);
-   }
-
-   }.observes('newDataSet.name'),
-   */
-  scheduleChangedOnUI: function () {
-
-    var isPleaseIgnoreListener = this.get('isPleaseIgnoreListener');
-    if (isPleaseIgnoreListener) {
-      return;
-    }
-
-    var isPleaseIgnoreListener = this.get('isPleaseIgnoreListener');
-
-
-    var newDataSet = this.get('controller.model.newDataSet');
-
-    var schedule = newDataSet.get('schedule');
-
-    var startTime = this.get('hourOptions.selectedForStart.value') + ':' + this.get('minuteOptions.selectedForStart.value') + ':' + this.get('dayOrNightOptions.selectedForStart.value');
-    var endTime = this.get('hourOptions.selectedForEnd.value') + ':' + this.get('minuteOptions.selectedForEnd.value') + ':' + this.get('dayOrNightOptions.selectedForEnd.value');
-    var timezone = 'UTC'; // TODO : Need to set this correctly
-    var frequency = this.get('repeatOptions.repeatOptionSelected.value') + '(' + this.get('repeatNumberSelected') + ')';
-
-    schedule.set('startTime', startTime);
-    schedule.set('endTime', endTime);
-    schedule.set('timezone', timezone);
-    schedule.set('frequency', frequency);
-    schedule.set('dataset', newDataSet);
-
-    //1. We need to find start time, end time
-    //2. We need to
-  }.observes('hourOptions.selectedForStart.value', 'hourOptions.selectedForEnd.value', 'minuteOptions.selectedForStart.value', 'minuteOptions.selectedForEnd.value', 'dayOrNightOptions.selectedForStart.value', 'dayOrNightOptions.selectedForEnd.value', 'repeatOptions.repeatOptionSelected.value', 'repeatNumberSelected'),
-
-
-  isPleaseIgnoreListener: false,
-
-  updateScheduleOnUI: function () {
-    this.set('isPleaseIgnoreListener', true);
-    var newDataSet = this.get('controller.model.newDataSet');
-
-    var schedule = newDataSet.get('schedule');
-
-    // this.notifyPropertyChange("hourOptions.selectedForStart.value");
-    var startTime = schedule.get('startTime');
-    var endTime = schedule.get('endTime');
-    var timezone = schedule.get('timezone'); // TODO : Need to handle this correctly
-    var frequency = schedule.get('frequency');
-    var repeatNumberSelected = frequency.substring(frequency.indexOf('(') + 1, frequency.indexOf(')'));
-    var repeatOptionSelected = frequency.substring(0, frequency.indexOf('('));
-
-    this.set('repeatNumberSelected', repeatNumberSelected);
-    this.set('repeatOptions.repeatOptionSelected', Ember.Object.create({value: repeatOptionSelected}));
-
-    var startTimeOptions = startTime.split(':');
-    var endTimeOptions = endTime.split(':');
-
-    var startHour = startTimeOptions[0];
-    var startMinute = startTimeOptions[1];
-    var startAMPM = startTimeOptions[2];
-
-    var endHour = endTimeOptions[0];
-    var endMinute = endTimeOptions[1];
-    var endAMPM = endTimeOptions[2];
-
-    this.set('dayOrNightOptions',
-      {
-        selectedForStart: startAMPM,
-        selectedForEnd: endAMPM
-      });
-
-    this.set('hourOptions.selectedForStart', Ember.Object.create({value: startHour}));
-    this.set('hourOptions.selectedForEnd', Ember.Object.create({value: endHour}));
-    this.set('minuteOptions.selectedForStart', Ember.Object.create({value: startMinute}));
-    this.set('minuteOptions.selectedForEnd', Ember.Object.create({value: endMinute}));
-    this.set('isPleaseIgnoreListener', false);
-  },
-
-  /**
-   * When View is displayed, it asks the controller "Give me the Model".
-   */
-  didInsertElement: function () {
-    var controller = this.get('controller');
-
-    // Load model and expose to view
-    var ds = controller.get('model.newDataSet');
-
-    if (this.get('controller.isPopupForEdit'))
-      this.updateScheduleOnUI();
-
-
-    // copy dataset for "undo" ability
-    var props = Em.Object.create();
-    for (var prop in ds) {
-      if (ds.hasOwnProperty(prop)
-        && prop.indexOf('__ember') < 0
-        && prop.indexOf('_super') < 0
-        && Em.typeOf(ds.get(prop)) !== 'function'
-        ) {
-        props.set(prop, ds.get(prop));
-      }
-    }
-    this.set('controller.rawDataSet', props);
-
-    $('.datepicker').datepicker({
-      format: 'mm/dd/yyyy'
-    });
-  }
-
-
-
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/views/main/mirroring/dropdown_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/dropdown_view.js b/ambari-web/app/views/main/mirroring/dropdown_view.js
deleted file mode 100644
index 114bb13..0000000
--- a/ambari-web/app/views/main/mirroring/dropdown_view.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-var filters = require('views/common/filter_view');
-var sort = require('views/common/sort_view');
-var date = require('utils/date');
-
-App.MainMirroringDropdownView = Em.View.extend({
-
-  name : 'mainMirroringDropdownSelect',
-
-  templateName:require('templates/main/mirroring/dropdown'),
-
-  selected: Ember.Object.create({title: 'Select type', value: ''}),
-
-  listOfOptions : null,
-
-  select: function(event){
-    var selected = event.context;
-    this.set('selected', selected);
-  },
-
-  didInsertElement:function () {
-    var controller = this.get('controller');
-  }
-})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/views/main/mirroring/edit_dataset_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/edit_dataset_view.js b/ambari-web/app/views/main/mirroring/edit_dataset_view.js
new file mode 100644
index 0000000..2d94c94
--- /dev/null
+++ b/ambari-web/app/views/main/mirroring/edit_dataset_view.js
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+var filters = require('views/common/filter_view');
+var sort = require('views/common/sort_view');
+var date = require('utils/date');
+
+App.MainMirroringEditDataSetView = Em.View.extend({
+  name: 'mainMirroringEditDataSetView',
+  templateName: require('templates/main/mirroring/edit_dataset'),
+
+  datasetTypeOptions: [Em.I18n.t('mirroring.dataset.type.HDFS'), Em.I18n.t('mirroring.dataset.type.Hive')],
+
+  targetClusterSelect: Em.Select.extend({
+    classNames: ['target-cluster-select'],
+
+    content: function () {
+      return [App.get('clusterName'), Em.I18n.t('mirroring.dataset.addTargetCluster')]
+    }.property(),
+
+    change: function () {
+      if (this.get('selection') === Em.I18n.t('mirroring.dataset.addTargetCluster')) {
+        this.set('selection', this.get('content')[0]);
+        App.router.get('mainMirroringController').manageClusters();
+      }
+      this.set('parentView.controller.formFields.datasetTargetClusterName', this.get('selection'))
+    }
+  }),
+
+  repeatOptions: [Em.I18n.t('mirroring.dataset.repeat.minutes'), Em.I18n.t('mirroring.dataset.repeat.hours'), Em.I18n.t('mirroring.dataset.repeat.days'), Em.I18n.t('mirroring.dataset.repeat.months')],
+
+  middayPeriodOptions: [Em.I18n.t('mirroring.dataset.middayPeriod.am'), Em.I18n.t('mirroring.dataset.middayPeriod.pm')],
+
+  hourOptions: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
+
+  minuteOptions: ['00', '05', '10', '15', '20', '25', '30', '35', '40', '45', '50', '55'],
+
+  didInsertElement: function () {
+    $('.datepicker').datepicker({
+      format: 'mm/dd/yyyy'
+    });
+  },
+
+  willDestroyElement: function () {
+    var controller = this.get('controller');
+    Em.keys(this.get('controller.formFields')).forEach(function (key) {
+      controller.removeObserver('formFields.' + key, controller, 'validate');
+    }, this);
+    this._super();
+  },
+
+  init: function () {
+    this.get('controller').clearStep();
+    this._super();
+  }
+});


[2/2] git commit: AMBARI-4348. Mirroring: New Dataset Dialog integration with API. ( akovalenko)

Posted by ak...@apache.org.
AMBARI-4348. Mirroring: New Dataset Dialog integration with API.  ( akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b26bca93
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b26bca93
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b26bca93

Branch: refs/heads/trunk
Commit: b26bca933b023a1d5a074661072f9671a6de8f78
Parents: 78b6399
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Mon Jan 20 14:19:22 2014 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Mon Jan 20 14:19:22 2014 +0200

----------------------------------------------------------------------
 .../assets/data/mirroring/all_dataset_jobs.json |  32 --
 .../app/assets/data/mirroring/all_datasets.json | 335 ---------------
 .../app/assets/data/mirroring/each_dataset.json | 101 -----
 .../assets/data/mirroring/each_dataset_job.json |  13 -
 .../app/assets/data/mirroring/past_jobs.json    |  20 -
 .../mirroring/poll/testConnection_poll1.json    |  60 ---
 .../mirroring/poll/testConnection_poll2.json    |  60 ---
 .../mirroring/poll/testConnection_poll3.json    |  60 ---
 .../mirroring/poll/testConnection_poll4.json    |  60 ---
 .../app/assets/data/mirroring/succeeded.json    |   5 +
 .../assets/data/mirroring/target_clusters.json  | 194 ---------
 .../assets/data/mirroring/upcoming_jobs.json    |  20 -
 ambari-web/app/controllers.js                   |   2 +-
 .../main/mirroring/dataset_controller.js        | 421 -------------------
 .../main/mirroring/edit_dataset_controller.js   | 244 +++++++++++
 .../testConnectionResults_controller.js         |   2 +-
 .../controllers/main/mirroring_controller.js    |   6 +-
 ambari-web/app/messages.js                      |   8 +-
 ambari-web/app/routes/main.js                   | 323 +-------------
 ambari-web/app/styles/application.less          |   6 +
 .../app/templates/main/mirroring/dataset.hbs    | 121 ------
 .../app/templates/main/mirroring/datasets.hbs   |   2 +-
 .../app/templates/main/mirroring/dropdown.hbs   |  29 --
 .../templates/main/mirroring/edit_dataset.hbs   | 121 ++++++
 ambari-web/app/utils/ajax.js                    |  12 +
 ambari-web/app/views.js                         |   3 +-
 .../app/views/main/mirroring/dataset_view.js    | 370 ----------------
 .../app/views/main/mirroring/dropdown_view.js   |  42 --
 .../views/main/mirroring/edit_dataset_view.js   |  72 ++++
 29 files changed, 487 insertions(+), 2257 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/all_dataset_jobs.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/all_dataset_jobs.json b/ambari-web/app/assets/data/mirroring/all_dataset_jobs.json
deleted file mode 100644
index 76abd53..0000000
--- a/ambari-web/app/assets/data/mirroring/all_dataset_jobs.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
-  "href" : "http://ec2...com:8080/api/v1/feeds/feed1/instances",
-  "items" : [
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-      "Instances":{
-        "id":"99",
-        "cluster":"drtarget1",
-        "sourceCluster":"drsource",
-        "status":"RUNNING",
-        "start":"2013-03-06T03:17Z",
-        "end":"2013-03-06T03:19Z",
-        "details":"",
-        "log":""
-      }
-    },
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-      "Instances":{
-        "id":"95",
-        "cluster":"drtarget1",
-        "sourceCluster":"drsource",
-        "status":"RUNNING",
-        "start":"2013-03-06T03:17Z",
-        "end":"2013-03-06T03:19Z",
-        "details":"",
-        "log":""
-      }
-    }
-  ]
-}
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/all_datasets.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/all_datasets.json b/ambari-web/app/assets/data/mirroring/all_datasets.json
deleted file mode 100644
index 76d387c..0000000
--- a/ambari-web/app/assets/data/mirroring/all_datasets.json
+++ /dev/null
@@ -1,335 +0,0 @@
-{
-  "href":"http://ec2...com:8080/api/v1/feeds",
-  "items":[
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1",
-      "Feeds":{
-        "description":"test feed 1",
-        "name":"feed_1",
-        "status":"SCHEDULED",
-        "groups":"online,bi",
-        "frequency":"minutes(1)",
-        "timezone":"UTC",
-        "late-arrival":{
-          "cut-off":"minutes(10)"
-        },
-        "clusters":{
-          "cluster":[
-            {
-              "name":"drsource3",
-              "type":"source",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(15)",
-                "action":"delete"
-              }
-            },
-            {
-              "name":"drtarget3",
-              "type":"target",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(17)",
-                "action":"delete"
-              }
-            }
-          ]
-        },
-        "locations":{
-          "location":{
-            "type":"data",
-            "path":"/mirrorthis"
-          }
-        },
-        "ACL":{
-          "owner":"testuser",
-          "group":"group",
-          "permission":"0x755"
-        },
-        "schema":{
-          "location":"/schema/clicks",
-          "provider":"protobuf"
-        },
-        "properties":{
-          "property":[
-            {
-              "name":"field3",
-              "value":"value3"
-            },
-            {
-              "name":"field2",
-              "value":"value2"
-            },
-            {
-              "name":"field4",
-              "value":"value2"
-            }
-          ]
-        }
-      },
-      "instances":[
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-          "Instances":{
-            "id":"99",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"FAILED",
-            "start":"2013-01-01T03:17Z",
-            "end":"2013-01-01T03:19Z",
-            "details":"",
-            "log":""
-          }
-        },
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-          "Instances":{
-            "id":"95",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"FAILED",
-            "start":"2012-03-06T03:17Z",
-            "end":"2012-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        },
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-          "Instances":{
-            "id":"90",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"FAILED",
-            "start":"2012-03-06T03:17Z",
-            "end":"2012-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        },
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-          "Instances":{
-            "id":"91",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"SUCCESSFUL",
-            "start":"2013-03-11T03:17Z",
-            "end":"2013-03-11T03:19Z",
-            "details":"",
-            "log":""
-          }
-        }
-      ]
-    },
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed2",
-      "Feeds":{
-        "description":"test feed 2",
-        "name":"feed_2",
-        "status":"SCHEDULED",
-        "groups":"online,bi",
-        "frequency":"minutes(1)",
-        "timezone":"UTC",
-        "late-arrival":{
-          "cut-off":"minutes(10)"
-        },
-        "clusters":{
-          "cluster":[
-            {
-              "name":"drsource1",
-              "type":"source",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(15)",
-                "action":"delete"
-              }
-            },
-            {
-              "name":"drtarget1",
-              "type":"target",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(17)",
-                "action":"delete"
-              }
-            }
-          ]
-        },
-        "locations":{
-          "location":{
-            "type":"data",
-            "path":"/mirrorthis"
-          }
-        },
-        "ACL":{
-          "owner":"testuser",
-          "group":"group",
-          "permission":"0x755"
-        },
-        "schema":{
-          "location":"/schema/clicks",
-          "provider":"protobuf"
-        },
-        "properties":{
-          "property":[
-            {
-              "name":"field3",
-              "value":"value3"
-            },
-            {
-              "name":"field2",
-              "value":"value2"
-            },
-            {
-              "name":"field4",
-              "value":"value2"
-            }
-          ]
-        }
-      },
-      "instances":[
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-          "Instances":{
-            "id":"99",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        },
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-          "Instances":{
-            "id":"95",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        }
-      ]
-    },
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1",
-      "Feeds":{
-        "description":"feed 3",
-        "name":"feed_3",
-        "status":"SCHEDULED",
-        "groups":"online,bi",
-        "frequency":"minutes(1)",
-        "timezone":"UTC",
-        "late-arrival":{
-          "cut-off":"minutes(10)"
-        },
-        "clusters":{
-          "cluster":[
-            {
-              "name":"drsource2",
-              "type":"source",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(15)",
-                "action":"delete"
-              }
-            },
-            {
-              "name":"drtarget2",
-              "type":"target",
-              "validity":{
-                "start":"2010-01-01T00:00Z",
-                "end":"2015-01-01T02:00Z"
-              },
-              "retention":{
-                "limit":"minutes(17)",
-                "action":"delete"
-              }
-            }
-          ]
-        },
-        "locations":{
-          "location":{
-            "type":"data",
-            "path":"/mirrorthis"
-          }
-        },
-        "ACL":{
-          "owner":"testuser",
-          "group":"group",
-          "permission":"0x755"
-        },
-        "schema":{
-          "location":"/schema/clicks",
-          "provider":"protobuf"
-        },
-        "properties":{
-          "property":[
-            {
-              "name":"field3",
-              "value":"value3"
-            },
-            {
-              "name":"field2",
-              "value":"value2"
-            },
-            {
-              "name":"field4",
-              "value":"value2"
-            }
-          ]
-        }
-      },
-      "instances":[
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-          "Instances":{
-            "id":"99",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        },
-        {
-          "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-          "Instances":{
-            "id":"95",
-            "cluster":"drtarget1",
-            "sourceCluster":"drsource",
-            "status":"RUNNING",
-            "start":"2013-03-06T03:17Z",
-            "end":"2013-03-06T03:19Z",
-            "details":"",
-            "log":""
-          }
-        }
-      ]
-    }
-
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/each_dataset.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/each_dataset.json b/ambari-web/app/assets/data/mirroring/each_dataset.json
deleted file mode 100644
index 7a7958c..0000000
--- a/ambari-web/app/assets/data/mirroring/each_dataset.json
+++ /dev/null
@@ -1,101 +0,0 @@
-{
-  "href":"http://ec2...com:8080/api/v1/feeds/feed1",
-  "Feeds":{
-    "description":"test feed 4",
-    "name":"test4",
-    "status":"SCHEDULED",
-    "groups":"online,bi",
-    "frequency":"minutes(1)",
-    "timezone":"UTC",
-    "late-arrival":{
-      "cut-off":"minutes(10)"
-    },
-    "clusters":{
-      "cluster":[
-        {
-          "name":"drsource",
-          "type":"source",
-          "validity":{
-            "start":"2010-01-01T00:00Z",
-            "end":"2015-01-01T02:00Z"
-          },
-          "retention":{
-            "limit":"minutes(15)",
-            "action":"delete"
-          }
-        },
-        {
-          "name":"drtarget",
-          "type":"target",
-          "validity":{
-            "start":"2010-01-01T00:00Z",
-            "end":"2015-01-01T02:00Z"
-          },
-          "retention":{
-            "limit":"minutes(17)",
-            "action":"delete"
-          }
-        }
-      ]
-    },
-    "locations":{
-      "location":{
-        "type":"data",
-        "path":"/mirrorthis"
-      }
-    },
-    "ACL":{
-      "owner":"testuser",
-      "group":"group",
-      "permission":"0x755"
-    },
-    "schema":{
-      "location":"/schema/clicks",
-      "provider":"protobuf"
-    },
-    "properties":{
-      "property":[
-        {
-          "name":"field3",
-          "value":"value3"
-        },
-        {
-          "name":"field2",
-          "value":"value2"
-        },
-        {
-          "name":"field4",
-          "value":"value2"
-        }
-      ]
-    }
-  },
-  "instances":[
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-      "Instances":{
-        "id":"99",
-        "cluster":"drtarget1",
-        "sourceCluster":"drsource",
-        "status":"RUNNING",
-        "start":"2013-03-06T03:17Z",
-        "end":"2013-03-06T03:19Z",
-        "details":"",
-        "log":""
-      }
-    },
-    {
-      "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/95",
-      "Instances":{
-        "id":"95",
-        "cluster":"drtarget1",
-        "sourceCluster":"drsource",
-        "status":"RUNNING",
-        "start":"2013-03-06T03:17Z",
-        "end":"2013-03-06T03:19Z",
-        "details":"",
-        "log":""
-      }
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/each_dataset_job.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/each_dataset_job.json b/ambari-web/app/assets/data/mirroring/each_dataset_job.json
deleted file mode 100644
index 2f54ee6..0000000
--- a/ambari-web/app/assets/data/mirroring/each_dataset_job.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
-  "href":"http://ec2...com:8080/api/v1/feeds/feed1/instances/99",
-  "Instances":{
-    "id":"99",
-    "cluster":"drtarget1",
-    "sourceCluster":"drsource",
-    "status":"RUNNING",
-    "start":"2013-03-06T03:17Z",
-    "end":"2013-03-06T03:19Z",
-    "details":"",
-    "log":""
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/past_jobs.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/past_jobs.json b/ambari-web/app/assets/data/mirroring/past_jobs.json
deleted file mode 100644
index 58dec3b..0000000
--- a/ambari-web/app/assets/data/mirroring/past_jobs.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "datasetJobs" : [
-    {
-      "dataset_id" : "dataset1",
-      "job_id" : "1",
-      "start_date" : 0,
-      "end_date" : 0,
-      "duration" : 1,
-      "data" : 100
-    },
-    {
-      "dataset_id" : "dataset2",
-      "job_id" : "1",
-      "start_date" : 0,
-      "end_date" : 0,
-      "duration" : 1,
-      "data" : 100
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json b/ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json
deleted file mode 100644
index 993d00c..0000000
--- a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll1.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
-  "Requests" : {
-    "id" : 1
-  },
-  "tasks" : [
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "readonly",
-        "endpoint": "http://ec2...com:50070",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "write",
-        "endpoint": "hdfs://ec2...com:8020",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "workflow",
-        "endpoint": "http://ec2...com:11000/oozie/",
-        "version": "3.1"
-      }
-    }
-
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json b/ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json
deleted file mode 100644
index 1a6b0ff..0000000
--- a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll2.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
-  "Requests" : {
-    "id" : 1
-  },
-  "tasks" : [
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "readonly",
-        "endpoint": "http://ec2...com:50070",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "write",
-        "endpoint": "hdfs://ec2...com:8020",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "workflow",
-        "endpoint": "http://ec2...com:11000/oozie/",
-        "version": "3.1"
-      }
-    }
-
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json b/ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json
deleted file mode 100644
index 2decf37..0000000
--- a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll3.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
-  "Requests" : {
-    "id" : 1
-  },
-  "tasks" : [
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "readonly",
-        "endpoint": "http://ec2...com:50070",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "write",
-        "endpoint": "hdfs://ec2...com:8020",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "PENDING",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "workflow",
-        "endpoint": "http://ec2...com:11000/oozie/",
-        "version": "3.1"
-      }
-    }
-
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json b/ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json
deleted file mode 100644
index 1de12bb..0000000
--- a/ambari-web/app/assets/data/mirroring/poll/testConnection_poll4.json
+++ /dev/null
@@ -1,60 +0,0 @@
-{
-  "href" : "http://localhost:8080/api/clusters/mycluster/requests/1",
-  "Requests" : {
-    "id" : 1
-  },
-  "tasks" : [
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "readonly",
-        "endpoint": "http://ec2...com:50070",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "write",
-        "endpoint": "hdfs://ec2...com:8020",
-        "version": "1.1.2.22"
-      }
-    },
-    {
-      "href" : "http://localhost:8080/api/clusters/mycluster/requests/1/tasks/1",
-      "Tasks" : {
-        "id" : "1",
-        "attempt_cnt" : "0",
-        "exit_code" : "999",
-        "stdout" : "",
-        "status" : "SUCCESS",
-        "command" : "CONNECT",
-        "start_time" : "-1",
-        "role" : "DATANODE",
-        "stderr" : "",
-        "type": "workflow",
-        "endpoint": "http://ec2...com:11000/oozie/",
-        "version": "3.1"
-      }
-    }
-
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/succeeded.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/succeeded.json b/ambari-web/app/assets/data/mirroring/succeeded.json
new file mode 100644
index 0000000..f3d577b
--- /dev/null
+++ b/ambari-web/app/assets/data/mirroring/succeeded.json
@@ -0,0 +1,5 @@
+{
+  "requestId": "schedule\/default\/b5b40931-175b-4b15-8f2b-02ef2e66f06b\n\nsubmit\/default\/b5b40931-175b-4b15-8f2b-02ef2e66f06b\n\n",
+  "message": "schedule\/default\/SampleProcess(process) scheduled successfully\n\nsubmit\/default\/Submit successful (process) SampleProcess\n\n",
+  "status": "SUCCEEDED"
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/target_clusters.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/target_clusters.json b/ambari-web/app/assets/data/mirroring/target_clusters.json
deleted file mode 100644
index 73f722c..0000000
--- a/ambari-web/app/assets/data/mirroring/target_clusters.json
+++ /dev/null
@@ -1,194 +0,0 @@
-{
-  "href": "http://ec2...com:8080/api/v1/targets",
-  "items": [
-    {
-      "href": "http://ec2...com:8080/api/v1/targets/drtarget1",
-      "Clusters": {
-        "colo": "gs1",
-        "name": "drtarget1",
-        "interfaces": {
-          "interface": [
-            {
-              "type": "readonly",
-              "endpoint": "http://ec2...com:50070",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "write",
-              "endpoint": "hdfs://ec2...com:8020",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "execute",
-              "endpoint": "ec2...com:8021",
-              "version": "0.20.2"
-            },
-            {
-              "type": "workflow",
-              "endpoint": "http://ec2...com:11000/oozie/",
-              "version": "3.1"
-            },
-            {
-              "type": "messaging",
-              "endpoint": "tcp://ec2...com:61616?daemon=true",
-              "version": "5.1.6"
-            },
-            {
-              "type": "registry",
-              "endpoint": "Hcat",
-              "version": "1"
-            }
-          ]
-        },
-        "locations": {
-          "location": [
-            {
-              "name": "temp",
-              "path": "/tmp"
-            },
-            {
-              "name": "working",
-              "path": "/projects/ivory/working"
-            },
-            {
-              "name": "staging",
-              "path": "/projects/ivory/staging"
-            }
-          ]
-        },
-        "properties": {
-          "property": {
-            "name": "separator",
-            "value": ""
-          }
-        }
-      }
-    },
-    {
-      "href": "http://ec2...com:8080/api/v1/targets/drtarget2",
-      "Clusters": {
-        "colo": "gs2",
-        "name": "drtarget2",
-        "interfaces": {
-          "interface": [
-            {
-              "type": "readonly",
-              "endpoint": "http://ec2...com:50070",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "write",
-              "endpoint": "hdfs://ec2...com:8020",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "execute",
-              "endpoint": "ec2...com:8021",
-              "version": "0.20.2"
-            },
-            {
-              "type": "workflow",
-              "endpoint": "http://ec2...com:11000/oozie/",
-              "version": "3.1"
-            },
-            {
-              "type": "messaging",
-              "endpoint": "tcp://ec2...com:61616?daemon=true",
-              "version": "5.1.6"
-            },
-            {
-              "type": "registry",
-              "endpoint": "Hcat",
-              "version": "1"
-            }
-          ]
-        },
-        "locations": {
-          "location": [
-            {
-              "name": "temp",
-              "path": "/tmp"
-            },
-            {
-              "name": "working",
-              "path": "/projects/ivory/working"
-            },
-            {
-              "name": "staging",
-              "path": "/projects/ivory/staging"
-            }
-          ]
-        },
-        "properties": {
-          "property": {
-            "name": "separator",
-            "value": ""
-          }
-        }
-      }
-    },
-    {
-      "href": "http://ec2...com:8080/api/v1/targets/drtarget3",
-      "Clusters": {
-        "colo": "gs3",
-        "name": "drtarget3",
-        "interfaces": {
-          "interface": [
-            {
-              "type": "readonly",
-              "endpoint": "http://ec2...com:50070",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "write",
-              "endpoint": "hdfs://ec2...com:8020",
-              "version": "1.1.2.22"
-            },
-            {
-              "type": "execute",
-              "endpoint": "ec2...com:8021",
-              "version": "0.20.2"
-            },
-            {
-              "type": "workflow",
-              "endpoint": "http://ec2...com:11000/oozie/",
-              "version": "3.1"
-            },
-            {
-              "type": "messaging",
-              "endpoint": "tcp://ec2...com:61616?daemon=true",
-              "version": "5.1.6"
-            },
-            {
-              "type": "registry",
-              "endpoint": "Hcat",
-              "version": "1"
-            }
-          ]
-        },
-        "locations": {
-          "location": [
-            {
-              "name": "temp",
-              "path": "/tmp"
-            },
-            {
-              "name": "working",
-              "path": "/projects/ivory/working"
-            },
-            {
-              "name": "staging",
-              "path": "/projects/ivory/staging"
-            }
-          ]
-        },
-        "properties": {
-          "property": {
-            "name": "separator",
-            "value": ""
-          }
-        }
-      }
-    }
-  ]
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/assets/data/mirroring/upcoming_jobs.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/mirroring/upcoming_jobs.json b/ambari-web/app/assets/data/mirroring/upcoming_jobs.json
deleted file mode 100644
index 1bc123b..0000000
--- a/ambari-web/app/assets/data/mirroring/upcoming_jobs.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "datasetJobs" : [
-    {
-      "dataset_id" : "dataset1",
-      "job_id" : "1",
-      "start_date" : 0,
-      "end_date" : 0,
-      "duration" : 1,
-      "data" : 100
-    },
-    {
-      "dataset_id" : "dataset2",
-      "job_id" : "1",
-      "start_date" : 0,
-      "end_date" : 0,
-      "duration" : 1,
-      "data" : 100
-    }
-  ]
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index a978646..5cb0f3d 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -110,7 +110,7 @@ require('controllers/main/charts/heatmap');
 require('controllers/main/apps_controller');
 require('controllers/main/apps/item_controller');
 require('controllers/main/mirroring_controller');
-require('controllers/main/mirroring/dataset_controller');
+require('controllers/main/mirroring/edit_dataset_controller');
 require('controllers/main/mirroring/datasets_controller');
 require('controllers/main/mirroring/jobs_controller');
 require('controllers/main/mirroring/targetClusterController');

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/controllers/main/mirroring/dataset_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/dataset_controller.js b/ambari-web/app/controllers/main/mirroring/dataset_controller.js
deleted file mode 100644
index 2bf22de..0000000
--- a/ambari-web/app/controllers/main/mirroring/dataset_controller.js
+++ /dev/null
@@ -1,421 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-App.MainMirroringDataSetController = Ember.Controller.extend({
-  name: 'mainMirroringDataSetController',
-
-  model: Ember.Object.create(
-    {
-      newDataSet: null,
-      listOfTargetClusterNames: function () {
-        var listOfClusterNames = [];
-        var listOfTargetClusters = App.TargetCluster.find();
-        if (listOfTargetClusters && listOfTargetClusters.content.length) {
-          listOfTargetClusters.forEach(function (tcluster) {
-            listOfClusterNames.push(tcluster.get('clusterName'));
-          });
-        }
-        return listOfClusterNames;
-      }.property('newDataSet.targetCluster'),  // this property will be set when someone clicks the save button
-
-      originalRecord: null,
-
-      isNameError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isNameError = controller.checkNameErrors();
-        return isNameError;
-      }.property('newDataSet.name', 'model.newDataSet.name'),
-
-      isTypeError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isTypeError = controller.checkNameErrors();
-        return isTypeError;
-      }.property('newDataSet.type', 'model.newDataSet.type'),
-
-      isSourceDirError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isSourceDirError = controller.checkSourceDirErrors();
-        return isSourceDirError;
-      }.property('newDataSet.sourceDir', 'model.newDataSet.sourceDir'),
-
-
-      isTargetClusterError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isTargetClusterError = controller.checkTargetClusterErrors();
-        return isTargetClusterError;
-      }.property('newDataSet.targetCluster', 'model.newDataSet.targetCluster'),
-
-      isTargetDirError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isTargetDirError = controller.checkTargetDirErrors();
-        return isTargetDirError;
-      }.property('newDataSet.targetDir', 'model.newDataSet.targetDir'),
-
-      isStartDateError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isStartDateError = controller.checkStartDateErrors();
-        return isStartDateError;
-      }.property('newDataSet.schedule.startDate', 'model.newDataSet.schedule.startDate'),
-
-      isEndDateError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isEndDateError = controller.checkEndDateErrors();
-        return isEndDateError;
-      }.property('newDataSet.schedule.endDate', 'model.newDataSet.schedule.endDate'),
-
-      isFrequencyError: function (key, value) {
-        if (value) {
-          return value;
-        }
-        var controller = App.router.get('mainMirroringDataSetController');
-        var isFrequencyError = controller.checkFrequencyErrors();
-        return isFrequencyError;
-      }.property('newDataSet.schedule.frequency', 'model.newDataSet.schedule.frequency')
-
-
-    }
-  ),
-
-  dataLoading: function () {
-    var dfd = $.Deferred();
-    this.connectOutlet('loading');
-    if (App.router.get('clusterController.isLoaded')) {
-      dfd.resolve();
-    } else {
-      var interval = setInterval(function () {
-        if (App.router.get('clusterController.isLoaded')) {
-          dfd.resolve();
-          clearInterval(interval);
-        }
-      }, 50);
-    }
-    return dfd.promise();
-  },
-
-  isSubmitted: null,
-
-  validate: function () {
-    var isNameError = this.checkNameErrors();
-    var isTypeError = this.checkTypeErrors();
-    var isSourceDirError = this.checkSourceDirErrors();
-    var isTargetClusterError = this.checkTargetClusterErrors();
-    var isTargetDirError = this.checkTargetDirErrors();
-    var isStartDateError = this.checkStartDateErrors();
-    var isEndDateError = this.checkEndDateErrors();
-    var isFrequencyError = this.checkFrequencyErrors();
-
-    if (isNameError || isTypeError || isSourceDirError || isTargetClusterError || isTargetDirError || isStartDateError || isEndDateError || isFrequencyError) {
-      return false;
-    }
-    return true;
-  },
-
-  checkNameErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('nameErrorMessage', "");
-      return false;
-    }
-    var name = this.get('model.newDataSet.name');
-    if (!name || name.trim() === "") {
-      this.set('model.isNameError', true);
-      this.set('nameErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('nameErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkTypeErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('typeErrorMessage', "");
-      return false;
-    }
-    var type = this.get('model.newDataSet.type');
-    if (!type || type.trim() === "") {
-      this.set('model.isTypeError', true);
-      this.set('typeErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('typeErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkSourceDirErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('sourceDirErrorMessage', "");
-      return false;
-    }
-    var sourceDir = this.get('model.newDataSet.sourceDir');
-    if (!sourceDir || sourceDir.trim() === "") {
-      this.set('model.isSourceDirError', true);
-      this.set('sourceDirErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('sourceDirErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkTargetClusterErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('targetClusterErrorMessage', "");
-      return false;
-    }
-    var targetCluster = this.get('model.newDataSet.targetCluster.clusterName');
-    if (!targetCluster || targetCluster.trim() === "") {
-      this.set('model.isTargetClusterError', true);
-      this.set('targetClusterErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('targetClusterErrorMessage', "");
-      return false;
-    }
-
-
-  },
-  checkTargetDirErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('targetDirErrorMessage', "");
-      return false;
-    }
-    var targetDir = this.get('model.newDataSet.targetDir');
-    if (!targetDir || targetDir.trim() === "") {
-      this.set('model.isTargetDirError', true);
-      this.set('targetDirErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('targetDirErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkStartDateErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('startDateErrorMessage', "");
-      return false;
-    }
-    var startDate = this.get('model.newDataSet.schedule.startDate');
-    if (!startDate || startDate.trim() === "") {
-      this.set('model.isStartDateError', true);
-      this.set('startDateErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-      this.set('startDateErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkEndDateErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('endDateErrorMessage', "");
-      return false;
-    }
-    var startDate = this.get('model.newDataSet.schedule.startDate');
-    var endDate = this.get('model.newDataSet.schedule.endDate');
-    if (!endDate || endDate.trim() === "") {
-      this.set('model.isEndDateError', true);
-      this.set('endDateErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-
-      var sDate = new Date(this.get('model.newDataSet.schedule.startDate'));
-      var eDate = new Date(this.get('model.newDataSet.schedule.endDate'));
-      if(sDate > eDate){
-        this.set('model.isEndDateError', true);
-        this.set('endDateErrorMessage', Em.I18n.t('mirroring.dateOrder.error'));
-        return true;
-      }
-
-
-      this.set('endDateErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  checkFrequencyErrors: function () {
-    if (!this.get('isSubmitted')){
-      this.set('frequencyErrorMessage', "");
-      return false;
-    }
-    var frequency = this.get('model.newDataSet.schedule.frequency');
-
-    if (!frequency || frequency.trim() === "") {
-      this.set('model.isFrequencyError', true);
-      this.set('frequencyErrorMessage', Em.I18n.t('mirroring.required.error'));
-      return true;
-    }
-    else {
-
-      var startParenthesisindex = frequency.indexOf('(');
-      var endParenthesisindex = frequency.indexOf(')');
-
-      if (endParenthesisindex - startParenthesisindex == 1) {
-        this.set('model.isFrequencyError', true);
-        this.set('frequencyErrorMessage', Em.I18n.t('mirroring.required.error'));
-        return true;
-      }
-      else {
-        var frequencyNum = frequency.substring(startParenthesisindex + 1, endParenthesisindex);
-
-        frequencyNum = parseInt(frequencyNum);
-
-        if (isNaN(frequencyNum)) {
-          this.set('model.isFrequencyError', true);
-          this.set('frequencyErrorMessage', Em.I18n.t('mirroring.required.invalidNumberError'));
-          return true;
-        }
-
-      }
-
-      this.set('frequencyErrorMessage', "");
-      return false;
-    }
-
-  },
-
-  nameErrorMessage: null,
-  typeErrorMessage: null,
-  sourceDirErrorMessage: null,
-  targetClusterErrorMessage: null,
-  targetDirErrorMessage: null,
-  startDateErrorMessage: null,
-  endDateErrorMessage: null,
-  frequencyErrorMessage: null,
-  /**
-   * Popup with add/edit form
-   */
-  popup: null,
-
-  /**
-   * true - popup with edit form
-   * false - popup with add form
-   */
-  isPopupForEdit: false,
-
-  createNewDataSet: function () {
-    var newDataSet = Ember.Object.create({
-      name: null,
-      type: null,
-      sourceDir: null,
-      targetCluster: Ember.Object.create(),
-      targetDir: null,
-      status : 'SCHEDULED',
-      schedule: Ember.Object.create()
-    });
-    this.set('model.newDataSet', newDataSet);
-    return newDataSet;
-  },
-
-  setDataSet: function (dataset) {
-    var newDataSet = Ember.Object.create({
-      name: dataset.get('name'),
-      type: dataset.get('type'),
-      sourceDir: dataset.get('sourceDir'),
-      targetCluster: dataset.get('targetCluster'),
-      targetDir: dataset.get('targetDir'),
-      schedule: dataset.get('schedule'),
-      status: dataset.get('status')
-
-    });
-    this.set('model.newDataSet', newDataSet);
-  },
-
-  setOriginalDataSetRecord: function (datasetRecord) {
-    this.set('model.originalRecord', datasetRecord);
-  },
-
-
-  getNewDataSet: function () {
-    return this.get('model.newDataSet');
-  },
-
-  createTargetCluster: function () {
-    var controller = App.router.get('mainMirroringController');
-    controller.manageClusters();
-  },
-
-  /**
-   * Set old values for all properties in the dataset
-   */
-  undoChanges: function () {
-    this.set('model.newDataSet', this.get('rawDataSet'));
-  },
-
-  /**
-   * Delete created dataset and its schedule
-   */
-  deleteNewDataSet: function () {
-    var originalRecordSchedule = this.get('model.originalRecord.schedule');
-    originalRecordSchedule.deleteRecord();
-    originalRecordSchedule.get("transaction").commit();
-
-    var originalRecord = this.get('model.originalRecord');
-
-    originalRecord.deleteRecord();
-    originalRecord.get("transaction").commit();
-  },
-
-  /**
-   * "Delete" button handler
-   */
-  deleteDatasetClick: function () {
-    var self = this;
-    App.showConfirmationPopup(function () {
-      self.deleteNewDataSet();
-      self.get('popup').hide();
-      App.router.transitionTo('main.mirroring.index');
-    });
-  }
-
-});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
new file mode 100644
index 0000000..9650bef
--- /dev/null
+++ b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
@@ -0,0 +1,244 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+App.MainMirroringEditDataSetController = Ember.Controller.extend({
+  name: 'mainMirroringEditDataSetController',
+
+  // Fields values from Edit DataSet form
+  formFields: Ember.Object.create({
+    datasetName: null,
+    datasetType: null,
+    datasetTargetClusterName: null,
+    datasetSourceDir: null,
+    datasetTargetDir: null,
+    datasetStartDate: null,
+    hoursForStart: null,
+    minutesForStart: null,
+    middayPeriodForStart: null,
+    datasetEndDate: null,
+    hoursForEnd: null,
+    minutesForEnd: null,
+    middayPeriodForEnd: null,
+    datasetFrequency: null,
+    repeatOptionSelected: null
+  }),
+
+  // Messages for errors occurred during Edit DataSet form validation
+  errorMessages: Ember.Object.create({
+    name: '',
+    sourceDir: '',
+    targetDir: '',
+    startDate: '',
+    endDate: '',
+    frequency: ''
+  }),
+
+  errors: Ember.Object.create({
+    isNameError: false,
+    isSourceDirError: false,
+    isTargetDirError: false,
+    isStartDateError: false,
+    isEndDateError: false,
+    isFrequencyError: false
+  }),
+
+  clearStep: function () {
+    var formFields = this.get('formFields');
+    Em.keys(formFields).forEach(function (key) {
+      formFields.set(key, null);
+    }, this);
+    this.clearErrors();
+  },
+
+  clearErrors: function () {
+    var errorMessages = this.get('errorMessages');
+    Em.keys(errorMessages).forEach(function (key) {
+      errorMessages.set(key, '');
+    }, this);
+    var errors = this.get('errors');
+    Em.keys(errors).forEach(function (key) {
+      errors.set(key, false);
+    }, this);
+  },
+
+  showAddPopup: function () {
+    this.showPopup(Em.I18n.t('mirroring.dataset.newDataset'));
+  },
+
+  showPopup: function (header) {
+    var self = this;
+    App.ModalPopup.show({
+      classNames: ['sixty-percent-width-modal'],
+      header: header,
+      primary: Em.I18n.t('mirroring.dataset.save'),
+      secondary: Em.I18n.t('common.cancel'),
+      showCloseButton: false,
+      saveDisabled: function () {
+        return !self.get('saveDisabled');
+      }.property('App.router.' + self.get('name') + '.saveDisabled'),
+      enablePrimary: function () {
+        return this.get('saveDisabled');
+      }.property('saveDisabled'),
+      onPrimary: function () {
+        if (!this.get('saveDisabled')) {
+          return false;
+        }
+        // Apply form validation for first click
+        if (!this.get('primaryWasClicked')) {
+          this.toggleProperty('primaryWasClicked');
+          self.applyValidation();
+          if (!this.get('saveDisabled')) {
+            return false;
+          }
+        }
+        self.save();
+        this.hide();
+        App.router.transitionTo('main.mirroring.index');
+      },
+      primaryWasClicked: false,
+      onSecondary: function () {
+        this.hide();
+        App.router.transitionTo('main.mirroring.index');
+      },
+      bodyClass: App.MainMirroringEditDataSetView.extend({
+        controller: self
+      })
+    });
+  },
+
+  // Set observer to call validate method if any property from formFields will change
+  applyValidation: function () {
+    Em.keys(this.get('formFields')).forEach(function (key) {
+      this.addObserver('formFields.' + key, this, 'validate');
+    }, this);
+    this.validate();
+  },
+
+  // Return date object calculated from appropriate fields
+  scheduleStartDate: function () {
+    var startDate = this.get('formFields.datasetStartDate');
+    var hoursForStart = this.get('formFields.hoursForStart');
+    var minutesForStart = this.get('formFields.minutesForStart');
+    var middayPeriodForStart = this.get('formFields.middayPeriodForStart');
+    if (startDate && hoursForStart && minutesForStart && middayPeriodForStart) {
+      return new Date(startDate + ' ' + hoursForStart + ':' + minutesForStart + ' ' + middayPeriodForStart);
+    }
+    return null;
+  }.property('formFields.datasetStartDate', 'formFields.hoursForStart', 'formFields.minutesForStart', 'formFields.middayPeriodForStart'),
+
+  // Return date object calculated from appropriate fields
+  scheduleEndDate: function () {
+    var endDate = this.get('formFields.datasetEndDate');
+    var hoursForEnd = this.get('formFields.hoursForEnd');
+    var minutesForEnd = this.get('formFields.minutesForEnd');
+    var middayPeriodForEnd = this.get('formFields.middayPeriodForEnd');
+    if (endDate && hoursForEnd && minutesForEnd && middayPeriodForEnd) {
+      return new Date(endDate + ' ' + hoursForEnd + ':' + minutesForEnd + ' ' + middayPeriodForEnd);
+    }
+    return null;
+  }.property('formFields.datasetEndDate', 'formFields.hoursForEnd', 'formFields.minutesForEnd', 'formFields.middayPeriodForEnd'),
+
+
+  // Validation for every field in Edit DataSet form
+  validate: function () {
+    var formFields = this.get('formFields');
+    var errors = this.get('errors');
+    var errorMessages = this.get('errorMessages');
+    this.clearErrors();
+    // Check if feild is empty
+    Em.keys(errorMessages).forEach(function (key) {
+      if (!formFields.get('dataset' + key.capitalize())) {
+        errors.set('is' + key.capitalize() + 'Error', true);
+        errorMessages.set(key, Em.I18n.t('mirroring.required.error'));
+      }
+    }, this);
+    // Check that endDate is after startDate
+    var scheduleStartDate = this.get('scheduleStartDate');
+    var scheduleEndDate = this.get('scheduleEndDate');
+    if (scheduleStartDate && scheduleEndDate && (scheduleStartDate > scheduleEndDate)) {
+      errors.set('isEndDateError', true);
+      errorMessages.set('endDate', Em.I18n.t('mirroring.dateOrder.error'));
+    }
+    // Check that repeat field value consists only from digits
+    if (isNaN(this.get('formFields.datasetFrequency'))) {
+      errors.set('isFrequencyError', true);
+      errorMessages.set('frequency', Em.I18n.t('mirroring.required.invalidNumberError'));
+    }
+  },
+
+  // Add '0' for numbers less than 10
+  addZero: function (number) {
+    return ('0' + number).slice(-2);
+  },
+
+  // Convert date to TZ format
+  toTZFormat: function (date) {
+    return date.getFullYear() + '-' + this.addZero(date.getMonth() + 1) + '-' + this.addZero(date.getDate()) + 'T' + this.addZero(date.getHours()) + ':' + this.addZero(date.getMinutes()) + 'Z';
+  },
+
+  save: function () {
+    var datasetName = this.get('formFields.datasetName');
+    var sourceCluster = App.get('clusterName');
+    var targetCluster = this.get('formFields.datasetTargetClusterName');
+    var sourceDir = this.get('formFields.datasetSourceDir');
+    var targetDir = this.get('formFields.datasetTargetDir');
+    var datasetFrequency = this.get('formFields.datasetFrequency');
+    var repeatOptionSelected = this.get('formFields.repeatOptionSelected');
+    var startDate = this.get('scheduleStartDate');
+    var endDate = this.get('scheduleEndDate');
+    var scheduleStartDateFormatted = this.toTZFormat(startDate);
+    var scheduleEndDateFormatted = this.toTZFormat(endDate);
+
+    // Compose XML data, that will be sended to server
+    var dataToSend = '<?xml version="1.0"?><feed description="" name="' + datasetName + '" xmlns="uri:falcon:feed:0.1"><frequency>' + repeatOptionSelected + '(' + datasetFrequency + ')' +
+        '</frequency><clusters><cluster name="' + targetCluster + '" type="source"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted +
+        '"/><retention limit="days(7)" action="delete"/></cluster><cluster name="' + targetCluster + '" type="target"><validity start="' + scheduleStartDateFormatted + '" end="' +
+        '"/><retention limit="months(1)" action="delete"/><locations><location type="data" path="' + targetDir + '" /></locations></cluster></clusters><locations><location type="data" path="' +
+        sourceDir + '" /></locations><ACL owner="hue" group="users" permission="0755" /><schema location="/none" provider="none"/></feed>';
+
+    // Send request to server to create dataset
+    App.ajax.send({
+      name: 'mirroring.create_new_dataset',
+      sender: this,
+      data: {
+        dataset: dataToSend
+      },
+      error: 'onCreateNewDatasetError'
+    });
+
+    var newDataset = {
+      id: datasetName,
+      name: datasetName,
+      source_cluster_name: sourceCluster,
+      target_cluster_name: targetCluster,
+      source_dir: sourceDir,
+      target_dir: targetDir,
+      dataset_jobs: []
+    };
+    App.store.load(App.Dataset, newDataset);
+  },
+
+  onCreateNewDatasetError: function () {
+    console.error('Error in sending new dataset data to server.');
+  },
+
+  saveDisabled: function () {
+    var errors = this.get('errors');
+    return errors.get('isNameError') || errors.get('isSourceDirError') || errors.get('isTargetDirError') || errors.get('isStartDateError') || errors.get('isEndDateError') || errors.get('isFrequencyError');
+  }.property('errors.isNameError', 'errors.isSourceDirError', 'errors.isTargetDirError', 'errors.isStartDateError', 'errors.isEndDateError', 'errors.isFrequencyError')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js b/ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js
index 9b44b53..9980488 100644
--- a/ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/testConnectionResults_controller.js
@@ -137,7 +137,7 @@ App.TestConnectionResultsController = Ember.Controller.extend({
       mainMirroringController.notifyPropertyChange("targetClusters");
 
       // refresh add/edit dataset model
-      var addDataSetController = App.router.get('mainMirroringDataSetController');
+      var addDataSetController = App.router.get('mainMirroringEditDataSetController');
       var dataSet = addDataSetController.get('model.newDataSet');
       if (dataSet)  // this may be undefined or null if we try to add cluster from main page. Hence the if check.
         dataSet.set('targetCluster', targetClusterRecord);

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/controllers/main/mirroring_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js
index fb66899..d449189 100644
--- a/ambari-web/app/controllers/main/mirroring_controller.js
+++ b/ambari-web/app/controllers/main/mirroring_controller.js
@@ -117,7 +117,6 @@ App.MainMirroringController = Em.ArrayController.extend({
     this.get('datasetsData').findProperty('name', opts.dataset).set('instances', datasetJobs);
     this.set('datasetCount', this.get('datasetCount') - 1);
     if (this.get('datasetCount') < 1) {
-      App.Dataset.find().clear();
       App.dataSetMapper.map(this.get('datasetsData'));
       this.set('datasets', App.Dataset.find().toArray().sort(function(a,b){
         return a.get('name') - b.get('name');
@@ -144,6 +143,11 @@ App.MainMirroringController = Em.ArrayController.extend({
       secondary: null,
       onPrimary: function () {
         this.hide();
+        App.router.transitionTo('main.mirroring.index');
+      },
+      onClose: function () {
+        this.hide();
+        App.router.transitionTo('main.mirroring.index');
       },
       didInsertElement: function () {
         this._super();

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 4531281..2f69fb0 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1708,7 +1708,7 @@ Em.I18n.translations = {
   'mirroring.dataset.selectTargetClusters':'Select Target Cluster...',
   'mirroring.dataset.name':'Name',
   'mirroring.dataset.type':'Type',
-  'mirroring.dataset.save': 'Save & Run',
+  'mirroring.dataset.save': 'Save & Schedule',
   'mirroring.dataset.sourceDir':'Source',
   'mirroring.dataset.target':'Target',
   'mirroring.dataset.source':'Source',
@@ -1724,6 +1724,12 @@ Em.I18n.translations = {
   'mirroring.dataset.toggle.suspended':'Suspend',
   'mirroring.dataset.type.HDFS':'HDFS',
   'mirroring.dataset.type.Hive':'Hive Tables',
+  'mirroring.dataset.repeat.minutes':'minutes',
+  'mirroring.dataset.repeat.hours':'hours',
+  'mirroring.dataset.repeat.days':'days',
+  'mirroring.dataset.repeat.months':'months',
+  'mirroring.dataset.middayPeriod.am':'AM',
+  'mirroring.dataset.middayPeriod.pm':'PM',
 
   'mirroring.manageClusters.ambariServer':'Ambari Server',
   'mirroring.manageClusters.testConnection':'Test Connection',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index bcefd43..4cc73cb 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -123,63 +123,19 @@ module.exports = Em.Route.extend({
       router.transitionTo('addNewDatasetRoute');
     },
 
-    addTargetCluster: function (router, event) {
-      router.transitionTo('addTargetClusterRoute');
-    },
-
     addNewDatasetRoute: Em.Route.extend({
       route: '/dataset/add',
-
-      setupController: function (controller) {
-        controller.createNewDataSet();
-      },
       enter: function (router) {
-        var self = this;
-        var controller = router.get('mainMirroringDataSetController');
-        controller.dataLoading().done(function () {
-          // if we are coming from closing AddCluster popup
-          if (controller.isReturning) {
-            controller.isReturning = false;
-            return;
-          }
+        var controller = router.get('mainMirroringEditDataSetController');
+        controller.showAddPopup();
+      }
+    }),
 
-          controller.set('isPopupForEdit', false);
-          self.setupController(controller);
-
-
-          controller.set('isSubmitted', false);
-          App.ModalPopup.show({
-            classNames: ['sixty-percent-width-modal', 'hideCloseLink'],
-            header: Em.I18n.t('mirroring.dataset.newDataset'),
-            primary: Em.I18n.t('mirroring.dataset.save'),
-            secondary: Em.I18n.t('common.cancel'),
-            onPrimary: function () {
-              controller.set('isSubmitted', true);
-              var isValid = controller.validate();
-
-              if (!isValid) {
-                return;
-              }
-              newDataSet = controller.getNewDataSet();
-              var schedule = newDataSet.get('schedule');
-              var targetCluster = newDataSet.get('targetCluster');
-              var scheduleRecord = App.Dataset.Schedule.createRecord(schedule);
-              var dataSetRecord = App.Dataset.createRecord(newDataSet);
-              scheduleRecord.set('dataset', dataSetRecord);
-              dataSetRecord.set('schedule', scheduleRecord);
-
-              this.hide();
-              router.transitionTo('main.mirroring.index');
-            },
-            onSecondary: function () {
-              this.hide();
-              router.transitionTo('main.mirroring.index');
-            },
-            bodyClass: App.MainMirroringDataSetView.extend({
-              controller: router.get('mainMirroringDataSetController')
-            })
-          });
-        });
+    manageClustersRoute: Em.Route.extend({
+      route: '/dataset/clusters/edit',
+      enter: function (router) {
+        var controller = router.get('mainMirroringController');
+        controller.manageClusters();
       }
     }),
 
@@ -194,266 +150,9 @@ module.exports = Em.Route.extend({
       }
     }),
 
-    editDataset: Em.Route.extend({
-      route: '/dataset/:dataset_id/edit',
-      setupController: function (controller, dataset) {
-        controller.setOriginalDataSetRecord(dataset);
-        controller.setDataSet(dataset);
-      },
-
-
-      connectOutlets: function (router, dataset) {
-        var controller = router.get('mainMirroringDataSetController');
-        // if we are coming from closing AddCluster popup
-        if (controller.isReturning) {
-          controller.isReturning = false;
-          return;
-        }
-        // for showing delete button
-        controller.set('isPopupForEdit', true);
-        this.setupController(controller, dataset);
-
-        var self = this;
-        controller.set('isSubmitted', false);
-        controller.set('popup', App.ModalPopup.show({
-          classNames: ['sixty-percent-width-modal'],
-          header: Em.I18n.t('mirroring.dataset.editDataset'),
-          primary: Em.I18n.t('mirroring.dataset.save'),
-          secondary: Em.I18n.t('common.cancel'),
-          onPrimary: function () {
-            controller.set('isSubmitted', true);
-            var isValid = controller.validate();
-
-            if (!isValid) {
-              return;
-            }
-            newDataSet = controller.getNewDataSet();
-
-            var originalRecord = controller.get('model.originalRecord');
-
-            originalRecord.set('name', newDataSet.get('name'));
-            originalRecord.set('sourceDir', newDataSet.get('sourceDir'));
-            originalRecord.set('targetCluster', newDataSet.get('targetCluster'));
-            originalRecord.set('targetDir', newDataSet.get('targetDir'));
-            originalRecord.set('schedule', newDataSet.get('schedule'));
-            this.hide();
-            router.transitionTo('main.mirroring.index');
-          },
-          onSecondary: function () {
-            this.hide();
-            router.transitionTo('main.mirroring.index');
-          },
-          bodyClass: App.MainMirroringDataSetView.extend({
-            controller: router.get('mainMirroringDataSetController')
-          })
-        })
-        );
-      }
-    }),
-
-    gotoEditDataset: function (router, event) {
-      router.transitionTo('editDataset', event.context);
-    },
-
-    addTargetClusterRoute: Ember.Route.extend({
-      route: '/targetCluster/add',
-      initialState: 'testConnectionRoute',
-      testConnectionRoute: Ember.Route.extend({
-        setupController: function (controller) {
-          controller.createTargetCluster();
-          controller.set('model.isPopupForEdit', false);
-
-        },
-
-        enter: function (router, context) {
-
-          var self = this;
-          var controller = App.router.get('mainMirroringTargetClusterController');
-          this.setupController(controller);
-
-          controller.set('isSubmitted1', false);
-          controller.set('isSubmitted2', false);
-          controller.set('popup', App.ModalPopup.show({
-            classNames: ['sixty-percent-width-modal', 'hideCloseLink'],
-            header: Em.I18n.t('mirroring.targetcluster.addCluster'),
-            primary: Em.I18n.t('mirroring.targetcluster.testConnection'),
-            onPrimary: function () {
-              controller.set('isSubmitted1', true);
-              var isValid = controller.validate1();
-
-              if (!isValid) {
-                return;
-              }
-
-              App.router.transitionTo('testConnectionResultsRoute');
-            },
-            onSecondary: function () {
-              this.hide();
-
-              var dscontroller = App.router.get('mainMirroringDataSetController');
-              var tccontroller = App.router.get('mainMirroringTargetClusterController');
-              var returnRoute = tccontroller.get('returnRoute');
-              // if we have come from addNewDatasetRoute
-              if (returnRoute) {
-                dscontroller.isReturning = true;
-                App.router.transitionTo(returnRoute);
-              }
-              else
-                App.router.transitionTo('main.mirroring.index');
-            },
-            bodyClass: App.MainMirroringAddTargetClusterView.extend({
-              controller: App.router.get('mainMirroringTargetClusterController')
-            })
-          }));
-        },
-
-        connectOutlets: function (router, context) {
-          console.log("entering the connectOutlets method of testConnectionRoute.")
-          var parentController = router.get('mainMirroringTargetClusterController');
-          parentController.connectOutlet('testConnection', parentController.get('model'));
-        },
-
-        exit: function (stateManager) {
-          console.log("exiting the testConnectionRoute state")
-        }
-      }),
-      testConnectionResultsRoute: Ember.Route.extend({
-        enter: function (stateManager) {
-          console.log("entering the testConnectionResultsRoute state.")
-          // lets change the primary button
-          var controller = App.router.get('mainMirroringTargetClusterController');
-          var popup = controller.get('popup');
-          popup.set('primary', Em.I18n.t('common.save'));
-          popup.set('onPrimary',
-            function () {
-              var controller = App.router.get('mainMirroringTargetClusterController');
-              controller.set('isSubmitted2', true);
-              var isValid = controller.validate2();
-
-              if (!isValid) {
-                return;
-              }
-
-              var controller = App.router.get('testConnectionResultsController');
-              controller.saveClusterName();
-            }
-          );
-
-        },
-
-        connectOutlets: function (router, context) {
-          console.log("entering the connectOutlets method of testConnectionResultsRoute.")
-          var parentController = router.get('mainMirroringTargetClusterController');
-          parentController.connectOutlet('testConnectionResults', parentController.get('model'));
-        },
-
-        exit: function (stateManager) {
-          console.log("exiting the connectionSuccessRoute state")
-        }
-
-      })
-    }),
-    editTargetClusterRoute: Em.Route.extend({
-      route: '/targetCluster/:targetCluster_id/edit',
-
-      initialState: 'testConnectionRoute',
-
-      setupController: function (controller, targetCluster) {
-        controller.setOriginalRecord(targetCluster);
-        controller.setTargetCluster(targetCluster);
-      },
-
-      connectOutlets: function (router, targetCluster) {
-        // this connectOutlets is mainly to receive the 'targetCluster' argument
-        var controller = router.get('mainMirroringTargetClusterController');
-        // for showing delete button
-        controller.set('model.isPopupForEdit', true);
-        this.setupController(controller, targetCluster);
-      },
-
-      testConnectionRoute: Em.Route.extend({
-        connectOutlets: function (router, targetCluster) {
-          var controller = router.get('mainMirroringTargetClusterController');
-          controller.set('isSubmitted1', false);
-          controller.set('isSubmitted2', false);
-
-          controller.set('popup', App.ModalPopup.show({
-            classNames: ['sixty-percent-width-modal'],
-            header: Em.I18n.t('mirroring.dataset.editDataset'),
-            primary: Em.I18n.t('mirroring.targetcluster.testConnection'),
-            onPrimary: function () {
-              var controller = App.router.get('mainMirroringTargetClusterController');
-              controller.set('isSubmitted1', true);
-              var isValid = controller.validate1();
-
-              if (!isValid) {
-                return;
-              }
-
-              App.router.transitionTo('testConnectionResultsRoute');
-            },
-            secondary: Em.I18n.t('common.cancel'),
-            onSecondary: function () {
-              this.hide();
-              router.transitionTo('main.mirroring.index');
-            },
-            bodyClass: App.MainMirroringAddTargetClusterView.extend({
-              controller: App.router.get('mainMirroringTargetClusterController')
-            })
-          }));
-
-          console.log("entering the connectOutlets method of testConnectionRoute.")
-          var parentController = router.get('mainMirroringTargetClusterController');
-          parentController.connectOutlet('testConnection', parentController.get('model'));
-
-        }
-
-      }),
-      testConnection: function () {
-        App.router.transitionTo('testConnectionResultsRoute');
-      },
-      testConnectionResultsRoute: Ember.Route.extend({
-        enter: function (stateManager) {
-          console.log("entering the testConnectionResultsRoute state.")
-          // lets change the primary button
-          var controller = App.router.get('mainMirroringTargetClusterController');
-          var popup = controller.get('popup');
-          popup.set('primary', Em.I18n.t('common.save'));
-          popup.set('onPrimary',
-            function () {
-              var controller = App.router.get('mainMirroringTargetClusterController');
-              controller.set('isSubmitted2', true);
-              var isValid = controller.validate1();
-
-              if (!isValid) {
-                return;
-              }
-              var controller2 = App.router.get('testConnectionResultsController');
-              controller2.saveClusterName();
-            }
-          );
-
-        },
-
-        connectOutlets: function (router, context) {
-          console.log("entering the connectOutlets method of testConnectionResultsRoute.");
-          var parentController = router.get('mainMirroringTargetClusterController');
-          parentController.connectOutlet('testConnectionResults', parentController.get('model'));
-        },
-
-        exit: function (stateManager) {
-          console.log("exiting the connectionSuccessRoute state")
-        }
-
-      })
-
-    }),
-
-    editTargetCluster: function (router, event) {
-      router.transitionTo('editTargetClusterRoute', event.context);
+    manageClusters: function (router) {
+      router.transitionTo('manageClustersRoute');
     }
-
-
   }),
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 8d8fd35..7df483e 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -3920,6 +3920,12 @@ ul.filter {
   }
 }
 
+.target-cluster-select {
+  option:last-of-type {
+    color: #0088cc
+  }
+}
+
 
 .jobs-sidebar{
   width: 16%;

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/templates/main/mirroring/dataset.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/dataset.hbs b/ambari-web/app/templates/main/mirroring/dataset.hbs
deleted file mode 100644
index fe6eca0..0000000
--- a/ambari-web/app/templates/main/mirroring/dataset.hbs
+++ /dev/null
@@ -1,121 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-<div class="row-fluid">
-    <form class="form-horizontal">
-        <div class="add-data-set">
-            <table>
-                <tr {{bindAttr class="model.isNameError:error"}}>
-                    <td class="percent25" colspan="1">
-                      {{t mirroring.dataset.name}}
-                    </td>
-                    <td colspan="2" style="text-align: left">
-                      {{view Ember.TextField valueBinding="model.newDataSet.name" class="span4"}}
-                        <span class="help-inline">{{nameErrorMessage}}</span>
-                    </td>
-                </tr>
-                <tr>
-                    <td class="spacer" colspan="3"></td>
-                </tr>
-
-                <tr {{bindAttr class="model.isTypeError:error"}}>
-                    <td class="percent25" colspan="1">
-                      {{t mirroring.dataset.type}}
-                    </td>
-                    <td colspan="2" style="text-align: left">
-                      {{view view.typeSelect }}
-                        <span class="help-inline">{{typeErrorMessage}}</span>
-                    </td>
-                </tr>
-                <tr>
-                    <td class="spacer" colspan="3"></td>
-                </tr>
-
-                <tr {{bindAttr class="model.isSourceDirError:error"}}>
-                    <td colspan="1">
-                      {{t mirroring.dataset.sourceDir}}
-                    </td>
-                    <td colspan="2" style="text-align: left">
-                      {{view Ember.TextField valueBinding="model.newDataSet.sourceDir" class="span4"}}
-                        <span class="help-inline">{{sourceDirErrorMessage}}</span>
-                    </td>
-                </tr>
-                <tr>
-                    <td class="spacer" colspan="3"></td>
-                </tr>
-                <tr {{bindAttr class="model.isTargetClusterError:error"}}>
-                    <td colspan="1">
-                      {{t mirroring.dataset.target}}
-                    </td>
-                    <td colspan="2" style="text-align: left">
-                      {{view view.targetClusterSelect }}
-                        <span class="help-inline">{{targetClusterErrorMessage}}</span>
-                    </td>
-                </tr>
-                <tr>
-                    <td class="spacer" colspan="3"></td>
-                </tr>
-                <tr {{bindAttr class="model.isTargetDirError:error"}}>
-                    <td class="spacer" colspan="1">
-                      {{t mirroring.dataset.targetDir}}
-                    </td>
-                    <td colspan="2" style="text-align: left">
-                      {{view Ember.TextField valueBinding="model.newDataSet.targetDir" class="span4"}}
-                        <span class="help-inline">{{targetDirErrorMessage}}</span>
-                    </td>
-                </tr>
-                <tr>
-                    <td class="spacer" colspan="3"></td>
-                </tr>
-                <tr>
-                    <td colspan="1"> {{t mirroring.dataset.schedule}} </td>
-                    <td colspan="2" style="text-align: left">
-                        <div {{bindAttr class="model.isStartDateError:error"}}>
-                          {{view Ember.TextField valueBinding="model.newDataSet.schedule.startDate" class="input-small datepicker"}}
-                          {{view Ember.Select contentBinding="view.hourOptions.content" selectionBinding="view.hourOptions.selectedForStart" class="input-mini" optionLabelPath="content.value" optionValuePath="content.value"}}
-                          {{view Ember.Select contentBinding="view.minuteOptions.content" selectionBinding="view.minuteOptions.selectedForStart" class="input-mini" optionLabelPath="content.value" optionValuePath="content.value"}}
-                          {{view Ember.Select contentBinding="view.dayOrNightOptions.content" selectionBinding="view.dayOrNightOptions.selectedForStart" class="input-mini" optionLabelPath="content.name" optionValuePath="content.name"}}
-                            <span class="help-inline">{{startDateErrorMessage}}</span>
-                        </div>
-                        <div>
-                          {{t mirroring.dataset.schedule.to}}
-                        </div>
-                        <div {{bindAttr class="model.isEndDateError:error"}}>
-                          {{view Ember.TextField valueBinding="model.newDataSet.schedule.endDate" class="input-small datepicker"}}
-                          {{view Ember.Select contentBinding="view.hourOptions.content" selectionBinding="view.hourOptions.selectedForEnd" class="input-mini" optionLabelPath="content.value" optionValuePath="content.value"}}
-                          {{view Ember.Select contentBinding="view.minuteOptions.content" selectionBinding="view.minuteOptions.selectedForEnd" class="input-mini" optionLabelPath="content.value" optionValuePath="content.value"}}
-                          {{view Ember.Select contentBinding="view.dayOrNightOptions.content" selectionBinding="view.dayOrNightOptions.selectedForEnd" class="input-mini" optionLabelPath="content.name" optionValuePath="content.name"}}
-                            <span class="help-inline">{{endDateErrorMessage}}</span>
-                        </div>
-
-                        <div {{bindAttr class=" :each-row model.isFrequencyError:error"}}>
-                          {{t mirroring.dataset.schedule.repeatEvery}}
-                          {{view Ember.TextField valueBinding="view.repeatNumberSelected" class="input-mini"}}
-                          {{view Ember.Select contentBinding="view.repeatOptions.content" selectionBinding="view.repeatOptions.repeatOptionSelected" class="input-small" optionLabelPath="content.value" optionValuePath="content.value"}}
-                            <span class="help-inline">{{frequencyErrorMessage}}</span>
-                        </div>
-                    </td>
-                </tr>
-            </table>
-        </div>
-    </form>
-</div>
-{{#if isPopupForEdit}}
-    <div class="pull-right dataset-delete">
-        <a {{action deleteDatasetClick target="controller"}} class="btn btn-danger">{{t common.delete}}</a>
-    </div>
-{{/if}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/templates/main/mirroring/datasets.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/datasets.hbs b/ambari-web/app/templates/main/mirroring/datasets.hbs
index 23f8ef1..bd2dadf 100644
--- a/ambari-web/app/templates/main/mirroring/datasets.hbs
+++ b/ambari-web/app/templates/main/mirroring/datasets.hbs
@@ -29,7 +29,7 @@
           </a>
         </li>
         <li>
-          <a {{action manageClusters target="controller"}} href="javascript:void(null);">
+          <a {{action manageClusters}} href="javascript:void(null);">
             <i class="icon-cog"></i>&nbsp;{{t mirroring.dataset.manageClusters}}...
           </a>
         </li>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b26bca93/ambari-web/app/templates/main/mirroring/dropdown.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/dropdown.hbs b/ambari-web/app/templates/main/mirroring/dropdown.hbs
deleted file mode 100644
index 889093e..0000000
--- a/ambari-web/app/templates/main/mirroring/dropdown.hbs
+++ /dev/null
@@ -1,29 +0,0 @@
-{{!
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-}}
-<div class="btn-group">
-    <a class="btn dropdown-toggle targetClusterDD" data-toggle="dropdown" href="#">
-      {{view.selected.title}}
-        <span class="caret"></span>
-    </a>
-    <ul class="dropdown-menu">
-      {{#each view.listOfOptions}}
-          <li {{!bindAttr class="view.isActive:active"   use this to hide the selected one in the drop down }}><a
-                  href="#" {{action "select" this target="view" on="click"}}>{{title}}</a></li>
-      {{/each}}
-    </ul>
-</div>
\ No newline at end of file