ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-6495. Service Pluggability: Show custom section on service config page for affiliated config-types to the service. (jaimin)
Date Tue, 15 Jul 2014 23:30:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ebed6dca2 -> 8e2993515


AMBARI-6495. Service Pluggability: Show custom section on service config page for affiliated
config-types to the service. (jaimin)


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

Branch: refs/heads/trunk
Commit: 8e2993515d3db6018bd38ee5ac423101702e2a01
Parents: ebed6dc
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Tue Jul 15 16:30:24 2014 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Tue Jul 15 16:30:24 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step5_controller.js  |   3 -
 ambari-web/app/data/HDP2/site_properties.js     | 117 -------------
 ambari-web/app/data/site_properties.js          | 131 --------------
 ambari-web/app/models/stack_service.js          | 172 ++++++++++---------
 ambari-web/app/utils/config.js                  |  48 +++++-
 .../test/data/HDP2/site_properties_test.js      |   6 -
 6 files changed, 136 insertions(+), 341 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/app/controllers/wizard/step5_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js
index 5ed0192..a8276a0 100644
--- a/ambari-web/app/controllers/wizard/step5_controller.js
+++ b/ambari-web/app/controllers/wizard/step5_controller.js
@@ -359,8 +359,6 @@ App.WizardStep5Controller = Em.Controller.extend({
   },
 
   /**
-<<<<<<< HEAD
-=======
    * @param {string} componentName
    * @returns {bool}
    * @private
@@ -371,7 +369,6 @@ App.WizardStep5Controller = Em.Controller.extend({
   },
 
   /**
->>>>>>> apache-ref/trunk
    * Put master components to <code>selectedServicesMasters</code>, which will
be automatically rendered in template
    * @param {Ember.Enumerable} masterComponents
    * @method renderComponents

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 49a5344..b858e38 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -1598,123 +1598,6 @@ module.exports =
       "filename": "pig-properties.xml",
       "category": "Advanced"
     },
-  /**********************************************log4j.properties***************************************/
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "HDFS",
-      "filename": "hdfs-log4j.xml",
-      "category": "AdvancedHDFSLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "YARN",
-      "filename": "yarn-log4j.xml",
-      "category": "AdvancedYARNLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "HBASE",
-      "filename": "hbase-log4j.xml",
-      "category": "AdvancedHbaseLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "HIVE",
-      "filename": "hive-exec-log4j.xml",
-      "category": "AdvancedHiveExecLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "HIVE",
-      "filename": "hive-log4j.xml",
-      "category": "AdvancedHiveLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "OOZIE",
-      "filename": "oozie-log4j.xml",
-      "category": "AdvancedOozieLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "ZOOKEEPER",
-      "filename": "zookeeper-log4j.xml",
-      "category": "AdvancedZooLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isRequired": false,
-      "showLabel": false,
-      "serviceName": "PIG",
-      "filename": "pig-log4j.xml",
-      "category": "AdvancedPigLog4j"
-    },
-
-
 
     //***************************************** GLUSTERFS stack********************************************
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/app/data/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/site_properties.js b/ambari-web/app/data/site_properties.js
index 36ae907..5f0bf9a 100644
--- a/ambari-web/app/data/site_properties.js
+++ b/ambari-web/app/data/site_properties.js
@@ -773,137 +773,6 @@ module.exports =
       "serviceName": "WEBHCAT",
       "category": "Advanced"
     },
-  /**********************************************log4j.properties***************************************/
-
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "HDFS",
-      "filename": "hdfs-log4j.xml",
-      "category": "AdvancedHDFSLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "MAPREDUCE",
-      "filename": "mapreduce-log4j.xml",
-      "category": "AdvancedMapredLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "HBASE",
-      "filename": "hbase-log4j.xml",
-      "category": "AdvancedHbaseLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "HIVE",
-      "filename": "hive-exec-log4j.xml",
-      "category": "AdvancedHiveExecLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "HIVE",
-      "filename": "hive-log4j.xml",
-      "category": "AdvancedHiveLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "OOZIE",
-      "filename": "oozie-log4j.xml",
-      "category": "AdvancedOozieLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "ZOOKEEPER",
-      "filename": "zookeeper-log4j.xml",
-      "category": "AdvancedZooLog4j"
-    },
-    {
-      "id": "site property",
-      "name": "content",
-      "displayName": "content",
-      "value": "",
-      "defaultValue": "",
-      "description": "log4j properties",
-      "displayType": "content",
-      "isOverridable": true,
-      "isRequired": false,
-      "isVisible": true,
-      "showLabel": false,
-      "serviceName": "PIG",
-      "filename": "pig-log4j.xml",
-      "category": "AdvancedPigLog4j"
-    },
-
 
     //***************************************** GLUSTERFS stack********************************************
     {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js
index f0611c7..812453b 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -60,14 +60,14 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, {
   }.property('serviceName'),
 
   configTypesRendered: function () {
-    var configTypes =  this.get('configTypes');
+    var configTypes = this.get('configTypes');
     if (this.get('serviceName') == 'HDFS') return configTypes;
     else {
-      var renderedConfigTypes = $.extend(true,{}, configTypes);
+      var renderedConfigTypes = $.extend(true, {}, configTypes);
       delete renderedConfigTypes['core-site'];
       return renderedConfigTypes
     }
-  }.property('serviceName','configTypes'),
+  }.property('serviceName', 'configTypes'),
 
   displayNameOnSelectServicePage: function () {
     var displayName = this.get('displayName');
@@ -180,7 +180,7 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, {
     var serviceComponents = this.get('serviceComponents');
     if (configTypes && Object.keys(configTypes).length) {
       var pattern = ["General", "CapacityScheduler", "^Advanced", "^Custom", "Falcon - Oozie
integration", "FalconStartupSite", "FalconRuntimeSite"];
-      configCategories = App.StackService.configCategories(serviceName).filter(function (_configCategory)
{
+      configCategories = App.StackService.configCategories.call(this).filter(function (_configCategory)
{
         var serviceComponentName = _configCategory.get('name');
         var isServiceComponent = serviceComponents.someProperty('componentName', serviceComponentName);
         if (isServiceComponent) return  isServiceComponent;
@@ -193,19 +193,7 @@ App.StackService = DS.Model.extend(App.ServiceModelMixin, {
       });
     }
     return configCategories;
-  }.property('serviceName', 'configTypes', 'serviceComponents'),
-
-  serviceConfigs: function () {
-    var configCategories = [];
-    var serviceName = this.get('serviceName');
-    var serviceComponents = this.get('serviceComponents');
-    configCategories = App.StackService.configCategories(serviceName).filter(function (_configCategory)
{
-      var serviceComponentName = _configCategory.get('name');
-      return serviceComponents.someProperty('componentName', serviceComponentName);
-    });
-    return configCategories;
-  }.observes('serviceName', 'serviceComponents')
-
+  }.property('serviceName', 'configTypes', 'serviceComponents')
 });
 
 App.StackService.FIXTURES = [];
@@ -272,107 +260,119 @@ App.StackService.defaultConfigsHandler = {
   TEZ: {defaultsProviders: [App.TezDefaultsProvider.create()], configsValidator: App.TezConfigsValidator}
 };
 
-App.StackService.configCategories = function (serviceName) {
-  switch (serviceName) {
+App.StackService.configCategories = function () {
+  var serviceConfigCategories = [];
+  switch (this.get('serviceName')) {
     case 'HDFS':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'NAMENODE', displayName: 'NameNode'}),
         App.ServiceConfigCategory.create({ name: 'SECONDARY_NAMENODE', displayName: 'Secondary
NameNode'}),
         App.ServiceConfigCategory.create({ name: 'DATANODE', displayName: 'DataNode'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedCoreSite', displayName: 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHDFSSite', displayName: 'Custom
hdfs-site.xml', siteFileName: 'hdfs-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHDFSLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'hdfs-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced core-site', displayName: 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced hdfs-site', displayName: 'Custom
hdfs-site.xml', siteFileName: 'hdfs-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced hdfs-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hdfs-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'GLUSTERFS':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedGlusterFSSite', displayName : 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced core-site', displayName : 'Custom
core-site.xml', siteFileName: 'core-site.xml', canAddProperty: true})
+      ]);
+      break;
     case 'MAPREDUCE':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 'History Server'}),
         App.ServiceConfigCategory.create({ name: 'JOBTRACKER', displayName: 'JobTracker'}),
         App.ServiceConfigCategory.create({ name: 'TASKTRACKER', displayName: 'TaskTracker'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedMapredLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'mapreduce-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced mapred-site', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced mapreduce-log4j', displayName:
'Custom log4j.properties', siteFileName: 'mapreduce-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'YARN':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'RESOURCEMANAGER', displayName: 'Resource
Manager'}),
         App.ServiceConfigCategory.create({ name: 'NODEMANAGER', displayName: 'Node Manager'}),
         App.ServiceConfigCategory.create({ name: 'APP_TIMELINE_SERVER', displayName: 'Application
Timeline Server'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'CapacityScheduler', displayName: 'Scheduler',
isCapacityScheduler: true, isCustomView: true, siteFileName: 'capacity-scheduler.xml', siteFileNames:
['capacity-scheduler.xml', 'mapred-queue-acls.xml'], canAddProperty: App.supports.capacitySchedulerUi}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedYARNSite', displayName: 'Custom
yarn-site.xml', siteFileName: 'yarn-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedYARNLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'yarn-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced yarn-site', displayName: 'Custom
yarn-site.xml', siteFileName: 'yarn-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced yarn-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'yarn-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'MAPREDUCE2':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'HISTORYSERVER', displayName: 'History Server'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedMapredLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'mapreduce2-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite', displayName: 'Custom
mapred-site.xml', siteFileName: 'mapred-site.xml', canAddProperty: true})
+      ]);
+      break;
     case 'HIVE':
-      return [
+     serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'HIVE_METASTORE', displayName: 'Hive Metastore'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHiveSite', displayName: 'Custom
hive-site.xml', siteFileName: 'hive-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHiveLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'hive-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHiveExecLog4j', displayName: 'Custom
hive-exec-log4j', siteFileName: 'hive-exec-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced hive-site', displayName: 'Custom
hive-site.xml', siteFileName: 'hive-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced hive-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hive-log4j.xml', canAddProperty: false}),
+        App.ServiceConfigCategory.create({ name: 'Advanced hive-exec-log4j', displayName:
'Custom hive-exec-log4j', siteFileName: 'hive-exec-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'WEBHCAT':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'WEBHCAT_SERVER', displayName: 'WebHCat
Server'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedWebHCatSite', displayName: 'Custom
webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced webhcat-site', displayName: 'Custom
webhcat-site.xml', siteFileName: 'webhcat-site.xml', canAddProperty: true})
+      ]);
+      break;
     case 'HBASE':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'HBASE_MASTER', displayName: 'HBase Master'}),
         App.ServiceConfigCategory.create({ name: 'HBASE_REGIONSERVER', displayName: 'RegionServer'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHbaseSite', displayName: 'Custom
hbase-site.xml', siteFileName: 'hbase-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedHbaseLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'hbase-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced hbase-site', displayName: 'Custom
hbase-site.xml', siteFileName: 'hbase-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced hbase-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'hbase-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'ZOOKEEPER':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'ZOOKEEPER_SERVER', displayName: 'ZooKeeper
Server'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedZooLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'zookeeper-log4j.xml', canAddProperty: false}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedZooCfg', displayName: 'Custom zoo.cfg',
siteFileName: 'zoo.cfg', canAddProperty: true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced zookeeper-log4j', displayName:
'Custom log4j.properties', siteFileName: 'zookeeper-log4j.xml', canAddProperty: false}),
+        App.ServiceConfigCategory.create({ name: 'Advanced zoo.cfg', displayName: 'Custom
zoo.cfg', siteFileName: 'zoo.cfg', canAddProperty: true})
+      ]);
+      break;
     case 'OOZIE':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'OOZIE_SERVER', displayName: 'Oozie Server'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedOozieSite', displayName: 'Custom
oozie-site.xml', siteFileName: 'oozie-site.xml', canAddProperty: true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedOozieLog4j', displayName: 'Custom
log4j.properties', siteFileName: 'oozie-log4j.xml', canAddProperty: false})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced oozie-site', displayName: 'Custom
oozie-site.xml', siteFileName: 'oozie-site.xml', canAddProperty: true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced oozie-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'oozie-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'PIG':
-    return [
-      App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Custom pig.properties',
siteFileName: 'pig-properties.xml', canAddProperty: false}),
-      App.ServiceConfigCategory.create({ name: 'AdvancedPigLog4j', displayName: 'Custom log4j.properties',
siteFileName: 'pig-log4j.xml', canAddProperty: false})
-    ];
+      serviceConfigCategories.pushObjects([
+        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Custom pig.properties',
siteFileName: 'pig-properties.xml', canAddProperty: false}),
+        App.ServiceConfigCategory.create({ name: 'Advanced pig-log4j', displayName: 'Custom
log4j.properties', siteFileName: 'pig-log4j.xml', canAddProperty: false})
+      ]);
+      break;
     case 'FALCON':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'FALCON_SERVER', displayName: 'Falcon Server'}),
         App.ServiceConfigCategory.create({ name: 'Falcon - Oozie integration', displayName:
'Falcon - Oozie integration'}),
         App.ServiceConfigCategory.create({ name: 'FalconStartupSite', displayName: 'Falcon
startup.properties'}),
         App.ServiceConfigCategory.create({ name: 'FalconRuntimeSite', displayName: 'Falcon
runtime.properties'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedFalconStartupSite', displayName:
'Custom startup.properties', siteFileName: 'falcon-startup.properties.xml', canAddProperty:
true}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedFalconRuntimeSite', displayName:
'Custom runtime.properties', siteFileName: 'falcon-runtime.properties.xml', canAddProperty:
true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced falcon-startup.properties', displayName:
'Custom startup.properties', siteFileName: 'falcon-startup.properties.xml', canAddProperty:
true}),
+        App.ServiceConfigCategory.create({ name: 'Advanced falcon-runtime.properties', displayName:
'Custom runtime.properties', siteFileName: 'falcon-runtime.properties.xml', canAddProperty:
true})
+      ]);
+      break;
     case 'STORM':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'NIMBUS', displayName: 'Nimbus'}),
         App.ServiceConfigCategory.create({ name: 'SUPERVISOR', displayName: 'Supervisor'}),
         App.ServiceConfigCategory.create({ name: 'STORM_UI_SERVER', displayName: 'Storm UI
Server'}),
@@ -380,24 +380,36 @@ App.StackService.configCategories = function (serviceName) {
         App.ServiceConfigCategory.create({ name: 'DRPC_SERVER', displayName: 'DRPC Server'}),
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedStormSite', displayName: 'Custom
storm.yaml', siteFileName: 'storm-site.xml', canAddProperty: true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced storm-site', displayName: 'Custom
storm.yaml', siteFileName: 'storm-site.xml', canAddProperty: true})
+      ]);
+      break;
     case 'TEZ':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
         App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'}),
-        App.ServiceConfigCategory.create({ name: 'AdvancedTezSite', displayName: 'Custom
tez-site.xml', siteFileName: 'tez-site.xml', canAddProperty: true})
-      ];
+        App.ServiceConfigCategory.create({ name: 'Advanced tez-site', displayName: 'Custom
tez-site.xml', siteFileName: 'tez-site.xml', canAddProperty: true})
+      ]);
+      break;
     case 'FLUME':
-      return [
+      serviceConfigCategories.pushObjects([
         App.ServiceConfigCategory.create({ name: 'FLUME_HANDLER', displayName: 'flume.conf',
siteFileName: 'flume-conf', canAddProperty: false})
-      ];
+      ]);
+      break;
     case 'HCATALOG':
-      return [];
+      break;
     default:
-      return [
-        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General', canAddProperty:
false}),
-        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced', canAddProperty:
false})
-      ];
+      serviceConfigCategories.pushObjects([
+        App.ServiceConfigCategory.create({ name: 'General', displayName: 'General'}),
+        App.ServiceConfigCategory.create({ name: 'Advanced', displayName: 'Advanced'})
+      ]);
+      var configTypes = Object.keys(this.get('configTypes')).without('core-site').without('global');
+      configTypes.forEach(function (type) {
+        var displayName = 'Custom ' + type;
+        var canAddProperty = !type.endsWith('-log4j');
+        var siteFileName = type + '.xml';
+        serviceConfigCategories.pushObject(App.ServiceConfigCategory.create({ name: 'Advanced
' + type, displayName: displayName, siteFileName: siteFileName,
+          canAddProperty: canAddProperty}));
+      }, this);
   }
+  return serviceConfigCategories;
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 3372770..226f839 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -163,6 +163,42 @@ App.config = Em.Object.create({
   //categories which contain custom configs
   categoriesWithCustom: ['CapacityScheduler'],
 
+
+  /**
+   * Create array of service properties for Log4j files
+   * @returns {Array}
+   */
+  createLog4jContent: function () {
+    var services = App.StackService.find();
+    var contentProperties = [];
+    services.forEach(function (service) {
+      if (service.get('configTypes')) {
+        Object.keys(service.get('configTypes')).forEach(function (type) {
+          if (type.endsWith('-log4j')) {
+            var property = {
+              "id": "site property",
+              "name": "content",
+              "displayName": "content",
+              "value": "",
+              "defaultValue": "",
+              "description": "log4j properties",
+              "displayType": "content",
+              "isOverridable": true,
+              "isRequired": false,
+              "isVisible": true,
+              "showLabel": false,
+              "serviceName": service.get('serviceName'),
+              "filename": type + '.xml',
+              "category": "Advanced " + type
+            };
+            contentProperties.pushObject(property);
+          }
+        }, this);
+      }
+    }, this);
+    return contentProperties;
+  },
+
   //configs with these filenames go to appropriate category not in Advanced
   customFileNames: function () {
     var customFiles = ['flume-conf.xml'];
@@ -296,7 +332,8 @@ App.config = Em.Object.create({
   mergePreDefinedWithLoaded: function (configGroups, advancedConfigs, tags, serviceName)
{
     var configs = [];
     var globalConfigs = [];
-    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties'));
+    var log4jContentProperties = this.createLog4jContent();
+    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')).concat(log4jContentProperties);
     var mappingConfigs = [];
     var filenameExceptions = this.get('filenameExceptions');
     var selectedServiceNames = App.Service.find().mapProperty('serviceName');
@@ -447,8 +484,10 @@ App.config = Em.Object.create({
         globalConfigs = globalConfigs.without(_global);
       }
     }, this);
-
-    this.get('preDefinedSiteProperties').mapProperty('name').forEach(function (name) {
+    var preDefinedSiteProperties = this.get('preDefinedSiteProperties').mapProperty('name');
+    var log4jContentProperties = this.createLog4jContent().mapProperty('name');
+    var siteProperties = preDefinedSiteProperties.concat(log4jContentProperties);
+    siteProperties.forEach(function (name) {
       var _site = siteConfigs.filterProperty('name', name);
       if (_site.length == 1) {
         siteStart.push(_site[0]);
@@ -477,7 +516,8 @@ App.config = Em.Object.create({
    */
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs, selectedServiceNames)
{
     var mergedConfigs = [];
-    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties'));
+    var log4jContentProperties = this.createLog4jContent();
+    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')).concat(log4jContentProperties);
 
     storedConfigs = (storedConfigs) ? storedConfigs : [];
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8e299351/ambari-web/test/data/HDP2/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2/site_properties_test.js b/ambari-web/test/data/HDP2/site_properties_test.js
index ae658fd..0336f92 100644
--- a/ambari-web/test/data/HDP2/site_properties_test.js
+++ b/ambari-web/test/data/HDP2/site_properties_test.js
@@ -22,12 +22,6 @@ var siteProperties = require('data/HDP2/site_properties').configProperties;
 
 describe('hdp2SiteProperties', function () {
 
-
-  //@TODO: log4j propeties should not be a part of site properties file. A separate file
 should address this logic. site_properties.js should be used only to provide ui attributes
to existing stack properties
-  //Exclude log4j properties from unit tests for now
-  siteProperties = siteProperties.filter(function(item, index){
-    return !(item.filename && item.filename.endsWith('log4j.xml'));
-  });
   // No site properties should be made invisible
   siteProperties.forEach(function(siteProperty){
     it('Check invisible attribute of "' + siteProperty.name  + '"' + '. It should not be
defined ', function () {


Mime
View raw message