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

[01/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre) [Forced Update!]

Repository: ambari
Updated Branches:
  refs/heads/branch-dev-logsearch c63b0d042 -> c3a856e33 (forced update)


http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-BZ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-BZ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-BZ.js
new file mode 100644
index 0000000..4a0692d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-BZ.js
@@ -0,0 +1,54 @@
+/*
+ * Globalize Culture en-BZ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "en-BZ", "default", {
+	name: "en-BZ",
+	englishName: "English (Belize)",
+	nativeName: "English (Belize)",
+	numberFormat: {
+		currency: {
+			groupSizes: [3,0],
+			symbol: "BZ$"
+		}
+	},
+	calendars: {
+		standard: {
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd, dd MMMM yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, dd MMMM yyyy hh:mm tt",
+				F: "dddd, dd MMMM yyyy hh:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));


[15/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css.map
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css.map b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css.map
new file mode 100644
index 0000000..bfb5616
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css.map
@@ -0,0 +1 @@
+{"version":3,"file":"bootstrap.css","sources":["bootstrap.css","less/normalize.less","less/print.less","less/glyphicons.less","less/scaffolding.less","less/mixins/vendor-prefixes.less","less/mixins/tab-focus.less","less/mixins/image.less","less/type.less","less/mixins/text-emphasis.less","less/mixins/background-variant.less","less/mixins/text-overflow.less","less/code.less","less/grid.less","less/mixins/grid.less","less/mixins/grid-framework.less","less/tables.less","less/mixins/table-row.less","less/forms.less","less/mixins/forms.less","less/buttons.less","less/mixins/buttons.less","less/mixins/opacity.less","less/component-animations.less","less/dropdowns.less","less/mixins/nav-divider.less","less/mixins/reset-filter.less","less/button-groups.less","less/mixins/border-radius.less","less/input-groups.less","less/navs.less","less/navbar.less","less/mixins/nav-vertical-align.less","less/utilities.less","less/breadcrumbs.less","less/pagination.less","less/mixins/pagination.less","less
 /pager.less","less/labels.less","less/mixins/labels.less","less/badges.less","less/jumbotron.less","less/thumbnails.less","less/alerts.less","less/mixins/alerts.less","less/progress-bars.less","less/mixins/gradients.less","less/mixins/progress-bar.less","less/media.less","less/list-group.less","less/mixins/list-group.less","less/panels.less","less/mixins/panels.less","less/responsive-embed.less","less/wells.less","less/close.less","less/modals.less","less/tooltip.less","less/popovers.less","less/carousel.less","less/mixins/clearfix.less","less/mixins/center-block.less","less/mixins/hide-text.less","less/responsive-utilities.less","less/mixins/responsive-visibility.less"],"names":[],"mappings":"AAAA,6DAA4D;ACQ5D;EACE,yBAAA;EACA,4BAAA;EACA,gCAAA;EDND;ACaD;EACE,WAAA;EDXD;ACuBD;;;;;;;;;;;;EAYE,gBAAA;EDrBD;AC6BD;;;;EAIE,uBAAA;EACA,0BAAA;ED3BD;ACmCD;EACE,eAAA;EACA,WAAA;EDjCD;ACyCD;;EAEE,eAAA;EDvCD;ACiDD;EACE,yBAAA;ED/CD;ACsDD;;EAEE,YAAA;EDpDD;AC8DD;EACE,2BAAA;ED5DD;ACmED;;EAEE,mBAAA;EDjED
 ;ACwED;EACE,oBAAA;EDtED;AC8ED;EACE,gBAAA;EACA,kBAAA;ED5ED;ACmFD;EACE,kBAAA;EACA,aAAA;EDjFD;ACwFD;EACE,gBAAA;EDtFD;AC6FD;;EAEE,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,0BAAA;ED3FD;AC8FD;EACE,aAAA;ED5FD;AC+FD;EACE,iBAAA;ED7FD;ACuGD;EACE,WAAA;EDrGD;AC4GD;EACE,kBAAA;ED1GD;ACoHD;EACE,kBAAA;EDlHD;ACyHD;EACE,8BAAA;EACA,iCAAA;EAAA,yBAAA;EACA,WAAA;EDvHD;AC8HD;EACE,gBAAA;ED5HD;ACmID;;;;EAIE,mCAAA;EACA,gBAAA;EDjID;ACmJD;;;;;EAKE,gBAAA;EACA,eAAA;EACA,WAAA;EDjJD;ACwJD;EACE,mBAAA;EDtJD;ACgKD;;EAEE,sBAAA;ED9JD;ACyKD;;;;EAIE,4BAAA;EACA,iBAAA;EDvKD;AC8KD;;EAEE,iBAAA;ED5KD;ACmLD;;EAEE,WAAA;EACA,YAAA;EDjLD;ACyLD;EACE,qBAAA;EDvLD;ACkMD;;EAEE,gCAAA;EAAA,6BAAA;EAAA,wBAAA;EACA,YAAA;EDhMD;ACyMD;;EAEE,cAAA;EDvMD;ACgND;EACE,+BAAA;EACA,8BAAA;EACA,iCAAA;EACA,yBAAA;ED9MD;ACuND;;EAEE,0BAAA;EDrND;AC4ND;EACE,2BAAA;EACA,eAAA;EACA,gCAAA;ED1ND;ACkOD;EACE,WAAA;EACA,YAAA;EDhOD;ACuOD;EACE,gBAAA;EDrOD;AC6OD;EACE,mBAAA;ED3OD;ACqPD;EACE,2BAAA;EACA,mBAAA;EDnPD;ACsPD;;EAEE,YAAA;EDpPD;AE9ED;EA9FE;IACE,8BAAA;IACA,wBAAA;IACA,oCAAA;IACA
 ,qCAAA;IAAA,6BAAA;IF+KD;EE5KD;;IAEE,4BAAA;IF8KD;EE3KD;IACE,8BAAA;IF6KD;EE1KD;IACE,+BAAA;IF4KD;EExKD;;IAEE,aAAA;IF0KD;EEvKD;;IAEE,wBAAA;IACA,0BAAA;IFyKD;EEtKD;IACE,6BAAA;IFwKD;EErKD;;IAEE,0BAAA;IFuKD;EEpKD;IACE,4BAAA;IFsKD;EEnKD;;;IAGE,YAAA;IACA,WAAA;IFqKD;EElKD;;IAEE,yBAAA;IFoKD;EE/JD;IACE,6BAAA;IFiKD;EE7JD;IACE,eAAA;IF+JD;EE7JD;;IAGI,mCAAA;IF8JH;EE3JD;;IAGI,mCAAA;IF4JH;EEzJD;IACE,wBAAA;IF2JD;EExJD;IACE,sCAAA;IF0JD;EExJD;;IAGI,mCAAA;IFyJH;EACF;AGhPD;EACE,qCAAA;EACA,uDAAA;EACA,6TAAA;EHkPD;AG3OD;EACE,oBAAA;EACA,UAAA;EACA,uBAAA;EACA,qCAAA;EACA,oBAAA;EACA,qBAAA;EACA,gBAAA;EACA,qCAAA;EACA,oCAAA;EH6OD;AGzOmC;EAAW,gBAAA;EH4O9C;AG3OmC;EAAW,gBAAA;EH8O9C;AG7OmC;EAAW,kBAAA;EHgP9C;AG/OmC;EAAW,kBAAA;EHkP9C;AGjPmC;EAAW,kBAAA;EHoP9C;AGnPmC;EAAW,kBAAA;EHsP9C;AGrPmC;EAAW,kBAAA;EHwP9C;AGvPmC;EAAW,kBAAA;EH0P9C;AGzPmC;EAAW,kBAAA;EH4P9C;AG3PmC;EAAW,kBAAA;EH8P9C;AG7PmC;EAAW,kBAAA;EHgQ9C;AG/PmC;EAAW,kBAAA;EHkQ9C;AGjQmC;EAAW,kBAAA;EHoQ9C;AGnQmC;EAAW,kBAAA;EHsQ9C;AGrQmC;EAAW,kBAAA;EHwQ9C;AGvQmC;EAAW,kBAAA;E
 H0Q9C;AGzQmC;EAAW,kBAAA;EH4Q9C;AG3QmC;EAAW,kBAAA;EH8Q9C;AG7QmC;EAAW,kBAAA;EHgR9C;AG/QmC;EAAW,kBAAA;EHkR9C;AGjRmC;EAAW,kBAAA;EHoR9C;AGnRmC;EAAW,kBAAA;EHsR9C;AGrRmC;EAAW,kBAAA;EHwR9C;AGvRmC;EAAW,kBAAA;EH0R9C;AGzRmC;EAAW,kBAAA;EH4R9C;AG3RmC;EAAW,kBAAA;EH8R9C;AG7RmC;EAAW,kBAAA;EHgS9C;AG/RmC;EAAW,kBAAA;EHkS9C;AGjSmC;EAAW,kBAAA;EHoS9C;AGnSmC;EAAW,kBAAA;EHsS9C;AGrSmC;EAAW,kBAAA;EHwS9C;AGvSmC;EAAW,kBAAA;EH0S9C;AGzSmC;EAAW,kBAAA;EH4S9C;AG3SmC;EAAW,kBAAA;EH8S9C;AG7SmC;EAAW,kBAAA;EHgT9C;AG/SmC;EAAW,kBAAA;EHkT9C;AGjTmC;EAAW,kBAAA;EHoT9C;AGnTmC;EAAW,kBAAA;EHsT9C;AGrTmC;EAAW,kBAAA;EHwT9C;AGvTmC;EAAW,kBAAA;EH0T9C;AGzTmC;EAAW,kBAAA;EH4T9C;AG3TmC;EAAW,kBAAA;EH8T9C;AG7TmC;EAAW,kBAAA;EHgU9C;AG/TmC;EAAW,kBAAA;EHkU9C;AGjUmC;EAAW,kBAAA;EHoU9C;AGnUmC;EAAW,kBAAA;EHsU9C;AGrUmC;EAAW,kBAAA;EHwU9C;AGvUmC;EAAW,kBAAA;EH0U9C;AGzUmC;EAAW,kBAAA;EH4U9C;AG3UmC;EAAW,kBAAA;EH8U9C;AG7UmC;EAAW,kBAAA;EHgV9C;AG/UmC;EAAW,kBAAA;EHkV9C;AGjVmC;EAAW,kBAAA;EHoV9C;AGnVmC;EAAW,kBAAA;EHsV9C;AGrVmC;EAAW,kBAAA;EHwV9C;AGvVmC;EAAW,kBAA
 A;EH0V9C;AGzVmC;EAAW,kBAAA;EH4V9C;AG3VmC;EAAW,kBAAA;EH8V9C;AG7VmC;EAAW,kBAAA;EHgW9C;AG/VmC;EAAW,kBAAA;EHkW9C;AGjWmC;EAAW,kBAAA;EHoW9C;AGnWmC;EAAW,kBAAA;EHsW9C;AGrWmC;EAAW,kBAAA;EHwW9C;AGvWmC;EAAW,kBAAA;EH0W9C;AGzWmC;EAAW,kBAAA;EH4W9C;AG3WmC;EAAW,kBAAA;EH8W9C;AG7WmC;EAAW,kBAAA;EHgX9C;AG/WmC;EAAW,kBAAA;EHkX9C;AGjXmC;EAAW,kBAAA;EHoX9C;AGnXmC;EAAW,kBAAA;EHsX9C;AGrXmC;EAAW,kBAAA;EHwX9C;AGvXmC;EAAW,kBAAA;EH0X9C;AGzXmC;EAAW,kBAAA;EH4X9C;AG3XmC;EAAW,kBAAA;EH8X9C;AG7XmC;EAAW,kBAAA;EHgY9C;AG/XmC;EAAW,kBAAA;EHkY9C;AGjYmC;EAAW,kBAAA;EHoY9C;AGnYmC;EAAW,kBAAA;EHsY9C;AGrYmC;EAAW,kBAAA;EHwY9C;AGvYmC;EAAW,kBAAA;EH0Y9C;AGzYmC;EAAW,kBAAA;EH4Y9C;AG3YmC;EAAW,kBAAA;EH8Y9C;AG7YmC;EAAW,kBAAA;EHgZ9C;AG/YmC;EAAW,kBAAA;EHkZ9C;AGjZmC;EAAW,kBAAA;EHoZ9C;AGnZmC;EAAW,kBAAA;EHsZ9C;AGrZmC;EAAW,kBAAA;EHwZ9C;AGvZmC;EAAW,kBAAA;EH0Z9C;AGzZmC;EAAW,kBAAA;EH4Z9C;AG3ZmC;EAAW,kBAAA;EH8Z9C;AG7ZmC;EAAW,kBAAA;EHga9C;AG/ZmC;EAAW,kBAAA;EHka9C;AGjamC;EAAW,kBAAA;EHoa9C;AGnamC;EAAW,kBAAA;EHsa9C;AGramC;EAAW,kBAAA;EHwa9C;AGvamC;EAAW,k
 BAAA;EH0a9C;AGzamC;EAAW,kBAAA;EH4a9C;AG3amC;EAAW,kBAAA;EH8a9C;AG7amC;EAAW,kBAAA;EHgb9C;AG/amC;EAAW,kBAAA;EHkb9C;AGjbmC;EAAW,kBAAA;EHob9C;AGnbmC;EAAW,kBAAA;EHsb9C;AGrbmC;EAAW,kBAAA;EHwb9C;AGvbmC;EAAW,kBAAA;EH0b9C;AGzbmC;EAAW,kBAAA;EH4b9C;AG3bmC;EAAW,kBAAA;EH8b9C;AG7bmC;EAAW,kBAAA;EHgc9C;AG/bmC;EAAW,kBAAA;EHkc9C;AGjcmC;EAAW,kBAAA;EHoc9C;AGncmC;EAAW,kBAAA;EHsc9C;AGrcmC;EAAW,kBAAA;EHwc9C;AGvcmC;EAAW,kBAAA;EH0c9C;AGzcmC;EAAW,kBAAA;EH4c9C;AG3cmC;EAAW,kBAAA;EH8c9C;AG7cmC;EAAW,kBAAA;EHgd9C;AG/cmC;EAAW,kBAAA;EHkd9C;AGjdmC;EAAW,kBAAA;EHod9C;AGndmC;EAAW,kBAAA;EHsd9C;AGrdmC;EAAW,kBAAA;EHwd9C;AGvdmC;EAAW,kBAAA;EH0d9C;AGzdmC;EAAW,kBAAA;EH4d9C;AG3dmC;EAAW,kBAAA;EH8d9C;AG7dmC;EAAW,kBAAA;EHge9C;AG/dmC;EAAW,kBAAA;EHke9C;AGjemC;EAAW,kBAAA;EHoe9C;AGnemC;EAAW,kBAAA;EHse9C;AGremC;EAAW,kBAAA;EHwe9C;AGvemC;EAAW,kBAAA;EH0e9C;AGzemC;EAAW,kBAAA;EH4e9C;AG3emC;EAAW,kBAAA;EH8e9C;AG7emC;EAAW,kBAAA;EHgf9C;AG/emC;EAAW,kBAAA;EHkf9C;AGjfmC;EAAW,kBAAA;EHof9C;AGnfmC;EAAW,kBAAA;EHsf9C;AGrfmC;EAAW,kBAAA;EHwf9C;AGvfmC;EAA
 W,kBAAA;EH0f9C;AGzfmC;EAAW,kBAAA;EH4f9C;AG3fmC;EAAW,kBAAA;EH8f9C;AG7fmC;EAAW,kBAAA;EHggB9C;AG/fmC;EAAW,kBAAA;EHkgB9C;AGjgBmC;EAAW,kBAAA;EHogB9C;AGngBmC;EAAW,kBAAA;EHsgB9C;AGrgBmC;EAAW,kBAAA;EHwgB9C;AGvgBmC;EAAW,kBAAA;EH0gB9C;AGzgBmC;EAAW,kBAAA;EH4gB9C;AG3gBmC;EAAW,kBAAA;EH8gB9C;AG7gBmC;EAAW,kBAAA;EHghB9C;AG/gBmC;EAAW,kBAAA;EHkhB9C;AGjhBmC;EAAW,kBAAA;EHohB9C;AGnhBmC;EAAW,kBAAA;EHshB9C;AGrhBmC;EAAW,kBAAA;EHwhB9C;AGvhBmC;EAAW,kBAAA;EH0hB9C;AGzhBmC;EAAW,kBAAA;EH4hB9C;AG3hBmC;EAAW,kBAAA;EH8hB9C;AG7hBmC;EAAW,kBAAA;EHgiB9C;AG/hBmC;EAAW,kBAAA;EHkiB9C;AGjiBmC;EAAW,kBAAA;EHoiB9C;AGniBmC;EAAW,kBAAA;EHsiB9C;AGriBmC;EAAW,kBAAA;EHwiB9C;AGviBmC;EAAW,kBAAA;EH0iB9C;AGziBmC;EAAW,kBAAA;EH4iB9C;AG3iBmC;EAAW,kBAAA;EH8iB9C;AG7iBmC;EAAW,kBAAA;EHgjB9C;AG/iBmC;EAAW,kBAAA;EHkjB9C;AGjjBmC;EAAW,kBAAA;EHojB9C;AGnjBmC;EAAW,kBAAA;EHsjB9C;AGrjBmC;EAAW,kBAAA;EHwjB9C;AGvjBmC;EAAW,kBAAA;EH0jB9C;AGzjBmC;EAAW,kBAAA;EH4jB9C;AG3jBmC;EAAW,kBAAA;EH8jB9C;AG7jBmC;EAAW,kBAAA;EHgkB9C;AG/jBmC;EAAW,kBAAA;EHkkB9C;AGjkBmC;EAAW,kBA
 AA;EHokB9C;AGnkBmC;EAAW,kBAAA;EHskB9C;AGrkBmC;EAAW,kBAAA;EHwkB9C;AGvkBmC;EAAW,kBAAA;EH0kB9C;AGzkBmC;EAAW,kBAAA;EH4kB9C;AG3kBmC;EAAW,kBAAA;EH8kB9C;AG7kBmC;EAAW,kBAAA;EHglB9C;AG/kBmC;EAAW,kBAAA;EHklB9C;AGjlBmC;EAAW,kBAAA;EHolB9C;AGnlBmC;EAAW,kBAAA;EHslB9C;AGrlBmC;EAAW,kBAAA;EHwlB9C;AGvlBmC;EAAW,kBAAA;EH0lB9C;AGzlBmC;EAAW,kBAAA;EH4lB9C;AG3lBmC;EAAW,kBAAA;EH8lB9C;AG7lBmC;EAAW,kBAAA;EHgmB9C;AG/lBmC;EAAW,kBAAA;EHkmB9C;AGjmBmC;EAAW,kBAAA;EHomB9C;AGnmBmC;EAAW,kBAAA;EHsmB9C;AGrmBmC;EAAW,kBAAA;EHwmB9C;AGvmBmC;EAAW,kBAAA;EH0mB9C;AGzmBmC;EAAW,kBAAA;EH4mB9C;AG3mBmC;EAAW,kBAAA;EH8mB9C;AG7mBmC;EAAW,kBAAA;EHgnB9C;AG/mBmC;EAAW,kBAAA;EHknB9C;AGjnBmC;EAAW,kBAAA;EHonB9C;AGnnBmC;EAAW,kBAAA;EHsnB9C;AGrnBmC;EAAW,kBAAA;EHwnB9C;AGvnBmC;EAAW,kBAAA;EH0nB9C;AIx1BD;ECgEE,gCAAA;EACG,6BAAA;EACK,wBAAA;EL2xBT;AI11BD;;EC6DE,gCAAA;EACG,6BAAA;EACK,wBAAA;ELiyBT;AIx1BD;EACE,iBAAA;EACA,+CAAA;EJ01BD;AIv1BD;EACE,6DAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,2BAAA;EJy1BD;AIr1BD;;;;EAIE,sBAAA;EACA,oBAAA;EACA,sBAAA;EJu1BD;AIj1B
 D;EACE,gBAAA;EACA,uBAAA;EJm1BD;AIj1BC;;EAEE,gBAAA;EACA,4BAAA;EJm1BH;AIh1BC;EErDA,sBAAA;EAEA,4CAAA;EACA,sBAAA;ENu4BD;AI10BD;EACE,WAAA;EJ40BD;AIt0BD;EACE,wBAAA;EJw0BD;AIp0BD;;;;;EGvEE,gBAAA;EACA,gBAAA;EACA,iBAAA;EACA,cAAA;EPk5BD;AIz0BD;EACE,oBAAA;EJ20BD;AIr0BD;EACE,cAAA;EACA,yBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EC0FA,0CAAA;EACK,qCAAA;EACG,kCAAA;EEpLR,uBAAA;EACA,gBAAA;EACA,iBAAA;EACA,cAAA;EPm6BD;AIt0BD;EACE,oBAAA;EJw0BD;AIl0BD;EACE,kBAAA;EACA,qBAAA;EACA,WAAA;EACA,+BAAA;EJo0BD;AI5zBD;EACE,oBAAA;EACA,YAAA;EACA,aAAA;EACA,cAAA;EACA,YAAA;EACA,kBAAA;EACA,wBAAA;EACA,WAAA;EJ8zBD;AItzBC;;EAEE,kBAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;EACA,mBAAA;EACA,YAAA;EJwzBH;AQn8BD;;;;;;;;;;;;EAEE,sBAAA;EACA,kBAAA;EACA,kBAAA;EACA,gBAAA;ER+8BD;AQp9BD;;;;;;;;;;;;;;;;;;;;;;;;EASI,qBAAA;EACA,gBAAA;EACA,gBAAA;ERq+BH;AQj+BD;;;;;;EAGE,kBAAA;EACA,qBAAA;ERs+BD;AQ1+BD;;;;;;;;;;;;EAQI,gBAAA;ERg/BH;AQ7+BD;;;;;;EAGE,kBAAA;EACA,qBAAA;ERk/BD;AQt/BD;;;;;;;;;;;;EAQI,gBAAA;ER4/BH;AQx/BD;;EAAU,iBAAA;ER4/BT;AQ3/BD;;EAAU,iBAAA;ER+/B
 T;AQ9/BD;;EAAU,iBAAA;ERkgCT;AQjgCD;;EAAU,iBAAA;ERqgCT;AQpgCD;;EAAU,iBAAA;ERwgCT;AQvgCD;;EAAU,iBAAA;ER2gCT;AQrgCD;EACE,kBAAA;ERugCD;AQpgCD;EACE,qBAAA;EACA,iBAAA;EACA,kBAAA;EACA,kBAAA;ERsgCD;AQjgCD;EAAA;IAFI,iBAAA;IRugCD;EACF;AQ//BD;;EAEE,gBAAA;ERigCD;AQ7/BD;EACE,oBAAA;ER+/BD;AQ5/BD;;EAEE,2BAAA;EACA,eAAA;ER8/BD;AQ1/BD;EAAuB,kBAAA;ER6/BtB;AQ5/BD;EAAuB,mBAAA;ER+/BtB;AQ9/BD;EAAuB,oBAAA;ERigCtB;AQhgCD;EAAuB,qBAAA;ERmgCtB;AQlgCD;EAAuB,qBAAA;ERqgCtB;AQlgCD;EAAuB,2BAAA;ERqgCtB;AQpgCD;EAAuB,2BAAA;ERugCtB;AQtgCD;EAAuB,4BAAA;ERygCtB;AQtgCD;EACE,gBAAA;ERwgCD;AQtgCD;EC1GE,gBAAA;ETmnCD;ASlnCC;EACE,gBAAA;ETonCH;AQzgCD;EC7GE,gBAAA;ETynCD;ASxnCC;EACE,gBAAA;ET0nCH;AQ5gCD;EChHE,gBAAA;ET+nCD;AS9nCC;EACE,gBAAA;ETgoCH;AQ/gCD;ECnHE,gBAAA;ETqoCD;ASpoCC;EACE,gBAAA;ETsoCH;AQlhCD;ECtHE,gBAAA;ET2oCD;AS1oCC;EACE,gBAAA;ET4oCH;AQjhCD;EAGE,aAAA;EEhIA,2BAAA;EVkpCD;AUjpCC;EACE,2BAAA;EVmpCH;AQlhCD;EEnIE,2BAAA;EVwpCD;AUvpCC;EACE,2BAAA;EVypCH;AQrhCD;EEtIE,2BAAA;EV8pCD;AU7pCC;EACE,2BAAA;EV+pCH;AQxhCD;EEzIE,2BAAA;EVoqCD;A
 UnqCC;EACE,2BAAA;EVqqCH;AQ3hCD;EE5IE,2BAAA;EV0qCD;AUzqCC;EACE,2BAAA;EV2qCH;AQzhCD;EACE,qBAAA;EACA,qBAAA;EACA,kCAAA;ER2hCD;AQnhCD;;EAEE,eAAA;EACA,qBAAA;ERqhCD;AQxhCD;;;;EAMI,kBAAA;ERwhCH;AQjhCD;EACE,iBAAA;EACA,kBAAA;ERmhCD;AQ/gCD;EALE,iBAAA;EACA,kBAAA;EAMA,mBAAA;ERkhCD;AQphCD;EAKI,uBAAA;EACA,mBAAA;EACA,oBAAA;ERkhCH;AQ7gCD;EACE,eAAA;EACA,qBAAA;ER+gCD;AQ7gCD;;EAEE,yBAAA;ER+gCD;AQ7gCD;EACE,mBAAA;ER+gCD;AQ7gCD;EACE,gBAAA;ER+gCD;AQt/BD;EAAA;IAVM,aAAA;IACA,cAAA;IACA,aAAA;IACA,mBAAA;IG3NJ,kBAAA;IACA,yBAAA;IACA,qBAAA;IXguCC;EQhgCH;IAHM,oBAAA;IRsgCH;EACF;AQ7/BD;;EAGE,cAAA;EACA,mCAAA;ER8/BD;AQ5/BD;EACE,gBAAA;EACA,2BAAA;ER8/BD;AQ1/BD;EACE,oBAAA;EACA,kBAAA;EACA,mBAAA;EACA,gCAAA;ER4/BD;AQv/BG;;;EACE,kBAAA;ER2/BL;AQrgCD;;;EAmBI,gBAAA;EACA,gBAAA;EACA,yBAAA;EACA,gBAAA;ERu/BH;AQr/BG;;;EACE,wBAAA;ERy/BL;AQj/BD;;EAEE,qBAAA;EACA,iBAAA;EACA,iCAAA;EACA,gBAAA;EACA,mBAAA;ERm/BD;AQ7+BG;;;;;;EAAW,aAAA;ERq/Bd;AQp/BG;;;;;;EACE,wBAAA;ER2/BL;AQr/BD;;EAEE,aAAA;ERu/BD;AQn/BD;EACE,qBAAA;EACA,oBAAA;EACA,yBAAA;ERq/BD;
 AYtyCD;;;;EAIE,gEAAA;EZwyCD;AYpyCD;EACE,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,2BAAA;EACA,oBAAA;EZsyCD;AYlyCD;EACE,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,2BAAA;EACA,oBAAA;EACA,wDAAA;EAAA,gDAAA;EZoyCD;AY1yCD;EASI,YAAA;EACA,iBAAA;EACA,0BAAA;EAAA,kBAAA;EZoyCH;AY/xCD;EACE,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,yBAAA;EACA,uBAAA;EACA,uBAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EZiyCD;AY5yCD;EAeI,YAAA;EACA,oBAAA;EACA,gBAAA;EACA,uBAAA;EACA,+BAAA;EACA,kBAAA;EZgyCH;AY3xCD;EACE,mBAAA;EACA,oBAAA;EZ6xCD;Aat1CD;ECHE,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,qBAAA;Ed41CD;Aat1CC;EAAA;IAFE,cAAA;Ib41CD;EACF;Aax1CC;EAAA;IAFE,cAAA;Ib81CD;EACF;Aa11CD;EAAA;IAFI,eAAA;Ibg2CD;EACF;Aav1CD;ECvBE,oBAAA;EACA,mBAAA;EACA,oBAAA;EACA,qBAAA;Edi3CD;Aap1CD;ECvBE,oBAAA;EACA,qBAAA;Ed82CD;Ae92CG;EACE,oBAAA;EAEA,iBAAA;EAEA,oBAAA;EACA,qBAAA;Ef82CL;Ae91CG;EACE,aAAA;Efg2CL;Aez1CC;EACE,aAAA;Ef21CH;Ae51CC;EACE,qBAAA;Ef81CH;Ae/1CC;EACE,qBAAA;Efi2CH;Ael2CC;EACE,YAAA;Efo2CH;Aer2CC;EACE,qBAAA;Efu2CH;Aex2CC;EACE,qBAAA;Ef02CH;Ae32CC;EACE,YAAA
 ;Ef62CH;Ae92CC;EACE,qBAAA;Efg3CH;Aej3CC;EACE,qBAAA;Efm3CH;Aep3CC;EACE,YAAA;Efs3CH;Aev3CC;EACE,qBAAA;Efy3CH;Ae13CC;EACE,oBAAA;Ef43CH;Ae92CC;EACE,aAAA;Efg3CH;Aej3CC;EACE,qBAAA;Efm3CH;Aep3CC;EACE,qBAAA;Efs3CH;Aev3CC;EACE,YAAA;Efy3CH;Ae13CC;EACE,qBAAA;Ef43CH;Ae73CC;EACE,qBAAA;Ef+3CH;Aeh4CC;EACE,YAAA;Efk4CH;Aen4CC;EACE,qBAAA;Efq4CH;Aet4CC;EACE,qBAAA;Efw4CH;Aez4CC;EACE,YAAA;Ef24CH;Ae54CC;EACE,qBAAA;Ef84CH;Ae/4CC;EACE,oBAAA;Efi5CH;Ae74CC;EACE,aAAA;Ef+4CH;Ae/5CC;EACE,YAAA;Efi6CH;Ael6CC;EACE,oBAAA;Efo6CH;Aer6CC;EACE,oBAAA;Efu6CH;Aex6CC;EACE,WAAA;Ef06CH;Ae36CC;EACE,oBAAA;Ef66CH;Ae96CC;EACE,oBAAA;Efg7CH;Aej7CC;EACE,WAAA;Efm7CH;Aep7CC;EACE,oBAAA;Efs7CH;Aev7CC;EACE,oBAAA;Efy7CH;Ae17CC;EACE,WAAA;Ef47CH;Ae77CC;EACE,oBAAA;Ef+7CH;Aeh8CC;EACE,mBAAA;Efk8CH;Ae97CC;EACE,YAAA;Efg8CH;Ael7CC;EACE,mBAAA;Efo7CH;Aer7CC;EACE,2BAAA;Efu7CH;Aex7CC;EACE,2BAAA;Ef07CH;Ae37CC;EACE,kBAAA;Ef67CH;Ae97CC;EACE,2BAAA;Efg8CH;Aej8CC;EACE,2BAAA;Efm8CH;Aep8CC;EACE,kBAAA;Efs8CH;Aev8CC;EACE,2BAAA;Efy8CH;Ae18CC;EACE,2BAAA;Ef48CH;
 Ae78CC;EACE,kBAAA;Ef+8CH;Aeh9CC;EACE,2BAAA;Efk9CH;Aen9CC;EACE,0BAAA;Efq9CH;Aet9CC;EACE,iBAAA;Efw9CH;Aa59CD;EE9BI;IACE,aAAA;If6/CH;Eet/CD;IACE,aAAA;Ifw/CD;Eez/CD;IACE,qBAAA;If2/CD;Ee5/CD;IACE,qBAAA;If8/CD;Ee//CD;IACE,YAAA;IfigDD;EelgDD;IACE,qBAAA;IfogDD;EergDD;IACE,qBAAA;IfugDD;EexgDD;IACE,YAAA;If0gDD;Ee3gDD;IACE,qBAAA;If6gDD;Ee9gDD;IACE,qBAAA;IfghDD;EejhDD;IACE,YAAA;IfmhDD;EephDD;IACE,qBAAA;IfshDD;EevhDD;IACE,oBAAA;IfyhDD;Ee3gDD;IACE,aAAA;If6gDD;Ee9gDD;IACE,qBAAA;IfghDD;EejhDD;IACE,qBAAA;IfmhDD;EephDD;IACE,YAAA;IfshDD;EevhDD;IACE,qBAAA;IfyhDD;Ee1hDD;IACE,qBAAA;If4hDD;Ee7hDD;IACE,YAAA;If+hDD;EehiDD;IACE,qBAAA;IfkiDD;EeniDD;IACE,qBAAA;IfqiDD;EetiDD;IACE,YAAA;IfwiDD;EeziDD;IACE,qBAAA;If2iDD;Ee5iDD;IACE,oBAAA;If8iDD;Ee1iDD;IACE,aAAA;If4iDD;Ee5jDD;IACE,YAAA;If8jDD;Ee/jDD;IACE,oBAAA;IfikDD;EelkDD;IACE,oBAAA;IfokDD;EerkDD;IACE,WAAA;IfukDD;EexkDD;IACE,oBAAA;If0kDD;Ee3kDD;IACE,oBAAA;If6kDD;Ee9kDD;IACE,WAAA;IfglDD;EejlDD;IACE,oBAAA;IfmlDD;EeplDD;IACE,oBAAA;IfslDD;EevlDD;IACE,WAAA;IfylDD;Ee1lD
 D;IACE,oBAAA;If4lDD;Ee7lDD;IACE,mBAAA;If+lDD;Ee3lDD;IACE,YAAA;If6lDD;Ee/kDD;IACE,mBAAA;IfilDD;EellDD;IACE,2BAAA;IfolDD;EerlDD;IACE,2BAAA;IfulDD;EexlDD;IACE,kBAAA;If0lDD;Ee3lDD;IACE,2BAAA;If6lDD;Ee9lDD;IACE,2BAAA;IfgmDD;EejmDD;IACE,kBAAA;IfmmDD;EepmDD;IACE,2BAAA;IfsmDD;EevmDD;IACE,2BAAA;IfymDD;Ee1mDD;IACE,kBAAA;If4mDD;Ee7mDD;IACE,2BAAA;If+mDD;EehnDD;IACE,0BAAA;IfknDD;EennDD;IACE,iBAAA;IfqnDD;EACF;AajnDD;EEvCI;IACE,aAAA;If2pDH;EeppDD;IACE,aAAA;IfspDD;EevpDD;IACE,qBAAA;IfypDD;Ee1pDD;IACE,qBAAA;If4pDD;Ee7pDD;IACE,YAAA;If+pDD;EehqDD;IACE,qBAAA;IfkqDD;EenqDD;IACE,qBAAA;IfqqDD;EetqDD;IACE,YAAA;IfwqDD;EezqDD;IACE,qBAAA;If2qDD;Ee5qDD;IACE,qBAAA;If8qDD;Ee/qDD;IACE,YAAA;IfirDD;EelrDD;IACE,qBAAA;IforDD;EerrDD;IACE,oBAAA;IfurDD;EezqDD;IACE,aAAA;If2qDD;Ee5qDD;IACE,qBAAA;If8qDD;Ee/qDD;IACE,qBAAA;IfirDD;EelrDD;IACE,YAAA;IforDD;EerrDD;IACE,qBAAA;IfurDD;EexrDD;IACE,qBAAA;If0rDD;Ee3rDD;IACE,YAAA;If6rDD;Ee9rDD;IACE,qBAAA;IfgsDD;EejsDD;IACE,qBAAA;IfmsDD;EepsDD;IACE,YAAA;IfssDD;EevsDD;IACE,qBAAA;IfysDD;E
 e1sDD;IACE,oBAAA;If4sDD;EexsDD;IACE,aAAA;If0sDD;Ee1tDD;IACE,YAAA;If4tDD;Ee7tDD;IACE,oBAAA;If+tDD;EehuDD;IACE,oBAAA;IfkuDD;EenuDD;IACE,WAAA;IfquDD;EetuDD;IACE,oBAAA;IfwuDD;EezuDD;IACE,oBAAA;If2uDD;Ee5uDD;IACE,WAAA;If8uDD;Ee/uDD;IACE,oBAAA;IfivDD;EelvDD;IACE,oBAAA;IfovDD;EervDD;IACE,WAAA;IfuvDD;EexvDD;IACE,oBAAA;If0vDD;Ee3vDD;IACE,mBAAA;If6vDD;EezvDD;IACE,YAAA;If2vDD;Ee7uDD;IACE,mBAAA;If+uDD;EehvDD;IACE,2BAAA;IfkvDD;EenvDD;IACE,2BAAA;IfqvDD;EetvDD;IACE,kBAAA;IfwvDD;EezvDD;IACE,2BAAA;If2vDD;Ee5vDD;IACE,2BAAA;If8vDD;Ee/vDD;IACE,kBAAA;IfiwDD;EelwDD;IACE,2BAAA;IfowDD;EerwDD;IACE,2BAAA;IfuwDD;EexwDD;IACE,kBAAA;If0wDD;Ee3wDD;IACE,2BAAA;If6wDD;Ee9wDD;IACE,0BAAA;IfgxDD;EejxDD;IACE,iBAAA;IfmxDD;EACF;AaxwDD;EE9CI;IACE,aAAA;IfyzDH;EelzDD;IACE,aAAA;IfozDD;EerzDD;IACE,qBAAA;IfuzDD;EexzDD;IACE,qBAAA;If0zDD;Ee3zDD;IACE,YAAA;If6zDD;Ee9zDD;IACE,qBAAA;Ifg0DD;Eej0DD;IACE,qBAAA;Ifm0DD;Eep0DD;IACE,YAAA;Ifs0DD;Eev0DD;IACE,qBAAA;Ify0DD;Ee10DD;IACE,qBAAA;If40DD;Ee70DD;IACE,YAAA;If+0DD;Eeh1DD;IACE,qBAAA;Ifk1D
 D;Een1DD;IACE,oBAAA;Ifq1DD;Eev0DD;IACE,aAAA;Ify0DD;Ee10DD;IACE,qBAAA;If40DD;Ee70DD;IACE,qBAAA;If+0DD;Eeh1DD;IACE,YAAA;Ifk1DD;Een1DD;IACE,qBAAA;Ifq1DD;Eet1DD;IACE,qBAAA;Ifw1DD;Eez1DD;IACE,YAAA;If21DD;Ee51DD;IACE,qBAAA;If81DD;Ee/1DD;IACE,qBAAA;Ifi2DD;Eel2DD;IACE,YAAA;Ifo2DD;Eer2DD;IACE,qBAAA;Ifu2DD;Eex2DD;IACE,oBAAA;If02DD;Eet2DD;IACE,aAAA;Ifw2DD;Eex3DD;IACE,YAAA;If03DD;Ee33DD;IACE,oBAAA;If63DD;Ee93DD;IACE,oBAAA;Ifg4DD;Eej4DD;IACE,WAAA;Ifm4DD;Eep4DD;IACE,oBAAA;Ifs4DD;Eev4DD;IACE,oBAAA;Ify4DD;Ee14DD;IACE,WAAA;If44DD;Ee74DD;IACE,oBAAA;If+4DD;Eeh5DD;IACE,oBAAA;Ifk5DD;Een5DD;IACE,WAAA;Ifq5DD;Eet5DD;IACE,oBAAA;Ifw5DD;Eez5DD;IACE,mBAAA;If25DD;Eev5DD;IACE,YAAA;Ify5DD;Ee34DD;IACE,mBAAA;If64DD;Ee94DD;IACE,2BAAA;Ifg5DD;Eej5DD;IACE,2BAAA;Ifm5DD;Eep5DD;IACE,kBAAA;Ifs5DD;Eev5DD;IACE,2BAAA;Ify5DD;Ee15DD;IACE,2BAAA;If45DD;Ee75DD;IACE,kBAAA;If+5DD;Eeh6DD;IACE,2BAAA;Ifk6DD;Een6DD;IACE,2BAAA;Ifq6DD;Eet6DD;IACE,kBAAA;Ifw6DD;Eez6DD;IACE,2BAAA;If26DD;Ee56DD;IACE,0BAAA;If86DD;Ee/6DD;IACE,iBAAA;Ifi7DD;EACF;
 AgBr/DD;EACE,+BAAA;EhBu/DD;AgBr/DD;EACE,kBAAA;EhBu/DD;AgBj/DD;EACE,aAAA;EACA,iBAAA;EACA,qBAAA;EhBm/DD;AgBt/DD;;;;;;EAWQ,cAAA;EACA,yBAAA;EACA,qBAAA;EACA,+BAAA;EhBm/DP;AgBjgED;EAoBI,wBAAA;EACA,kCAAA;EhBg/DH;AgBrgED;;;;;;EA8BQ,eAAA;EhB++DP;AgB7gED;EAoCI,+BAAA;EhB4+DH;AgBhhED;EAyCI,2BAAA;EhB0+DH;AgBn+DD;;;;;;EAOQ,cAAA;EhBo+DP;AgBz9DD;EACE,2BAAA;EhB29DD;AgB59DD;;;;;;EAQQ,2BAAA;EhB49DP;AgBp+DD;;EAeM,0BAAA;EhBy9DL;AgB/8DD;;EAIM,2BAAA;EhB+8DL;AgBr8DD;;EAIM,2BAAA;EhBq8DL;AgB37DD;EACE,kBAAA;EACA,aAAA;EACA,uBAAA;EhB67DD;AgBx7DG;;EACE,kBAAA;EACA,aAAA;EACA,qBAAA;EhB27DL;AiBvkEC;;;;;;;;;;;;EAOI,2BAAA;EjB8kEL;AiBxkEC;;;;;EAMI,2BAAA;EjBykEL;AiB5lEC;;;;;;;;;;;;EAOI,2BAAA;EjBmmEL;AiB7lEC;;;;;EAMI,2BAAA;EjB8lEL;AiBjnEC;;;;;;;;;;;;EAOI,2BAAA;EjBwnEL;AiBlnEC;;;;;EAMI,2BAAA;EjBmnEL;AiBtoEC;;;;;;;;;;;;EAOI,2BAAA;EjB6oEL;AiBvoEC;;;;;EAMI,2BAAA;EjBwoEL;AiB3pEC;;;;;;;;;;;;EAOI,2BAAA;EjBkqEL;AiB5pEC;;;;;EAMI,2BAAA;EjB6pEL;AgB78DD;EAAA;IA5DI,aAAA;IACA,qBAAA;IACA,oBAAA;IACA,kBAAA;IACA,8CAAA;IACA,2BAAA;IACA,mCAA
 A;IhB6gED;EgBv9DH;IAlDM,kBAAA;IhB4gEH;EgB19DH;;;;;;IAzCY,qBAAA;IhB2gET;EgBl+DH;IAjCM,WAAA;IhBsgEH;EgBr+DH;;;;;;IAxBY,gBAAA;IhBqgET;EgB7+DH;;;;;;IApBY,iBAAA;IhBygET;EgBr/DH;;;;IAPY,kBAAA;IhBkgET;EACF;AkB3tED;EACE,YAAA;EACA,WAAA;EACA,WAAA;EAIA,cAAA;ElB0tED;AkBvtED;EACE,gBAAA;EACA,aAAA;EACA,YAAA;EACA,qBAAA;EACA,iBAAA;EACA,sBAAA;EACA,gBAAA;EACA,WAAA;EACA,kCAAA;ElBytED;AkBttED;EACE,uBAAA;EACA,iBAAA;EACA,oBAAA;EACA,mBAAA;ElBwtED;AkB7sED;Eb4BE,gCAAA;EACG,6BAAA;EACK,wBAAA;ELorET;AkB7sED;;EAEE,iBAAA;EACA,oBAAA;EACA,qBAAA;ElB+sED;AkB3sED;EACE,gBAAA;ElB6sED;AkBzsED;EACE,gBAAA;EACA,aAAA;ElB2sED;AkBvsED;;EAEE,cAAA;ElBysED;AkBrsED;;;EZxEE,sBAAA;EAEA,4CAAA;EACA,sBAAA;ENixED;AkBrsED;EACE,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;ElBusED;AkB7qED;EACE,gBAAA;EACA,aAAA;EACA,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,2BAAA;EACA,wBAAA;EACA,2BAAA;EACA,oBAAA;EbzDA,0DAAA;EACQ,kDAAA;EAsHR,wFAAA;EACK,2EAAA;EACG,wEAAA;ELonET;AmB7vEC;EACE,uBAAA;EACA,YAAA;EdcF,wFAAA;EACQ,gFAAA;ELkvET;AKltEC;EA
 AgC,gBAAA;EACA,YAAA;ELqtEjC;AKptEC;EAAgC,gBAAA;ELutEjC;AKttEC;EAAgC,gBAAA;ELytEjC;AkBrrEC;;;EAGE,qBAAA;EACA,2BAAA;EACA,YAAA;ElBurEH;AkBnrEC;EACE,cAAA;ElBqrEH;AkBzqED;EACE,0BAAA;ElB2qED;AkB/pED;;;;EAIE,mBAAA;EAEA,4BAAA;ElBgqED;AkB9pEC;;;;EACE,mBAAA;ElBmqEH;AkBjqEC;;;;EACE,mBAAA;ElBsqEH;AkB5pED;EACE,qBAAA;ElB8pED;AkBtpED;;EAEE,oBAAA;EACA,gBAAA;EACA,kBAAA;EACA,kBAAA;EACA,qBAAA;ElBwpED;AkB9pED;;EASI,oBAAA;EACA,kBAAA;EACA,qBAAA;EACA,iBAAA;ElBypEH;AkBtpED;;;;EAIE,oBAAA;EACA,oBAAA;EACA,oBAAA;ElBwpED;AkBrpED;;EAEE,kBAAA;ElBupED;AkBnpED;;EAEE,uBAAA;EACA,oBAAA;EACA,kBAAA;EACA,wBAAA;EACA,qBAAA;EACA,iBAAA;ElBqpED;AkBnpED;;EAEE,eAAA;EACA,mBAAA;ElBqpED;AkB5oEC;;;;;;EAGE,qBAAA;ElBipEH;AkB3oEC;;;;EAEE,qBAAA;ElB+oEH;AkBzoEC;;;;EAGI,qBAAA;ElB4oEL;AkBjoED;EAEE,kBAAA;EACA,qBAAA;EAEA,kBAAA;ElBioED;AkB/nEC;;EAEE,iBAAA;EACA,kBAAA;ElBioEH;AkBvnED;;ECnPE,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EnB82ED;AmB52EC;EACE,cAAA;EACA,mBAAA;EnB82EH;AmB32EC;;EAEE,cAAA;EnB62EH;AkBnoED;;ECvPE,cAAA;EACA,oBAAA;EAC
 A,iBAAA;EACA,mBAAA;EACA,oBAAA;EnB83ED;AmB53EC;EACE,cAAA;EACA,mBAAA;EnB83EH;AmB33EC;;EAEE,cAAA;EnB63EH;AkB1oED;EAEE,oBAAA;ElB2oED;AkB7oED;EAMI,uBAAA;ElB0oEH;AkBtoED;EACE,oBAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;EACA,gBAAA;EACA,aAAA;EACA,cAAA;EACA,mBAAA;EACA,oBAAA;ElBwoED;AkBtoED;EACE,aAAA;EACA,cAAA;EACA,mBAAA;ElBwoED;AkBtoED;EACE,aAAA;EACA,cAAA;EACA,mBAAA;ElBwoED;AkBpoED;;;;;;ECrVI,gBAAA;EnBi+EH;AkB5oED;ECjVI,uBAAA;EdmDF,0DAAA;EACQ,kDAAA;EL86ET;AmBh+EG;EACE,uBAAA;EdgDJ,2EAAA;EACQ,mEAAA;ELm7ET;AkBtpED;ECvUI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnBg+EH;AkB3pED;ECjUI,gBAAA;EnB+9EH;AkB3pED;;;;;;ECxVI,gBAAA;EnB2/EH;AkBnqED;ECpVI,uBAAA;EdmDF,0DAAA;EACQ,kDAAA;ELw8ET;AmB1/EG;EACE,uBAAA;EdgDJ,2EAAA;EACQ,mEAAA;EL68ET;AkB7qED;EC1UI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnB0/EH;AkBlrED;ECpUI,gBAAA;EnBy/EH;AkBlrED;;;;;;EC3VI,gBAAA;EnBqhFH;AkB1rED;ECvVI,uBAAA;EdmDF,0DAAA;EACQ,kDAAA;ELk+ET;AmBphFG;EACE,uBAAA;EdgDJ,2EAAA;EACQ,mEAAA;ELu+ET;AkBpsED;EC7UI,gBAAA;EACA,uBAAA;EACA,2BAAA;EnBohFH;AkBzsED;ECvUI,gBAAA;EnBmhFH;AkBtsED
 ;EACE,QAAA;ElBwsED;AkB/rED;EACE,gBAAA;EACA,iBAAA;EACA,qBAAA;EACA,gBAAA;ElBisED;AkB9mED;EAAA;IA7DM,uBAAA;IACA,kBAAA;IACA,wBAAA;IlB+qEH;EkBpnEH;IAtDM,uBAAA;IACA,aAAA;IACA,wBAAA;IlB6qEH;EkBznEH;IAhDM,uBAAA;IACA,wBAAA;IlB4qEH;EkB7nEH;;;IA1CQ,aAAA;IlB4qEL;EkBloEH;IApCM,aAAA;IlByqEH;EkBroEH;IAhCM,kBAAA;IACA,wBAAA;IlBwqEH;EkBzoEH;;IAvBM,uBAAA;IACA,eAAA;IACA,kBAAA;IACA,wBAAA;IlBoqEH;EkBhpEH;;IAjBQ,iBAAA;IlBqqEL;EkBppEH;;IAZM,oBAAA;IACA,gBAAA;IlBoqEH;EkBzpEH;IAHM,QAAA;IlB+pEH;EACF;AkBrpED;;;;EASI,eAAA;EACA,kBAAA;EACA,kBAAA;ElBkpEH;AkB7pED;;EAiBI,kBAAA;ElBgpEH;AkBjqED;EJxcE,oBAAA;EACA,qBAAA;Ed4mFD;AkBloEC;EAAA;IANI,mBAAA;IACA,kBAAA;IACA,kBAAA;IlB4oEH;EACF;AkB5qED;EAwCI,QAAA;EACA,aAAA;ElBuoEH;AkB1nEG;EAAA;IAHI,qBAAA;IlBioEL;EACF;AkBrnEG;EAAA;IAHI,kBAAA;IlB4nEL;EACF;AoBzoFD;EACE,uBAAA;EACA,kBAAA;EACA,qBAAA;EACA,oBAAA;EACA,wBAAA;EACA,iBAAA;EACA,wBAAA;EACA,+BAAA;EACA,qBAAA;EC4BA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,oBAAA;EhB2KA,2BAAA;EACG,wBAAA;EACC,uBAAA;EACI,mBAAA;ELs8ET;AoB5oFG;;;EdpBF,sBAAA;EAEA,
 4CAAA;EACA,sBAAA;ENoqFD;AoB9oFC;;EAEE,gBAAA;EACA,uBAAA;EpBgpFH;AoB7oFC;;EAEE,YAAA;EACA,wBAAA;Ef8BF,0DAAA;EACQ,kDAAA;ELknFT;AoB7oFC;;;EAGE,qBAAA;EACA,sBAAA;EE3CF,eAAA;EAGA,2BAAA;EjB8DA,0BAAA;EACQ,kBAAA;EL4nFT;AoBzoFD;EClDE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErB8rFD;AqB5rFC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErB8rFP;AqB5rFC;;;EAGE,wBAAA;ErB8rFH;AqBzrFG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErBqsFT;AoB9qFD;EClBI,gBAAA;EACA,2BAAA;ErBmsFH;AoB/qFD;ECrDE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBuuFD;AqBruFC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBuuFP;AqBruFC;;;EAGE,wBAAA;ErBuuFH;AqBluFG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErB8uFT;AoBptFD;ECrBI,gBAAA;EACA,2BAAA;ErB4uFH;AoBptFD;ECzDE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBgxFD;AqB9wFC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBgxFP;AqB9wFC;;;EAGE,wBAAA;ErBgxFH;AqB3wFG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErBuxFT;AoBzvFD;ECzBI,gBAAA;EACA,2BAAA;ErBqxFH;AoBzvFD;EC7DE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErByzFD;AqBvzFC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErByzFP;AqBvzFC;;;EAGE,wB
 AAA;ErByzFH;AqBpzFG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErBg0FT;AoB9xFD;EC7BI,gBAAA;EACA,2BAAA;ErB8zFH;AoB9xFD;ECjEE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErBk2FD;AqBh2FC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErBk2FP;AqBh2FC;;;EAGE,wBAAA;ErBk2FH;AqB71FG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErBy2FT;AoBn0FD;ECjCI,gBAAA;EACA,2BAAA;ErBu2FH;AoBn0FD;ECrEE,gBAAA;EACA,2BAAA;EACA,uBAAA;ErB24FD;AqBz4FC;;;;;EAKE,gBAAA;EACA,2BAAA;EACI,uBAAA;ErB24FP;AqBz4FC;;;EAGE,wBAAA;ErB24FH;AqBt4FG;;;;;;;;;;;;;;;EAKE,2BAAA;EACI,uBAAA;ErBk5FT;AoBx2FD;ECrCI,gBAAA;EACA,2BAAA;ErBg5FH;AoBn2FD;EACE,gBAAA;EACA,qBAAA;EACA,iBAAA;EACA,kBAAA;EpBq2FD;AoBn2FC;;;;EAIE,+BAAA;Ef1BF,0BAAA;EACQ,kBAAA;ELg4FT;AoBp2FC;;;;EAIE,2BAAA;EpBs2FH;AoBp2FC;;EAEE,gBAAA;EACA,4BAAA;EACA,+BAAA;EpBs2FH;AoBl2FG;;;;EAEE,gBAAA;EACA,uBAAA;EpBs2FL;AoB71FD;;EC9EE,oBAAA;EACA,iBAAA;EACA,mBAAA;EACA,oBAAA;ErB+6FD;AoBh2FD;;EClFE,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;ErBs7FD;AoBn2FD;;ECtFE,kBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;ErB67FD;AoBl2FD;EACE,gBAAA;EACA,aAAA;
 EpBo2FD;AoBh2FD;EACE,iBAAA;EpBk2FD;AoB31FC;;;EACE,aAAA;EpB+1FH;AuBh/FD;EACE,YAAA;ElBiLA,0CAAA;EACK,qCAAA;EACG,kCAAA;ELk0FT;AuBn/FC;EACE,YAAA;EvBq/FH;AuBj/FD;EACE,eAAA;EvBm/FD;AuBj/FC;EAAY,gBAAA;EvBo/Fb;AuBn/FC;EAAY,oBAAA;EvBs/Fb;AuBr/FC;EAAY,0BAAA;EvBw/Fb;AuBr/FD;EACE,oBAAA;EACA,WAAA;EACA,kBAAA;ElB+JA,uCAAA;EACK,kCAAA;EACG,+BAAA;ELy1FT;AwBhhGD;EACE,uBAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EACA,wBAAA;EACA,uBAAA;EACA,qCAAA;EACA,oCAAA;ExBkhGD;AwB9gGD;EACE,oBAAA;ExBghGD;AwB5gGD;EACE,YAAA;ExB8gGD;AwB1gGD;EACE,oBAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,eAAA;EACA,aAAA;EACA,kBAAA;EACA,gBAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;EACA,kBAAA;EACA,2BAAA;EACA,2BAAA;EACA,uCAAA;EACA,oBAAA;EnBwBA,qDAAA;EACQ,6CAAA;EmBvBR,sCAAA;EAAA,8BAAA;ExB6gGD;AwBxgGC;EACE,UAAA;EACA,YAAA;ExB0gGH;AwBniGD;ECvBE,aAAA;EACA,eAAA;EACA,kBAAA;EACA,2BAAA;EzB6jGD;AwBziGD;EAmCI,gBAAA;EACA,mBAAA;EACA,aAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,qBAAA;ExBygGH;AwBngGC;;EAEE,uBAAA;EACA,gBAAA;EACA,2BAAA;ExBqgGH;AwB//FC;;;EAGE,gBAAA;EACA,uBAAA
 ;EACA,YAAA;EACA,2BAAA;ExBigGH;AwBx/FC;;;EAGE,gBAAA;ExB0/FH;AwBr/FC;;EAEE,uBAAA;EACA,+BAAA;EACA,wBAAA;EE1GF,qEAAA;EF4GE,qBAAA;ExBu/FH;AwBl/FD;EAGI,gBAAA;ExBk/FH;AwBr/FD;EAQI,YAAA;ExBg/FH;AwBx+FD;EACE,YAAA;EACA,UAAA;ExB0+FD;AwBl+FD;EACE,SAAA;EACA,aAAA;ExBo+FD;AwBh+FD;EACE,gBAAA;EACA,mBAAA;EACA,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,qBAAA;ExBk+FD;AwB99FD;EACE,iBAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,QAAA;EACA,cAAA;ExBg+FD;AwB59FD;EACE,UAAA;EACA,YAAA;ExB89FD;AwBt9FD;;EAII,eAAA;EACA,0BAAA;EACA,aAAA;ExBs9FH;AwB59FD;;EAUI,WAAA;EACA,cAAA;EACA,oBAAA;ExBs9FH;AwBh8FD;EAZE;IAnEA,YAAA;IACA,UAAA;IxBmhGC;EwBj9FD;IAzDA,SAAA;IACA,aAAA;IxB6gGC;EACF;A2B5pGD;;EAEE,oBAAA;EACA,uBAAA;EACA,wBAAA;E3B8pGD;A2BlqGD;;EAMI,oBAAA;EACA,aAAA;E3BgqGH;A2B9pGG;;;;;;;;EAIE,YAAA;E3BoqGL;A2BlqGG;;EAEE,YAAA;E3BoqGL;A2B9pGD;;;;EAKI,mBAAA;E3B+pGH;A2B1pGD;EACE,mBAAA;E3B4pGD;A2B7pGD;;EAMI,aAAA;E3B2pGH;A2BjqGD;;;EAWI,kBAAA;E3B2pGH;A2BvpGD;EACE,kBAAA;E3BypGD;A2BrpGD;EACE,gBAAA;E3BupGD;A2BtpGC;ECrDA,+BAAA;EACG,4BAAA;E5B8sGJ;A2BrpGD;;E
 ClDE,8BAAA;EACG,2BAAA;E5B2sGJ;A2BppGD;EACE,aAAA;E3BspGD;A2BppGD;EACE,kBAAA;E3BspGD;A2BppGD;;ECtEE,+BAAA;EACG,4BAAA;E5B8tGJ;A2BnpGD;ECpEE,8BAAA;EACG,2BAAA;E5B0tGJ;A2BlpGD;;EAEE,YAAA;E3BopGD;A2BnoGD;EACE,mBAAA;EACA,oBAAA;E3BqoGD;A2BnoGD;EACE,oBAAA;EACA,qBAAA;E3BqoGD;A2BhoGD;EtBlDE,0DAAA;EACQ,kDAAA;ELqrGT;A2BhoGC;EtBtDA,0BAAA;EACQ,kBAAA;ELyrGT;A2B7nGD;EACE,gBAAA;E3B+nGD;A2B5nGD;EACE,yBAAA;EACA,wBAAA;E3B8nGD;A2B3nGD;EACE,yBAAA;E3B6nGD;A2BtnGD;;;EAII,gBAAA;EACA,aAAA;EACA,aAAA;EACA,iBAAA;E3BunGH;A2B9nGD;EAcM,aAAA;E3BmnGL;A2BjoGD;;;;EAsBI,kBAAA;EACA,gBAAA;E3BinGH;A2B5mGC;EACE,kBAAA;E3B8mGH;A2B5mGC;EACE,8BAAA;ECvKF,+BAAA;EACC,8BAAA;E5BsxGF;A2B7mGC;EACE,gCAAA;ECnLF,4BAAA;EACC,2BAAA;E5BmyGF;A2B7mGD;EACE,kBAAA;E3B+mGD;A2B7mGD;;EClLE,+BAAA;EACC,8BAAA;E5BmyGF;A2B5mGD;EChME,4BAAA;EACC,2BAAA;E5B+yGF;A2BvmGD;EACE,gBAAA;EACA,aAAA;EACA,qBAAA;EACA,2BAAA;E3BymGD;A2B7mGD;;EAOI,aAAA;EACA,qBAAA;EACA,WAAA;E3B0mGH;A2BnnGD;EAYI,aAAA;E3B0mGH;A2BtnGD;EAgBI,YAAA;E3BymGH;A2B3lGD;;EAEE,oBAAA;EACA,aAAA;EL1OA,YAAA;
 EAGA,0BAAA;EtBs0GD;A6Bt0GD;EACE,oBAAA;EACA,gBAAA;EACA,2BAAA;E7Bw0GD;A6Br0GC;EACE,aAAA;EACA,iBAAA;EACA,kBAAA;E7Bu0GH;A6Bh1GD;EAeI,oBAAA;EACA,YAAA;EAKA,aAAA;EAEA,aAAA;EACA,kBAAA;E7B+zGH;A6BtzGD;;;EV0BE,cAAA;EACA,oBAAA;EACA,iBAAA;EACA,mBAAA;EACA,oBAAA;EnBiyGD;AmB/xGC;;;EACE,cAAA;EACA,mBAAA;EnBmyGH;AmBhyGC;;;;;;EAEE,cAAA;EnBsyGH;A6Bx0GD;;;EVqBE,cAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EnBwzGD;AmBtzGC;;;EACE,cAAA;EACA,mBAAA;EnB0zGH;AmBvzGC;;;;;;EAEE,cAAA;EnB6zGH;A6Bt1GD;;;EAGE,qBAAA;E7Bw1GD;A6Bt1GC;;;EACE,kBAAA;E7B01GH;A6Bt1GD;;EAEE,WAAA;EACA,qBAAA;EACA,wBAAA;E7Bw1GD;A6Bn1GD;EACE,mBAAA;EACA,iBAAA;EACA,qBAAA;EACA,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;E7Bq1GD;A6Bl1GC;EACE,mBAAA;EACA,iBAAA;EACA,oBAAA;E7Bo1GH;A6Bl1GC;EACE,oBAAA;EACA,iBAAA;EACA,oBAAA;E7Bo1GH;A6Bx2GD;;EA0BI,eAAA;E7Bk1GH;A6B70GD;;;;;;;EDhGE,+BAAA;EACG,4BAAA;E5Bs7GJ;A6B90GD;EACE,iBAAA;E7Bg1GD;A6B90GD;;;;;;;EDpGE,8BAAA;EACG,2BAAA;E5B27GJ;A6B/0GD;EACE,gBAAA;E7Bi1GD;A6B50GD;EACE,oBAAA;EAGA,cAAA;EACA,q
 BAAA;E7B40GD;A6Bj1GD;EAUI,oBAAA;E7B00GH;A6Bp1GD;EAYM,mBAAA;E7B20GL;A6Bx0GG;;;EAGE,YAAA;E7B00GL;A6Br0GC;;EAGI,oBAAA;E7Bs0GL;A6Bn0GC;;EAGI,mBAAA;E7Bo0GL;A8B99GD;EACE,kBAAA;EACA,iBAAA;EACA,kBAAA;E9Bg+GD;A8Bn+GD;EAOI,oBAAA;EACA,gBAAA;E9B+9GH;A8Bv+GD;EAWM,oBAAA;EACA,gBAAA;EACA,oBAAA;E9B+9GL;A8B99GK;;EAEE,uBAAA;EACA,2BAAA;E9Bg+GP;A8B39GG;EACE,gBAAA;E9B69GL;A8B39GK;;EAEE,gBAAA;EACA,uBAAA;EACA,+BAAA;EACA,qBAAA;E9B69GP;A8Bt9GG;;;EAGE,2BAAA;EACA,uBAAA;E9Bw9GL;A8BjgHD;ELHE,aAAA;EACA,eAAA;EACA,kBAAA;EACA,2BAAA;EzBugHD;A8BvgHD;EA0DI,iBAAA;E9Bg9GH;A8Bv8GD;EACE,kCAAA;E9By8GD;A8B18GD;EAGI,aAAA;EAEA,qBAAA;E9By8GH;A8B98GD;EASM,mBAAA;EACA,yBAAA;EACA,+BAAA;EACA,4BAAA;E9Bw8GL;A8Bv8GK;EACE,uCAAA;E9By8GP;A8Bn8GK;;;EAGE,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,kCAAA;EACA,iBAAA;E9Bq8GP;A8Bh8GC;EAqDA,aAAA;EA8BA,kBAAA;E9Bi3GD;A8Bp8GC;EAwDE,aAAA;E9B+4GH;A8Bv8GC;EA0DI,oBAAA;EACA,oBAAA;E9Bg5GL;A8B38GC;EAgEE,WAAA;EACA,YAAA;E9B84GH;A8Bl4GD;EAAA;IAPM,qBAAA;IACA,WAAA;I9B64GH;E8Bv4GH;IAJQ,kBAAA;I9B84GL;EACF;A8Bx9GC;EAuFE,iBA
 AA;EACA,oBAAA;E9Bo4GH;A8B59GC;;;EA8FE,2BAAA;E9Bm4GH;A8Br3GD;EAAA;IATM,kCAAA;IACA,4BAAA;I9Bk4GH;E8B13GH;;;IAHM,8BAAA;I9Bk4GH;EACF;A8Bn+GD;EAEI,aAAA;E9Bo+GH;A8Bt+GD;EAMM,oBAAA;E9Bm+GL;A8Bz+GD;EASM,kBAAA;E9Bm+GL;A8B99GK;;;EAGE,gBAAA;EACA,2BAAA;E9Bg+GP;A8Bx9GD;EAEI,aAAA;E9By9GH;A8B39GD;EAIM,iBAAA;EACA,gBAAA;E9B09GL;A8B98GD;EACE,aAAA;E9Bg9GD;A8Bj9GD;EAII,aAAA;E9Bg9GH;A8Bp9GD;EAMM,oBAAA;EACA,oBAAA;E9Bi9GL;A8Bx9GD;EAYI,WAAA;EACA,YAAA;E9B+8GH;A8Bn8GD;EAAA;IAPM,qBAAA;IACA,WAAA;I9B88GH;E8Bx8GH;IAJQ,kBAAA;I9B+8GL;EACF;A8Bv8GD;EACE,kBAAA;E9By8GD;A8B18GD;EAKI,iBAAA;EACA,oBAAA;E9Bw8GH;A8B98GD;;;EAYI,2BAAA;E9Bu8GH;A8Bz7GD;EAAA;IATM,kCAAA;IACA,4BAAA;I9Bs8GH;E8B97GH;;;IAHM,8BAAA;I9Bs8GH;EACF;A8B77GD;EAEI,eAAA;E9B87GH;A8Bh8GD;EAKI,gBAAA;E9B87GH;A8Br7GD;EAEE,kBAAA;EF3OA,4BAAA;EACC,2BAAA;E5BkqHF;A+B5pHD;EACE,oBAAA;EACA,kBAAA;EACA,qBAAA;EACA,+BAAA;E/B8pHD;A+BtpHD;EAAA;IAFI,oBAAA;I/B4pHD;EACF;A+B7oHD;EAAA;IAFI,aAAA;I/BmpHD;EACF;A+BroHD;EACE,qBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mCAAA;EACA,4DAAA;EAAA,oDAAA;EAE
 A,mCAAA;E/BsoHD;A+BpoHC;EACE,kBAAA;E/BsoHH;A+B1mHD;EAAA;IAxBI,aAAA;IACA,eAAA;IACA,0BAAA;IAAA,kBAAA;I/BsoHD;E+BpoHC;IACE,2BAAA;IACA,yBAAA;IACA,mBAAA;IACA,8BAAA;I/BsoHH;E+BnoHC;IACE,qBAAA;I/BqoHH;E+BhoHC;;;IAGE,iBAAA;IACA,kBAAA;I/BkoHH;EACF;A+B9nHD;;EAGI,mBAAA;E/B+nHH;A+B1nHC;EAAA;;IAFI,mBAAA;I/BioHH;EACF;A+BxnHD;;;;EAII,qBAAA;EACA,oBAAA;E/B0nHH;A+BpnHC;EAAA;;;;IAHI,iBAAA;IACA,gBAAA;I/B8nHH;EACF;A+BlnHD;EACE,eAAA;EACA,uBAAA;E/BonHD;A+B/mHD;EAAA;IAFI,kBAAA;I/BqnHD;EACF;A+BjnHD;;EAEE,iBAAA;EACA,UAAA;EACA,SAAA;EACA,eAAA;E1BGA,yCAAA;EACQ,oCAAA;EAAA,iCAAA;ELinHT;A+B9mHD;EAAA;;IAFI,kBAAA;I/BqnHD;EACF;A+BnnHD;EACE,QAAA;EACA,uBAAA;E/BqnHD;A+BnnHD;EACE,WAAA;EACA,kBAAA;EACA,uBAAA;E/BqnHD;A+B/mHD;EACE,aAAA;EACA,oBAAA;EACA,iBAAA;EACA,mBAAA;EACA,cAAA;E/BinHD;A+B/mHC;;EAEE,uBAAA;E/BinHH;A+BxmHD;EALI;;IAEE,oBAAA;I/BgnHH;EACF;A+BtmHD;EACE,oBAAA;EACA,cAAA;EACA,oBAAA;EACA,mBAAA;EC3LA,iBAAA;EACA,oBAAA;ED4LA,+BAAA;EACA,wBAAA;EACA,+BAAA;EACA,oBAAA;E/BymHD;A+BrmHC;EACE,YAAA;E/BumHH;A+BrnHD;EAmBI,gBAAA;EACA
 ,aAAA;EACA,aAAA;EACA,oBAAA;E/BqmHH;A+B3nHD;EAyBI,iBAAA;E/BqmHH;A+B/lHD;EAAA;IAFI,eAAA;I/BqmHD;EACF;A+B5lHD;EACE,qBAAA;E/B8lHD;A+B/lHD;EAII,mBAAA;EACA,sBAAA;EACA,mBAAA;E/B8lHH;A+BnkHC;EAAA;IArBI,kBAAA;IACA,aAAA;IACA,aAAA;IACA,eAAA;IACA,+BAAA;IACA,WAAA;IACA,0BAAA;IAAA,kBAAA;I/B4lHH;E+B7kHD;;IAZM,4BAAA;I/B6lHL;E+BjlHD;IATM,mBAAA;I/B6lHL;E+B5lHK;;IAEE,wBAAA;I/B8lHP;EACF;A+BxkHD;EAAA;IAfI,aAAA;IACA,WAAA;I/B2lHD;E+B7kHH;IAXM,aAAA;I/B2lHH;E+BhlHH;IATQ,mBAAA;IACA,sBAAA;I/B4lHL;E+BxlHC;IACE,qBAAA;I/B0lHH;EACF;A+BzkHD;EALE;IE9QA,wBAAA;IjCg2HC;E+BjlHD;IElRA,yBAAA;IjCs2HC;EACF;A+B5kHD;EACE,oBAAA;EACA,qBAAA;EACA,oBAAA;EACA,mCAAA;EACA,sCAAA;E1B3OA,8FAAA;EACQ,sFAAA;E2B/DR,iBAAA;EACA,oBAAA;EhC03HD;AkBl7GD;EAAA;IA7DM,uBAAA;IACA,kBAAA;IACA,wBAAA;IlBm/GH;EkBx7GH;IAtDM,uBAAA;IACA,aAAA;IACA,wBAAA;IlBi/GH;EkB77GH;IAhDM,uBAAA;IACA,wBAAA;IlBg/GH;EkBj8GH;;;IA1CQ,aAAA;IlBg/GL;EkBt8GH;IApCM,aAAA;IlB6+GH;EkBz8GH;IAhCM,kBAAA;IACA,wBAAA;IlB4+GH;EkB78GH;;IAvBM,uBAAA;IACA,eAAA;IACA,kBAAA;IACA,wBAAA;IlBw+GH;EkBp9GH
 ;;IAjBQ,iBAAA;IlBy+GL;EkBx9GH;;IAZM,oBAAA;IACA,gBAAA;IlBw+GH;EkB79GH;IAHM,QAAA;IlBm+GH;EACF;A+BtnHC;EAAA;IAFI,oBAAA;I/B4nHH;EACF;A+BvmHD;EAAA;IAbI,aAAA;IACA,WAAA;IACA,gBAAA;IACA,iBAAA;IACA,gBAAA;IACA,mBAAA;I1BlQF,0BAAA;IACQ,kBAAA;IL23HP;E+BtnHC;IACE,qBAAA;I/BwnHH;EACF;A+BhnHD;EACE,eAAA;EHlVA,4BAAA;EACC,2BAAA;E5Bq8HF;A+BhnHD;EH9UE,+BAAA;EACC,8BAAA;E5Bi8HF;A+B3mHD;EC5VE,iBAAA;EACA,oBAAA;EhC08HD;A+B5mHC;EC/VA,kBAAA;EACA,qBAAA;EhC88HD;A+B7mHC;EClWA,kBAAA;EACA,qBAAA;EhCk9HD;A+BvmHD;EC5WE,kBAAA;EACA,qBAAA;EhCs9HD;A+B9lHD;EAAA;IATI,aAAA;IACA,mBAAA;IACA,oBAAA;I/B2mHD;E+BxmHC;IACE,iBAAA;I/B0mHH;EACF;A+BlmHD;EACE,2BAAA;EACA,uBAAA;E/BomHD;A+BtmHD;EAKI,gBAAA;E/BomHH;A+BnmHG;;EAEE,gBAAA;EACA,+BAAA;E/BqmHL;A+B9mHD;EAcI,gBAAA;E/BmmHH;A+BjnHD;EAmBM,gBAAA;E/BimHL;A+B/lHK;;EAEE,gBAAA;EACA,+BAAA;E/BimHP;A+B7lHK;;;EAGE,gBAAA;EACA,2BAAA;E/B+lHP;A+B3lHK;;;EAGE,gBAAA;EACA,+BAAA;E/B6lHP;A+BroHD;EA8CI,uBAAA;E/B0lHH;A+BzlHG;;EAEE,2BAAA;E/B2lHL;A+B5oHD;EAoDM,2BAAA;E/B2lHL;A+B/oHD;;EA0DI,uBAAA;E/BylHH;A+BllHK;
 ;;EAGE,2BAAA;EACA,gBAAA;E/BolHP;A+BnjHC;EAAA;IAzBQ,gBAAA;I/BglHP;E+B/kHO;;IAEE,gBAAA;IACA,+BAAA;I/BilHT;E+B7kHO;;;IAGE,gBAAA;IACA,2BAAA;I/B+kHT;E+B3kHO;;;IAGE,gBAAA;IACA,+BAAA;I/B6kHT;EACF;A+B/qHD;EA8GI,gBAAA;E/BokHH;A+BnkHG;EACE,gBAAA;E/BqkHL;A+BrrHD;EAqHI,gBAAA;E/BmkHH;A+BlkHG;;EAEE,gBAAA;E/BokHL;A+BhkHK;;;;EAEE,gBAAA;E/BokHP;A+B5jHD;EACE,2BAAA;EACA,uBAAA;E/B8jHD;A+BhkHD;EAKI,gBAAA;E/B8jHH;A+B7jHG;;EAEE,gBAAA;EACA,+BAAA;E/B+jHL;A+BxkHD;EAcI,gBAAA;E/B6jHH;A+B3kHD;EAmBM,gBAAA;E/B2jHL;A+BzjHK;;EAEE,gBAAA;EACA,+BAAA;E/B2jHP;A+BvjHK;;;EAGE,gBAAA;EACA,2BAAA;E/ByjHP;A+BrjHK;;;EAGE,gBAAA;EACA,+BAAA;E/BujHP;A+B/lHD;EA+CI,uBAAA;E/BmjHH;A+BljHG;;EAEE,2BAAA;E/BojHL;A+BtmHD;EAqDM,2BAAA;E/BojHL;A+BzmHD;;EA2DI,uBAAA;E/BkjHH;A+B5iHK;;;EAGE,2BAAA;EACA,gBAAA;E/B8iHP;A+BvgHC;EAAA;IA/BQ,uBAAA;I/B0iHP;E+B3gHD;IA5BQ,2BAAA;I/B0iHP;E+B9gHD;IAzBQ,gBAAA;I/B0iHP;E+BziHO;;IAEE,gBAAA;IACA,+BAAA;I/B2iHT;E+BviHO;;;IAGE,gBAAA;IACA,2BAAA;I/ByiHT;E+BriHO;;;IAGE,gBAAA;IACA,+BAAA;I/BuiHT;EACF;A+B/oHD;EA+GI,gBAAA;E/B
 miHH;A+BliHG;EACE,gBAAA;E/BoiHL;A+BrpHD;EAsHI,gBAAA;E/BkiHH;A+BjiHG;;EAEE,gBAAA;E/BmiHL;A+B/hHK;;;;EAEE,gBAAA;E/BmiHP;AkCxqID;EACE,mBAAA;EACA,qBAAA;EACA,kBAAA;EACA,2BAAA;EACA,oBAAA;ElC0qID;AkC/qID;EAQI,uBAAA;ElC0qIH;AkClrID;EAWM,mBAAA;EACA,gBAAA;EACA,gBAAA;ElC0qIL;AkCvrID;EAkBI,gBAAA;ElCwqIH;AmC5rID;EACE,uBAAA;EACA,iBAAA;EACA,gBAAA;EACA,oBAAA;EnC8rID;AmClsID;EAOI,iBAAA;EnC8rIH;AmCrsID;;EAUM,oBAAA;EACA,aAAA;EACA,mBAAA;EACA,yBAAA;EACA,uBAAA;EACA,gBAAA;EACA,2BAAA;EACA,2BAAA;EACA,mBAAA;EnC+rIL;AmC7rIG;;EAGI,gBAAA;EPXN,gCAAA;EACG,6BAAA;E5B0sIJ;AmC5rIG;;EPvBF,iCAAA;EACG,8BAAA;E5ButIJ;AmCvrIG;;;;EAEE,gBAAA;EACA,2BAAA;EACA,uBAAA;EnC2rIL;AmCrrIG;;;;;;EAGE,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,uBAAA;EACA,iBAAA;EnC0rIL;AmChvID;;;;;;EAiEM,gBAAA;EACA,2BAAA;EACA,uBAAA;EACA,qBAAA;EnCurIL;AmC9qID;;EC1EM,oBAAA;EACA,iBAAA;EpC4vIL;AoC1vIG;;ERMF,gCAAA;EACG,6BAAA;E5BwvIJ;AoCzvIG;;ERRF,iCAAA;EACG,8BAAA;E5BqwIJ;AmCxrID;;EC/EM,mBAAA;EACA,iBAAA;EpC2wIL;AoCzwIG;;ERMF,gCAAA;EACG,6BAAA;E5BuwIJ;AoCxwIG;;ERRF,iCAAA;EA
 CG,8BAAA;E5BoxIJ;AqCvxID;EACE,iBAAA;EACA,gBAAA;EACA,kBAAA;EACA,oBAAA;ErCyxID;AqC7xID;EAOI,iBAAA;ErCyxIH;AqChyID;;EAUM,uBAAA;EACA,mBAAA;EACA,2BAAA;EACA,2BAAA;EACA,qBAAA;ErC0xIL;AqCxyID;;EAmBM,uBAAA;EACA,2BAAA;ErCyxIL;AqC7yID;;EA2BM,cAAA;ErCsxIL;AqCjzID;;EAkCM,aAAA;ErCmxIL;AqCrzID;;;;EA2CM,gBAAA;EACA,2BAAA;EACA,qBAAA;ErCgxIL;AsC9zID;EACE,iBAAA;EACA,yBAAA;EACA,gBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,oBAAA;EACA,qBAAA;EACA,0BAAA;EACA,sBAAA;EtCg0ID;AsC5zIG;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;EtC8zIL;AsCzzIC;EACE,eAAA;EtC2zIH;AsCvzIC;EACE,oBAAA;EACA,WAAA;EtCyzIH;AsClzID;ECtCE,2BAAA;EvC21ID;AuCx1IG;;EAEE,2BAAA;EvC01IL;AsCrzID;EC1CE,2BAAA;EvCk2ID;AuC/1IG;;EAEE,2BAAA;EvCi2IL;AsCxzID;EC9CE,2BAAA;EvCy2ID;AuCt2IG;;EAEE,2BAAA;EvCw2IL;AsC3zID;EClDE,2BAAA;EvCg3ID;AuC72IG;;EAEE,2BAAA;EvC+2IL;AsC9zID;ECtDE,2BAAA;EvCu3ID;AuCp3IG;;EAEE,2BAAA;EvCs3IL;AsCj0ID;EC1DE,2BAAA;EvC83ID;AuC33IG;;EAEE,2BAAA;EvC63IL;AwC/3ID;EACE,uBAAA;EACA,iBAAA;EACA,kBAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,0BAAA;E
 ACA,qBAAA;EACA,oBAAA;EACA,2BAAA;EACA,qBAAA;ExCi4ID;AwC93IC;EACE,eAAA;ExCg4IH;AwC53IC;EACE,oBAAA;EACA,WAAA;ExC83IH;AwC53IC;EACE,QAAA;EACA,kBAAA;ExC83IH;AwCz3IG;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;ExC23IL;AwCt3IC;;EAEE,gBAAA;EACA,2BAAA;ExCw3IH;AwCt3IC;EACE,kBAAA;ExCw3IH;AyCv6ID;EACE,eAAA;EACA,qBAAA;EACA,gBAAA;EACA,2BAAA;EzCy6ID;AyC76ID;;EAQI,gBAAA;EzCy6IH;AyCj7ID;EAWI,qBAAA;EACA,iBAAA;EACA,kBAAA;EzCy6IH;AyCt7ID;EAiBI,2BAAA;EzCw6IH;AyCr6IC;EACE,oBAAA;EzCu6IH;AyC57ID;EAyBI,iBAAA;EzCs6IH;AyCr5ID;EAAA;IAbI,mBAAA;IACA,sBAAA;IzCs6ID;EyCp6IC;IACE,oBAAA;IACA,qBAAA;IzCs6IH;EyC95IH;;IAHM,iBAAA;IzCq6IH;EACF;A0C58ID;EACE,gBAAA;EACA,cAAA;EACA,qBAAA;EACA,yBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;ErC8KA,0CAAA;EACK,qCAAA;EACG,kCAAA;ELiyIT;A0Cx9ID;;EAaI,mBAAA;EACA,oBAAA;E1C+8IH;A0C38IC;;;EAGE,uBAAA;E1C68IH;A0Cl+ID;EA0BI,cAAA;EACA,gBAAA;E1C28IH;A2Cp+ID;EACE,eAAA;EACA,qBAAA;EACA,+BAAA;EACA,oBAAA;E3Cs+ID;A2C1+ID;EAQI,eAAA;EAEA,gBAAA;E3Co+IH;A2C9+ID;EAcI,mBAAA;E3Cm+IH;A2Cj/ID;;EAoBI,kBAAA;E3Ci+IH;A2Cr/ID;EAuBI
 ,iBAAA;E3Ci+IH;A2Cz9ID;;EAEE,qBAAA;E3C29ID;A2C79ID;;EAMI,oBAAA;EACA,WAAA;EACA,cAAA;EACA,gBAAA;E3C29IH;A2Cn9ID;ECrDE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5C2gJD;A2Cx9ID;EChDI,2BAAA;E5C2gJH;A2C39ID;EC7CI,gBAAA;E5C2gJH;A2C39ID;ECxDE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5CshJD;A2Ch+ID;ECnDI,2BAAA;E5CshJH;A2Cn+ID;EChDI,gBAAA;E5CshJH;A2Cn+ID;EC3DE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5CiiJD;A2Cx+ID;ECtDI,2BAAA;E5CiiJH;A2C3+ID;ECnDI,gBAAA;E5CiiJH;A2C3+ID;EC9DE,2BAAA;EACA,uBAAA;EACA,gBAAA;E5C4iJD;A2Ch/ID;ECzDI,2BAAA;E5C4iJH;A2Cn/ID;ECtDI,gBAAA;E5C4iJH;A6C9iJD;EACE;IAAQ,6BAAA;I7CijJP;E6ChjJD;IAAQ,0BAAA;I7CmjJP;EACF;A6ChjJD;EACE;IAAQ,6BAAA;I7CmjJP;E6CljJD;IAAQ,0BAAA;I7CqjJP;EACF;A6CxjJD;EACE;IAAQ,6BAAA;I7CmjJP;E6CljJD;IAAQ,0BAAA;I7CqjJP;EACF;A6C7iJD;EACE,kBAAA;EACA,cAAA;EACA,qBAAA;EACA,2BAAA;EACA,oBAAA;ExCqCA,wDAAA;EACQ,gDAAA;EL2gJT;A6C5iJD;EACE,aAAA;EACA,WAAA;EACA,cAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2BAAA;ExCwBA,wDAAA;EACQ,gDAAA;EAsHR,qCAAA;EACK,gCAAA;EACG,6BAAA;ELk6IT;A6CziJD;;ECAI,+MAAA;EACA,0MA
 AA;EACA,uMAAA;EDCF,oCAAA;EAAA,4BAAA;E7C6iJD;A6CtiJD;;ExC7CE,4DAAA;EACK,uDAAA;EACG,oDAAA;ELulJT;A6CriJC;;EAEE,iBAAA;E7CuiJH;A6CpiJC;EACE,gBAAA;EACA,iBAAA;EACA,+BAAA;EACA,wBAAA;EACA,0BAAA;EAAA,kBAAA;E7CsiJH;A6C7hJD;EEvFE,2BAAA;E/CunJD;A+CpnJC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9CukJH;A6CjiJD;EE3FE,2BAAA;E/C+nJD;A+C5nJC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9C+kJH;A6CriJD;EE/FE,2BAAA;E/CuoJD;A+CpoJC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9CulJH;A6CziJD;EEnGE,2BAAA;E/C+oJD;A+C5oJC;EDgDE,+MAAA;EACA,0MAAA;EACA,uMAAA;E9C+lJH;AgD9oJD;;EAEE,kBAAA;EACA,SAAA;EhDgpJD;AgD5oJD;;EAEE,kBAAA;EhD8oJD;AgD5oJD;EACE,eAAA;EhD8oJD;AgD1oJD;EACE,gBAAA;EhD4oJD;AgDxoJD;EACE,iBAAA;EhD0oJD;AgDnoJD;EAEI,oBAAA;EhDooJH;AgDtoJD;EAKI,mBAAA;EhDooJH;AgD3nJD;EACE,iBAAA;EACA,kBAAA;EhD6nJD;AiD1qJD;EAEE,qBAAA;EACA,iBAAA;EjD2qJD;AiDnqJD;EACE,oBAAA;EACA,gBAAA;EACA,oBAAA;EAEA,qBAAA;EACA,2BAAA;EACA,2BAAA;EjDoqJD;AiDjqJC;ErB3BA,8BAAA;EACC,6BAAA;E5B+rJF;AiDlqJC;EACE,kBAAA;ErBvBF,iCAAA;EACC,gCAAA;E5B4rJF;AiDprJD;EAoBI,cAAA;EjDmqJH;AiDv
 rJD;EAuBI,mBAAA;EjDmqJH;AiDzpJD;EACE,gBAAA;EjD2pJD;AiD5pJD;EAII,gBAAA;EjD2pJH;AiDvpJC;;EAEE,uBAAA;EACA,gBAAA;EACA,2BAAA;EjDypJH;AiDnpJC;;;EAGE,2BAAA;EACA,gBAAA;EjDqpJH;AiDzpJC;;;EAQI,gBAAA;EjDspJL;AiD9pJC;;;EAWI,gBAAA;EjDwpJL;AiDnpJC;;;EAGE,YAAA;EACA,gBAAA;EACA,2BAAA;EACA,uBAAA;EjDqpJH;AiD3pJC;;;;;;;;;EAYI,gBAAA;EjD0pJL;AiDtqJC;;;EAeI,gBAAA;EjD4pJL;AkD/vJC;EACE,gBAAA;EACA,2BAAA;ElDiwJH;AkD/vJG;EACE,gBAAA;ElDiwJL;AkDlwJG;EAII,gBAAA;ElDiwJP;AkD9vJK;;EAEE,gBAAA;EACA,2BAAA;ElDgwJP;AkD9vJK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDgwJP;AkDrxJC;EACE,gBAAA;EACA,2BAAA;ElDuxJH;AkDrxJG;EACE,gBAAA;ElDuxJL;AkDxxJG;EAII,gBAAA;ElDuxJP;AkDpxJK;;EAEE,gBAAA;EACA,2BAAA;ElDsxJP;AkDpxJK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDsxJP;AkD3yJC;EACE,gBAAA;EACA,2BAAA;ElD6yJH;AkD3yJG;EACE,gBAAA;ElD6yJL;AkD9yJG;EAII,gBAAA;ElD6yJP;AkD1yJK;;EAEE,gBAAA;EACA,2BAAA;ElD4yJP;AkD1yJK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElD4yJP;AkDj0JC;EACE,gBAAA;EACA,2BAAA;ElDm0JH;AkDj0JG;EACE,gBAAA;ElDm0JL;AkDp0JG;EAII,gBAAA;ElDm0JP;AkDh0JK;;EA
 EE,gBAAA;EACA,2BAAA;ElDk0JP;AkDh0JK;;;EAGE,aAAA;EACA,2BAAA;EACA,uBAAA;ElDk0JP;AiD/tJD;EACE,eAAA;EACA,oBAAA;EjDiuJD;AiD/tJD;EACE,kBAAA;EACA,kBAAA;EjDiuJD;AmD51JD;EACE,qBAAA;EACA,2BAAA;EACA,+BAAA;EACA,oBAAA;E9C0DA,mDAAA;EACQ,2CAAA;ELqyJT;AmD31JD;EACE,eAAA;EnD61JD;AmDx1JD;EACE,oBAAA;EACA,sCAAA;EvBpBA,8BAAA;EACC,6BAAA;E5B+2JF;AmD91JD;EAMI,gBAAA;EnD21JH;AmDt1JD;EACE,eAAA;EACA,kBAAA;EACA,iBAAA;EACA,gBAAA;EnDw1JD;AmD51JD;EAOI,gBAAA;EnDw1JH;AmDn1JD;EACE,oBAAA;EACA,2BAAA;EACA,+BAAA;EvBpCA,iCAAA;EACC,gCAAA;E5B03JF;AmD70JD;EAEI,kBAAA;EnD80JH;AmDh1JD;EAKM,qBAAA;EACA,kBAAA;EnD80JL;AmD10JG;EAEI,eAAA;EvBlEN,8BAAA;EACC,6BAAA;E5B84JF;AmDx0JG;EAEI,kBAAA;EvBjEN,iCAAA;EACC,gCAAA;E5B24JF;AmDp0JD;EAEI,qBAAA;EnDq0JH;AmDl0JD;EACE,qBAAA;EnDo0JD;AmD5zJD;;;EAII,kBAAA;EnD6zJH;AmDj0JD;;EvB9FE,8BAAA;EACC,6BAAA;E5Bm6JF;AmDt0JD;;;;;;;;EAgBU,6BAAA;EnDg0JT;AmDh1JD;;;;;;;;EAoBU,8BAAA;EnDs0JT;AmD11JD;;EvBtFE,iCAAA;EACC,gCAAA;E5Bo7JF;AmD/1JD;;;;;;;;EAmCU,gCAAA;EnDs0JT;AmDz2JD;;;;;;;;EAuCU,iCAAA;EnD40JT;AmDn3JD;;EA8CI,+
 BAAA;EnDy0JH;AmDv3JD;;EAkDI,eAAA;EnDy0JH;AmD33JD;;EAsDI,WAAA;EnDy0JH;AmD/3JD;;;;;;;;;;;;EA6DU,gBAAA;EnDg1JT;AmD74JD;;;;;;;;;;;;EAiEU,iBAAA;EnD01JT;AmD35JD;;;;;;;;EA0EU,kBAAA;EnD21JT;AmDr6JD;;;;;;;;EAmFU,kBAAA;EnD41JT;AmD/6JD;EAyFI,WAAA;EACA,kBAAA;EnDy1JH;AmD/0JD;EACE,qBAAA;EnDi1JD;AmDl1JD;EAKI,kBAAA;EACA,oBAAA;EnDg1JH;AmDt1JD;EAQM,iBAAA;EnDi1JL;AmDz1JD;EAaI,kBAAA;EnD+0JH;AmD51JD;EAeM,+BAAA;EnDg1JL;AmD/1JD;EAmBI,eAAA;EnD+0JH;AmDl2JD;EAqBM,kCAAA;EnDg1JL;AmDz0JD;EC9NE,uBAAA;EpD0iKD;AoDxiKC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpD0iKH;AoD7iKC;EAMI,2BAAA;EpD0iKL;AoDhjKC;EASI,gBAAA;EACA,2BAAA;EpD0iKL;AoDviKC;EAEI,8BAAA;EpDwiKL;AmDx1JD;ECjOE,uBAAA;EpD4jKD;AoD1jKC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpD4jKH;AoD/jKC;EAMI,2BAAA;EpD4jKL;AoDlkKC;EASI,gBAAA;EACA,2BAAA;EpD4jKL;AoDzjKC;EAEI,8BAAA;EpD0jKL;AmDv2JD;ECpOE,uBAAA;EpD8kKD;AoD5kKC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpD8kKH;AoDjlKC;EAMI,2BAAA;EpD8kKL;AoDplKC;EASI,gBAAA;EACA,2BAAA;EpD8kKL;AoD3kKC;EAEI,8BAAA;EpD4kKL;AmDt3JD;ECvOE,uBAAA;EpDgmKD;AoD9lK
 C;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDgmKH;AoDnmKC;EAMI,2BAAA;EpDgmKL;AoDtmKC;EASI,gBAAA;EACA,2BAAA;EpDgmKL;AoD7lKC;EAEI,8BAAA;EpD8lKL;AmDr4JD;EC1OE,uBAAA;EpDknKD;AoDhnKC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDknKH;AoDrnKC;EAMI,2BAAA;EpDknKL;AoDxnKC;EASI,gBAAA;EACA,2BAAA;EpDknKL;AoD/mKC;EAEI,8BAAA;EpDgnKL;AmDp5JD;EC7OE,uBAAA;EpDooKD;AoDloKC;EACE,gBAAA;EACA,2BAAA;EACA,uBAAA;EpDooKH;AoDvoKC;EAMI,2BAAA;EpDooKL;AoD1oKC;EASI,gBAAA;EACA,2BAAA;EpDooKL;AoDjoKC;EAEI,8BAAA;EpDkoKL;AqDlpKD;EACE,oBAAA;EACA,gBAAA;EACA,WAAA;EACA,YAAA;EACA,kBAAA;ErDopKD;AqDzpKD;;;;EAWI,oBAAA;EACA,QAAA;EACA,SAAA;EACA,WAAA;EACA,cAAA;EACA,aAAA;EACA,WAAA;ErDopKH;AqDhpKC;EACE,wBAAA;ErDkpKH;AqD9oKC;EACE,qBAAA;ErDgpKH;AsDzqKD;EACE,kBAAA;EACA,eAAA;EACA,qBAAA;EACA,2BAAA;EACA,2BAAA;EACA,oBAAA;EjDwDA,yDAAA;EACQ,iDAAA;ELonKT;AsDnrKD;EASI,oBAAA;EACA,mCAAA;EtD6qKH;AsDxqKD;EACE,eAAA;EACA,oBAAA;EtD0qKD;AsDxqKD;EACE,cAAA;EACA,oBAAA;EtD0qKD;AuDhsKD;EACE,cAAA;EACA,iBAAA;EACA,mBAAA;EACA,gBAAA;EACA,gBAAA;EACA,8BAAA;EjCRA,cAAA;EAGA,2BAAA;
 EtBysKD;AuDjsKC;;EAEE,gBAAA;EACA,uBAAA;EACA,iBAAA;EjCfF,cAAA;EAGA,2BAAA;EtBitKD;AuD9rKC;EACE,YAAA;EACA,iBAAA;EACA,yBAAA;EACA,WAAA;EACA,0BAAA;EvDgsKH;AwDptKD;EACE,kBAAA;ExDstKD;AwDltKD;EACE,eAAA;EACA,kBAAA;EACA,iBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,mCAAA;EAIA,YAAA;ExDitKD;AwD9sKC;EnDkHA,4CAAA;EACQ,uCAAA;EAAA,oCAAA;EA8DR,qDAAA;EAEK,2CAAA;EACG,qCAAA;ELkiKT;AwDltKC;EnD8GA,yCAAA;EACQ,oCAAA;EAAA,iCAAA;ELumKT;AwDptKD;EACE,oBAAA;EACA,kBAAA;ExDstKD;AwDltKD;EACE,oBAAA;EACA,aAAA;EACA,cAAA;ExDotKD;AwDhtKD;EACE,oBAAA;EACA,2BAAA;EACA,2BAAA;EACA,sCAAA;EACA,oBAAA;EnDaA,kDAAA;EACQ,0CAAA;EmDZR,sCAAA;EAAA,8BAAA;EAEA,YAAA;ExDktKD;AwD9sKD;EACE,iBAAA;EACA,QAAA;EACA,UAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA,2BAAA;ExDgtKD;AwD9sKC;ElCrEA,YAAA;EAGA,0BAAA;EtBoxKD;AwDjtKC;ElCtEA,cAAA;EAGA,2BAAA;EtBwxKD;AwDhtKD;EACE,eAAA;EACA,kCAAA;EACA,2BAAA;ExDktKD;AwD/sKD;EACE,kBAAA;ExDitKD;AwD7sKD;EACE,WAAA;EACA,yBAAA;ExD+sKD;AwD1sKD;EACE,oBAAA;EACA,eAAA;ExD4sKD;AwDxsKD;EACE,eAAA;EACA,mBAAA;EACA,+BAAA;E
 xD0sKD;AwD7sKD;EAQI,kBAAA;EACA,kBAAA;ExDwsKH;AwDjtKD;EAaI,mBAAA;ExDusKH;AwDptKD;EAiBI,gBAAA;ExDssKH;AwDjsKD;EACE,oBAAA;EACA,cAAA;EACA,aAAA;EACA,cAAA;EACA,kBAAA;ExDmsKD;AwDjrKD;EAZE;IACE,cAAA;IACA,mBAAA;IxDgsKD;EwD9rKD;InDvEA,mDAAA;IACQ,2CAAA;ILwwKP;EwD7rKD;IAAY,cAAA;IxDgsKX;EACF;AwD3rKD;EAFE;IAAY,cAAA;IxDisKX;EACF;AyDh1KD;EACE,oBAAA;EACA,eAAA;EACA,gBAAA;EACA,qBAAA;EACA,iBAAA;EACA,kBAAA;EnCTA,YAAA;EAGA,0BAAA;EtB01KD;AyDj1KC;EnCZA,cAAA;EAGA,2BAAA;EtB81KD;AyDp1KC;EAAW,kBAAA;EAAmB,gBAAA;EzDw1K/B;AyDv1KC;EAAW,kBAAA;EAAmB,gBAAA;EzD21K/B;AyD11KC;EAAW,iBAAA;EAAmB,gBAAA;EzD81K/B;AyD71KC;EAAW,mBAAA;EAAmB,gBAAA;EzDi2K/B;AyD71KD;EACE,kBAAA;EACA,kBAAA;EACA,gBAAA;EACA,oBAAA;EACA,uBAAA;EACA,2BAAA;EACA,oBAAA;EzD+1KD;AyD31KD;EACE,oBAAA;EACA,UAAA;EACA,WAAA;EACA,2BAAA;EACA,qBAAA;EzD61KD;AyD11KC;EACE,WAAA;EACA,WAAA;EACA,mBAAA;EACA,yBAAA;EACA,2BAAA;EzD41KH;AyD11KC;EACE,WAAA;EACA,WAAA;EACA,yBAAA;EACA,2BAAA;EzD41KH;AyD11KC;EACE,WAAA;EACA,YAAA;EACA,yBAAA;EACA,2BAAA;EzD41KH;AyD11KC;EACE,UAAA;EACA,SAAA;EACA,
 kBAAA;EACA,6BAAA;EACA,6BAAA;EzD41KH;AyD11KC;EACE,UAAA;EACA,UAAA;EACA,kBAAA;EACA,6BAAA;EACA,4BAAA;EzD41KH;AyD11KC;EACE,QAAA;EACA,WAAA;EACA,mBAAA;EACA,yBAAA;EACA,8BAAA;EzD41KH;AyD11KC;EACE,QAAA;EACA,WAAA;EACA,yBAAA;EACA,8BAAA;EzD41KH;AyD11KC;EACE,QAAA;EACA,YAAA;EACA,yBAAA;EACA,8BAAA;EzD41KH;A0Dn7KD;EACE,oBAAA;EACA,QAAA;EACA,SAAA;EACA,eAAA;EACA,eAAA;EACA,kBAAA;EACA,cAAA;EACA,kBAAA;EACA,2BAAA;EACA,sCAAA;EAAA,8BAAA;EACA,2BAAA;EACA,sCAAA;EACA,oBAAA;ErDkDA,mDAAA;EACQ,2CAAA;EqD/CR,qBAAA;E1Do7KD;A0Dj7KC;EAAY,mBAAA;E1Do7Kb;A0Dn7KC;EAAY,mBAAA;E1Ds7Kb;A0Dr7KC;EAAY,kBAAA;E1Dw7Kb;A0Dv7KC;EAAY,oBAAA;E1D07Kb;A0Dv7KD;EACE,WAAA;EACA,mBAAA;EACA,iBAAA;EACA,qBAAA;EACA,mBAAA;EACA,2BAAA;EACA,kCAAA;EACA,4BAAA;E1Dy7KD;A0Dt7KD;EACE,mBAAA;E1Dw7KD;A0Dh7KC;;EAEE,oBAAA;EACA,gBAAA;EACA,UAAA;EACA,WAAA;EACA,2BAAA;EACA,qBAAA;E1Dk7KH;A0D/6KD;EACE,oBAAA;E1Di7KD;A0D/6KD;EACE,oBAAA;EACA,aAAA;E1Di7KD;A0D76KC;EACE,WAAA;EACA,oBAAA;EACA,wBAAA;EACA,2BAAA;EACA,uCAAA;EACA,eAAA;E1D+6KH;A0D96KG;EACE,cAAA;EACA,aAAA;EACA,oBAAA;EAC
 A,wBAAA;EACA,2BAAA;E1Dg7KL;A0D76KC;EACE,UAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,6BAAA;EACA,yCAAA;E1D+6KH;A0D96KG;EACE,cAAA;EACA,WAAA;EACA,eAAA;EACA,sBAAA;EACA,6BAAA;E1Dg7KL;A0D76KC;EACE,WAAA;EACA,oBAAA;EACA,qBAAA;EACA,8BAAA;EACA,0CAAA;EACA,YAAA;E1D+6KH;A0D96KG;EACE,cAAA;EACA,UAAA;EACA,oBAAA;EACA,qBAAA;EACA,8BAAA;E1Dg7KL;A0D56KC;EACE,UAAA;EACA,cAAA;EACA,mBAAA;EACA,uBAAA;EACA,4BAAA;EACA,wCAAA;E1D86KH;A0D76KG;EACE,cAAA;EACA,YAAA;EACA,uBAAA;EACA,4BAAA;EACA,eAAA;E1D+6KL;A2DziLD;EACE,oBAAA;E3D2iLD;A2DxiLD;EACE,oBAAA;EACA,kBAAA;EACA,aAAA;E3D0iLD;A2D7iLD;EAMI,eAAA;EACA,oBAAA;EtD0KF,2CAAA;EACK,sCAAA;EACG,mCAAA;ELi4KT;A2DpjLD;;EAcM,gBAAA;E3D0iLL;A2DxjLD;;;EAqBI,gBAAA;E3DwiLH;A2D7jLD;EAyBI,SAAA;E3DuiLH;A2DhkLD;;EA8BI,oBAAA;EACA,QAAA;EACA,aAAA;E3DsiLH;A2DtkLD;EAoCI,YAAA;E3DqiLH;A2DzkLD;EAuCI,aAAA;E3DqiLH;A2D5kLD;;EA2CI,SAAA;E3DqiLH;A2DhlLD;EA+CI,aAAA;E3DoiLH;A2DnlLD;EAkDI,YAAA;E3DoiLH;A2D5hLD;EACE,oBAAA;EACA,QAAA;EACA,SAAA;EACA,WAAA;EACA,YAAA;ErCtEA,cAAA;EAGA,2BAAA;EqCqEA,iBAAA;EACA,gBAAA;EAC
 A,oBAAA;EACA,2CAAA;E3D+hLD;A2D1hLC;Eb1EE,oGAAA;EACA,+FAAA;EACA,sHAAA;EAAA,gGAAA;EACA,6BAAA;EACA,wHAAA;E9CumLH;A2D9hLC;EACE,YAAA;EACA,UAAA;Eb/EA,oGAAA;EACA,+FAAA;EACA,sHAAA;EAAA,gGAAA;EACA,6BAAA;EACA,wHAAA;E9CgnLH;A2DhiLC;;EAEE,YAAA;EACA,gBAAA;EACA,uBAAA;ErC9FF,cAAA;EAGA,2BAAA;EtB+nLD;A2DjkLD;;;;EAsCI,oBAAA;EACA,UAAA;EACA,YAAA;EACA,uBAAA;E3DiiLH;A2D1kLD;;EA6CI,WAAA;EACA,oBAAA;E3DiiLH;A2D/kLD;;EAkDI,YAAA;EACA,qBAAA;E3DiiLH;A2DplLD;;EAuDI,aAAA;EACA,cAAA;EACA,mBAAA;EACA,oBAAA;E3DiiLH;A2D5hLG;EACE,kBAAA;E3D8hLL;A2D1hLG;EACE,kBAAA;E3D4hLL;A2DlhLD;EACE,oBAAA;EACA,cAAA;EACA,WAAA;EACA,aAAA;EACA,YAAA;EACA,mBAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;E3DohLD;A2D7hLD;EAYI,uBAAA;EACA,aAAA;EACA,cAAA;EACA,aAAA;EACA,qBAAA;EACA,2BAAA;EACA,qBAAA;EACA,iBAAA;EAUA,2BAAA;EACA,oCAAA;E3D2gLH;A2DziLD;EAiCI,WAAA;EACA,aAAA;EACA,cAAA;EACA,2BAAA;E3D2gLH;A2DpgLD;EACE,oBAAA;EACA,WAAA;EACA,YAAA;EACA,cAAA;EACA,aAAA;EACA,mBAAA;EACA,sBAAA;EACA,gBAAA;EACA,oBAAA;EACA,2CAAA;E3DsgLD;A2DrgLC;EACE,mBAAA;E3DugLH;A2D99KD;EAhCE;;;;
 IAKI,aAAA;IACA,cAAA;IACA,mBAAA;IACA,iBAAA;I3DggLH;E2DxgLD;;IAYI,oBAAA;I3DggLH;E2D5gLD;;IAgBI,qBAAA;I3DggLH;E2D3/KD;IACE,WAAA;IACA,YAAA;IACA,sBAAA;I3D6/KD;E2Dz/KD;IACE,cAAA;I3D2/KD;EACF;A4D/tLC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEE,cAAA;EACA,gBAAA;E5D6vLH;A4D3vLC;;;;;;;;;;;;;;;EACE,aAAA;E5D2wLH;AiCnxLD;E4BRE,gBAAA;EACA,mBAAA;EACA,oBAAA;E7D8xLD;AiCrxLD;EACE,yBAAA;EjCuxLD;AiCrxLD;EACE,wBAAA;EjCuxLD;AiC/wLD;EACE,0BAAA;EjCixLD;AiC/wLD;EACE,2BAAA;EjCixLD;AiC/wLD;EACE,oBAAA;EjCixLD;AiC/wLD;E6BzBE,aAAA;EACA,oBAAA;EACA,mBAAA;EACA,+BAAA;EACA,WAAA;E9D2yLD;AiC7wLD;EACE,0BAAA;EACA,+BAAA;EjC+wLD;AiCxwLD;EACE,iBAAA;E5B2FA,yCAAA;EACQ,oCAAA;EAAA,iCAAA;ELgrLT;A+D9yLD;EACE,qBAAA;E/DgzLD;A+D1yLD;;;;ECdE,0BAAA;EhE8zLD;A+DzyLD;;;;;;;;;;;;EAYE,0BAAA;E/D2yLD;A+DpyLD;EAAA;IChDE,2BAAA;IhEw1LC;EgEv1LD;IAAU,gBAAA;IhE01LT;EgEz1LD;IAAU,+BAAA;IhE41LT;EgE31LD;;IACU,gCAAA;IhE81LT;EACF;A+D9yLD;EAAA;IAFI,2BAAA;I/DozLD;EACF;A+D9yLD;EAAA;IAFI,4BAAA;I/DozLD;EACF;A+D9yLD;EAAA;IAFI,kCAAA;I/DozLD;EACF;A+D7yLD;EAAA;ICrEE,2BAAA;
 IhEs3LC;EgEr3LD;IAAU,gBAAA;IhEw3LT;EgEv3LD;IAAU,+BAAA;IhE03LT;EgEz3LD;;IACU,gCAAA;IhE43LT;EACF;A+DvzLD;EAAA;IAFI,2BAAA;I/D6zLD;EACF;A+DvzLD;EAAA;IAFI,4BAAA;I/D6zLD;EACF;A+DvzLD;EAAA;IAFI,kCAAA;I/D6zLD;EACF;A+DtzLD;EAAA;IC1FE,2BAAA;IhEo5LC;EgEn5LD;IAAU,gBAAA;IhEs5LT;EgEr5LD;IAAU,+BAAA;IhEw5LT;EgEv5LD;;IACU,gCAAA;IhE05LT;EACF;A+Dh0LD;EAAA;IAFI,2BAAA;I/Ds0LD;EACF;A+Dh0LD;EAAA;IAFI,4BAAA;I/Ds0LD;EACF;A+Dh0LD;EAAA;IAFI,kCAAA;I/Ds0LD;EACF;A+D/zLD;EAAA;IC/GE,2BAAA;IhEk7LC;EgEj7LD;IAAU,gBAAA;IhEo7LT;EgEn7LD;IAAU,+BAAA;IhEs7LT;EgEr7LD;;IACU,gCAAA;IhEw7LT;EACF;A+Dz0LD;EAAA;IAFI,2BAAA;I/D+0LD;EACF;A+Dz0LD;EAAA;IAFI,4BAAA;I/D+0LD;EACF;A+Dz0LD;EAAA;IAFI,kCAAA;I/D+0LD;EACF;A+Dx0LD;EAAA;IC5HE,0BAAA;IhEw8LC;EACF;A+Dx0LD;EAAA;ICjIE,0BAAA;IhE68LC;EACF;A+Dx0LD;EAAA;ICtIE,0BAAA;IhEk9LC;EACF;A+Dx0LD;EAAA;IC3IE,0BAAA;IhEu9LC;EACF;A+Dr0LD;ECnJE,0BAAA;EhE29LD;A+Dl0LD;EAAA;ICjKE,2BAAA;IhEu+LC;EgEt+LD;IAAU,gBAAA;IhEy+LT;EgEx+LD;IAAU,+BAAA;IhE2+LT;EgE1+LD;;IACU,gCAAA;IhE6+LT;EACF;A+Dh1LD;EACE,0BAAA;E/Dk1LD;A+
 D70LD;EAAA;IAFI,2BAAA;I/Dm1LD;EACF;A+Dj1LD;EACE,0BAAA;E/Dm1LD;A+D90LD;EAAA;IAFI,4BAAA;I/Do1LD;EACF;A+Dl1LD;EACE,0BAAA;E/Do1LD;A+D/0LD;EAAA;IAFI,kCAAA;I/Dq1LD;EACF;A+D90LD;EAAA;ICpLE,0BAAA;IhEsgMC;EACF","sourcesContent":[null,"/*! normalize.css v3.0.1 | MIT License | git.io/normalize */\n\n//\n// 1. Set default font family to sans-serif.\n// 2. Prevent iOS text size adjust after orientation change, without disabling\n//    user zoom.\n//\n\nhtml {\n  font-family: sans-serif; // 1\n  -ms-text-size-adjust: 100%; // 2\n  -webkit-text-size-adjust: 100%; // 2\n}\n\n//\n// Remove default margin.\n//\n\nbody {\n  margin: 0;\n}\n\n// HTML5 display definitions\n// ==========================================================================\n\n//\n// Correct `block` display not defined for any HTML5 element in IE 8/9.\n// Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox.\n// Correct `block` display not defined for `main` in IE 11.\n//\n\narticle,\naside,\nde
 tails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n  display: block;\n}\n\n//\n// 1. Correct `inline-block` display not defined in IE 8/9.\n// 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n//\n\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block; // 1\n  vertical-align: baseline; // 2\n}\n\n//\n// Prevent modern browsers from displaying `audio` without controls.\n// Remove excess height in iOS 5 devices.\n//\n\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n\n//\n// Address `[hidden]` styling not present in IE 8/9/10.\n// Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.\n//\n\n[hidden],\ntemplate {\n  display: none;\n}\n\n// Links\n// ==========================================================================\n\n//\n// Remove the gray background color from active links in IE 10.\n//\n\na {\n  background: transparent;\n}\n\n//\n// Improve readability when focused and also 
 mouse hovered in all browsers.\n//\n\na:active,\na:hover {\n  outline: 0;\n}\n\n// Text-level semantics\n// ==========================================================================\n\n//\n// Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n//\n\nabbr[title] {\n  border-bottom: 1px dotted;\n}\n\n//\n// Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n//\n\nb,\nstrong {\n  font-weight: bold;\n}\n\n//\n// Address styling not present in Safari and Chrome.\n//\n\ndfn {\n  font-style: italic;\n}\n\n//\n// Address variable `h1` font-size and margin within `section` and `article`\n// contexts in Firefox 4+, Safari, and Chrome.\n//\n\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n\n//\n// Address styling not present in IE 8/9.\n//\n\nmark {\n  background: #ff0;\n  color: #000;\n}\n\n//\n// Address inconsistent and variable font size in all browsers.\n//\n\nsmall {\n  font-size: 80%;\n}\n\n//\n// Prevent `sub` and `sup` affecting `line-height` in all bro
 wsers.\n//\n\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\n\nsup {\n  top: -0.5em;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\n// Embedded content\n// ==========================================================================\n\n//\n// Remove border when inside `a` element in IE 8/9/10.\n//\n\nimg {\n  border: 0;\n}\n\n//\n// Correct overflow not hidden in IE 9/10/11.\n//\n\nsvg:not(:root) {\n  overflow: hidden;\n}\n\n// Grouping content\n// ==========================================================================\n\n//\n// Address margin not present in IE 8/9 and Safari.\n//\n\nfigure {\n  margin: 1em 40px;\n}\n\n//\n// Address differences between Firefox and other browsers.\n//\n\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0;\n}\n\n//\n// Contain overflow in all browsers.\n//\n\npre {\n  overflow: auto;\n}\n\n//\n// Address odd `em`-unit font size rendering in all browsers.\n//\n\ncode,\nkbd,
 \npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\n\n// Forms\n// ==========================================================================\n\n//\n// Known limitation: by default, Chrome and Safari on OS X allow very limited\n// styling of `select`, unless a `border` property is set.\n//\n\n//\n// 1. Correct color not being inherited.\n//    Known issue: affects color of disabled elements.\n// 2. Correct font properties not being inherited.\n// 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n//\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit; // 1\n  font: inherit; // 2\n  margin: 0; // 3\n}\n\n//\n// Address `overflow` set to `hidden` in IE 8/9/10/11.\n//\n\nbutton {\n  overflow: visible;\n}\n\n//\n// Address inconsistent `text-transform` inheritance for `button` and `select`.\n// All other form control elements do not inherit `text-transform` values.\n// Correct `button` style inheritance in Firefox, IE 8/9/10/1
 1, and Opera.\n// Correct `select` style inheritance in Firefox.\n//\n\nbutton,\nselect {\n  text-transform: none;\n}\n\n//\n// 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n//    and `video` controls.\n// 2. Correct inability to style clickable `input` types in iOS.\n// 3. Improve usability and consistency of cursor style between image-type\n//    `input` and others.\n//\n\nbutton,\nhtml input[type=\"button\"], // 1\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button; // 2\n  cursor: pointer; // 3\n}\n\n//\n// Re-set default cursor for disabled elements.\n//\n\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n\n//\n// Remove inner padding and border in Firefox 4+.\n//\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n\n//\n// Address Firefox 4+ setting `line-height` on `input` using `!important` in\n// the UA stylesheet.\n//\n\ninput {\n  line-height: normal;\n}\n\n//\n
 // It's recommended that you don't attempt to style these elements.\n// Firefox's implementation doesn't respect box-sizing, padding, or width.\n//\n// 1. Address box sizing set to `content-box` in IE 8/9/10.\n// 2. Remove excess padding in IE 8/9/10.\n//\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box; // 1\n  padding: 0; // 2\n}\n\n//\n// Fix the cursor style for Chrome's increment/decrement buttons. For certain\n// `font-size` values of the `input`, it causes the cursor style of the\n// decrement button to change from `default` to `text`.\n//\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\n\n//\n// 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n// 2. Address `box-sizing` set to `border-box` in Safari and Chrome\n//    (include `-moz` to future-proof).\n//\n\ninput[type=\"search\"] {\n  -webkit-appearance: textfield; // 1\n  -moz-box-sizing: content-
 box;\n  -webkit-box-sizing: content-box; // 2\n  box-sizing: content-box;\n}\n\n//\n// Remove inner padding and search cancel button in Safari and Chrome on OS X.\n// Safari (but not Chrome) clips the cancel button when the search input has\n// padding (and `textfield` appearance).\n//\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n//\n// Define consistent border, margin, and padding.\n//\n\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\n\n//\n// 1. Correct `color` not being inherited in IE 8/9/10/11.\n// 2. Remove padding so people aren't caught out if they zero out fieldsets.\n//\n\nlegend {\n  border: 0; // 1\n  padding: 0; // 2\n}\n\n//\n// Remove default vertical scrollbar in IE 8/9/10/11.\n//\n\ntextarea {\n  overflow: auto;\n}\n\n//\n// Don't inherit the `font-weight` (applied by a rule above).\n// NOTE: the default cannot safely
  be changed in Chrome and Safari on OS X.\n//\n\noptgroup {\n  font-weight: bold;\n}\n\n// Tables\n// ==========================================================================\n\n//\n// Remove most spacing between table cells.\n//\n\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\ntd,\nth {\n  padding: 0;\n}\n","//\n// Basic print styles\n// --------------------------------------------------\n// Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css\n\n@media print {\n\n  * {\n    text-shadow: none !important;\n    color: #000 !important; // Black prints faster: h5bp.com/s\n    background: transparent !important;\n    box-shadow: none !important;\n  }\n\n  a,\n  a:visited {\n    text-decoration: underline;\n  }\n\n  a[href]:after {\n    content: \" (\" attr(href) \")\";\n  }\n\n  abbr[title]:after {\n    content: \" (\" attr(title) \")\";\n  }\n\n  // Don't show links for images, or javascript/internal links\n  a[href^=\"javascript:\"]:after,\n
   a[href^=\"#\"]:after {\n    content: \"\";\n  }\n\n  pre,\n  blockquote {\n    border: 1px solid #999;\n    page-break-inside: avoid;\n  }\n\n  thead {\n    display: table-header-group; // h5bp.com/t\n  }\n\n  tr,\n  img {\n    page-break-inside: avoid;\n  }\n\n  img {\n    max-width: 100% !important;\n  }\n\n  p,\n  h2,\n  h3 {\n    orphans: 3;\n    widows: 3;\n  }\n\n  h2,\n  h3 {\n    page-break-after: avoid;\n  }\n\n  // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245\n  // Once fixed, we can just straight up remove this.\n  select {\n    background: #fff !important;\n  }\n\n  // Bootstrap components\n  .navbar {\n    display: none;\n  }\n  .table {\n    td,\n    th {\n      background-color: #fff !important;\n    }\n  }\n  .btn,\n  .dropup > .btn {\n    > .caret {\n      border-top-color: #000 !important;\n    }\n  }\n  .label {\n    border: 1px solid #000;\n  }\n\n  .table {\n    border-collapse: collapse !important;\n  }\n  .table-bordered {\n    th,\n  
   td {\n      border: 1px solid #ddd !important;\n    }\n  }\n\n}\n","//\n// Glyphicons for Bootstrap\n//\n// Since icons are fonts, they can be placed anywhere text is placed and are\n// thus automatically sized to match the surrounding child. To use, create an\n// inline element with the appropriate classes, like so:\n//\n// <a href=\"#\"><span class=\"glyphicon glyphicon-star\"></span> Star</a>\n\n// Import the fonts\n@font-face {\n  font-family: 'Glyphicons Halflings';\n  src: url('@{icon-font-path}@{icon-font-name}.eot');\n  src: url('@{icon-font-path}@{icon-font-name}.eot?#iefix') format('embedded-opentype'),\n       url('@{icon-font-path}@{icon-font-name}.woff') format('woff'),\n       url('@{icon-font-path}@{icon-font-name}.ttf') format('truetype'),\n       url('@{icon-font-path}@{icon-font-name}.svg#@{icon-font-svg-id}') format('svg');\n}\n\n// Catchall baseclass\n.glyphicon {\n  position: relative;\n  top: 1px;\n  display: inline-block;\n  font-family: 'Glyphicons Halfling
 s';\n  font-style: normal;\n  font-weight: normal;\n  line-height: 1;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n// Individual icons\n.glyphicon-asterisk               { &:before { content: \"\\2a\"; } }\n.glyphicon-plus                   { &:before { content: \"\\2b\"; } }\n.glyphicon-euro                   { &:before { content: \"\\20ac\"; } }\n.glyphicon-minus                  { &:before { content: \"\\2212\"; } }\n.glyphicon-cloud                  { &:before { content: \"\\2601\"; } }\n.glyphicon-envelope               { &:before { content: \"\\2709\"; } }\n.glyphicon-pencil                 { &:before { content: \"\\270f\"; } }\n.glyphicon-glass                  { &:before { content: \"\\e001\"; } }\n.glyphicon-music                  { &:before { content: \"\\e002\"; } }\n.glyphicon-search                 { &:before { content: \"\\e003\"; } }\n.glyphicon-heart                  { &:before { content: \"\\e005\"; } }\n.glyphicon-star       
             { &:before { content: \"\\e006\"; } }\n.glyphicon-star-empty             { &:before { content: \"\\e007\"; } }\n.glyphicon-user                   { &:before { content: \"\\e008\"; } }\n.glyphicon-film                   { &:before { content: \"\\e009\"; } }\n.glyphicon-th-large               { &:before { content: \"\\e010\"; } }\n.glyphicon-th                     { &:before { content: \"\\e011\"; } }\n.glyphicon-th-list                { &:before { content: \"\\e012\"; } }\n.glyphicon-ok                     { &:before { content: \"\\e013\"; } }\n.glyphicon-remove                 { &:before { content: \"\\e014\"; } }\n.glyphicon-zoom-in                { &:before { content: \"\\e015\"; } }\n.glyphicon-zoom-out               { &:before { content: \"\\e016\"; } }\n.glyphicon-off                    { &:before { content: \"\\e017\"; } }\n.glyphicon-signal                 { &:before { content: \"\\e018\"; } }\n.glyphicon-cog                    { &:before { content: \"\\e019\"; } 
 }\n.glyphicon-trash                  { &:before { content: \"\\e020\"; } }\n.glyphicon-home                   { &:before { content: \"\\e021\"; } }\n.glyphicon-file                   { &:before { content: \"\\e022\"; } }\n.glyphicon-time                   { &:before { content: \"\\e023\"; } }\n.glyphicon-road                   { &:before { content: \"\\e024\"; } }\n.glyphicon-download-alt           { &:before { content: \"\\e025\"; } }\n.glyphicon-download               { &:before { content: \"\\e026\"; } }\n.glyphicon-upload                 { &:before { content: \"\\e027\"; } }\n.glyphicon-inbox                  { &:before { content: \"\\e028\"; } }\n.glyphicon-play-circle            { &:before { content: \"\\e029\"; } }\n.glyphicon-repeat                 { &:before { content: \"\\e030\"; } }\n.glyphicon-refresh                { &:before { content: \"\\e031\"; } }\n.glyphicon-list-alt               { &:before { content: \"\\e032\"; } }\n.glyphicon-lock                   { &:before 
 { content: \"\\e033\"; } }\n.glyphicon-flag                   { &:before { content: \"\\e034\"; } }\n.glyphicon-headphones             { &:before { content: \"\\e035\"; } }\n.glyphicon-volume-off             { &:before { content: \"\\e036\"; } }\n.glyphicon-volume-down            { &:before { content: \"\\e037\"; } }\n.glyphicon-volume-up              { &:before { content: \"\\e038\"; } }\n.glyphicon-qrcode                 { &:before { content: \"\\e039\"; } }\n.glyphicon-barcode                { &:before { content: \"\\e040\"; } }\n.glyphicon-tag                    { &:before { content: \"\\e041\"; } }\n.glyphicon-tags                   { &:before { content: \"\\e042\"; } }\n.glyphicon-book                   { &:before { content: \"\\e043\"; } }\n.glyphicon-bookmark               { &:before { content: \"\\e044\"; } }\n.glyphicon-print                  { &:before { content: \"\\e045\"; } }\n.glyphicon-camera                 { &:before { content: \"\\e046\"; } }\n.glyphicon-font     
               { &:before { content: \"\\e047\"; } }\n.glyphicon-bold                   { &:before { content: \"\\e048\"; } }\n.glyphicon-italic                 { &:before { content: \"\\e049\"; } }\n.glyphicon-text-height            { &:before { content: \"\\e050\"; } }\n.glyphicon-text-width             { &:before { content: \"\\e051\"; } }\n.glyphicon-align-left             { &:before { content: \"\\e052\"; } }\n.glyphicon-align-center           { &:before { content: \"\\e053\"; } }\n.glyphicon-align-right            { &:before { content: \"\\e054\"; } }\n.glyphicon-align-justify          { &:before { content: \"\\e055\"; } }\n.glyphicon-list                   { &:before { content: \"\\e056\"; } }\n.glyphicon-indent-left            { &:before { content: \"\\e057\"; } }\n.glyphicon-indent-right           { &:before { content: \"\\e058\"; } }\n.glyphicon-facetime-video         { &:before { content: \"\\e059\"; } }\n.glyphicon-picture                { &:before { content: \"\\e060\"; 
 } }\n.glyphicon-map-marker             { &:before { content: \"\\e062\"; } }\n.glyphicon-adjust                 { &:before { content: \"\\e063\"; } }\n.glyphicon-tint                   { &:before { content: \"\\e064\"; } }\n.glyphicon-edit                   { &:before { content: \"\\e065\"; } }\n.glyphicon-share                  { &:before { content: \"\\e066\"; } }\n.glyphicon-check                  { &:before { content: \"\\e067\"; } }\n.glyphicon-move                   { &:before { content: \"\\e068\"; } }\n.glyphicon-step-backward          { &:before { content: \"\\e069\"; } }\n.glyphicon-fast-backward          { &:before { content: \"\\e070\"; } }\n.glyphicon-backward               { &:before { content: \"\\e071\"; } }\n.glyphicon-play                   { &:before { content: \"\\e072\"; } }\n.glyphicon-pause                  { &:before { content: \"\\e073\"; } }\n.glyphicon-stop                   { &:before { content: \"\\e074\"; } }\n.glyphicon-forward                { &:befor
 e { content: \"\\e075\"; } }\n.glyphicon-fast-forward           { &:before { content: \"\\e076\"; } }\n.glyphicon-step-forward           { &:before { content: \"\\e077\"; } }\n.glyphicon-eject                  { &:before { content: \"\\e078\"; } }\n.glyphicon-chevron-left           { &:before { content: \"\\e079\"; } }\n.glyphicon-chevron-right          { &:before { content: \"\\e080\"; } }\n.glyphicon-plus-sign              { &:before { content: \"\\e081\"; } }\n.glyphicon-minus-sign             { &:before { content: \"\\e082\"; } }\n.glyphicon-remove-sign            { &:before { content: \"\\e083\"; } }\n.glyphicon-ok-sign                { &:before { content: \"\\e084\"; } }\n.glyphicon-question-sign          { &:before { content: \"\\e085\"; } }\n.glyphicon-info-sign              { &:before { content: \"\\e086\"; } }\n.glyphicon-screenshot             { &:before { content: \"\\e087\"; } }\n.glyphicon-remove-circle          { &:before { content: \"\\e088\"; } }\n.glyphicon-ok-circ
 le              { &:before { content: \"\\e089\"; } }\n.glyphicon-ban-circle             { &:before { content: \"\\e090\"; } }\n.glyphicon-arrow-left             { &:before { content: \"\\e091\"; } }\n.glyphicon-arrow-right            { &:before { content: \"\\e092\"; } }\n.glyphicon-arrow-up               { &:before { content: \"\\e093\"; } }\n.glyphicon-arrow-down             { &:before { content: \"\\e094\"; } }\n.glyphicon-share-alt              { &:before { content: \"\\e095\"; } }\n.glyphicon-resize-full            { &:before { content: \"\\e096\"; } }\n.glyphicon-resize-small           { &:before { content: \"\\e097\"; } }\n.glyphicon-exclamation-sign       { &:before { content: \"\\e101\"; } }\n.glyphicon-gift                   { &:before { content: \"\\e102\"; } }\n.glyphicon-leaf                   { &:before { content: \"\\e103\"; } }\n.glyphicon-fire                   { &:before { content: \"\\e104\"; } }\n.glyphicon-eye-open               { &:before { content: \"\\e105\"
 ; } }\n.glyphicon-eye-close              { &:before { content: \"\\e106\"; } }\n.glyphicon-warning-sign           { &:before { content: \"\\e107\"; } }\n.glyphicon-plane                  { &:before { content: \"\\e108\"; } }\n.glyphicon-calendar               { &:before { content: \"\\e109\"; } }\n.glyphicon-random                 { &:before { content: \"\\e110\"; } }\n.glyphicon-comment                { &:before { content: \"\\e111\"; } }\n.glyphicon-magnet                 { &:before { content: \"\\e112\"; } }\n.glyphicon-chevron-up             { &:before { content: \"\\e113\"; } }\n.glyphicon-chevron-down           { &:before { content: \"\\e114\"; } }\n.glyphicon-retweet                { &:before { content: \"\\e115\"; } }\n.glyphicon-shopping-cart          { &:before { content: \"\\e116\"; } }\n.glyphicon-folder-close           { &:before { content: \"\\e117\"; } }\n.glyphicon-folder-open            { &:before { content: \"\\e118\"; } }\n.glyphicon-resize-vertical        { &:bef
 ore { content: \"\\e119\"; } }\n.glyphicon-resize-horizontal      { &:before { content: \"\\e120\"; } }\n.glyphicon-hdd                    { &:before { content: \"\\e121\"; } }\n.glyphicon-bullhorn               { &:before { content: \"\\e122\"; } }\n.glyphicon-bell                   { &:before { content: \"\\e123\"; } }\n.glyphicon-certificate            { &:before { content: \"\\e124\"; } }\n.glyphicon-thumbs-up              { &:before { content: \"\\e125\"; } }\n.glyphicon-thumbs-down            { &:before { content: \"\\e126\"; } }\n.glyphicon-hand-right             { &:before { content: \"\\e127\"; } }\n.glyphicon-hand-left              { &:before { content: \"\\e128\"; } }\n.glyphicon-hand-up                { &:before { content: \"\\e129\"; } }\n.glyphicon-hand-down              { &:before { content: \"\\e130\"; } }\n.glyphicon-circle-arrow-right     { &:before { content: \"\\e131\"; } }\n.glyphicon-circle-arrow-left      { &:before { content: \"\\e132\"; } }\n.glyphicon-circl
 e-arrow-up        { &:before { content: \"\\e133\"; } }\n.glyphicon-circle-arrow-down      { &:before { content: \"\\e134\"; } }\n.glyphicon-globe                  { &:before { content: \"\\e135\"; } }\n.glyphicon-wrench                 { &:before { content: \"\\e136\"; } }\n.glyphicon-tasks                  { &:before { content: \"\\e137\"; } }\n.glyphicon-filter                 { &:before { content: \"\\e138\"; } }\n.glyphicon-briefcase              { &:before { content: \"\\e139\"; } }\n.glyphicon-fullscreen             { &:before { content: \"\\e140\"; } }\n.glyphicon-dashboard              { &:before { content: \"\\e141\"; } }\n.glyphicon-paperclip              { &:before { content: \"\\e142\"; } }\n.glyphicon-heart-empty            { &:before { content: \"\\e143\"; } }\n.glyphicon-link                   { &:before { content: \"\\e144\"; } }\n.glyphicon-phone                  { &:before { content: \"\\e145\"; } }\n.glyphicon-pushpin                { &:before { content: \"\\e146
 \"; } }\n.glyphicon-usd                    { &:before { content: \"\\e148\"; } }\n.glyphicon-gbp                    { &:before { content: \"\\e149\"; } }\n.glyphicon-sort                   { &:before { content: \"\\e150\"; } }\n.glyphicon-sort-by-alphabet       { &:before { content: \"\\e151\"; } }\n.glyphicon-sort-by-alphabet-alt   { &:before { content: \"\\e152\"; } }\n.glyphicon-sort-by-order          { &:before { content: \"\\e153\"; } }\n.glyphicon-sort-by-order-alt      { &:before { content: \"\\e154\"; } }\n.glyphicon-sort-by-attributes     { &:before { content: \"\\e155\"; } }\n.glyphicon-sort-by-attributes-alt { &:before { content: \"\\e156\"; } }\n.glyphicon-unchecked              { &:before { content: \"\\e157\"; } }\n.glyphicon-expand                 { &:before { content: \"\\e158\"; } }\n.glyphicon-collapse-down          { &:before { content: \"\\e159\"; } }\n.glyphicon-collapse-up            { &:before { content: \"\\e160\"; } }\n.glyphicon-log-in                 { &:b
 efore { content: \"\\e161\"; } }\n.glyphicon-flash                  { &:before { content: \"\\e162\"; } }\n.glyphicon-log-out                { &:before { content: \"\\e163\"; } }\n.glyphicon-new-window             { &:before { content: \"\\e164\"; } }\n.glyphicon-record                 { &:before { content: \"\\e165\"; } }\n.glyphicon-save                   { &:before { content: \"\\e166\"; } }\n.glyphicon-open                   { &:before { content: \"\\e167\"; } }\n.glyphicon-saved                  { &:before { content: \"\\e168\"; } }\n.glyphicon-import                 { &:before { content: \"\\e169\"; } }\n.glyphicon-export                 { &:before { content: \"\\e170\"; } }\n.glyphicon-send                   { &:before { content: \"\\e171\"; } }\n.glyphicon-floppy-disk            { &:before { content: \"\\e172\"; } }\n.glyphicon-floppy-saved           { &:before { content: \"\\e173\"; } }\n.glyphicon-floppy-remove          { &:before { content: \"\\e174\"; } }\n.glyphicon-flo
 ppy-save            { &:before { content: \"\\e175\"; } }\n.glyphicon-floppy-open            { &:before { content: \"\\e176\"; } }\n.glyphicon-credit-card            { &:before { content: \"\\e177\"; } }\n.glyphicon-transfer               { &:before { content: \"\\e178\"; } }\n.glyphicon-cutlery                { &:before { content: \"\\e179\"; } }\n.glyphicon-header                 { &:before { content: \"\\e180\"; } }\n.glyphicon-compressed             { &:before { content: \"\\e181\"; } }\n.glyphicon-earphone               { &:before { content: \"\\e182\"; } }\n.glyphicon-phone-alt              { &:before { content: \"\\e183\"; } }\n.glyphicon-tower                  { &:before { content: \"\\e184\"; } }\n.glyphicon-stats                  { &:before { content: \"\\e185\"; } }\n.glyphicon-sd-video               { &:before { content: \"\\e186\"; } }\n.glyphicon-hd-video               { &:before { content: \"\\e187\"; } }\n.glyphicon-subtitles              { &:before { content: \"\\e1
 88\"; } }\n.glyphicon-sound-stereo           { &:before { content: \"\\e189\"; } }\n.glyphicon-sound-dolby            { &:before { content: \"\\e190\"; } }\n.glyphicon-sound-5-1              { &:before { content: \"\\e191\"; } }\n.glyphicon-sound-6-1              { &:before { content: \"\\e192\"; } }\n.glyphicon-sound-7-1              { &:before { content: \"\\e193\"; } }\n.glyphicon-copyright-mark         { &:before { content: \"\\e194\"; } }\n.glyphicon-registration-mark      { &:before { content: \"\\e195\"; } }\n.glyphicon-cloud-download         { &:before { content: \"\\e197\"; } }\n.glyphicon-cloud-upload           { &:before { content: \"\\e198\"; } }\n.glyphicon-tree-conifer           { &:before { content: \"\\e199\"; } }\n.glyphicon-tree-deciduous         { &:before { content: \"\\e200\"; } }\n","//\n// Scaffolding\n// --------------------------------------------------\n\n\n// Reset the box-sizing\n//\n// Heads up! This reset may cause conflicts with some third-party widget
 s.\n// For recommendations on resolving such conflicts, see\n// http://getbootstrap.com/getting-started/#third-box-sizing\n* {\n  .box-sizing(border-box);\n}\n*:before,\n*:after {\n  .box-sizing(border-box);\n}\n\n\n// Body reset\n\nhtml {\n  font-size: 10px;\n  -webkit-tap-highlight-color: rgba(0,0,0,0);\n}\n\nbody {\n  font-family: @font-family-base;\n  font-size: @font-size-base;\n  line-height: @line-height-base;\n  color: @text-color;\n  background-color: @body-bg;\n}\n\n// Reset fonts for relevant elements\ninput,\nbutton,\nselect,\ntextarea {\n  font-family: inherit;\n  font-size: inherit;\n  line-height: inherit;\n}\n\n\n// Links\n\na {\n  color: @link-color;\n  text-decoration: none;\n\n  &:hover,\n  &:focus {\n    color: @link-hover-color;\n    text-decoration: underline;\n  }\n\n  &:focus {\n    .tab-focus();\n  }\n}\n\n\n// Figures\n//\n// We reset this here because previously Normalize had no `figure` margins. This\n// ensures we don't break anyone's use of the element.
 \n\nfigure {\n  margin: 0;\n}\n\n\n// Images\n\nimg {\n  vertical-align: middle;\n}\n\n// Responsive images (ensure images don't scale beyond their parents)\n.img-responsive {\n  .img-responsive();\n}\n\n// Rounded corners\n.img-rounded {\n  border-radius: @border-radius-large;\n}\n\n// Image thumbnails\n//\n// Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.\n.img-thumbnail {\n  padding: @thumbnail-padding;\n  line-height: @line-height-base;\n  background-color: @thumbnail-bg;\n  border: 1px solid @thumbnail-border;\n  border-radius: @thumbnail-border-radius;\n  .transition(all .2s ease-in-out);\n\n  // Keep them at most 100% wide\n  .img-responsive(inline-block);\n}\n\n// Perfect circle\n.img-circle {\n  border-radius: 50%; // set radius in percents\n}\n\n\n// Horizontal rules\n\nhr {\n  margin-top:    @line-height-computed;\n  margin-bottom: @line-height-computed;\n  border: 0;\n  border-top: 1px solid @hr-border;\n}\n\n\n// Only display content to screen readers
 \n//\n// See: http://a11yproject.com/posts/how-to-hide-content/\n\n.sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip: rect(0,0,0,0);\n  border: 0;\n}\n\n// Use in conjunction with .sr-only to only display content when it's focused.\n// Useful for \"Skip to main content\" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1\n// Credit: HTML5 Boilerplate\n\n.sr-only-focusable {\n  &:active,\n  &:focus {\n    position: static;\n    width: auto;\n    height: auto;\n    margin: 0;\n    overflow: visible;\n    clip: auto;\n  }\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They will be removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animat
 ions\n.animation(@animation) {\n  -webkit-animation: @animation;\n       -o-animation: @animation;\n          animation: @animation;\n}\n.animation-name(@name) {\n  -webkit-animation-name: @name;\n          animation-name: @name;\n}\n.animation-duration(@duration) {\n  -webkit-animation-duration: @duration;\n          animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n  -webkit-animation-timing-function: @timing-function;\n          animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n  -webkit-animation-delay: @delay;\n          animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n  -webkit-animation-iteration-count: @iteration-count;\n          animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n  -webkit-animation-direction: @direction;\n          animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n  -webkit-animation-fill-mode: @fill-mode;\n      
     animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS 3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility){\n  -webkit-backface-visibility: @visibility;\n     -moz-backface-visibility: @visibility;\n          backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n          box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n  -webkit-box-sizing: @boxmodel;\n     -moz-box-sizing: @boxmodel;\n          box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n  -webkit-column-count: @column-count;\n     -moz-column-count: @column-count;\n          
 column-count: @column-count;\n  -webkit-column-gap: @column-gap;\n     -moz-column-gap: @column-gap;\n          column-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n  word-wrap: break-word;\n  -webkit-hyphens: @mode;\n     -moz-hyphens: @mode;\n      -ms-hyphens: @mode; // IE10+\n       -o-hyphens: @mode;\n          hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n  &::-moz-placeholder           { color: @color;   // Firefox\n                                  opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526\n  &:-ms-input-placeholder       { color: @color; } // Internet Explorer 10+\n  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n  -webkit-transform: scale(@ratio);\n      -ms-transform: scale(@ratio); // IE9 only\n       -o-transform: scale(@ratio);\n          transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n  -webkit-
 transform: scale(@ratioX, @ratioY);\n      -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n       -o-transform: scale(@ratioX, @ratioY);\n          transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n  -webkit-transform: scaleX(@ratio);\n      -ms-transform: scaleX(@ratio); // IE9 only\n       -o-transform: scaleX(@ratio);\n          transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n  -webkit-transform: scaleY(@ratio);\n      -ms-transform: scaleY(@ratio); // IE9 only\n       -o-transform: scaleY(@ratio);\n          transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n  -webkit-transform: skewX(@x) skewY(@y);\n      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n       -o-transform: skewX(@x) skewY(@y);\n          transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n  -webkit-transform: translate(@x, @y);\n      -ms-transform: translate(@x, @y); // IE9 only\n       -o-transform: translate(@x, @y);\n          transform: tra
 nslate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n  -webkit-transform: translate3d(@x, @y, @z);\n          transform: translate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n  -webkit-transform: rotate(@degrees);\n      -ms-transform: rotate(@degrees); // IE9 only\n       -o-transform: rotate(@degrees);\n          transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n  -webkit-transform: rotateX(@degrees);\n      -ms-transform: rotateX(@degrees); // IE9 only\n       -o-transform: rotateX(@degrees);\n          transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n  -webkit-transform: rotateY(@degrees);\n      -ms-transform: rotateY(@degrees); // IE9 only\n       -o-transform: rotateY(@degrees);\n          transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n  -webkit-perspective: @perspective;\n     -moz-perspective: @perspective;\n          perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n  -webkit-perspective-origin: @perspective;\n     -moz-perspective-ori
 gin: @perspective;\n          perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n  -webkit-transform-origin: @origin;\n     -moz-transform-origin: @origin;\n      -ms-transform-origin: @origin; // IE9 only\n          transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n  -webkit-transition: @transition;\n       -o-transition: @transition;\n          transition: @transition;\n}\n.transition-property(@transition-property) {\n  -webkit-transition-property: @transition-property;\n          transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n  -webkit-transition-delay: @transition-delay;\n          transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n  -webkit-transition-duration: @transition-duration;\n          transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n  -webkit-transition-timing-function: @timing-function;\n          tr
 ansition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n  -webkit-transition: -webkit-transform @transition;\n     -moz-transition: -moz-transform @transition;\n       -o-transition: -o-transform @transition;\n          transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n  -webkit-user-select: @select;\n     -moz-user-select: @select;\n      -ms-user-select: @select; // IE10+\n          user-select: @select;\n}\n","// WebKit-style focus\n\n.tab-focus() {\n  // Default\n  outline: thin dotted;\n  // WebKit\n  outline: 5px auto -webkit-focus-ring-color;\n  outline-offset: -2px;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n.img-responsive(@display: block) {\n  display: @display;\n  width: 100% \\9; // Force IE10 and below to size SVG images correctly\n  max-width: 100%; // Par
 t 1: Set a maximum relative to the parent\n  height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size. Note that the\n// spelling of `min--moz-device-pixel-ratio` is intentional.\n.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {\n  background-image: url(\"@{file-1x}\");\n\n  @media\n  only screen and (-webkit-min-device-pixel-ratio: 2),\n  only screen and (   min--moz-device-pixel-ratio: 2),\n  only screen and (     -o-min-device-pixel-ratio: 2/1),\n  only screen and (        min-device-pixel-ratio: 2),\n  only screen and (                min-resolution: 192dpi),\n  only screen and (                min-resolution: 2dppx) {\n    background-image: url(\"@{file-2x}\");\n    background-size: @width-1x @height-1x;\n  }\n}\n","//\n// Typography\n// --------------------------------------------------\n\n\n// Headings\n// -------------------------\n\nh1, h2,
  h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n  font-family: @headings-font-family;\n  font-weight: @headings-font-weight;\n  line-height: @headings-line-height;\n  color: @headings-color;\n\n  small,\n  .small {\n    font-weight: normal;\n    line-height: 1;\n    color: @headings-small-color;\n  }\n}\n\nh1, .h1,\nh2, .h2,\nh3, .h3 {\n  margin-top: @line-height-computed;\n  margin-bottom: (@line-height-computed / 2);\n\n  small,\n  .small {\n    font-size: 65%;\n  }\n}\nh4, .h4,\nh5, .h5,\nh6, .h6 {\n  margin-top: (@line-height-computed / 2);\n  margin-bottom: (@line-height-computed / 2);\n\n  small,\n  .small {\n    font-size: 75%;\n  }\n}\n\nh1, .h1 { font-size: @font-size-h1; }\nh2, .h2 { font-size: @font-size-h2; }\nh3, .h3 { font-size: @font-size-h3; }\nh4, .h4 { font-size: @font-size-h4; }\nh5, .h5 { font-size: @font-size-h5; }\nh6, .h6 { font-size: @font-size-h6; }\n\n\n// Body text\n// -------------------------\n\np {\n  margin: 0 0 (@line-height-computed / 2);\n}\n\n.le
 ad {\n  margin-bottom: @line-height-computed;\n  font-size: floor((@font-size-base * 1.15));\n  font-weight: 300;\n  line-height: 1.4;\n\n  @media

<TRUNCATED>

[27/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.js
new file mode 100644
index 0000000..13dfe62
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.js
@@ -0,0 +1,2365 @@
+/**
+ * Backbone Forms v0.12.0
+ *
+ * NOTE:
+ * This version is for use with RequireJS
+ * If using regular <script> tags to include your files, use backbone-forms.min.js
+ *
+ * Copyright (c) 2013 Charles Davison, Pow Media Ltd
+ * 
+ * License and more information at:
+ * http://github.com/powmedia/backbone-forms
+ */
+define(['jquery', 'underscore', 'backbone'], function($, _, Backbone) {
+
+  
+//==================================================================================================
+//FORM
+//==================================================================================================
+
+var Form = Backbone.View.extend({
+
+  /**
+   * Constructor
+   * 
+   * @param {Object} [options.schema]
+   * @param {Backbone.Model} [options.model]
+   * @param {Object} [options.data]
+   * @param {String[]|Object[]} [options.fieldsets]
+   * @param {String[]} [options.fields]
+   * @param {String} [options.idPrefix]
+   * @param {Form.Field} [options.Field]
+   * @param {Form.Fieldset} [options.Fieldset]
+   * @param {Function} [options.template]
+   */
+  initialize: function(options) {
+    var self = this;
+
+    options = options || {};
+
+    //Find the schema to use
+    var schema = this.schema = (function() {
+      //Prefer schema from options
+      if (options.schema) return _.result(options, 'schema');
+
+      //Then schema on model
+      var model = options.model;
+      if (model && model.schema) {
+        return (_.isFunction(model.schema)) ? model.schema() : model.schema;
+      }
+
+      //Then built-in schema
+      if (self.schema) {
+        return (_.isFunction(self.schema)) ? self.schema() : self.schema;
+      }
+
+      //Fallback to empty schema
+      return {};
+    })();
+
+    //Store important data
+    _.extend(this, _.pick(options, 'model', 'data', 'idPrefix'));
+
+    //Override defaults
+    var constructor = this.constructor;
+    this.template = options.template || constructor.template;
+    this.Fieldset = options.Fieldset || constructor.Fieldset;
+    this.Field = options.Field || constructor.Field;
+    this.NestedField = options.NestedField || constructor.NestedField;
+
+    //Check which fields will be included (defaults to all)
+    var selectedFields = this.selectedFields = options.fields || _.keys(schema);
+
+    //Create fields
+    var fields = this.fields = {};
+
+    _.each(selectedFields, function(key) {
+      var fieldSchema = schema[key];
+      fields[key] = this.createField(key, fieldSchema);
+    }, this);
+
+    //Create fieldsets
+    var fieldsetSchema = options.fieldsets || [selectedFields],
+        fieldsets = this.fieldsets = [];
+
+    _.each(fieldsetSchema, function(itemSchema) {
+      this.fieldsets.push(this.createFieldset(itemSchema));
+    }, this);
+  },
+
+  /**
+   * Creates a Fieldset instance
+   *
+   * @param {String[]|Object[]} schema       Fieldset schema
+   *
+   * @return {Form.Fieldset}
+   */
+  createFieldset: function(schema) {
+    var options = {
+      schema: schema,
+      fields: this.fields
+    };
+
+    return new this.Fieldset(options);
+  },
+
+  /**
+   * Creates a Field instance
+   *
+   * @param {String} key
+   * @param {Object} schema       Field schema
+   *
+   * @return {Form.Field}
+   */
+  createField: function(key, schema) {
+    var options = {
+      form: this,
+      key: key,
+      schema: schema,
+      idPrefix: this.idPrefix
+    };
+
+    if (this.model) {
+      options.model = this.model;
+    } else if (this.data) {
+      options.value = this.data[key];
+    } else {
+      options.value = null;
+    }
+
+    var field = new this.Field(options);
+
+    this.listenTo(field.editor, 'all', this.handleEditorEvent);
+
+    return field;
+  },
+
+  /**
+   * Callback for when an editor event is fired.
+   * Re-triggers events on the form as key:event and triggers additional form-level events
+   *
+   * @param {String} event
+   * @param {Editor} editor
+   */
+  handleEditorEvent: function(event, editor) {
+    //Re-trigger editor events on the form
+    var formEvent = editor.key+':'+event;
+
+    this.trigger.call(this, formEvent, this, editor);
+
+    //Trigger additional events
+    switch (event) {
+      case 'change':
+        this.trigger('change', this);
+        break;
+
+      case 'focus':
+        if (!this.hasFocus) this.trigger('focus', this);
+        break;
+
+      case 'blur':
+        if (this.hasFocus) {
+          //TODO: Is the timeout etc needed?
+          var self = this;
+          setTimeout(function() {
+            var focusedField = _.find(self.fields, function(field) {
+              return field.editor.hasFocus;
+            });
+
+            if (!focusedField) self.trigger('blur', self);
+          }, 0);
+        }
+        break;
+    }
+  },
+
+  render: function() {
+    var self = this,
+        fields = this.fields;
+
+    //Render form
+    var $form = $($.trim(this.template(_.result(this, 'templateData'))));
+
+    //Render standalone editors
+    $form.find('[data-editors]').add($form).each(function(i, el) {
+      var $container = $(el),
+          selection = $container.attr('data-editors');
+
+      if (_.isUndefined(selection)) return;
+
+      //Work out which fields to include
+      var keys = (selection == '*')
+        ? self.selectedFields || _.keys(fields)
+        : selection.split(',');
+
+      //Add them
+      _.each(keys, function(key) {
+        var field = fields[key];
+
+        $container.append(field.editor.render().el);
+      });
+    });
+
+    //Render standalone fields
+    $form.find('[data-fields]').add($form).each(function(i, el) {
+      var $container = $(el),
+          selection = $container.attr('data-fields');
+
+      if (_.isUndefined(selection)) return;
+
+      //Work out which fields to include
+      var keys = (selection == '*')
+        ? self.selectedFields || _.keys(fields)
+        : selection.split(',');
+
+      //Add them
+      _.each(keys, function(key) {
+        var field = fields[key];
+
+        $container.append(field.render().el);
+      });
+    });
+
+    //Render fieldsets
+    $form.find('[data-fieldsets]').add($form).each(function(i, el) {
+      var $container = $(el),
+          selection = $container.attr('data-fieldsets');
+
+      if (_.isUndefined(selection)) return;
+
+      _.each(self.fieldsets, function(fieldset) {
+        $container.append(fieldset.render().el);
+      });
+    });
+
+    //Set the main element
+    this.setElement($form);
+
+    return this;
+  },
+
+  /**
+   * Validate the data
+   *
+   * @return {Object}       Validation errors
+   */
+  validate: function() {
+    var self = this,
+        fields = this.fields,
+        model = this.model,
+        errors = {};
+
+    //Collect errors from schema validation
+    _.each(fields, function(field) {
+      var error = field.validate();
+      if (error) {
+        errors[field.key] = error;
+      }
+    });
+
+    //Get errors from default Backbone model validator
+    if (model && model.validate) {
+      var modelErrors = model.validate(this.getValue());
+
+      if (modelErrors) {
+        var isDictionary = _.isObject(modelErrors) && !_.isArray(modelErrors);
+
+        //If errors are not in object form then just store on the error object
+        if (!isDictionary) {
+          errors._others = errors._others || [];
+          errors._others.push(modelErrors);
+        }
+
+        //Merge programmatic errors (requires model.validate() to return an object e.g. { fieldKey: 'error' })
+        if (isDictionary) {
+          _.each(modelErrors, function(val, key) {
+            //Set error on field if there isn't one already
+            if (fields[key] && !errors[key]) {
+              fields[key].setError(val);
+              errors[key] = val;
+            }
+
+            else {
+              //Otherwise add to '_others' key
+              errors._others = errors._others || [];
+              var tmpErr = {};
+              tmpErr[key] = val;
+              errors._others.push(tmpErr);
+            }
+          });
+        }
+      }
+    }
+
+    return _.isEmpty(errors) ? null : errors;
+  },
+
+  /**
+   * Update the model with all latest values.
+   *
+   * @param {Object} [options]  Options to pass to Model#set (e.g. { silent: true })
+   *
+   * @return {Object}  Validation errors
+   */
+  commit: function(options) {
+    //Validate
+    var errors = this.validate();
+    if (errors){
+    	var vFirstField = this.fields[_.keys(errors)[0]];
+    	if(vFirstField){
+    		$("html, body").animate({
+				scrollTop: vFirstField.$el.position().top-80
+			}, 1100, function(){
+				if(options.focusFirstField) vFirstField.editor.$el.focus();
+			});
+    	}
+    	return errors;
+    }
+
+    //Commit
+    var modelError;
+
+    var setOptions = _.extend({
+      error: function(model, e) {
+        modelError = e;
+      }
+    }, options);
+
+    this.model.set(this.getValue(), setOptions);
+    
+    if (modelError) return modelError;
+  },
+
+  /**
+   * Get all the field values as an object.
+   * Use this method when passing data instead of objects
+   *
+   * @param {String} [key]    Specific field value to get
+   */
+  getValue: function(key) {
+    //Return only given key if specified
+    if (key) return this.fields[key].getValue();
+
+    //Otherwise return entire form
+    var values = {};
+    _.each(this.fields, function(field) {
+      values[field.key] = field.getValue();
+    });
+
+    return values;
+  },
+
+  /**
+   * Update field values, referenced by key
+   *
+   * @param {Object|String} key     New values to set, or property to set
+   * @param val                     Value to set
+   */
+  setValue: function(prop, val) {
+    var data = {};
+    if (typeof prop === 'string') {
+      data[prop] = val;
+    } else {
+      data = prop;
+    }
+
+    var key;
+    for (key in this.schema) {
+      if (data[key] !== undefined) {
+        this.fields[key].setValue(data[key]);
+      }
+    }
+  },
+
+  /**
+   * Returns the editor for a given field key
+   *
+   * @param {String} key
+   *
+   * @return {Editor}
+   */
+  getEditor: function(key) {
+    var field = this.fields[key];
+    if (!field) throw 'Field not found: '+key;
+
+    return field.editor;
+  },
+
+  /**
+   * Gives the first editor in the form focus
+   */
+  focus: function() {
+    if (this.hasFocus) return;
+
+    //Get the first field
+    var fieldset = this.fieldsets[0],
+        field = fieldset.getFieldAt(0);
+
+    if (!field) return;
+
+    //Set focus
+    field.editor.focus();
+  },
+
+  /**
+   * Removes focus from the currently focused editor
+   */
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    var focusedField = _.find(this.fields, function(field) {
+      return field.editor.hasFocus;
+    });
+
+    if (focusedField) focusedField.editor.blur();
+  },
+
+  /**
+   * Manages the hasFocus property
+   *
+   * @param {String} event
+   */
+  trigger: function(event) {
+    if (event === 'focus') {
+      this.hasFocus = true;
+    }
+    else if (event === 'blur') {
+      this.hasFocus = false;
+    }
+
+    return Backbone.View.prototype.trigger.apply(this, arguments);
+  },
+
+  /**
+   * Override default remove function in order to remove embedded views
+   *
+   * TODO: If editors are included directly with data-editors="x", they need to be removed
+   * May be best to use XView to manage adding/removing views
+   */
+  remove: function() {
+    _.each(this.fieldsets, function(fieldset) {
+      fieldset.remove();
+    });
+
+    _.each(this.fields, function(field) {
+      field.remove();
+    });
+
+    Backbone.View.prototype.remove.call(this);
+  }
+
+}, {
+
+  //STATICS
+  template: _.template('\
+    <form data-fieldsets></form>\
+  ', null, this.templateSettings),
+
+  templateSettings: {
+    evaluate: /<%([\s\S]+?)%>/g, 
+    interpolate: /<%=([\s\S]+?)%>/g, 
+    escape: /<%-([\s\S]+?)%>/g
+  },
+
+  editors: {}
+
+});
+
+  
+//==================================================================================================
+//VALIDATORS
+//==================================================================================================
+
+Form.validators = (function() {
+
+  var validators = {};
+
+  validators.errMessages = {
+    required: 'Required',
+    regexp: 'Invalid',
+    email: 'Invalid email address',
+    url: 'Invalid URL',
+    match: _.template('Must match field "<%= field %>"', null, Form.templateSettings)
+  };
+  
+  validators.required = function(options) {
+    options = _.extend({
+      type: 'required',
+      message: this.errMessages.required
+    }, options);
+     
+    return function required(value) {
+      options.value = value;
+      
+      var err = {
+        type: options.type,
+        message: _.isFunction(options.message) ? options.message(options) : options.message
+      };
+      
+      if (value === null || value === undefined || value === false || value === '') return err;
+    };
+  };
+  
+  validators.regexp = function(options) {
+    if (!options.regexp) throw new Error('Missing required "regexp" option for "regexp" validator');
+  
+    options = _.extend({
+      type: 'regexp',
+      message: this.errMessages.regexp
+    }, options);
+    
+    return function regexp(value) {
+      options.value = value;
+      
+      var err = {
+        type: options.type,
+        message: _.isFunction(options.message) ? options.message(options) : options.message
+      };
+      
+      //Don't check empty values (add a 'required' validator for this)
+      if (value === null || value === undefined || value === '') return;
+
+      if (!options.regexp.test(value)) return err;
+    };
+  };
+  
+  validators.email = function(options) {
+    options = _.extend({
+      type: 'email',
+      message: this.errMessages.email,
+      regexp: /^[\w\-]{1,}([\w\-\+.]{1,1}[\w\-]{1,}){0,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/
+    }, options);
+    
+    return validators.regexp(options);
+  };
+  
+  validators.url = function(options) {
+    options = _.extend({
+      type: 'url',
+      message: this.errMessages.url,
+      regexp: /^(http|https):\/\/(([A-Z0-9][A-Z0-9_\-]*)(\.[A-Z0-9][A-Z0-9_\-]*)+)(:(\d+))?\/?/i
+    }, options);
+    
+    return validators.regexp(options);
+  };
+  
+  validators.match = function(options) {
+    if (!options.field) throw new Error('Missing required "field" options for "match" validator');
+    
+    options = _.extend({
+      type: 'match',
+      message: this.errMessages.match
+    }, options);
+    
+    return function match(value, attrs) {
+      options.value = value;
+      
+      var err = {
+        type: options.type,
+        message: _.isFunction(options.message) ? options.message(options) : options.message
+      };
+      
+      //Don't check empty values (add a 'required' validator for this)
+      if (value === null || value === undefined || value === '') return;
+      
+      if (value !== attrs[options.field]) return err;
+    };
+  };
+
+
+  return validators;
+
+})();
+
+
+//==================================================================================================
+//FIELDSET
+//==================================================================================================
+
+Form.Fieldset = Backbone.View.extend({
+
+  /**
+   * Constructor
+   *
+   * Valid fieldset schemas:
+   *   ['field1', 'field2']
+   *   { legend: 'Some Fieldset', fields: ['field1', 'field2'] }
+   *
+   * @param {String[]|Object[]} options.schema      Fieldset schema
+   * @param {Object} options.fields           Form fields
+   */
+  initialize: function(options) {
+    options = options || {};
+
+    //Create the full fieldset schema, merging defaults etc.
+    var schema = this.schema = this.createSchema(options.schema);
+
+    //Store the fields for this fieldset
+    this.fields = _.pick(options.fields, schema.fields);
+    
+    //Override defaults
+    this.template = options.template || this.constructor.template;
+  },
+
+  /**
+   * Creates the full fieldset schema, normalising, merging defaults etc.
+   *
+   * @param {String[]|Object[]} schema
+   *
+   * @return {Object}
+   */
+  createSchema: function(schema) {
+    //Normalise to object
+    if (_.isArray(schema)) {
+      schema = { fields: schema };
+    }
+
+    //Add null legend to prevent template error
+    schema.legend = schema.legend || null;
+
+    return schema;
+  },
+
+  /**
+   * Returns the field for a given index
+   *
+   * @param {Number} index
+   *
+   * @return {Field}
+   */
+  getFieldAt: function(index) {
+    var key = this.schema.fields[index];
+
+    return this.fields[key];
+  },
+
+  /**
+   * Returns data to pass to template
+   *
+   * @return {Object}
+   */
+  templateData: function() {
+    return this.schema;
+  },
+
+  /**
+   * Renders the fieldset and fields
+   *
+   * @return {Fieldset} this
+   */
+  render: function() {
+    var schema = this.schema,
+        fields = this.fields;
+
+    //Render fieldset
+    var $fieldset = $($.trim(this.template(_.result(this, 'templateData'))));
+
+    //Render fields
+    $fieldset.find('[data-fields]').add($fieldset).each(function(i, el) {
+      var $container = $(el),
+          selection = $container.attr('data-fields');
+
+      if (_.isUndefined(selection)) return;
+
+      _.each(fields, function(field) {
+        $container.append(field.render().el);
+      });
+    });
+
+    this.setElement($fieldset);
+
+    return this;
+  },
+
+  /**
+   * Remove embedded views then self
+   */
+  remove: function() {
+    _.each(this.fields, function(field) {
+      field.remove();
+    });
+
+    Backbone.View.prototype.remove.call(this);
+  }
+  
+}, {
+  //STATICS
+
+  template: _.template('\
+    <fieldset data-fields>\
+      <% if (legend) { %>\
+        <legend><%= legend %></legend>\
+      <% } %>\
+    </fieldset>\
+  ', null, Form.templateSettings)
+
+});
+
+
+//==================================================================================================
+//FIELD
+//==================================================================================================
+
+Form.Field = Backbone.View.extend({
+
+  /**
+   * Constructor
+   * 
+   * @param {Object} options.key
+   * @param {Object} options.form
+   * @param {Object} [options.schema]
+   * @param {Backbone.Model} [options.model]
+   * @param {Object} [options.value]
+   * @param {String} [options.idPrefix]
+   * @param {Function} [options.template]
+   * @param {Function} [options.errorClassName]
+   */
+  initialize: function(options) {
+    options = options || {};
+
+    //Store important data
+    _.extend(this, _.pick(options, 'form', 'key', 'model', 'value', 'idPrefix'));
+
+    //Override defaults
+    this.template = options.template || this.constructor.template;
+    this.errorClassName = options.errorClassName || this.constructor.errorClassName;
+
+    //Create the full field schema, merging defaults etc.
+    this.schema = this.createSchema(options.schema);
+
+    //Create editor
+    this.editor = this.createEditor();
+  },
+
+  /**
+   * Creates the full field schema, merging defaults etc.
+   *
+   * @param {Object|String} schema
+   *
+   * @return {Object}
+   */
+  createSchema: function(schema) {
+    if (_.isString(schema)) schema = { type: schema };
+
+    //Set defaults
+    schema = _.extend({
+      type: 'Text',
+      title: this.createTitle()
+    }, schema);
+
+    //Get the real constructor function i.e. if type is a string such as 'Text'
+    schema.type = (_.isString(schema.type)) ? Form.editors[schema.type] : schema.type;
+
+    return schema;
+  },
+
+  /**
+   * Creates the editor specified in the schema; either an editor string name or
+   * a constructor function
+   *
+   * @return {View}
+   */
+  createEditor: function() {
+    var options = _.extend(
+      _.pick(this, 'schema', 'form', 'key', 'model', 'value'),
+      { id: this.createEditorId() }
+    );
+
+    var constructorFn = this.schema.type;
+
+    return new constructorFn(options);
+  },
+
+  /**
+   * Creates the ID that will be assigned to the editor
+   *
+   * @return {String}
+   */
+  createEditorId: function() {
+    var prefix = this.idPrefix,
+        id = this.key;
+
+    //Replace periods with underscores (e.g. for when using paths)
+    id = id.replace(/\./g, '_');
+
+    //If a specific ID prefix is set, use it
+    if (_.isString(prefix) || _.isNumber(prefix)) return prefix + id;
+    if (_.isNull(prefix)) return id;
+
+    //Otherwise, if there is a model use it's CID to avoid conflicts when multiple forms are on the page
+    if (this.model) return this.model.cid + '_' + id;
+
+    return id;
+  },
+
+  /**
+   * Create the default field title (label text) from the key name.
+   * (Converts 'camelCase' to 'Camel Case')
+   *
+   * @return {String}
+   */
+  createTitle: function() {
+    var str = this.key;
+
+    //Add spaces
+    str = str.replace(/([A-Z])/g, ' $1');
+
+    //Uppercase first character
+    str = str.replace(/^./, function(str) { return str.toUpperCase(); });
+
+    return str;
+  },
+
+  /**
+   * Returns the data to be passed to the template
+   *
+   * @return {Object}
+   */
+  templateData: function() {
+    var schema = this.schema;
+
+    return {
+      help: schema.help || '',
+      title: schema.title,
+      fieldAttrs: schema.fieldAttrs,
+      editorAttrs: schema.editorAttrs,
+      key: this.key,
+      editorId: this.editor.id
+    };
+  },
+
+  /**
+   * Render the field and editor
+   *
+   * @return {Field} self
+   */
+  render: function() {
+    var schema = this.schema,
+        editor = this.editor;
+
+    //Render field
+    var $field = $($.trim(this.template(_.result(this, 'templateData'))));
+
+    if (schema.fieldClass) $field.addClass(schema.fieldClass);
+    if (schema.fieldAttrs) $field.attr(schema.fieldAttrs);
+
+    //Render editor
+    $field.find('[data-editor]').add($field).each(function(i, el) {
+      var $container = $(el),
+          selection = $container.attr('data-editor');
+
+      if (_.isUndefined(selection)) return;
+
+      $container.append(editor.render().el);
+    });
+
+    this.setElement($field);
+
+    return this;
+  },
+
+  /**
+   * Check the validity of the field
+   *
+   * @return {String}
+   */
+  validate: function() {
+    var error = this.editor.validate();
+
+    if (error) {
+      this.setError(error.message);
+    } else {
+      this.clearError();
+    }
+
+    return error;
+  },
+
+  /**
+   * Set the field into an error state, adding the error class and setting the error message
+   *
+   * @param {String} msg     Error message
+   */
+  setError: function(msg) {
+    //Nested form editors (e.g. Object) set their errors internally
+    if (this.editor.hasNestedForm) return;
+
+    //Add error CSS class
+    this.$el.addClass(this.errorClassName);
+
+    //Set error message
+    this.$('[data-error]').html(msg);
+  },
+
+  /**
+   * Clear the error state and reset the help message
+   */
+  clearError: function() {
+    //Remove error CSS class
+    this.$el.removeClass(this.errorClassName);
+
+    //Clear error message
+    this.$('[data-error]').empty();
+  },
+
+  /**
+   * Update the model with the new value from the editor
+   *
+   * @return {Mixed}
+   */
+  commit: function() {
+    return this.editor.commit();
+  },
+
+  /**
+   * Get the value from the editor
+   *
+   * @return {Mixed}
+   */
+  getValue: function() {
+    return this.editor.getValue();
+  },
+
+  /**
+   * Set/change the value of the editor
+   *
+   * @param {Mixed} value
+   */
+  setValue: function(value) {
+    this.editor.setValue(value);
+  },
+
+  /**
+   * Give the editor focus
+   */
+  focus: function() {
+    this.editor.focus();
+  },
+
+  /**
+   * Remove focus from the editor
+   */
+  blur: function() {
+    this.editor.blur();
+  },
+
+  /**
+   * Remove the field and editor views
+   */
+  remove: function() {
+    this.editor.remove();
+
+    Backbone.View.prototype.remove.call(this);
+  }
+
+}, {
+  //STATICS
+
+  template: _.template('\
+    <div>\
+      <label for="<%= editorId %>"><%= title %></label>\
+      <div>\
+        <span data-editor></span>\
+        <div data-error></div>\
+        <div><%= help %></div>\
+      </div>\
+    </div>\
+  ', null, Form.templateSettings),
+
+  /**
+   * CSS class name added to the field when there is a validation error
+   */
+  errorClassName: 'error'
+
+});
+
+
+//==================================================================================================
+//NESTEDFIELD
+//==================================================================================================
+
+Form.NestedField = Form.Field.extend({
+
+  template: _.template($.trim('\
+    <div>\
+      <span data-editor></span>\
+      <% if (help) { %>\
+        <div><%= help %></div>\
+      <% } %>\
+      <div data-error></div>\
+    </div>\
+  '), null, Form.templateSettings)
+
+});
+
+/**
+ * Base editor (interface). To be extended, not used directly
+ *
+ * @param {Object} options
+ * @param {String} [options.id]         Editor ID
+ * @param {Model} [options.model]       Use instead of value, and use commit()
+ * @param {String} [options.key]        The model attribute key. Required when using 'model'
+ * @param {Mixed} [options.value]       When not using a model. If neither provided, defaultValue will be used
+ * @param {Object} [options.schema]     Field schema; may be required by some editors
+ * @param {Object} [options.validators] Validators; falls back to those stored on schema
+ * @param {Object} [options.form]       The form
+ */
+Form.Editor = Form.editors.Base = Backbone.View.extend({
+
+  defaultValue: null,
+
+  hasFocus: false,
+
+  initialize: function(options) {
+    var options = options || {};
+
+    //Set initial value
+    if (options.model) {
+      if (!options.key) throw "Missing option: 'key'";
+
+      this.model = options.model;
+
+      this.value = this.model.get(options.key);
+    }
+    else if (options.value) {
+      this.value = options.value;
+    }
+
+    if (this.value === undefined) this.value = this.defaultValue;
+
+    //Store important data
+    _.extend(this, _.pick(options, 'key', 'form'));
+
+    var schema = this.schema = options.schema || {};
+
+    this.validators = options.validators || schema.validators;
+
+    //Main attributes
+    this.$el.attr('id', this.id);
+    this.$el.attr('name', this.getName());
+    if (schema.editorClass) this.$el.addClass(schema.editorClass);
+    if (schema.editorAttrs) this.$el.attr(schema.editorAttrs);
+  },
+
+  /**
+   * Get the value for the form input 'name' attribute
+   *
+   * @return {String}
+   *
+   * @api private
+   */
+  getName: function() {
+    var key = this.key || '';
+
+    //Replace periods with underscores (e.g. for when using paths)
+    return key.replace(/\./g, '_');
+  },
+
+  /**
+   * Get editor value
+   * Extend and override this method to reflect changes in the DOM
+   *
+   * @return {Mixed}
+   */
+  getValue: function() {
+    return this.value;
+  },
+
+  /**
+   * Set editor value
+   * Extend and override this method to reflect changes in the DOM
+   *
+   * @param {Mixed} value
+   */
+  setValue: function(value) {
+    this.value = value;
+  },
+
+  /**
+   * Give the editor focus
+   * Extend and override this method
+   */
+  focus: function() {
+    throw 'Not implemented';
+  },
+  
+  /**
+   * Remove focus from the editor
+   * Extend and override this method
+   */
+  blur: function() {
+    throw 'Not implemented';
+  },
+
+  /**
+   * Update the model with the current value
+   *
+   * @param {Object} [options]              Options to pass to model.set()
+   * @param {Boolean} [options.validate]    Set to true to trigger built-in model validation
+   *
+   * @return {Mixed} error
+   */
+  commit: function(options) {
+    var error = this.validate();
+    if (error) return error;
+
+    this.listenTo(this.model, 'invalid', function(model, e) {
+      error = e;
+    });
+    this.model.set(this.key, this.getValue(), options);
+
+    if (error) return error;
+  },
+
+  /**
+   * Check validity
+   *
+   * @return {Object|Undefined}
+   */
+  validate: function() {
+    var $el = this.$el,
+        error = null,
+        value = this.getValue(),
+        formValues = this.form ? this.form.getValue() : {},
+        validators = this.validators,
+        getValidator = this.getValidator;
+
+    if (validators) {
+      //Run through validators until an error is found
+      _.every(validators, function(validator) {
+        error = getValidator(validator)(value, formValues);
+
+        return error ? false : true;
+      });
+    }
+
+    return error;
+  },
+
+  /**
+   * Set this.hasFocus, or call parent trigger()
+   *
+   * @param {String} event
+   */
+  trigger: function(event) {
+    if (event === 'focus') {
+      this.hasFocus = true;
+    }
+    else if (event === 'blur') {
+      this.hasFocus = false;
+    }
+
+    return Backbone.View.prototype.trigger.apply(this, arguments);
+  },
+
+  /**
+   * Returns a validation function based on the type defined in the schema
+   *
+   * @param {RegExp|String|Function} validator
+   * @return {Function}
+   */
+  getValidator: function(validator) {
+    var validators = Form.validators;
+
+    //Convert regular expressions to validators
+    if (_.isRegExp(validator)) {
+      return validators.regexp({ regexp: validator });
+    }
+    
+    //Use a built-in validator if given a string
+    if (_.isString(validator)) {
+      if (!validators[validator]) throw new Error('Validator "'+validator+'" not found');
+      
+      return validators[validator]();
+    }
+
+    //Functions can be used directly
+    if (_.isFunction(validator)) return validator;
+
+    //Use a customised built-in validator if given an object
+    if (_.isObject(validator) && validator.type) {
+      var config = validator;
+      
+      return validators[config.type](config);
+    }
+    
+    //Unkown validator type
+    throw new Error('Invalid validator: ' + validator);
+  }
+});
+
+/**
+ * Text
+ * 
+ * Text input with focus, blur and change events
+ */
+Form.editors.Text = Form.Editor.extend({
+
+  tagName: 'input',
+
+  defaultValue: '',
+
+  previousValue: '',
+
+  events: {
+    'keyup':    'determineChange',
+    'keypress': function(event) {
+      var self = this;
+      setTimeout(function() {
+        self.determineChange();
+      }, 0);
+    },
+    'select':   function(event) {
+      this.trigger('select', this);
+    },
+    'focus':    function(event) {
+      this.trigger('focus', this);
+    },
+    'blur':     function(event) {
+      var trimmedVal = $.trim(this.$el.val());
+      this.$el.val(trimmedVal);
+      this.trigger('blur', this);
+    }
+  },
+
+  initialize: function(options) {
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    var schema = this.schema;
+
+    //Allow customising text type (email, phone etc.) for HTML5 browsers
+    var type = 'text';
+
+    if (schema && schema.editorAttrs && schema.editorAttrs.type) type = schema.editorAttrs.type;
+    if (schema && schema.dataType) type = schema.dataType;
+
+    this.$el.attr('type', type);
+  },
+
+  /**
+   * Adds the editor to the DOM
+   */
+  render: function() {
+    this.setValue(this.value);
+
+    return this;
+  },
+
+  determineChange: function(event) {
+    var currentValue = this.$el.val();
+    var changed = (currentValue !== this.previousValue);
+
+    if (changed) {
+      this.previousValue = currentValue;
+
+      this.trigger('change', this);
+    }
+  },
+
+  /**
+   * Returns the current editor value
+   * @return {String}
+   */
+  getValue: function() {
+    return this.$el.val();
+  },
+
+  /**
+   * Sets the value of the form element
+   * @param {String}
+   */
+  setValue: function(value) {
+    this.$el.val(value);
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$el.focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$el.blur();
+  },
+
+  select: function() {
+    this.$el.select();
+  }
+
+});
+
+/**
+ * TextArea editor
+ */
+Form.editors.TextArea = Form.editors.Text.extend({
+
+  tagName: 'textarea'
+
+});
+
+/**
+ * Password editor
+ */
+Form.editors.Password = Form.editors.Text.extend({
+
+  initialize: function(options) {
+    Form.editors.Text.prototype.initialize.call(this, options);
+
+    this.$el.attr('type', 'password');
+  }
+
+});
+
+/**
+ * NUMBER
+ * 
+ * Normal text input that only allows a number. Letters etc. are not entered.
+ */
+Form.editors.Number = Form.editors.Text.extend({
+
+  defaultValue: 0,
+
+  events: _.extend({}, Form.editors.Text.prototype.events, {
+    'keypress': 'onKeyPress'
+  }),
+
+  initialize: function(options) {
+    Form.editors.Text.prototype.initialize.call(this, options);
+
+    this.$el.attr('type', 'number');
+    this.$el.attr('step', 'any');
+  },
+
+  /**
+   * Check value is numeric
+   */
+  onKeyPress: function(event) {
+    var self = this,
+        delayedDetermineChange = function() {
+          setTimeout(function() {
+            self.determineChange();
+          }, 0);
+        };
+
+    //Allow backspace
+    if (event.charCode === 0) {
+      delayedDetermineChange();
+      return;
+    }
+
+    //Get the whole new value so that we can prevent things like double decimals points etc.
+    var newVal = this.$el.val() + String.fromCharCode(event.charCode);
+
+    var numeric = /^[0-9]*\.?[0-9]*?$/.test(newVal);
+
+    if (numeric) {
+      delayedDetermineChange();
+    }
+    else {
+      event.preventDefault();
+    }
+  },
+
+  getValue: function() {
+    var value = this.$el.val();
+
+    return value === "" ? null : parseFloat(value, 10);
+  },
+
+  setValue: function(value) {
+    value = (function() {
+      if (_.isNumber(value)) return value;
+
+      if (_.isString(value) && value !== '') return parseFloat(value, 10);
+
+      return null;
+    })();
+
+    if (_.isNaN(value)) value = null;
+
+    Form.editors.Text.prototype.setValue.call(this, value);
+  }
+
+});
+
+/**
+ * Hidden editor
+ */
+Form.editors.Hidden = Form.editors.Base.extend({
+
+  defaultValue: '',
+
+  initialize: function(options) {
+    Form.editors.Text.prototype.initialize.call(this, options);
+
+    this.$el.attr('type', 'hidden');
+  },
+
+  focus: function() {
+
+  },
+
+  blur: function() {
+
+  }
+
+});
+
+/**
+ * Checkbox editor
+ *
+ * Creates a single checkbox, i.e. boolean value
+ */
+Form.editors.Checkbox = Form.editors.Base.extend({
+
+  defaultValue: false,
+
+  tagName: 'input',
+
+  events: {
+    'click':  function(event) {
+      this.trigger('change', this);
+    },
+    'focus':  function(event) {
+      this.trigger('focus', this);
+    },
+    'blur':   function(event) {
+      this.trigger('blur', this);
+    }
+  },
+
+  initialize: function(options) {
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    this.$el.attr('type', 'checkbox');
+  },
+
+  /**
+   * Adds the editor to the DOM
+   */
+  render: function() {
+    this.setValue(this.value);
+
+    return this;
+  },
+
+  getValue: function() {
+    return this.$el.prop('checked');
+  },
+
+  setValue: function(value) {
+    if (value) {
+      this.$el.prop('checked', true);
+    }
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$el.focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$el.blur();
+  }
+
+});
+
+/**
+ * Select editor
+ *
+ * Renders a <select> with given options
+ *
+ * Requires an 'options' value on the schema.
+ *  Can be an array of options, a function that calls back with the array of options, a string of HTML
+ *  or a Backbone collection. If a collection, the models must implement a toString() method
+ */
+Form.editors.Select = Form.editors.Base.extend({
+
+  tagName: 'select',
+
+  events: {
+    'change': function(event) {
+      this.trigger('change', this);
+    },
+    'focus':  function(event) {
+      this.trigger('focus', this);
+    },
+    'blur':   function(event) {
+      this.trigger('blur', this);
+    }
+  },
+
+  initialize: function(options) {
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    if (!this.schema || !this.schema.options) throw "Missing required 'schema.options'";
+  },
+
+  render: function() {
+    this.setOptions(this.schema.options);
+
+    return this;
+  },
+
+  /**
+   * Sets the options that populate the <select>
+   *
+   * @param {Mixed} options
+   */
+  setOptions: function(options) {
+    var self = this;
+
+    //If a collection was passed, check if it needs fetching
+    if (options instanceof Backbone.Collection) {
+      var collection = options;
+
+      //Don't do the fetch if it's already populated
+      if (collection.length > 0) {
+        this.renderOptions(options);
+      } else {
+        collection.fetch({
+          success: function(collection) {
+            self.renderOptions(options);
+          }
+        });
+      }
+    }
+
+    //If a function was passed, run it to get the options
+    else if (_.isFunction(options)) {
+      options(function(result) {
+        self.renderOptions(result);
+      }, self);
+    }
+
+    //Otherwise, ready to go straight to renderOptions
+    else {
+      this.renderOptions(options);
+    }
+  },
+
+  /**
+   * Adds the <option> html to the DOM
+   * @param {Mixed}   Options as a simple array e.g. ['option1', 'option2']
+   *                      or as an array of objects e.g. [{val: 543, label: 'Title for object 543'}]
+   *                      or as a string of <option> HTML to insert into the <select>
+   */
+  renderOptions: function(options) {
+    var $select = this.$el,
+        html;
+
+    html = this._getOptionsHtml(options);
+
+    //Insert options
+    $select.html(html);
+
+    //Select correct option
+    this.setValue(this.value);
+  },
+
+  _getOptionsHtml: function(options) {
+    var html;
+    //Accept string of HTML
+    if (_.isString(options)) {
+      html = options;
+    }
+
+    //Or array
+    else if (_.isArray(options)) {
+      html = this._arrayToHtml(options);
+    }
+
+    //Or Backbone collection
+    else if (options instanceof Backbone.Collection) {
+      html = this._collectionToHtml(options);
+    }
+
+    else if (_.isFunction(options)) {
+      var newOptions;
+      
+      options(function(opts) {
+        newOptions = opts;
+      }, this);
+      
+      html = this._getOptionsHtml(newOptions);
+    }
+
+    return html;
+  },
+
+  getValue: function() {
+    return this.$el.val();
+  },
+
+  setValue: function(value) {
+    this.$el.val(value);
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$el.focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$el.blur();
+  },
+
+  /**
+   * Transforms a collection into HTML ready to use in the renderOptions method
+   * @param {Backbone.Collection}
+   * @return {String}
+   */
+  _collectionToHtml: function(collection) {
+    //Convert collection to array first
+    var array = [];
+    collection.each(function(model) {
+      array.push({ val: model.id, label: model.toString() });
+    });
+
+    //Now convert to HTML
+    var html = this._arrayToHtml(array);
+
+    return html;
+  },
+
+  /**
+   * Create the <option> HTML
+   * @param {Array}   Options as a simple array e.g. ['option1', 'option2']
+   *                      or as an array of objects e.g. [{val: 543, label: 'Title for object 543'}]
+   * @return {String} HTML
+   */
+  _arrayToHtml: function(array) {
+    var html = [];
+
+    //Generate HTML
+    _.each(array, function(option) {
+      if (_.isObject(option)) {
+        if (option.group) {
+          html.push('<optgroup label="'+option.group+'">');
+          html.push(this._getOptionsHtml(option.options))
+          html.push('</optgroup>');
+        } else {
+          var val = (option.val || option.val === 0) ? option.val : '';
+          html.push('<option value="'+val+'">'+option.label+'</option>');
+        }
+      }
+      else {
+        html.push('<option>'+option+'</option>');
+      }
+    }, this);
+
+    return html.join('');
+  }
+
+});
+
+/**
+ * Radio editor
+ *
+ * Renders a <ul> with given options represented as <li> objects containing radio buttons
+ *
+ * Requires an 'options' value on the schema.
+ *  Can be an array of options, a function that calls back with the array of options, a string of HTML
+ *  or a Backbone collection. If a collection, the models must implement a toString() method
+ */
+Form.editors.Radio = Form.editors.Select.extend({
+
+  tagName: 'ul',
+
+  events: {
+    'change input[type=radio]': function() {
+      this.trigger('change', this);
+    },
+    'focus input[type=radio]': function() {
+      if (this.hasFocus) return;
+      this.trigger('focus', this);
+    },
+    'blur input[type=radio]': function() {
+      if (!this.hasFocus) return;
+      var self = this;
+      setTimeout(function() {
+        if (self.$('input[type=radio]:focus')[0]) return;
+        self.trigger('blur', self);
+      }, 0);
+    }
+  },
+
+  getValue: function() {
+    return this.$('input[type=radio]:checked').val();
+  },
+
+  setValue: function(value) {
+    this.$('input[type=radio]').val([value]);
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    var checked = this.$('input[type=radio]:checked');
+    if (checked[0]) {
+      checked.focus();
+      return;
+    }
+
+    this.$('input[type=radio]').first().focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$('input[type=radio]:focus').blur();
+  },
+
+  /**
+   * Create the radio list HTML
+   * @param {Array}   Options as a simple array e.g. ['option1', 'option2']
+   *                      or as an array of objects e.g. [{val: 543, label: 'Title for object 543'}]
+   * @return {String} HTML
+   */
+  _arrayToHtml: function (array) {
+    var html = [];
+    var self = this;
+
+    _.each(array, function(option, index) {
+      var itemHtml = '<li>';
+      if (_.isObject(option)) {
+        var val = (option.val || option.val === 0) ? option.val : '';
+        itemHtml += ('<input type="radio" name="'+self.id+'" value="'+val+'" id="'+self.id+'-'+index+'" />');
+        itemHtml += ('<label for="'+self.id+'-'+index+'">'+option.label+'</label>');
+      }
+      else {
+        itemHtml += ('<input type="radio" name="'+self.id+'" value="'+option+'" id="'+self.id+'-'+index+'" />');
+        itemHtml += ('<label for="'+self.id+'-'+index+'">'+option+'</label>');
+      }
+      itemHtml += '</li>';
+      html.push(itemHtml);
+    });
+
+    return html.join('');
+  }
+
+});
+
+/**
+ * Checkboxes editor
+ *
+ * Renders a <ul> with given options represented as <li> objects containing checkboxes
+ *
+ * Requires an 'options' value on the schema.
+ *  Can be an array of options, a function that calls back with the array of options, a string of HTML
+ *  or a Backbone collection. If a collection, the models must implement a toString() method
+ */
+Form.editors.Checkboxes = Form.editors.Select.extend({
+
+  tagName: 'ul',
+
+  events: {
+    'click input[type=checkbox]': function() {
+      this.trigger('change', this);
+    },
+    'focus input[type=checkbox]': function() {
+      if (this.hasFocus) return;
+      this.trigger('focus', this);
+    },
+    'blur input[type=checkbox]':  function() {
+      if (!this.hasFocus) return;
+      var self = this;
+      setTimeout(function() {
+        if (self.$('input[type=checkbox]:focus')[0]) return;
+        self.trigger('blur', self);
+      }, 0);
+    }
+  },
+
+  getValue: function() {
+    var values = [];
+    this.$('input[type=checkbox]:checked').each(function() {
+      values.push($(this).val());
+    });
+    return values;
+  },
+
+  setValue: function(values) {
+    if (!_.isArray(values)) values = [values];
+    this.$('input[type=checkbox]').val(values);
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$('input[type=checkbox]').first().focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$('input[type=checkbox]:focus').blur();
+  },
+
+  /**
+   * Create the checkbox list HTML
+   * @param {Array}   Options as a simple array e.g. ['option1', 'option2']
+   *                      or as an array of objects e.g. [{val: 543, label: 'Title for object 543'}]
+   * @return {String} HTML
+   */
+  _arrayToHtml: function (array) {
+    var html = [];
+    var self = this;
+
+    _.each(array, function(option, index) {
+      var itemHtml = '<li>';
+      if (_.isObject(option)) {
+        var val = (option.val || option.val === 0) ? option.val : '';
+        itemHtml += ('<input type="checkbox" name="'+self.id+'" value="'+val+'" id="'+self.id+'-'+index+'" />');
+        itemHtml += ('<label for="'+self.id+'-'+index+'">'+option.label+'</label>');
+      }
+      else {
+        itemHtml += ('<input type="checkbox" name="'+self.id+'" value="'+option+'" id="'+self.id+'-'+index+'" />');
+        itemHtml += ('<label for="'+self.id+'-'+index+'">'+option+'</label>');
+      }
+      itemHtml += '</li>';
+      html.push(itemHtml);
+    });
+
+    return html.join('');
+  }
+
+});
+
+/**
+ * Object editor
+ *
+ * Creates a child form. For editing Javascript objects
+ *
+ * @param {Object} options
+ * @param {Form} options.form                 The form this editor belongs to; used to determine the constructor for the nested form
+ * @param {Object} options.schema             The schema for the object
+ * @param {Object} options.schema.subSchema   The schema for the nested form
+ */
+Form.editors.Object = Form.editors.Base.extend({
+  //Prevent error classes being set on the main control; they are internally on the individual fields
+  hasNestedForm: true,
+
+  initialize: function(options) {
+    //Set default value for the instance so it's not a shared object
+    this.value = {};
+
+    //Init
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    //Check required options
+    if (!this.form) throw 'Missing required option "form"';
+    if (!this.schema.subSchema) throw new Error("Missing required 'schema.subSchema' option for Object editor");
+  },
+
+  render: function() {
+    //Get the constructor for creating the nested form; i.e. the same constructor as used by the parent form
+    var NestedForm = this.form.constructor;
+
+    //Create the nested form
+    this.nestedForm = new NestedForm({
+      schema: this.schema.subSchema,
+      data: this.value,
+      idPrefix: this.id + '_',
+      Field: NestedForm.NestedField
+    });
+
+    this._observeFormEvents();
+
+    this.$el.html(this.nestedForm.render().el);
+
+    if (this.hasFocus) this.trigger('blur', this);
+
+    return this;
+  },
+
+  getValue: function() {
+    if (this.nestedForm) return this.nestedForm.getValue();
+
+    return this.value;
+  },
+
+  setValue: function(value) {
+    this.value = value;
+
+    this.render();
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.nestedForm.focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.nestedForm.blur();
+  },
+
+  remove: function() {
+    this.nestedForm.remove();
+
+    Backbone.View.prototype.remove.call(this);
+  },
+
+  validate: function() {
+    return this.nestedForm.validate();
+  },
+
+  _observeFormEvents: function() {
+    if (!this.nestedForm) return;
+    
+    this.nestedForm.on('all', function() {
+      // args = ["key:change", form, fieldEditor]
+      var args = _.toArray(arguments);
+      args[1] = this;
+      // args = ["key:change", this=objectEditor, fieldEditor]
+
+      this.trigger.apply(this, args);
+    }, this);
+  }
+
+});
+
+/**
+ * NestedModel editor
+ *
+ * Creates a child form. For editing nested Backbone models
+ *
+ * Special options:
+ *   schema.model:   Embedded model constructor
+ */
+Form.editors.NestedModel = Form.editors.Object.extend({
+  initialize: function(options) {
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    if (!this.form) throw 'Missing required option "form"';
+    if (!options.schema.model) throw 'Missing required "schema.model" option for NestedModel editor';
+  },
+
+  render: function() {
+    //Get the constructor for creating the nested form; i.e. the same constructor as used by the parent form
+    var NestedForm = this.form.constructor;
+
+    var data = this.value || {},
+        key = this.key,
+        nestedModel = this.schema.model;
+
+    //Wrap the data in a model if it isn't already a model instance
+    var modelInstance = (data.constructor === nestedModel) ? data : new nestedModel(data);
+
+    this.nestedForm = new NestedForm({
+      model: modelInstance,
+      idPrefix: this.id + '_',
+      fieldTemplate: 'nestedField'
+    });
+
+    this._observeFormEvents();
+
+    //Render form
+    this.$el.html(this.nestedForm.render().el);
+
+    if (this.hasFocus) this.trigger('blur', this);
+
+    return this;
+  },
+
+  /**
+   * Update the embedded model, checking for nested validation errors and pass them up
+   * Then update the main model if all OK
+   *
+   * @return {Error|null} Validation error or null
+   */
+  commit: function() {
+    var error = this.nestedForm.commit();
+    if (error) {
+      this.$el.addClass('error');
+      return error;
+    }
+
+    return Form.editors.Object.prototype.commit.call(this);
+  }
+
+});
+
+/**
+ * Date editor
+ *
+ * Schema options
+ * @param {Number|String} [options.schema.yearStart]  First year in list. Default: 100 years ago
+ * @param {Number|String} [options.schema.yearEnd]    Last year in list. Default: current year
+ *
+ * Config options (if not set, defaults to options stored on the main Date class)
+ * @param {Boolean} [options.showMonthNames]  Use month names instead of numbers. Default: true
+ * @param {String[]} [options.monthNames]     Month names. Default: Full English names
+ */
+Form.editors.Date = Form.editors.Base.extend({
+
+  events: {
+    'change select':  function() {
+      this.updateHidden();
+      this.trigger('change', this);
+    },
+    'focus select':   function() {
+      if (this.hasFocus) return;
+      this.trigger('focus', this);
+    },
+    'blur select':    function() {
+      if (!this.hasFocus) return;
+      var self = this;
+      setTimeout(function() {
+        if (self.$('select:focus')[0]) return;
+        self.trigger('blur', self);
+      }, 0);
+    }
+  },
+
+  initialize: function(options) {
+    options = options || {};
+
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    var Self = Form.editors.Date,
+        today = new Date();
+
+    //Option defaults
+    this.options = _.extend({
+      monthNames: Self.monthNames,
+      showMonthNames: Self.showMonthNames
+    }, options);
+
+    //Schema defaults
+    this.schema = _.extend({
+      yearStart: today.getFullYear() - 100,
+      yearEnd: today.getFullYear()
+    }, options.schema || {});
+
+    //Cast to Date
+    if (this.value && !_.isDate(this.value)) {
+      this.value = new Date(this.value);
+    }
+
+    //Set default date
+    if (!this.value) {
+      var date = new Date();
+      date.setSeconds(0);
+      date.setMilliseconds(0);
+
+      this.value = date;
+    }
+
+    //Template
+    this.template = options.template || this.constructor.template;
+  },
+
+  render: function() {
+    var options = this.options,
+        schema = this.schema;
+
+    var datesOptions = _.map(_.range(1, 32), function(date) {
+      return '<option value="'+date+'">' + date + '</option>';
+    });
+
+    var monthsOptions = _.map(_.range(0, 12), function(month) {
+      var value = (options.showMonthNames)
+          ? options.monthNames[month]
+          : (month + 1);
+
+      return '<option value="'+month+'">' + value + '</option>';
+    });
+
+    var yearRange = (schema.yearStart < schema.yearEnd)
+      ? _.range(schema.yearStart, schema.yearEnd + 1)
+      : _.range(schema.yearStart, schema.yearEnd - 1, -1);
+
+    var yearsOptions = _.map(yearRange, function(year) {
+      return '<option value="'+year+'">' + year + '</option>';
+    });
+
+    //Render the selects
+    var $el = $($.trim(this.template({
+      dates: datesOptions.join(''),
+      months: monthsOptions.join(''),
+      years: yearsOptions.join('')
+    })));
+
+    //Store references to selects
+    this.$date = $el.find('[data-type="date"]');
+    this.$month = $el.find('[data-type="month"]');
+    this.$year = $el.find('[data-type="year"]');
+
+    //Create the hidden field to store values in case POSTed to server
+    this.$hidden = $('<input type="hidden" name="'+this.key+'" />');
+    $el.append(this.$hidden);
+
+    //Set value on this and hidden field
+    this.setValue(this.value);
+
+    //Remove the wrapper tag
+    this.setElement($el);
+    this.$el.attr('id', this.id);
+    this.$el.attr('name', this.getName());
+
+    if (this.hasFocus) this.trigger('blur', this);
+
+    return this;
+  },
+
+  /**
+   * @return {Date}   Selected date
+   */
+  getValue: function() {
+    var year = this.$year.val(),
+        month = this.$month.val(),
+        date = this.$date.val();
+
+    if (!year || !month || !date) return null;
+
+    return new Date(year, month, date);
+  },
+
+  /**
+   * @param {Date} date
+   */
+  setValue: function(date) {
+    this.$date.val(date.getDate());
+    this.$month.val(date.getMonth());
+    this.$year.val(date.getFullYear());
+
+    this.updateHidden();
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$('select').first().focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$('select:focus').blur();
+  },
+
+  /**
+   * Update the hidden input which is maintained for when submitting a form
+   * via a normal browser POST
+   */
+  updateHidden: function() {
+    var val = this.getValue();
+
+    if (_.isDate(val)) val = val.toISOString();
+
+    this.$hidden.val(val);
+  }
+
+}, {
+  //STATICS
+  template: _.template('\
+    <div>\
+      <select data-type="date"><%= dates %></select>\
+      <select data-type="month"><%= months %></select>\
+      <select data-type="year"><%= years %></select>\
+    </div>\
+  ', null, Form.templateSettings),
+
+  //Whether to show month names instead of numbers
+  showMonthNames: true,
+
+  //Month names to use if showMonthNames is true
+  //Replace for localisation, e.g. Form.editors.Date.monthNames = ['Janvier', 'Fevrier'...]
+  monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
+});
+
+/**
+ * DateTime editor
+ *
+ * @param {Editor} [options.DateEditor]           Date editor view to use (not definition)
+ * @param {Number} [options.schema.minsInterval]  Interval between minutes. Default: 15
+ */
+Form.editors.DateTime = Form.editors.Base.extend({
+
+  events: {
+    'change select':  function() {
+      this.updateHidden();
+      this.trigger('change', this);
+    },
+    'focus select':   function() {
+      if (this.hasFocus) return;
+      this.trigger('focus', this);
+    },
+    'blur select':    function() {
+      if (!this.hasFocus) return;
+      var self = this;
+      setTimeout(function() {
+        if (self.$('select:focus')[0]) return;
+        self.trigger('blur', self);
+      }, 0);
+    }
+  },
+
+  initialize: function(options) {
+    options = options || {};
+
+    Form.editors.Base.prototype.initialize.call(this, options);
+
+    //Option defaults
+    this.options = _.extend({
+      DateEditor: Form.editors.DateTime.DateEditor
+    }, options);
+
+    //Schema defaults
+    this.schema = _.extend({
+      minsInterval: 15
+    }, options.schema || {});
+
+    //Create embedded date editor
+    this.dateEditor = new this.options.DateEditor(options);
+
+    this.value = this.dateEditor.value;
+
+    //Template
+    this.template = options.template || this.constructor.template;
+  },
+
+  render: function() {
+    function pad(n) {
+      return n < 10 ? '0' + n : n;
+    }
+
+    var schema = this.schema;
+
+    //Create options
+    var hoursOptions = _.map(_.range(0, 24), function(hour) {
+      return '<option value="'+hour+'">' + pad(hour) + '</option>';
+    });
+
+    var minsOptions = _.map(_.range(0, 60, schema.minsInterval), function(min) {
+      return '<option value="'+min+'">' + pad(min) + '</option>';
+    });
+
+    //Render time selects
+    var $el = $($.trim(this.template({
+      hours: hoursOptions.join(),
+      mins: minsOptions.join()
+    })));
+
+    //Include the date editor
+    $el.find('[data-date]').append(this.dateEditor.render().el);
+
+    //Store references to selects
+    this.$hour = $el.find('select[data-type="hour"]');
+    this.$min = $el.find('select[data-type="min"]');
+
+    //Get the hidden date field to store values in case POSTed to server
+    this.$hidden = $el.find('input[type="hidden"]');
+
+    //Set time
+    this.setValue(this.value);
+
+    this.setElement($el);
+    this.$el.attr('id', this.id);
+    this.$el.attr('name', this.getName());
+
+    if (this.hasFocus) this.trigger('blur', this);
+
+    return this;
+  },
+
+  /**
+   * @return {Date}   Selected datetime
+   */
+  getValue: function() {
+    var date = this.dateEditor.getValue();
+
+    var hour = this.$hour.val(),
+        min = this.$min.val();
+
+    if (!date || !hour || !min) return null;
+
+    date.setHours(hour);
+    date.setMinutes(min);
+
+    return date;
+  },
+
+  /**
+   * @param {Date}
+   */
+  setValue: function(date) {
+    if (!_.isDate(date)) date = new Date(date);
+
+    this.dateEditor.setValue(date);
+
+    this.$hour.val(date.getHours());
+    this.$min.val(date.getMinutes());
+
+    this.updateHidden();
+  },
+
+  focus: function() {
+    if (this.hasFocus) return;
+
+    this.$('select').first().focus();
+  },
+
+  blur: function() {
+    if (!this.hasFocus) return;
+
+    this.$('select:focus').blur();
+  },
+
+  /**
+   * Update the hidden input which is maintained for when submitting a form
+   * via a normal browser POST
+   */
+  updateHidden: function() {
+    var val = this.getValue();
+    if (_.isDate(val)) val = val.toISOString();
+
+    this.$hidden.val(val);
+  },
+
+  /**
+   * Remove the Date editor before removing self
+   */
+  remove: function() {
+    this.dateEditor.remove();
+
+    Form.editors.Base.prototype.remove.call(this);
+  }
+
+}, {
+  //STATICS
+  template: _.template('\
+    <div class="bbf-datetime">\
+      <div class="bbf-date-container" data-date></div>\
+      <select data-type="hour"><%= hours %></select>\
+      :\
+      <select data-type="min"><%= mins %></select>\
+    </div>\
+  ', null, Form.templateSettings),
+
+  //The date editor to use (constructor function, not instance)
+  DateEditor: Form.editors.Date
+});
+
+
+
+  //Metadata
+  Form.VERSION = '0.12.0';
+
+  //Exports
+  Backbone.Form = Form;
+
+  return Form;
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.min.js
new file mode 100644
index 0000000..36e34bf
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/backbone-forms.min.js
@@ -0,0 +1 @@
+define(["jquery","underscore","backbone"],function(e,t,n){var r=n.View.extend({initialize:function(e){var n=this;e=e||{};var r=this.schema=function(){if(e.schema)return t.result(e,"schema");var r=e.model;return r&&r.schema?t.isFunction(r.schema)?r.schema():r.schema:n.schema?t.isFunction(n.schema)?n.schema():n.schema:{}}();t.extend(this,t.pick(e,"model","data","idPrefix"));var i=this.constructor;this.template=e.template||i.template,this.Fieldset=e.Fieldset||i.Fieldset,this.Field=e.Field||i.Field,this.NestedField=e.NestedField||i.NestedField;var s=this.selectedFields=e.fields||t.keys(r),o=this.fields={};t.each(s,function(e){var t=r[e];o[e]=this.createField(e,t)},this);var u=e.fieldsets||[s],a=this.fieldsets=[];t.each(u,function(e){this.fieldsets.push(this.createFieldset(e))},this)},createFieldset:function(e){var t={schema:e,fields:this.fields};return new this.Fieldset(t)},createField:function(e,t){var n={form:this,key:e,schema:t,idPrefix:this.idPrefix};this.model?n.model=this.model:th
 is.data?n.value=this.data[e]:n.value=null;var r=new this.Field(n);return this.listenTo(r.editor,"all",this.handleEditorEvent),r},handleEditorEvent:function(e,n){var r=n.key+":"+e;this.trigger.call(this,r,this,n);switch(e){case"change":this.trigger("change",this);break;case"focus":this.hasFocus||this.trigger("focus",this);break;case"blur":if(this.hasFocus){var i=this;setTimeout(function(){var e=t.find(i.fields,function(e){return e.editor.hasFocus});e||i.trigger("blur",i)},0)}}},render:function(){var n=this,r=this.fields,i=e(e.trim(this.template(t.result(this,"templateData"))));return i.find("[data-editors]").add(i).each(function(i,s){var o=e(s),u=o.attr("data-editors");if(t.isUndefined(u))return;var a=u=="*"?n.selectedFields||t.keys(r):u.split(",");t.each(a,function(e){var t=r[e];o.append(t.editor.render().el)})}),i.find("[data-fields]").add(i).each(function(i,s){var o=e(s),u=o.attr("data-fields");if(t.isUndefined(u))return;var a=u=="*"?n.selectedFields||t.keys(r):u.split(",");t.each
 (a,function(e){var t=r[e];o.append(t.render().el)})}),i.find("[data-fieldsets]").add(i).each(function(r,i){var s=e(i),o=s.attr("data-fieldsets");if(t.isUndefined(o))return;t.each(n.fieldsets,function(e){s.append(e.render().el)})}),this.setElement(i),this},validate:function(){var e=this,n=this.fields,r=this.model,i={};t.each(n,function(e){var t=e.validate();t&&(i[e.key]=t)});if(r&&r.validate){var s=r.validate(this.getValue());if(s){var o=t.isObject(s)&&!t.isArray(s);o||(i._others=i._others||[],i._others.push(s)),o&&t.each(s,function(e,t){if(n[t]&&!i[t])n[t].setError(e),i[t]=e;else{i._others=i._others||[];var r={};r[t]=e,i._others.push(r)}})}}return t.isEmpty(i)?null:i},commit:function(e){var n=this.validate();if(n)return n;var r,i=t.extend({error:function(e,t){r=t}},e);this.model.set(this.getValue(),i);if(r)return r},getValue:function(e){if(e)return this.fields[e].getValue();var n={};return t.each(this.fields,function(e){n[e.key]=e.getValue()}),n},setValue:function(e,t){var n={};type
 of e=="string"?n[e]=t:n=e;var r;for(r in this.schema)n[r]!==undefined&&this.fields[r].setValue(n[r])},getEditor:function(e){var t=this.fields[e];if(!t)throw"Field not found: "+e;return t.editor},focus:function(){if(this.hasFocus)return;var e=this.fieldsets[0],t=e.getFieldAt(0);if(!t)return;t.editor.focus()},blur:function(){if(!this.hasFocus)return;var e=t.find(this.fields,function(e){return e.editor.hasFocus});e&&e.editor.blur()},trigger:function(e){return e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),n.View.prototype.trigger.apply(this,arguments)},remove:function(){t.each(this.fieldsets,function(e){e.remove()}),t.each(this.fields,function(e){e.remove()}),n.View.prototype.remove.call(this)}},{template:t.template("    <form data-fieldsets></form>  ",null,this.templateSettings),templateSettings:{evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},editors:{}});return r.validators=function(){var e={};return e.errMessages={required:"Required
 ",regexp:"Invalid",email:"Invalid email address",url:"Invalid URL",match:t.template('Must match field "<%= field %>"',null,r.templateSettings)},e.required=function(e){return e=t.extend({type:"required",message:this.errMessages.required},e),function(r){e.value=r;var i={type:e.type,message:t.isFunction(e.message)?e.message(e):e.message};if(r===null||r===undefined||r===!1||r==="")return i}},e.regexp=function(e){if(!e.regexp)throw new Error('Missing required "regexp" option for "regexp" validator');return e=t.extend({type:"regexp",message:this.errMessages.regexp},e),function(r){e.value=r;var i={type:e.type,message:t.isFunction(e.message)?e.message(e):e.message};if(r===null||r===undefined||r==="")return;if(!e.regexp.test(r))return i}},e.email=function(n){return n=t.extend({type:"email",message:this.errMessages.email,regexp:/^[\w\-]{1,}([\w\-\+.]{1,1}[\w\-]{1,}){0,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/},n),e.regexp(n)},e.url=function(n){return n=t.extend({type:"url",message:this.errMessag
 es.url,regexp:/^(http|https):\/\/(([A-Z0-9][A-Z0-9_\-]*)(\.[A-Z0-9][A-Z0-9_\-]*)+)(:(\d+))?\/?/i},n),e.regexp(n)},e.match=function(e){if(!e.field)throw new Error('Missing required "field" options for "match" validator');return e=t.extend({type:"match",message:this.errMessages.match},e),function(r,i){e.value=r;var s={type:e.type,message:t.isFunction(e.message)?e.message(e):e.message};if(r===null||r===undefined||r==="")return;if(r!==i[e.field])return s}},e}(),r.Fieldset=n.View.extend({initialize:function(e){e=e||{};var n=this.schema=this.createSchema(e.schema);this.fields=t.pick(e.fields,n.fields),this.template=e.template||this.constructor.template},createSchema:function(e){return t.isArray(e)&&(e={fields:e}),e.legend=e.legend||null,e},getFieldAt:function(e){var t=this.schema.fields[e];return this.fields[t]},templateData:function(){return this.schema},render:function(){var n=this.schema,r=this.fields,i=e(e.trim(this.template(t.result(this,"templateData"))));return i.find("[data-fields
 ]").add(i).each(function(n,i){var s=e(i),o=s.attr("data-fields");if(t.isUndefined(o))return;t.each(r,function(e){s.append(e.render().el)})}),this.setElement(i),this},remove:function(){t.each(this.fields,function(e){e.remove()}),n.View.prototype.remove.call(this)}},{template:t.template("    <fieldset data-fields>      <% if (legend) { %>        <legend><%= legend %></legend>      <% } %>    </fieldset>  ",null,r.templateSettings)}),r.Field=n.View.extend({initialize:function(e){e=e||{},t.extend(this,t.pick(e,"form","key","model","value","idPrefix")),this.template=e.template||this.constructor.template,this.errorClassName=e.errorClassName||this.constructor.errorClassName,this.schema=this.createSchema(e.schema),this.editor=this.createEditor()},createSchema:function(e){return t.isString(e)&&(e={type:e}),e=t.extend({type:"Text",title:this.createTitle()},e),e.type=t.isString(e.type)?r.editors[e.type]:e.type,e},createEditor:function(){var e=t.extend(t.pick(this,"schema","form","key","model",
 "value"),{id:this.createEditorId()}),n=this.schema.type;return new n(e)},createEditorId:function(){var e=this.idPrefix,n=this.key;return n=n.replace(/\./g,"_"),t.isString(e)||t.isNumber(e)?e+n:t.isNull(e)?n:this.model?this.model.cid+"_"+n:n},createTitle:function(){var e=this.key;return e=e.replace(/([A-Z])/g," $1"),e=e.replace(/^./,function(e){return e.toUpperCase()}),e},templateData:function(){var e=this.schema;return{help:e.help||"",title:e.title,fieldAttrs:e.fieldAttrs,editorAttrs:e.editorAttrs,key:this.key,editorId:this.editor.id}},render:function(){var n=this.schema,r=this.editor,i=e(e.trim(this.template(t.result(this,"templateData"))));return n.fieldClass&&i.addClass(n.fieldClass),n.fieldAttrs&&i.attr(n.fieldAttrs),i.find("[data-editor]").add(i).each(function(n,i){var s=e(i),o=s.attr("data-editor");if(t.isUndefined(o))return;s.append(r.render().el)}),this.setElement(i),this},validate:function(){var e=this.editor.validate();return e?this.setError(e.message):this.clearError(),e}
 ,setError:function(e){if(this.editor.hasNestedForm)return;this.$el.addClass(this.errorClassName),this.$("[data-error]").html(e)},clearError:function(){this.$el.removeClass(this.errorClassName),this.$("[data-error]").empty()},commit:function(){return this.editor.commit()},getValue:function(){return this.editor.getValue()},setValue:function(e){this.editor.setValue(e)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},remove:function(){this.editor.remove(),n.View.prototype.remove.call(this)}},{template:t.template('    <div>      <label for="<%= editorId %>"><%= title %></label>      <div>        <span data-editor></span>        <div data-error></div>        <div><%= help %></div>      </div>    </div>  ',null,r.templateSettings),errorClassName:"error"}),r.NestedField=r.Field.extend({template:t.template(e.trim("    <div>      <span data-editor></span>      <% if (help) { %>        <div><%= help %></div>      <% } %>      <div data-error></div>    </div>  "),null,
 r.templateSettings)}),r.Editor=r.editors.Base=n.View.extend({defaultValue:null,hasFocus:!1,initialize:function(e){var e=e||{};if(e.model){if(!e.key)throw"Missing option: 'key'";this.model=e.model,this.value=this.model.get(e.key)}else e.value&&(this.value=e.value);this.value===undefined&&(this.value=this.defaultValue),t.extend(this,t.pick(e,"key","form"));var n=this.schema=e.schema||{};this.validators=e.validators||n.validators,this.$el.attr("id",this.id),this.$el.attr("name",this.getName()),n.editorClass&&this.$el.addClass(n.editorClass),n.editorAttrs&&this.$el.attr(n.editorAttrs)},getName:function(){var e=this.key||"";return e.replace(/\./g,"_")},getValue:function(){return this.value},setValue:function(e){this.value=e},focus:function(){throw"Not implemented"},blur:function(){throw"Not implemented"},commit:function(e){var t=this.validate();if(t)return t;this.listenTo(this.model,"invalid",function(e,n){t=n}),this.model.set(this.key,this.getValue(),e);if(t)return t},validate:function(
 ){var e=this.$el,n=null,r=this.getValue(),i=this.form?this.form.getValue():{},s=this.validators,o=this.getValidator;return s&&t.every(s,function(e){return n=o(e)(r,i),n?!1:!0}),n},trigger:function(e){return e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),n.View.prototype.trigger.apply(this,arguments)},getValidator:function(e){var n=r.validators;if(t.isRegExp(e))return n.regexp({regexp:e});if(t.isString(e)){if(!n[e])throw new Error('Validator "'+e+'" not found');return n[e]()}if(t.isFunction(e))return e;if(t.isObject(e)&&e.type){var i=e;return n[i.type](i)}throw new Error("Invalid validator: "+e)}}),r.editors.Text=r.Editor.extend({tagName:"input",defaultValue:"",previousValue:"",events:{keyup:"determineChange",keypress:function(e){var t=this;setTimeout(function(){t.determineChange()},0)},select:function(e){this.trigger("select",this)},focus:function(e){this.trigger("focus",this)},blur:function(e){this.trigger("blur",this)}},initialize:function(e){r.editors.Base.prototype.
 initialize.call(this,e);var t=this.schema,n="text";t&&t.editorAttrs&&t.editorAttrs.type&&(n=t.editorAttrs.type),t&&t.dataType&&(n=t.dataType),this.$el.attr("type",n)},render:function(){return this.setValue(this.value),this},determineChange:function(e){var t=this.$el.val(),n=t!==this.previousValue;n&&(this.previousValue=t,this.trigger("change",this))},getValue:function(){return this.$el.val()},setValue:function(e){this.$el.val(e)},focus:function(){if(this.hasFocus)return;this.$el.focus()},blur:function(){if(!this.hasFocus)return;this.$el.blur()},select:function(){this.$el.select()}}),r.editors.TextArea=r.editors.Text.extend({tagName:"textarea"}),r.editors.Password=r.editors.Text.extend({initialize:function(e){r.editors.Text.prototype.initialize.call(this,e),this.$el.attr("type","password")}}),r.editors.Number=r.editors.Text.extend({defaultValue:0,events:t.extend({},r.editors.Text.prototype.events,{keypress:"onKeyPress"}),initialize:function(e){r.editors.Text.prototype.initialize.call
 (this,e),this.$el.attr("type","number"),this.$el.attr("step","any")},onKeyPress:function(e){var t=this,n=function(){setTimeout(function(){t.determineChange()},0)};if(e.charCode===0){n();return}var r=this.$el.val()+String.fromCharCode(e.charCode),i=/^[0-9]*\.?[0-9]*?$/.test(r);i?n():e.preventDefault()},getValue:function(){var e=this.$el.val();return e===""?null:parseFloat(e,10)},setValue:function(e){e=function(){return t.isNumber(e)?e:t.isString(e)&&e!==""?parseFloat(e,10):null}(),t.isNaN(e)&&(e=null),r.editors.Text.prototype.setValue.call(this,e)}}),r.editors.Hidden=r.editors.Base.extend({defaultValue:"",initialize:function(e){r.editors.Text.prototype.initialize.call(this,e),this.$el.attr("type","hidden")},focus:function(){},blur:function(){}}),r.editors.Checkbox=r.editors.Base.extend({defaultValue:!1,tagName:"input",events:{click:function(e){this.trigger("change",this)},focus:function(e){this.trigger("focus",this)},blur:function(e){this.trigger("blur",this)}},initialize:function(e)
 {r.editors.Base.prototype.initialize.call(this,e),this.$el.attr("type","checkbox")},render:function(){return this.setValue(this.value),this},getValue:function(){return this.$el.prop("checked")},setValue:function(e){e&&this.$el.prop("checked",!0)},focus:function(){if(this.hasFocus)return;this.$el.focus()},blur:function(){if(!this.hasFocus)return;this.$el.blur()}}),r.editors.Select=r.editors.Base.extend({tagName:"select",events:{change:function(e){this.trigger("change",this)},focus:function(e){this.trigger("focus",this)},blur:function(e){this.trigger("blur",this)}},initialize:function(e){r.editors.Base.prototype.initialize.call(this,e);if(!this.schema||!this.schema.options)throw"Missing required 'schema.options'"},render:function(){return this.setOptions(this.schema.options),this},setOptions:function(e){var r=this;if(e instanceof n.Collection){var i=e;i.length>0?this.renderOptions(e):i.fetch({success:function(t){r.renderOptions(e)}})}else t.isFunction(e)?e(function(e){r.renderOptions(
 e)},r):this.renderOptions(e)},renderOptions:function(e){var t=this.$el,n;n=this._getOptionsHtml(e),t.html(n),this.setValue(this.value)},_getOptionsHtml:function(e){var r;if(t.isString(e))r=e;else if(t.isArray(e))r=this._arrayToHtml(e);else if(e instanceof n.Collection)r=this._collectionToHtml(e);else if(t.isFunction(e)){var i;e(function(e){i=e},this),r=this._getOptionsHtml(i)}return r},getValue:function(){return this.$el.val()},setValue:function(e){this.$el.val(e)},focus:function(){if(this.hasFocus)return;this.$el.focus()},blur:function(){if(!this.hasFocus)return;this.$el.blur()},_collectionToHtml:function(e){var t=[];e.each(function(e){t.push({val:e.id,label:e.toString()})});var n=this._arrayToHtml(t);return n},_arrayToHtml:function(e){var n=[];return t.each(e,function(e){if(t.isObject(e))if(e.group)n.push('<optgroup label="'+e.group+'">'),n.push(this._getOptionsHtml(e.options)),n.push("</optgroup>");else{var r=e.val||e.val===0?e.val:"";n.push('<option value="'+r+'">'+e.label+"</op
 tion>")}else n.push("<option>"+e+"</option>")},this),n.join("")}}),r.editors.Radio=r.editors.Select.extend({tagName:"ul",events:{"change input[type=radio]":function(){this.trigger("change",this)},"focus input[type=radio]":function(){if(this.hasFocus)return;this.trigger("focus",this)},"blur input[type=radio]":function(){if(!this.hasFocus)return;var e=this;setTimeout(function(){if(e.$("input[type=radio]:focus")[0])return;e.trigger("blur",e)},0)}},getValue:function(){return this.$("input[type=radio]:checked").val()},setValue:function(e){this.$("input[type=radio]").val([e])},focus:function(){if(this.hasFocus)return;var e=this.$("input[type=radio]:checked");if(e[0]){e.focus();return}this.$("input[type=radio]").first().focus()},blur:function(){if(!this.hasFocus)return;this.$("input[type=radio]:focus").blur()},_arrayToHtml:function(e){var n=[],r=this;return t.each(e,function(e,i){var s="<li>";if(t.isObject(e)){var o=e.val||e.val===0?e.val:"";s+='<input type="radio" name="'+r.id+'" value="'
 +o+'" id="'+r.id+"-"+i+'" />',s+='<label for="'+r.id+"-"+i+'">'+e.label+"</label>"}else s+='<input type="radio" name="'+r.id+'" value="'+e+'" id="'+r.id+"-"+i+'" />',s+='<label for="'+r.id+"-"+i+'">'+e+"</label>";s+="</li>",n.push(s)}),n.join("")}}),r.editors.Checkboxes=r.editors.Select.extend({tagName:"ul",events:{"click input[type=checkbox]":function(){this.trigger("change",this)},"focus input[type=checkbox]":function(){if(this.hasFocus)return;this.trigger("focus",this)},"blur input[type=checkbox]":function(){if(!this.hasFocus)return;var e=this;setTimeout(function(){if(e.$("input[type=checkbox]:focus")[0])return;e.trigger("blur",e)},0)}},getValue:function(){var t=[];return this.$("input[type=checkbox]:checked").each(function(){t.push(e(this).val())}),t},setValue:function(e){t.isArray(e)||(e=[e]),this.$("input[type=checkbox]").val(e)},focus:function(){if(this.hasFocus)return;this.$("input[type=checkbox]").first().focus()},blur:function(){if(!this.hasFocus)return;this.$("input[type=
 checkbox]:focus").blur()},_arrayToHtml:function(e){var n=[],r=this;return t.each(e,function(e,i){var s="<li>";if(t.isObject(e)){var o=e.val||e.val===0?e.val:"";s+='<input type="checkbox" name="'+r.id+'" value="'+o+'" id="'+r.id+"-"+i+'" />',s+='<label for="'+r.id+"-"+i+'">'+e.label+"</label>"}else s+='<input type="checkbox" name="'+r.id+'" value="'+e+'" id="'+r.id+"-"+i+'" />',s+='<label for="'+r.id+"-"+i+'">'+e+"</label>";s+="</li>",n.push(s)}),n.join("")}}),r.editors.Object=r.editors.Base.extend({hasNestedForm:!0,initialize:function(e){this.value={},r.editors.Base.prototype.initialize.call(this,e);if(!this.form)throw'Missing required option "form"';if(!this.schema.subSchema)throw new Error("Missing required 'schema.subSchema' option for Object editor")},render:function(){var e=this.form.constructor;return this.nestedForm=new e({schema:this.schema.subSchema,data:this.value,idPrefix:this.id+"_",Field:e.NestedField}),this._observeFormEvents(),this.$el.html(this.nestedForm.render().el
 ),this.hasFocus&&this.trigger("blur",this),this},getValue:function(){return this.nestedForm?this.nestedForm.getValue():this.value},setValue:function(e){this.value=e,this.render()},focus:function(){if(this.hasFocus)return;this.nestedForm.focus()},blur:function(){if(!this.hasFocus)return;this.nestedForm.blur()},remove:function(){this.nestedForm.remove(),n.View.prototype.remove.call(this)},validate:function(){return this.nestedForm.validate()},_observeFormEvents:function(){if(!this.nestedForm)return;this.nestedForm.on("all",function(){var e=t.toArray(arguments);e[1]=this,this.trigger.apply(this,e)},this)}}),r.editors.NestedModel=r.editors.Object.extend({initialize:function(e){r.editors.Base.prototype.initialize.call(this,e);if(!this.form)throw'Missing required option "form"';if(!e.schema.model)throw'Missing required "schema.model" option for NestedModel editor'},render:function(){var e=this.form.constructor,t=this.value||{},n=this.key,r=this.schema.model,i=t.constructor===r?t:new r(t);
 return this.nestedForm=new e({model:i,idPrefix:this.id+"_",fieldTemplate:"nestedField"}),this._observeFormEvents(),this.$el.html(this.nestedForm.render().el),this.hasFocus&&this.trigger("blur",this),this},commit:function(){var e=this.nestedForm.commit();return e?(this.$el.addClass("error"),e):r.editors.Object.prototype.commit.call(this)}}),r.editors.Date=r.editors.Base.extend({events:{"change select":function(){this.updateHidden(),this.trigger("change",this)},"focus select":function(){if(this.hasFocus)return;this.trigger("focus",this)},"blur select":function(){if(!this.hasFocus)return;var e=this;setTimeout(function(){if(e.$("select:focus")[0])return;e.trigger("blur",e)},0)}},initialize:function(e){e=e||{},r.editors.Base.prototype.initialize.call(this,e);var n=r.editors.Date,i=new Date;this.options=t.extend({monthNames:n.monthNames,showMonthNames:n.showMonthNames},e),this.schema=t.extend({yearStart:i.getFullYear()-100,yearEnd:i.getFullYear()},e.schema||{}),this.value&&!t.isDate(this.
 value)&&(this.value=new Date(this.value));if(!this.value){var s=new Date;s.setSeconds(0),s.setMilliseconds(0),this.value=s}this.template=e.template||this.constructor.template},render:function(){var n=this.options,r=this.schema,i=t.map(t.range(1,32),function(e){return'<option value="'+e+'">'+e+"</option>"}),s=t.map(t.range(0,12),function(e){var t=n.showMonthNames?n.monthNames[e]:e+1;return'<option value="'+e+'">'+t+"</option>"}),o=r.yearStart<r.yearEnd?t.range(r.yearStart,r.yearEnd+1):t.range(r.yearStart,r.yearEnd-1,-1),u=t.map(o,function(e){return'<option value="'+e+'">'+e+"</option>"}),a=e(e.trim(this.template({dates:i.join(""),months:s.join(""),years:u.join("")})));return this.$date=a.find('[data-type="date"]'),this.$month=a.find('[data-type="month"]'),this.$year=a.find('[data-type="year"]'),this.$hidden=e('<input type="hidden" name="'+this.key+'" />'),a.append(this.$hidden),this.setValue(this.value),this.setElement(a),this.$el.attr("id",this.id),this.$el.attr("name",this.getName(
 )),this.hasFocus&&this.trigger("blur",this),this},getValue:function(){var e=this.$year.val(),t=this.$month.val(),n=this.$date.val();return!e||!t||!n?null:new Date(e,t,n)},setValue:function(e){this.$date.val(e.getDate()),this.$month.val(e.getMonth()),this.$year.val(e.getFullYear()),this.updateHidden()},focus:function(){if(this.hasFocus)return;this.$("select").first().focus()},blur:function(){if(!this.hasFocus)return;this.$("select:focus").blur()},updateHidden:function(){var e=this.getValue();t.isDate(e)&&(e=e.toISOString()),this.$hidden.val(e)}},{template:t.template('    <div>      <select data-type="date"><%= dates %></select>      <select data-type="month"><%= months %></select>      <select data-type="year"><%= years %></select>    </div>  ',null,r.templateSettings),showMonthNames:!0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"]}),r.editors.DateTime=r.editors.Base.extend({events:{"change select":function(
 ){this.updateHidden(),this.trigger("change",this)},"focus select":function(){if(this.hasFocus)return;this.trigger("focus",this)},"blur select":function(){if(!this.hasFocus)return;var e=this;setTimeout(function(){if(e.$("select:focus")[0])return;e.trigger("blur",e)},0)}},initialize:function(e){e=e||{},r.editors.Base.prototype.initialize.call(this,e),this.options=t.extend({DateEditor:r.editors.DateTime.DateEditor},e),this.schema=t.extend({minsInterval:15},e.schema||{}),this.dateEditor=new this.options.DateEditor(e),this.value=this.dateEditor.value,this.template=e.template||this.constructor.template},render:function(){function n(e){return e<10?"0"+e:e}var r=this.schema,i=t.map(t.range(0,24),function(e){return'<option value="'+e+'">'+n(e)+"</option>"}),s=t.map(t.range(0,60,r.minsInterval),function(e){return'<option value="'+e+'">'+n(e)+"</option>"}),o=e(e.trim(this.template({hours:i.join(),mins:s.join()})));return o.find("[data-date]").append(this.dateEditor.render().el),this.$hour=o.fi
 nd('select[data-type="hour"]'),this.$min=o.find('select[data-type="min"]'),this.$hidden=o.find('input[type="hidden"]'),this.setValue(this.value),this.setElement(o),this.$el.attr("id",this.id),this.$el.attr("name",this.getName()),this.hasFocus&&this.trigger("blur",this),this},getValue:function(){var e=this.dateEditor.getValue(),t=this.$hour.val(),n=this.$min.val();return!e||!t||!n?null:(e.setHours(t),e.setMinutes(n),e)},setValue:function(e){t.isDate(e)||(e=new Date(e)),this.dateEditor.setValue(e),this.$hour.val(e.getHours()),this.$min.val(e.getMinutes()),this.updateHidden()},focus:function(){if(this.hasFocus)return;this.$("select").first().focus()},blur:function(){if(!this.hasFocus)return;this.$("select:focus").blur()},updateHidden:function(){var e=this.getValue();t.isDate(e)&&(e=e.toISOString()),this.$hidden.val(e)},remove:function(){this.dateEditor.remove(),r.editors.Base.prototype.remove.call(this)}},{template:t.template('    <div class="bbf-datetime">      <div class="bbf-date-co
 ntainer" data-date></div>      <select data-type="hour"><%= hours %></select>      :      <select data-type="min"><%= mins %></select>    </div>  ',null,r.templateSettings),DateEditor:r.editors.Date}),r.VERSION="0.12.0",n.Form=r,r})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/bootstrap.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/bootstrap.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/bootstrap.js
new file mode 100644
index 0000000..2761755
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/bootstrap.js
@@ -0,0 +1,66 @@
+/** 
+ * Include this template file after backbone-forms.amd.js to override the default templates
+ *
+ * 'data-*' attributes control where elements are placed
+ */
+define(['jquery', 'underscore', 'backbone', 'backbone-forms'], function($, _, Backbone) {
+  var Form = Backbone.Form;
+
+  
+  /**
+   * Bootstrap templates for Backbone Forms
+   */
+  Form.template = _.template('\
+    <form class="form-horizontal" data-fieldsets></form>\
+  ');
+
+
+  Form.Fieldset.template = _.template('\
+    <fieldset data-fields>\
+      <% if (legend) { %>\
+        <legend><%= legend %></legend>\
+      <% } %>\
+    </fieldset>\
+  ');
+
+
+  Form.Field.template = _.template('\
+    <div class="control-group field-<%= key %>">\
+      <label class="control-label" for="<%= editorId %>"><%= title %></label>\
+      <div class="controls">\
+        <span data-editor></span>\
+        <div class="help-inline" data-error></div>\
+        <div class="help-block"><%= help %></div>\
+      </div>\
+    </div>\
+  ');
+
+
+  Form.NestedField.template = _.template('\
+    <div class="field-<%= key %>">\
+      <div title="<%= title %>" class="input-xlarge">\
+        <span data-editor></span>\
+        <div class="help-inline" data-error></div>\
+      </div>\
+      <div class="help-block"><%= help %></div>\
+    </div>\
+  ');
+
+
+  Form.editors.List.template = _.template('\
+    <div class="bbf-list">\
+      <ul class="unstyled clearfix" data-items></ul>\
+      <button class="btn bbf-add" data-action="add">Add</button>\
+    </div>\
+  ');
+
+
+  Form.editors.List.Item.template = _.template('\
+    <li class="clearfix">\
+      <div class="pull-left" data-editor></div>\
+      <button type="button" class="btn bbf-del" data-action="remove">&times;</button>\
+    </li>\
+  ');
+
+
+});


[16/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css
new file mode 100644
index 0000000..037dd05
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.css
@@ -0,0 +1,6203 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
+html {
+  font-family: sans-serif;
+  -webkit-text-size-adjust: 100%;
+      -ms-text-size-adjust: 100%;
+}
+body {
+  margin: 0;
+}
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+  display: block;
+}
+audio,
+canvas,
+progress,
+video {
+  display: inline-block;
+  vertical-align: baseline;
+}
+audio:not([controls]) {
+  display: none;
+  height: 0;
+}
+[hidden],
+template {
+  display: none;
+}
+a {
+  background: transparent;
+}
+a:active,
+a:hover {
+  outline: 0;
+}
+abbr[title] {
+  border-bottom: 1px dotted;
+}
+b,
+strong {
+  font-weight: bold;
+}
+dfn {
+  font-style: italic;
+}
+h1 {
+  margin: .67em 0;
+  font-size: 2em;
+}
+mark {
+  color: #000;
+  background: #ff0;
+}
+small {
+  font-size: 80%;
+}
+sub,
+sup {
+  position: relative;
+  font-size: 75%;
+  line-height: 0;
+  vertical-align: baseline;
+}
+sup {
+  top: -.5em;
+}
+sub {
+  bottom: -.25em;
+}
+img {
+  border: 0;
+}
+svg:not(:root) {
+  overflow: hidden;
+}
+figure {
+  margin: 1em 40px;
+}
+hr {
+  height: 0;
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+}
+pre {
+  overflow: auto;
+}
+code,
+kbd,
+pre,
+samp {
+  font-family: monospace, monospace;
+  font-size: 1em;
+}
+button,
+input,
+optgroup,
+select,
+textarea {
+  margin: 0;
+  font: inherit;
+  color: inherit;
+}
+button {
+  overflow: visible;
+}
+button,
+select {
+  text-transform: none;
+}
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+  -webkit-appearance: button;
+  cursor: pointer;
+}
+button[disabled],
+html input[disabled] {
+  cursor: default;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+  padding: 0;
+  border: 0;
+}
+input {
+  line-height: normal;
+}
+input[type="checkbox"],
+input[type="radio"] {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+  padding: 0;
+}
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+  height: auto;
+}
+input[type="search"] {
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+  -webkit-appearance: textfield;
+}
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+fieldset {
+  padding: .35em .625em .75em;
+  margin: 0 2px;
+  border: 1px solid #c0c0c0;
+}
+legend {
+  padding: 0;
+  border: 0;
+}
+textarea {
+  overflow: auto;
+}
+optgroup {
+  font-weight: bold;
+}
+table {
+  border-spacing: 0;
+  border-collapse: collapse;
+}
+td,
+th {
+  padding: 0;
+}
+@media print {
+  * {
+    color: #000 !important;
+    text-shadow: none !important;
+    background: transparent !important;
+    -webkit-box-shadow: none !important;
+            box-shadow: none !important;
+  }
+  a,
+  a:visited {
+    text-decoration: underline;
+  }
+  a[href]:after {
+    content: " (" attr(href) ")";
+  }
+  abbr[title]:after {
+    content: " (" attr(title) ")";
+  }
+  a[href^="javascript:"]:after,
+  a[href^="#"]:after {
+    content: "";
+  }
+  pre,
+  blockquote {
+    border: 1px solid #999;
+
+    page-break-inside: avoid;
+  }
+  thead {
+    display: table-header-group;
+  }
+  tr,
+  img {
+    page-break-inside: avoid;
+  }
+  img {
+    max-width: 100% !important;
+  }
+  p,
+  h2,
+  h3 {
+    orphans: 3;
+    widows: 3;
+  }
+  h2,
+  h3 {
+    page-break-after: avoid;
+  }
+  select {
+    background: #fff !important;
+  }
+  .navbar {
+    display: none;
+  }
+  .table td,
+  .table th {
+    background-color: #fff !important;
+  }
+  .btn > .caret,
+  .dropup > .btn > .caret {
+    border-top-color: #000 !important;
+  }
+  .label {
+    border: 1px solid #000;
+  }
+  .table {
+    border-collapse: collapse !important;
+  }
+  .table-bordered th,
+  .table-bordered td {
+    border: 1px solid #ddd !important;
+  }
+}
+@font-face {
+  font-family: 'Glyphicons Halflings';
+
+  src: url('../fonts/glyphicons-halflings-regular.eot');
+  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
+}
+.glyphicon {
+  position: relative;
+  top: 1px;
+  display: inline-block;
+  font-family: 'Glyphicons Halflings';
+  font-style: normal;
+  font-weight: normal;
+  line-height: 1;
+
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+.glyphicon-asterisk:before {
+  content: "\2a";
+}
+.glyphicon-plus:before {
+  content: "\2b";
+}
+.glyphicon-euro:before {
+  content: "\20ac";
+}
+.glyphicon-minus:before {
+  content: "\2212";
+}
+.glyphicon-cloud:before {
+  content: "\2601";
+}
+.glyphicon-envelope:before {
+  content: "\2709";
+}
+.glyphicon-pencil:before {
+  content: "\270f";
+}
+.glyphicon-glass:before {
+  content: "\e001";
+}
+.glyphicon-music:before {
+  content: "\e002";
+}
+.glyphicon-search:before {
+  content: "\e003";
+}
+.glyphicon-heart:before {
+  content: "\e005";
+}
+.glyphicon-star:before {
+  content: "\e006";
+}
+.glyphicon-star-empty:before {
+  content: "\e007";
+}
+.glyphicon-user:before {
+  content: "\e008";
+}
+.glyphicon-film:before {
+  content: "\e009";
+}
+.glyphicon-th-large:before {
+  content: "\e010";
+}
+.glyphicon-th:before {
+  content: "\e011";
+}
+.glyphicon-th-list:before {
+  content: "\e012";
+}
+.glyphicon-ok:before {
+  content: "\e013";
+}
+.glyphicon-remove:before {
+  content: "\e014";
+}
+.glyphicon-zoom-in:before {
+  content: "\e015";
+}
+.glyphicon-zoom-out:before {
+  content: "\e016";
+}
+.glyphicon-off:before {
+  content: "\e017";
+}
+.glyphicon-signal:before {
+  content: "\e018";
+}
+.glyphicon-cog:before {
+  content: "\e019";
+}
+.glyphicon-trash:before {
+  content: "\e020";
+}
+.glyphicon-home:before {
+  content: "\e021";
+}
+.glyphicon-file:before {
+  content: "\e022";
+}
+.glyphicon-time:before {
+  content: "\e023";
+}
+.glyphicon-road:before {
+  content: "\e024";
+}
+.glyphicon-download-alt:before {
+  content: "\e025";
+}
+.glyphicon-download:before {
+  content: "\e026";
+}
+.glyphicon-upload:before {
+  content: "\e027";
+}
+.glyphicon-inbox:before {
+  content: "\e028";
+}
+.glyphicon-play-circle:before {
+  content: "\e029";
+}
+.glyphicon-repeat:before {
+  content: "\e030";
+}
+.glyphicon-refresh:before {
+  content: "\e031";
+}
+.glyphicon-list-alt:before {
+  content: "\e032";
+}
+.glyphicon-lock:before {
+  content: "\e033";
+}
+.glyphicon-flag:before {
+  content: "\e034";
+}
+.glyphicon-headphones:before {
+  content: "\e035";
+}
+.glyphicon-volume-off:before {
+  content: "\e036";
+}
+.glyphicon-volume-down:before {
+  content: "\e037";
+}
+.glyphicon-volume-up:before {
+  content: "\e038";
+}
+.glyphicon-qrcode:before {
+  content: "\e039";
+}
+.glyphicon-barcode:before {
+  content: "\e040";
+}
+.glyphicon-tag:before {
+  content: "\e041";
+}
+.glyphicon-tags:before {
+  content: "\e042";
+}
+.glyphicon-book:before {
+  content: "\e043";
+}
+.glyphicon-bookmark:before {
+  content: "\e044";
+}
+.glyphicon-print:before {
+  content: "\e045";
+}
+.glyphicon-camera:before {
+  content: "\e046";
+}
+.glyphicon-font:before {
+  content: "\e047";
+}
+.glyphicon-bold:before {
+  content: "\e048";
+}
+.glyphicon-italic:before {
+  content: "\e049";
+}
+.glyphicon-text-height:before {
+  content: "\e050";
+}
+.glyphicon-text-width:before {
+  content: "\e051";
+}
+.glyphicon-align-left:before {
+  content: "\e052";
+}
+.glyphicon-align-center:before {
+  content: "\e053";
+}
+.glyphicon-align-right:before {
+  content: "\e054";
+}
+.glyphicon-align-justify:before {
+  content: "\e055";
+}
+.glyphicon-list:before {
+  content: "\e056";
+}
+.glyphicon-indent-left:before {
+  content: "\e057";
+}
+.glyphicon-indent-right:before {
+  content: "\e058";
+}
+.glyphicon-facetime-video:before {
+  content: "\e059";
+}
+.glyphicon-picture:before {
+  content: "\e060";
+}
+.glyphicon-map-marker:before {
+  content: "\e062";
+}
+.glyphicon-adjust:before {
+  content: "\e063";
+}
+.glyphicon-tint:before {
+  content: "\e064";
+}
+.glyphicon-edit:before {
+  content: "\e065";
+}
+.glyphicon-share:before {
+  content: "\e066";
+}
+.glyphicon-check:before {
+  content: "\e067";
+}
+.glyphicon-move:before {
+  content: "\e068";
+}
+.glyphicon-step-backward:before {
+  content: "\e069";
+}
+.glyphicon-fast-backward:before {
+  content: "\e070";
+}
+.glyphicon-backward:before {
+  content: "\e071";
+}
+.glyphicon-play:before {
+  content: "\e072";
+}
+.glyphicon-pause:before {
+  content: "\e073";
+}
+.glyphicon-stop:before {
+  content: "\e074";
+}
+.glyphicon-forward:before {
+  content: "\e075";
+}
+.glyphicon-fast-forward:before {
+  content: "\e076";
+}
+.glyphicon-step-forward:before {
+  content: "\e077";
+}
+.glyphicon-eject:before {
+  content: "\e078";
+}
+.glyphicon-chevron-left:before {
+  content: "\e079";
+}
+.glyphicon-chevron-right:before {
+  content: "\e080";
+}
+.glyphicon-plus-sign:before {
+  content: "\e081";
+}
+.glyphicon-minus-sign:before {
+  content: "\e082";
+}
+.glyphicon-remove-sign:before {
+  content: "\e083";
+}
+.glyphicon-ok-sign:before {
+  content: "\e084";
+}
+.glyphicon-question-sign:before {
+  content: "\e085";
+}
+.glyphicon-info-sign:before {
+  content: "\e086";
+}
+.glyphicon-screenshot:before {
+  content: "\e087";
+}
+.glyphicon-remove-circle:before {
+  content: "\e088";
+}
+.glyphicon-ok-circle:before {
+  content: "\e089";
+}
+.glyphicon-ban-circle:before {
+  content: "\e090";
+}
+.glyphicon-arrow-left:before {
+  content: "\e091";
+}
+.glyphicon-arrow-right:before {
+  content: "\e092";
+}
+.glyphicon-arrow-up:before {
+  content: "\e093";
+}
+.glyphicon-arrow-down:before {
+  content: "\e094";
+}
+.glyphicon-share-alt:before {
+  content: "\e095";
+}
+.glyphicon-resize-full:before {
+  content: "\e096";
+}
+.glyphicon-resize-small:before {
+  content: "\e097";
+}
+.glyphicon-exclamation-sign:before {
+  content: "\e101";
+}
+.glyphicon-gift:before {
+  content: "\e102";
+}
+.glyphicon-leaf:before {
+  content: "\e103";
+}
+.glyphicon-fire:before {
+  content: "\e104";
+}
+.glyphicon-eye-open:before {
+  content: "\e105";
+}
+.glyphicon-eye-close:before {
+  content: "\e106";
+}
+.glyphicon-warning-sign:before {
+  content: "\e107";
+}
+.glyphicon-plane:before {
+  content: "\e108";
+}
+.glyphicon-calendar:before {
+  content: "\e109";
+}
+.glyphicon-random:before {
+  content: "\e110";
+}
+.glyphicon-comment:before {
+  content: "\e111";
+}
+.glyphicon-magnet:before {
+  content: "\e112";
+}
+.glyphicon-chevron-up:before {
+  content: "\e113";
+}
+.glyphicon-chevron-down:before {
+  content: "\e114";
+}
+.glyphicon-retweet:before {
+  content: "\e115";
+}
+.glyphicon-shopping-cart:before {
+  content: "\e116";
+}
+.glyphicon-folder-close:before {
+  content: "\e117";
+}
+.glyphicon-folder-open:before {
+  content: "\e118";
+}
+.glyphicon-resize-vertical:before {
+  content: "\e119";
+}
+.glyphicon-resize-horizontal:before {
+  content: "\e120";
+}
+.glyphicon-hdd:before {
+  content: "\e121";
+}
+.glyphicon-bullhorn:before {
+  content: "\e122";
+}
+.glyphicon-bell:before {
+  content: "\e123";
+}
+.glyphicon-certificate:before {
+  content: "\e124";
+}
+.glyphicon-thumbs-up:before {
+  content: "\e125";
+}
+.glyphicon-thumbs-down:before {
+  content: "\e126";
+}
+.glyphicon-hand-right:before {
+  content: "\e127";
+}
+.glyphicon-hand-left:before {
+  content: "\e128";
+}
+.glyphicon-hand-up:before {
+  content: "\e129";
+}
+.glyphicon-hand-down:before {
+  content: "\e130";
+}
+.glyphicon-circle-arrow-right:before {
+  content: "\e131";
+}
+.glyphicon-circle-arrow-left:before {
+  content: "\e132";
+}
+.glyphicon-circle-arrow-up:before {
+  content: "\e133";
+}
+.glyphicon-circle-arrow-down:before {
+  content: "\e134";
+}
+.glyphicon-globe:before {
+  content: "\e135";
+}
+.glyphicon-wrench:before {
+  content: "\e136";
+}
+.glyphicon-tasks:before {
+  content: "\e137";
+}
+.glyphicon-filter:before {
+  content: "\e138";
+}
+.glyphicon-briefcase:before {
+  content: "\e139";
+}
+.glyphicon-fullscreen:before {
+  content: "\e140";
+}
+.glyphicon-dashboard:before {
+  content: "\e141";
+}
+.glyphicon-paperclip:before {
+  content: "\e142";
+}
+.glyphicon-heart-empty:before {
+  content: "\e143";
+}
+.glyphicon-link:before {
+  content: "\e144";
+}
+.glyphicon-phone:before {
+  content: "\e145";
+}
+.glyphicon-pushpin:before {
+  content: "\e146";
+}
+.glyphicon-usd:before {
+  content: "\e148";
+}
+.glyphicon-gbp:before {
+  content: "\e149";
+}
+.glyphicon-sort:before {
+  content: "\e150";
+}
+.glyphicon-sort-by-alphabet:before {
+  content: "\e151";
+}
+.glyphicon-sort-by-alphabet-alt:before {
+  content: "\e152";
+}
+.glyphicon-sort-by-order:before {
+  content: "\e153";
+}
+.glyphicon-sort-by-order-alt:before {
+  content: "\e154";
+}
+.glyphicon-sort-by-attributes:before {
+  content: "\e155";
+}
+.glyphicon-sort-by-attributes-alt:before {
+  content: "\e156";
+}
+.glyphicon-unchecked:before {
+  content: "\e157";
+}
+.glyphicon-expand:before {
+  content: "\e158";
+}
+.glyphicon-collapse-down:before {
+  content: "\e159";
+}
+.glyphicon-collapse-up:before {
+  content: "\e160";
+}
+.glyphicon-log-in:before {
+  content: "\e161";
+}
+.glyphicon-flash:before {
+  content: "\e162";
+}
+.glyphicon-log-out:before {
+  content: "\e163";
+}
+.glyphicon-new-window:before {
+  content: "\e164";
+}
+.glyphicon-record:before {
+  content: "\e165";
+}
+.glyphicon-save:before {
+  content: "\e166";
+}
+.glyphicon-open:before {
+  content: "\e167";
+}
+.glyphicon-saved:before {
+  content: "\e168";
+}
+.glyphicon-import:before {
+  content: "\e169";
+}
+.glyphicon-export:before {
+  content: "\e170";
+}
+.glyphicon-send:before {
+  content: "\e171";
+}
+.glyphicon-floppy-disk:before {
+  content: "\e172";
+}
+.glyphicon-floppy-saved:before {
+  content: "\e173";
+}
+.glyphicon-floppy-remove:before {
+  content: "\e174";
+}
+.glyphicon-floppy-save:before {
+  content: "\e175";
+}
+.glyphicon-floppy-open:before {
+  content: "\e176";
+}
+.glyphicon-credit-card:before {
+  content: "\e177";
+}
+.glyphicon-transfer:before {
+  content: "\e178";
+}
+.glyphicon-cutlery:before {
+  content: "\e179";
+}
+.glyphicon-header:before {
+  content: "\e180";
+}
+.glyphicon-compressed:before {
+  content: "\e181";
+}
+.glyphicon-earphone:before {
+  content: "\e182";
+}
+.glyphicon-phone-alt:before {
+  content: "\e183";
+}
+.glyphicon-tower:before {
+  content: "\e184";
+}
+.glyphicon-stats:before {
+  content: "\e185";
+}
+.glyphicon-sd-video:before {
+  content: "\e186";
+}
+.glyphicon-hd-video:before {
+  content: "\e187";
+}
+.glyphicon-subtitles:before {
+  content: "\e188";
+}
+.glyphicon-sound-stereo:before {
+  content: "\e189";
+}
+.glyphicon-sound-dolby:before {
+  content: "\e190";
+}
+.glyphicon-sound-5-1:before {
+  content: "\e191";
+}
+.glyphicon-sound-6-1:before {
+  content: "\e192";
+}
+.glyphicon-sound-7-1:before {
+  content: "\e193";
+}
+.glyphicon-copyright-mark:before {
+  content: "\e194";
+}
+.glyphicon-registration-mark:before {
+  content: "\e195";
+}
+.glyphicon-cloud-download:before {
+  content: "\e197";
+}
+.glyphicon-cloud-upload:before {
+  content: "\e198";
+}
+.glyphicon-tree-conifer:before {
+  content: "\e199";
+}
+.glyphicon-tree-deciduous:before {
+  content: "\e200";
+}
+* {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+*:before,
+*:after {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+html {
+  font-size: 10px;
+
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+body {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 14px;
+  line-height: 1.42857143;
+  color: #333;
+  background-color: #fff;
+}
+input,
+button,
+select,
+textarea {
+  font-family: inherit;
+  font-size: inherit;
+  line-height: inherit;
+}
+a {
+  color: #428bca;
+  text-decoration: none;
+}
+a:hover,
+a:focus {
+  color: #2a6496;
+  text-decoration: underline;
+}
+a:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+figure {
+  margin: 0;
+}
+img {
+  vertical-align: middle;
+}
+.img-responsive,
+.thumbnail > img,
+.thumbnail a > img,
+.carousel-inner > .item > img,
+.carousel-inner > .item > a > img {
+  display: block;
+  width: 100% \9;
+  max-width: 100%;
+  height: auto;
+}
+.img-rounded {
+  border-radius: 6px;
+}
+.img-thumbnail {
+  display: inline-block;
+  width: 100% \9;
+  max-width: 100%;
+  height: auto;
+  padding: 4px;
+  line-height: 1.42857143;
+  background-color: #fff;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  -webkit-transition: all .2s ease-in-out;
+       -o-transition: all .2s ease-in-out;
+          transition: all .2s ease-in-out;
+}
+.img-circle {
+  border-radius: 50%;
+}
+hr {
+  margin-top: 20px;
+  margin-bottom: 20px;
+  border: 0;
+  border-top: 1px solid #eee;
+}
+.sr-only {
+  position: absolute;
+  width: 1px;
+  height: 1px;
+  padding: 0;
+  margin: -1px;
+  overflow: hidden;
+  clip: rect(0, 0, 0, 0);
+  border: 0;
+}
+.sr-only-focusable:active,
+.sr-only-focusable:focus {
+  position: static;
+  width: auto;
+  height: auto;
+  margin: 0;
+  overflow: visible;
+  clip: auto;
+}
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+.h1,
+.h2,
+.h3,
+.h4,
+.h5,
+.h6 {
+  font-family: inherit;
+  font-weight: 500;
+  line-height: 1.1;
+  color: inherit;
+}
+h1 small,
+h2 small,
+h3 small,
+h4 small,
+h5 small,
+h6 small,
+.h1 small,
+.h2 small,
+.h3 small,
+.h4 small,
+.h5 small,
+.h6 small,
+h1 .small,
+h2 .small,
+h3 .small,
+h4 .small,
+h5 .small,
+h6 .small,
+.h1 .small,
+.h2 .small,
+.h3 .small,
+.h4 .small,
+.h5 .small,
+.h6 .small {
+  font-weight: normal;
+  line-height: 1;
+  color: #777;
+}
+h1,
+.h1,
+h2,
+.h2,
+h3,
+.h3 {
+  margin-top: 20px;
+  margin-bottom: 10px;
+}
+h1 small,
+.h1 small,
+h2 small,
+.h2 small,
+h3 small,
+.h3 small,
+h1 .small,
+.h1 .small,
+h2 .small,
+.h2 .small,
+h3 .small,
+.h3 .small {
+  font-size: 65%;
+}
+h4,
+.h4,
+h5,
+.h5,
+h6,
+.h6 {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+h4 small,
+.h4 small,
+h5 small,
+.h5 small,
+h6 small,
+.h6 small,
+h4 .small,
+.h4 .small,
+h5 .small,
+.h5 .small,
+h6 .small,
+.h6 .small {
+  font-size: 75%;
+}
+h1,
+.h1 {
+  font-size: 36px;
+}
+h2,
+.h2 {
+  font-size: 30px;
+}
+h3,
+.h3 {
+  font-size: 24px;
+}
+h4,
+.h4 {
+  font-size: 18px;
+}
+h5,
+.h5 {
+  font-size: 14px;
+}
+h6,
+.h6 {
+  font-size: 12px;
+}
+p {
+  margin: 0 0 10px;
+}
+.lead {
+  margin-bottom: 20px;
+  font-size: 16px;
+  font-weight: 300;
+  line-height: 1.4;
+}
+@media (min-width: 768px) {
+  .lead {
+    font-size: 21px;
+  }
+}
+small,
+.small {
+  font-size: 85%;
+}
+cite {
+  font-style: normal;
+}
+mark,
+.mark {
+  padding: .2em;
+  background-color: #fcf8e3;
+}
+.text-left {
+  text-align: left;
+}
+.text-right {
+  text-align: right;
+}
+.text-center {
+  text-align: center;
+}
+.text-justify {
+  text-align: justify;
+}
+.text-nowrap {
+  white-space: nowrap;
+}
+.text-lowercase {
+  text-transform: lowercase;
+}
+.text-uppercase {
+  text-transform: uppercase;
+}
+.text-capitalize {
+  text-transform: capitalize;
+}
+.text-muted {
+  color: #777;
+}
+.text-primary {
+  color: #428bca;
+}
+a.text-primary:hover {
+  color: #3071a9;
+}
+.text-success {
+  color: #3c763d;
+}
+a.text-success:hover {
+  color: #2b542c;
+}
+.text-info {
+  color: #31708f;
+}
+a.text-info:hover {
+  color: #245269;
+}
+.text-warning {
+  color: #8a6d3b;
+}
+a.text-warning:hover {
+  color: #66512c;
+}
+.text-danger {
+  color: #a94442;
+}
+a.text-danger:hover {
+  color: #843534;
+}
+.bg-primary {
+  color: #fff;
+  background-color: #428bca;
+}
+a.bg-primary:hover {
+  background-color: #3071a9;
+}
+.bg-success {
+  background-color: #dff0d8;
+}
+a.bg-success:hover {
+  background-color: #c1e2b3;
+}
+.bg-info {
+  background-color: #d9edf7;
+}
+a.bg-info:hover {
+  background-color: #afd9ee;
+}
+.bg-warning {
+  background-color: #fcf8e3;
+}
+a.bg-warning:hover {
+  background-color: #f7ecb5;
+}
+.bg-danger {
+  background-color: #f2dede;
+}
+a.bg-danger:hover {
+  background-color: #e4b9b9;
+}
+.page-header {
+  padding-bottom: 9px;
+  margin: 40px 0 20px;
+  border-bottom: 1px solid #eee;
+}
+ul,
+ol {
+  margin-top: 0;
+  margin-bottom: 10px;
+}
+ul ul,
+ol ul,
+ul ol,
+ol ol {
+  margin-bottom: 0;
+}
+.list-unstyled {
+  padding-left: 0;
+  list-style: none;
+}
+.list-inline {
+  padding-left: 0;
+  margin-left: -5px;
+  list-style: none;
+}
+.list-inline > li {
+  display: inline-block;
+  padding-right: 5px;
+  padding-left: 5px;
+}
+dl {
+  margin-top: 0;
+  margin-bottom: 20px;
+}
+dt,
+dd {
+  line-height: 1.42857143;
+}
+dt {
+  font-weight: bold;
+}
+dd {
+  margin-left: 0;
+}
+@media (min-width: 768px) {
+  .dl-horizontal dt {
+    float: left;
+    width: 160px;
+    overflow: hidden;
+    clear: left;
+    text-align: right;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
+  .dl-horizontal dd {
+    margin-left: 180px;
+  }
+}
+abbr[title],
+abbr[data-original-title] {
+  cursor: help;
+  border-bottom: 1px dotted #777;
+}
+.initialism {
+  font-size: 90%;
+  text-transform: uppercase;
+}
+blockquote {
+  padding: 10px 20px;
+  margin: 0 0 20px;
+  font-size: 17.5px;
+  border-left: 5px solid #eee;
+}
+blockquote p:last-child,
+blockquote ul:last-child,
+blockquote ol:last-child {
+  margin-bottom: 0;
+}
+blockquote footer,
+blockquote small,
+blockquote .small {
+  display: block;
+  font-size: 80%;
+  line-height: 1.42857143;
+  color: #777;
+}
+blockquote footer:before,
+blockquote small:before,
+blockquote .small:before {
+  content: '\2014 \00A0';
+}
+.blockquote-reverse,
+blockquote.pull-right {
+  padding-right: 15px;
+  padding-left: 0;
+  text-align: right;
+  border-right: 5px solid #eee;
+  border-left: 0;
+}
+.blockquote-reverse footer:before,
+blockquote.pull-right footer:before,
+.blockquote-reverse small:before,
+blockquote.pull-right small:before,
+.blockquote-reverse .small:before,
+blockquote.pull-right .small:before {
+  content: '';
+}
+.blockquote-reverse footer:after,
+blockquote.pull-right footer:after,
+.blockquote-reverse small:after,
+blockquote.pull-right small:after,
+.blockquote-reverse .small:after,
+blockquote.pull-right .small:after {
+  content: '\00A0 \2014';
+}
+blockquote:before,
+blockquote:after {
+  content: "";
+}
+address {
+  margin-bottom: 20px;
+  font-style: normal;
+  line-height: 1.42857143;
+}
+code,
+kbd,
+pre,
+samp {
+  font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
+}
+code {
+  padding: 2px 4px;
+  font-size: 90%;
+  color: #c7254e;
+  background-color: #f9f2f4;
+  border-radius: 4px;
+}
+kbd {
+  padding: 2px 4px;
+  font-size: 90%;
+  color: #fff;
+  background-color: #333;
+  border-radius: 3px;
+  -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
+          box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
+}
+kbd kbd {
+  padding: 0;
+  font-size: 100%;
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+pre {
+  display: block;
+  padding: 9.5px;
+  margin: 0 0 10px;
+  font-size: 13px;
+  line-height: 1.42857143;
+  color: #333;
+  word-break: break-all;
+  word-wrap: break-word;
+  background-color: #f5f5f5;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+}
+pre code {
+  padding: 0;
+  font-size: inherit;
+  color: inherit;
+  white-space: pre-wrap;
+  background-color: transparent;
+  border-radius: 0;
+}
+.pre-scrollable {
+  max-height: 340px;
+  overflow-y: scroll;
+}
+.container {
+  padding-right: 15px;
+  padding-left: 15px;
+  margin-right: auto;
+  margin-left: auto;
+}
+@media (min-width: 768px) {
+  .container {
+    width: 750px;
+  }
+}
+@media (min-width: 992px) {
+  .container {
+    width: 970px;
+  }
+}
+@media (min-width: 1200px) {
+  .container {
+    width: 1170px;
+  }
+}
+.container-fluid {
+  padding-right: 15px;
+  padding-left: 15px;
+  margin-right: auto;
+  margin-left: auto;
+}
+.row {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
+  position: relative;
+  min-height: 1px;
+  padding-right: 15px;
+  padding-left: 15px;
+}
+.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
+  float: left;
+}
+.col-xs-12 {
+  width: 100%;
+}
+.col-xs-11 {
+  width: 91.66666667%;
+}
+.col-xs-10 {
+  width: 83.33333333%;
+}
+.col-xs-9 {
+  width: 75%;
+}
+.col-xs-8 {
+  width: 66.66666667%;
+}
+.col-xs-7 {
+  width: 58.33333333%;
+}
+.col-xs-6 {
+  width: 50%;
+}
+.col-xs-5 {
+  width: 41.66666667%;
+}
+.col-xs-4 {
+  width: 33.33333333%;
+}
+.col-xs-3 {
+  width: 25%;
+}
+.col-xs-2 {
+  width: 16.66666667%;
+}
+.col-xs-1 {
+  width: 8.33333333%;
+}
+.col-xs-pull-12 {
+  right: 100%;
+}
+.col-xs-pull-11 {
+  right: 91.66666667%;
+}
+.col-xs-pull-10 {
+  right: 83.33333333%;
+}
+.col-xs-pull-9 {
+  right: 75%;
+}
+.col-xs-pull-8 {
+  right: 66.66666667%;
+}
+.col-xs-pull-7 {
+  right: 58.33333333%;
+}
+.col-xs-pull-6 {
+  right: 50%;
+}
+.col-xs-pull-5 {
+  right: 41.66666667%;
+}
+.col-xs-pull-4 {
+  right: 33.33333333%;
+}
+.col-xs-pull-3 {
+  right: 25%;
+}
+.col-xs-pull-2 {
+  right: 16.66666667%;
+}
+.col-xs-pull-1 {
+  right: 8.33333333%;
+}
+.col-xs-pull-0 {
+  right: auto;
+}
+.col-xs-push-12 {
+  left: 100%;
+}
+.col-xs-push-11 {
+  left: 91.66666667%;
+}
+.col-xs-push-10 {
+  left: 83.33333333%;
+}
+.col-xs-push-9 {
+  left: 75%;
+}
+.col-xs-push-8 {
+  left: 66.66666667%;
+}
+.col-xs-push-7 {
+  left: 58.33333333%;
+}
+.col-xs-push-6 {
+  left: 50%;
+}
+.col-xs-push-5 {
+  left: 41.66666667%;
+}
+.col-xs-push-4 {
+  left: 33.33333333%;
+}
+.col-xs-push-3 {
+  left: 25%;
+}
+.col-xs-push-2 {
+  left: 16.66666667%;
+}
+.col-xs-push-1 {
+  left: 8.33333333%;
+}
+.col-xs-push-0 {
+  left: auto;
+}
+.col-xs-offset-12 {
+  margin-left: 100%;
+}
+.col-xs-offset-11 {
+  margin-left: 91.66666667%;
+}
+.col-xs-offset-10 {
+  margin-left: 83.33333333%;
+}
+.col-xs-offset-9 {
+  margin-left: 75%;
+}
+.col-xs-offset-8 {
+  margin-left: 66.66666667%;
+}
+.col-xs-offset-7 {
+  margin-left: 58.33333333%;
+}
+.col-xs-offset-6 {
+  margin-left: 50%;
+}
+.col-xs-offset-5 {
+  margin-left: 41.66666667%;
+}
+.col-xs-offset-4 {
+  margin-left: 33.33333333%;
+}
+.col-xs-offset-3 {
+  margin-left: 25%;
+}
+.col-xs-offset-2 {
+  margin-left: 16.66666667%;
+}
+.col-xs-offset-1 {
+  margin-left: 8.33333333%;
+}
+.col-xs-offset-0 {
+  margin-left: 0;
+}
+@media (min-width: 768px) {
+  .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
+    float: left;
+  }
+  .col-sm-12 {
+    width: 100%;
+  }
+  .col-sm-11 {
+    width: 91.66666667%;
+  }
+  .col-sm-10 {
+    width: 83.33333333%;
+  }
+  .col-sm-9 {
+    width: 75%;
+  }
+  .col-sm-8 {
+    width: 66.66666667%;
+  }
+  .col-sm-7 {
+    width: 58.33333333%;
+  }
+  .col-sm-6 {
+    width: 50%;
+  }
+  .col-sm-5 {
+    width: 41.66666667%;
+  }
+  .col-sm-4 {
+    width: 33.33333333%;
+  }
+  .col-sm-3 {
+    width: 25%;
+  }
+  .col-sm-2 {
+    width: 16.66666667%;
+  }
+  .col-sm-1 {
+    width: 8.33333333%;
+  }
+  .col-sm-pull-12 {
+    right: 100%;
+  }
+  .col-sm-pull-11 {
+    right: 91.66666667%;
+  }
+  .col-sm-pull-10 {
+    right: 83.33333333%;
+  }
+  .col-sm-pull-9 {
+    right: 75%;
+  }
+  .col-sm-pull-8 {
+    right: 66.66666667%;
+  }
+  .col-sm-pull-7 {
+    right: 58.33333333%;
+  }
+  .col-sm-pull-6 {
+    right: 50%;
+  }
+  .col-sm-pull-5 {
+    right: 41.66666667%;
+  }
+  .col-sm-pull-4 {
+    right: 33.33333333%;
+  }
+  .col-sm-pull-3 {
+    right: 25%;
+  }
+  .col-sm-pull-2 {
+    right: 16.66666667%;
+  }
+  .col-sm-pull-1 {
+    right: 8.33333333%;
+  }
+  .col-sm-pull-0 {
+    right: auto;
+  }
+  .col-sm-push-12 {
+    left: 100%;
+  }
+  .col-sm-push-11 {
+    left: 91.66666667%;
+  }
+  .col-sm-push-10 {
+    left: 83.33333333%;
+  }
+  .col-sm-push-9 {
+    left: 75%;
+  }
+  .col-sm-push-8 {
+    left: 66.66666667%;
+  }
+  .col-sm-push-7 {
+    left: 58.33333333%;
+  }
+  .col-sm-push-6 {
+    left: 50%;
+  }
+  .col-sm-push-5 {
+    left: 41.66666667%;
+  }
+  .col-sm-push-4 {
+    left: 33.33333333%;
+  }
+  .col-sm-push-3 {
+    left: 25%;
+  }
+  .col-sm-push-2 {
+    left: 16.66666667%;
+  }
+  .col-sm-push-1 {
+    left: 8.33333333%;
+  }
+  .col-sm-push-0 {
+    left: auto;
+  }
+  .col-sm-offset-12 {
+    margin-left: 100%;
+  }
+  .col-sm-offset-11 {
+    margin-left: 91.66666667%;
+  }
+  .col-sm-offset-10 {
+    margin-left: 83.33333333%;
+  }
+  .col-sm-offset-9 {
+    margin-left: 75%;
+  }
+  .col-sm-offset-8 {
+    margin-left: 66.66666667%;
+  }
+  .col-sm-offset-7 {
+    margin-left: 58.33333333%;
+  }
+  .col-sm-offset-6 {
+    margin-left: 50%;
+  }
+  .col-sm-offset-5 {
+    margin-left: 41.66666667%;
+  }
+  .col-sm-offset-4 {
+    margin-left: 33.33333333%;
+  }
+  .col-sm-offset-3 {
+    margin-left: 25%;
+  }
+  .col-sm-offset-2 {
+    margin-left: 16.66666667%;
+  }
+  .col-sm-offset-1 {
+    margin-left: 8.33333333%;
+  }
+  .col-sm-offset-0 {
+    margin-left: 0;
+  }
+}
+@media (min-width: 992px) {
+  .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
+    float: left;
+  }
+  .col-md-12 {
+    width: 100%;
+  }
+  .col-md-11 {
+    width: 91.66666667%;
+  }
+  .col-md-10 {
+    width: 83.33333333%;
+  }
+  .col-md-9 {
+    width: 75%;
+  }
+  .col-md-8 {
+    width: 66.66666667%;
+  }
+  .col-md-7 {
+    width: 58.33333333%;
+  }
+  .col-md-6 {
+    width: 50%;
+  }
+  .col-md-5 {
+    width: 41.66666667%;
+  }
+  .col-md-4 {
+    width: 33.33333333%;
+  }
+  .col-md-3 {
+    width: 25%;
+  }
+  .col-md-2 {
+    width: 16.66666667%;
+  }
+  .col-md-1 {
+    width: 8.33333333%;
+  }
+  .col-md-pull-12 {
+    right: 100%;
+  }
+  .col-md-pull-11 {
+    right: 91.66666667%;
+  }
+  .col-md-pull-10 {
+    right: 83.33333333%;
+  }
+  .col-md-pull-9 {
+    right: 75%;
+  }
+  .col-md-pull-8 {
+    right: 66.66666667%;
+  }
+  .col-md-pull-7 {
+    right: 58.33333333%;
+  }
+  .col-md-pull-6 {
+    right: 50%;
+  }
+  .col-md-pull-5 {
+    right: 41.66666667%;
+  }
+  .col-md-pull-4 {
+    right: 33.33333333%;
+  }
+  .col-md-pull-3 {
+    right: 25%;
+  }
+  .col-md-pull-2 {
+    right: 16.66666667%;
+  }
+  .col-md-pull-1 {
+    right: 8.33333333%;
+  }
+  .col-md-pull-0 {
+    right: auto;
+  }
+  .col-md-push-12 {
+    left: 100%;
+  }
+  .col-md-push-11 {
+    left: 91.66666667%;
+  }
+  .col-md-push-10 {
+    left: 83.33333333%;
+  }
+  .col-md-push-9 {
+    left: 75%;
+  }
+  .col-md-push-8 {
+    left: 66.66666667%;
+  }
+  .col-md-push-7 {
+    left: 58.33333333%;
+  }
+  .col-md-push-6 {
+    left: 50%;
+  }
+  .col-md-push-5 {
+    left: 41.66666667%;
+  }
+  .col-md-push-4 {
+    left: 33.33333333%;
+  }
+  .col-md-push-3 {
+    left: 25%;
+  }
+  .col-md-push-2 {
+    left: 16.66666667%;
+  }
+  .col-md-push-1 {
+    left: 8.33333333%;
+  }
+  .col-md-push-0 {
+    left: auto;
+  }
+  .col-md-offset-12 {
+    margin-left: 100%;
+  }
+  .col-md-offset-11 {
+    margin-left: 91.66666667%;
+  }
+  .col-md-offset-10 {
+    margin-left: 83.33333333%;
+  }
+  .col-md-offset-9 {
+    margin-left: 75%;
+  }
+  .col-md-offset-8 {
+    margin-left: 66.66666667%;
+  }
+  .col-md-offset-7 {
+    margin-left: 58.33333333%;
+  }
+  .col-md-offset-6 {
+    margin-left: 50%;
+  }
+  .col-md-offset-5 {
+    margin-left: 41.66666667%;
+  }
+  .col-md-offset-4 {
+    margin-left: 33.33333333%;
+  }
+  .col-md-offset-3 {
+    margin-left: 25%;
+  }
+  .col-md-offset-2 {
+    margin-left: 16.66666667%;
+  }
+  .col-md-offset-1 {
+    margin-left: 8.33333333%;
+  }
+  .col-md-offset-0 {
+    margin-left: 0;
+  }
+}
+@media (min-width: 1200px) {
+  .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
+    float: left;
+  }
+  .col-lg-12 {
+    width: 100%;
+  }
+  .col-lg-11 {
+    width: 91.66666667%;
+  }
+  .col-lg-10 {
+    width: 83.33333333%;
+  }
+  .col-lg-9 {
+    width: 75%;
+  }
+  .col-lg-8 {
+    width: 66.66666667%;
+  }
+  .col-lg-7 {
+    width: 58.33333333%;
+  }
+  .col-lg-6 {
+    width: 50%;
+  }
+  .col-lg-5 {
+    width: 41.66666667%;
+  }
+  .col-lg-4 {
+    width: 33.33333333%;
+  }
+  .col-lg-3 {
+    width: 25%;
+  }
+  .col-lg-2 {
+    width: 16.66666667%;
+  }
+  .col-lg-1 {
+    width: 8.33333333%;
+  }
+  .col-lg-pull-12 {
+    right: 100%;
+  }
+  .col-lg-pull-11 {
+    right: 91.66666667%;
+  }
+  .col-lg-pull-10 {
+    right: 83.33333333%;
+  }
+  .col-lg-pull-9 {
+    right: 75%;
+  }
+  .col-lg-pull-8 {
+    right: 66.66666667%;
+  }
+  .col-lg-pull-7 {
+    right: 58.33333333%;
+  }
+  .col-lg-pull-6 {
+    right: 50%;
+  }
+  .col-lg-pull-5 {
+    right: 41.66666667%;
+  }
+  .col-lg-pull-4 {
+    right: 33.33333333%;
+  }
+  .col-lg-pull-3 {
+    right: 25%;
+  }
+  .col-lg-pull-2 {
+    right: 16.66666667%;
+  }
+  .col-lg-pull-1 {
+    right: 8.33333333%;
+  }
+  .col-lg-pull-0 {
+    right: auto;
+  }
+  .col-lg-push-12 {
+    left: 100%;
+  }
+  .col-lg-push-11 {
+    left: 91.66666667%;
+  }
+  .col-lg-push-10 {
+    left: 83.33333333%;
+  }
+  .col-lg-push-9 {
+    left: 75%;
+  }
+  .col-lg-push-8 {
+    left: 66.66666667%;
+  }
+  .col-lg-push-7 {
+    left: 58.33333333%;
+  }
+  .col-lg-push-6 {
+    left: 50%;
+  }
+  .col-lg-push-5 {
+    left: 41.66666667%;
+  }
+  .col-lg-push-4 {
+    left: 33.33333333%;
+  }
+  .col-lg-push-3 {
+    left: 25%;
+  }
+  .col-lg-push-2 {
+    left: 16.66666667%;
+  }
+  .col-lg-push-1 {
+    left: 8.33333333%;
+  }
+  .col-lg-push-0 {
+    left: auto;
+  }
+  .col-lg-offset-12 {
+    margin-left: 100%;
+  }
+  .col-lg-offset-11 {
+    margin-left: 91.66666667%;
+  }
+  .col-lg-offset-10 {
+    margin-left: 83.33333333%;
+  }
+  .col-lg-offset-9 {
+    margin-left: 75%;
+  }
+  .col-lg-offset-8 {
+    margin-left: 66.66666667%;
+  }
+  .col-lg-offset-7 {
+    margin-left: 58.33333333%;
+  }
+  .col-lg-offset-6 {
+    margin-left: 50%;
+  }
+  .col-lg-offset-5 {
+    margin-left: 41.66666667%;
+  }
+  .col-lg-offset-4 {
+    margin-left: 33.33333333%;
+  }
+  .col-lg-offset-3 {
+    margin-left: 25%;
+  }
+  .col-lg-offset-2 {
+    margin-left: 16.66666667%;
+  }
+  .col-lg-offset-1 {
+    margin-left: 8.33333333%;
+  }
+  .col-lg-offset-0 {
+    margin-left: 0;
+  }
+}
+table {
+  background-color: transparent;
+}
+th {
+  text-align: left;
+}
+.table {
+  width: 100%;
+  max-width: 100%;
+  margin-bottom: 20px;
+}
+.table > thead > tr > th,
+.table > tbody > tr > th,
+.table > tfoot > tr > th,
+.table > thead > tr > td,
+.table > tbody > tr > td,
+.table > tfoot > tr > td {
+  padding: 8px;
+  line-height: 1.42857143;
+  vertical-align: top;
+  border-top: 1px solid #ddd;
+}
+.table > thead > tr > th {
+  vertical-align: bottom;
+  border-bottom: 2px solid #ddd;
+}
+.table > caption + thead > tr:first-child > th,
+.table > colgroup + thead > tr:first-child > th,
+.table > thead:first-child > tr:first-child > th,
+.table > caption + thead > tr:first-child > td,
+.table > colgroup + thead > tr:first-child > td,
+.table > thead:first-child > tr:first-child > td {
+  border-top: 0;
+}
+.table > tbody + tbody {
+  border-top: 2px solid #ddd;
+}
+.table .table {
+  background-color: #fff;
+}
+.table-condensed > thead > tr > th,
+.table-condensed > tbody > tr > th,
+.table-condensed > tfoot > tr > th,
+.table-condensed > thead > tr > td,
+.table-condensed > tbody > tr > td,
+.table-condensed > tfoot > tr > td {
+  padding: 5px;
+}
+.table-bordered {
+  border: 1px solid #ddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > tbody > tr > th,
+.table-bordered > tfoot > tr > th,
+.table-bordered > thead > tr > td,
+.table-bordered > tbody > tr > td,
+.table-bordered > tfoot > tr > td {
+  border: 1px solid #ddd;
+}
+.table-bordered > thead > tr > th,
+.table-bordered > thead > tr > td {
+  border-bottom-width: 2px;
+}
+.table-striped > tbody > tr:nth-child(odd) > td,
+.table-striped > tbody > tr:nth-child(odd) > th {
+  background-color: #f9f9f9;
+}
+.table-hover > tbody > tr:hover > td,
+.table-hover > tbody > tr:hover > th {
+  background-color: #f5f5f5;
+}
+table col[class*="col-"] {
+  position: static;
+  display: table-column;
+  float: none;
+}
+table td[class*="col-"],
+table th[class*="col-"] {
+  position: static;
+  display: table-cell;
+  float: none;
+}
+.table > thead > tr > td.active,
+.table > tbody > tr > td.active,
+.table > tfoot > tr > td.active,
+.table > thead > tr > th.active,
+.table > tbody > tr > th.active,
+.table > tfoot > tr > th.active,
+.table > thead > tr.active > td,
+.table > tbody > tr.active > td,
+.table > tfoot > tr.active > td,
+.table > thead > tr.active > th,
+.table > tbody > tr.active > th,
+.table > tfoot > tr.active > th {
+  background-color: #f5f5f5;
+}
+.table-hover > tbody > tr > td.active:hover,
+.table-hover > tbody > tr > th.active:hover,
+.table-hover > tbody > tr.active:hover > td,
+.table-hover > tbody > tr:hover > .active,
+.table-hover > tbody > tr.active:hover > th {
+  background-color: #e8e8e8;
+}
+.table > thead > tr > td.success,
+.table > tbody > tr > td.success,
+.table > tfoot > tr > td.success,
+.table > thead > tr > th.success,
+.table > tbody > tr > th.success,
+.table > tfoot > tr > th.success,
+.table > thead > tr.success > td,
+.table > tbody > tr.success > td,
+.table > tfoot > tr.success > td,
+.table > thead > tr.success > th,
+.table > tbody > tr.success > th,
+.table > tfoot > tr.success > th {
+  background-color: #dff0d8;
+}
+.table-hover > tbody > tr > td.success:hover,
+.table-hover > tbody > tr > th.success:hover,
+.table-hover > tbody > tr.success:hover > td,
+.table-hover > tbody > tr:hover > .success,
+.table-hover > tbody > tr.success:hover > th {
+  background-color: #d0e9c6;
+}
+.table > thead > tr > td.info,
+.table > tbody > tr > td.info,
+.table > tfoot > tr > td.info,
+.table > thead > tr > th.info,
+.table > tbody > tr > th.info,
+.table > tfoot > tr > th.info,
+.table > thead > tr.info > td,
+.table > tbody > tr.info > td,
+.table > tfoot > tr.info > td,
+.table > thead > tr.info > th,
+.table > tbody > tr.info > th,
+.table > tfoot > tr.info > th {
+  background-color: #d9edf7;
+}
+.table-hover > tbody > tr > td.info:hover,
+.table-hover > tbody > tr > th.info:hover,
+.table-hover > tbody > tr.info:hover > td,
+.table-hover > tbody > tr:hover > .info,
+.table-hover > tbody > tr.info:hover > th {
+  background-color: #c4e3f3;
+}
+.table > thead > tr > td.warning,
+.table > tbody > tr > td.warning,
+.table > tfoot > tr > td.warning,
+.table > thead > tr > th.warning,
+.table > tbody > tr > th.warning,
+.table > tfoot > tr > th.warning,
+.table > thead > tr.warning > td,
+.table > tbody > tr.warning > td,
+.table > tfoot > tr.warning > td,
+.table > thead > tr.warning > th,
+.table > tbody > tr.warning > th,
+.table > tfoot > tr.warning > th {
+  background-color: #fcf8e3;
+}
+.table-hover > tbody > tr > td.warning:hover,
+.table-hover > tbody > tr > th.warning:hover,
+.table-hover > tbody > tr.warning:hover > td,
+.table-hover > tbody > tr:hover > .warning,
+.table-hover > tbody > tr.warning:hover > th {
+  background-color: #faf2cc;
+}
+.table > thead > tr > td.danger,
+.table > tbody > tr > td.danger,
+.table > tfoot > tr > td.danger,
+.table > thead > tr > th.danger,
+.table > tbody > tr > th.danger,
+.table > tfoot > tr > th.danger,
+.table > thead > tr.danger > td,
+.table > tbody > tr.danger > td,
+.table > tfoot > tr.danger > td,
+.table > thead > tr.danger > th,
+.table > tbody > tr.danger > th,
+.table > tfoot > tr.danger > th {
+  background-color: #f2dede;
+}
+.table-hover > tbody > tr > td.danger:hover,
+.table-hover > tbody > tr > th.danger:hover,
+.table-hover > tbody > tr.danger:hover > td,
+.table-hover > tbody > tr:hover > .danger,
+.table-hover > tbody > tr.danger:hover > th {
+  background-color: #ebcccc;
+}
+@media screen and (max-width: 767px) {
+  .table-responsive {
+    width: 100%;
+    margin-bottom: 15px;
+    overflow-x: auto;
+    overflow-y: hidden;
+    -webkit-overflow-scrolling: touch;
+    -ms-overflow-style: -ms-autohiding-scrollbar;
+    border: 1px solid #ddd;
+  }
+  .table-responsive > .table {
+    margin-bottom: 0;
+  }
+  .table-responsive > .table > thead > tr > th,
+  .table-responsive > .table > tbody > tr > th,
+  .table-responsive > .table > tfoot > tr > th,
+  .table-responsive > .table > thead > tr > td,
+  .table-responsive > .table > tbody > tr > td,
+  .table-responsive > .table > tfoot > tr > td {
+    white-space: nowrap;
+  }
+  .table-responsive > .table-bordered {
+    border: 0;
+  }
+  .table-responsive > .table-bordered > thead > tr > th:first-child,
+  .table-responsive > .table-bordered > tbody > tr > th:first-child,
+  .table-responsive > .table-bordered > tfoot > tr > th:first-child,
+  .table-responsive > .table-bordered > thead > tr > td:first-child,
+  .table-responsive > .table-bordered > tbody > tr > td:first-child,
+  .table-responsive > .table-bordered > tfoot > tr > td:first-child {
+    border-left: 0;
+  }
+  .table-responsive > .table-bordered > thead > tr > th:last-child,
+  .table-responsive > .table-bordered > tbody > tr > th:last-child,
+  .table-responsive > .table-bordered > tfoot > tr > th:last-child,
+  .table-responsive > .table-bordered > thead > tr > td:last-child,
+  .table-responsive > .table-bordered > tbody > tr > td:last-child,
+  .table-responsive > .table-bordered > tfoot > tr > td:last-child {
+    border-right: 0;
+  }
+  .table-responsive > .table-bordered > tbody > tr:last-child > th,
+  .table-responsive > .table-bordered > tfoot > tr:last-child > th,
+  .table-responsive > .table-bordered > tbody > tr:last-child > td,
+  .table-responsive > .table-bordered > tfoot > tr:last-child > td {
+    border-bottom: 0;
+  }
+}
+fieldset {
+  min-width: 0;
+  padding: 0;
+  margin: 0;
+  border: 0;
+}
+legend {
+  display: block;
+  width: 100%;
+  padding: 0;
+  margin-bottom: 20px;
+  font-size: 21px;
+  line-height: inherit;
+  color: #333;
+  border: 0;
+  border-bottom: 1px solid #e5e5e5;
+}
+label {
+  display: inline-block;
+  max-width: 100%;
+  margin-bottom: 5px;
+  font-weight: bold;
+}
+input[type="search"] {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+input[type="radio"],
+input[type="checkbox"] {
+  margin: 4px 0 0;
+  margin-top: 1px \9;
+  line-height: normal;
+}
+input[type="file"] {
+  display: block;
+}
+input[type="range"] {
+  display: block;
+  width: 100%;
+}
+select[multiple],
+select[size] {
+  height: auto;
+}
+input[type="file"]:focus,
+input[type="radio"]:focus,
+input[type="checkbox"]:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+output {
+  display: block;
+  padding-top: 7px;
+  font-size: 14px;
+  line-height: 1.42857143;
+  color: #555;
+}
+.form-control {
+  display: block;
+  width: 100%;
+  height: 34px;
+  padding: 6px 12px;
+  font-size: 14px;
+  line-height: 1.42857143;
+  color: #555;
+  background-color: #fff;
+  background-image: none;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+  -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
+       -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+          transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+}
+.form-control:focus {
+  border-color: #66afe9;
+  outline: 0;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
+          box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6);
+}
+.form-control::-moz-placeholder {
+  color: #777;
+  opacity: 1;
+}
+.form-control:-ms-input-placeholder {
+  color: #777;
+}
+.form-control::-webkit-input-placeholder {
+  color: #777;
+}
+.form-control[disabled],
+.form-control[readonly],
+fieldset[disabled] .form-control {
+  cursor: not-allowed;
+  background-color: #eee;
+  opacity: 1;
+}
+textarea.form-control {
+  height: auto;
+}
+input[type="search"] {
+  -webkit-appearance: none;
+}
+input[type="date"],
+input[type="time"],
+input[type="datetime-local"],
+input[type="month"] {
+  line-height: 34px;
+  line-height: 1.42857143 \0;
+}
+input[type="date"].input-sm,
+input[type="time"].input-sm,
+input[type="datetime-local"].input-sm,
+input[type="month"].input-sm {
+  line-height: 30px;
+}
+input[type="date"].input-lg,
+input[type="time"].input-lg,
+input[type="datetime-local"].input-lg,
+input[type="month"].input-lg {
+  line-height: 46px;
+}
+.form-group {
+  margin-bottom: 15px;
+}
+.radio,
+.checkbox {
+  position: relative;
+  display: block;
+  min-height: 20px;
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+.radio label,
+.checkbox label {
+  padding-left: 20px;
+  margin-bottom: 0;
+  font-weight: normal;
+  cursor: pointer;
+}
+.radio input[type="radio"],
+.radio-inline input[type="radio"],
+.checkbox input[type="checkbox"],
+.checkbox-inline input[type="checkbox"] {
+  position: absolute;
+  margin-top: 4px \9;
+  margin-left: -20px;
+}
+.radio + .radio,
+.checkbox + .checkbox {
+  margin-top: -5px;
+}
+.radio-inline,
+.checkbox-inline {
+  display: inline-block;
+  padding-left: 20px;
+  margin-bottom: 0;
+  font-weight: normal;
+  vertical-align: middle;
+  cursor: pointer;
+}
+.radio-inline + .radio-inline,
+.checkbox-inline + .checkbox-inline {
+  margin-top: 0;
+  margin-left: 10px;
+}
+input[type="radio"][disabled],
+input[type="checkbox"][disabled],
+input[type="radio"].disabled,
+input[type="checkbox"].disabled,
+fieldset[disabled] input[type="radio"],
+fieldset[disabled] input[type="checkbox"] {
+  cursor: not-allowed;
+}
+.radio-inline.disabled,
+.checkbox-inline.disabled,
+fieldset[disabled] .radio-inline,
+fieldset[disabled] .checkbox-inline {
+  cursor: not-allowed;
+}
+.radio.disabled label,
+.checkbox.disabled label,
+fieldset[disabled] .radio label,
+fieldset[disabled] .checkbox label {
+  cursor: not-allowed;
+}
+.form-control-static {
+  padding-top: 7px;
+  padding-bottom: 7px;
+  margin-bottom: 0;
+}
+.form-control-static.input-lg,
+.form-control-static.input-sm {
+  padding-right: 0;
+  padding-left: 0;
+}
+.input-sm,
+.form-horizontal .form-group-sm .form-control {
+  height: 30px;
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+select.input-sm {
+  height: 30px;
+  line-height: 30px;
+}
+textarea.input-sm,
+select[multiple].input-sm {
+  height: auto;
+}
+.input-lg,
+.form-horizontal .form-group-lg .form-control {
+  height: 46px;
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+select.input-lg {
+  height: 46px;
+  line-height: 46px;
+}
+textarea.input-lg,
+select[multiple].input-lg {
+  height: auto;
+}
+.has-feedback {
+  position: relative;
+}
+.has-feedback .form-control {
+  padding-right: 42.5px;
+}
+.form-control-feedback {
+  position: absolute;
+  top: 25px;
+  right: 0;
+  z-index: 2;
+  display: block;
+  width: 34px;
+  height: 34px;
+  line-height: 34px;
+  text-align: center;
+}
+.input-lg + .form-control-feedback {
+  width: 46px;
+  height: 46px;
+  line-height: 46px;
+}
+.input-sm + .form-control-feedback {
+  width: 30px;
+  height: 30px;
+  line-height: 30px;
+}
+.has-success .help-block,
+.has-success .control-label,
+.has-success .radio,
+.has-success .checkbox,
+.has-success .radio-inline,
+.has-success .checkbox-inline {
+  color: #3c763d;
+}
+.has-success .form-control {
+  border-color: #3c763d;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-success .form-control:focus {
+  border-color: #2b542c;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
+}
+.has-success .input-group-addon {
+  color: #3c763d;
+  background-color: #dff0d8;
+  border-color: #3c763d;
+}
+.has-success .form-control-feedback {
+  color: #3c763d;
+}
+.has-warning .help-block,
+.has-warning .control-label,
+.has-warning .radio,
+.has-warning .checkbox,
+.has-warning .radio-inline,
+.has-warning .checkbox-inline {
+  color: #8a6d3b;
+}
+.has-warning .form-control {
+  border-color: #8a6d3b;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-warning .form-control:focus {
+  border-color: #66512c;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
+}
+.has-warning .input-group-addon {
+  color: #8a6d3b;
+  background-color: #fcf8e3;
+  border-color: #8a6d3b;
+}
+.has-warning .form-control-feedback {
+  color: #8a6d3b;
+}
+.has-error .help-block,
+.has-error .control-label,
+.has-error .radio,
+.has-error .checkbox,
+.has-error .radio-inline,
+.has-error .checkbox-inline {
+  color: #a94442;
+}
+.has-error .form-control {
+  border-color: #a94442;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
+}
+.has-error .form-control:focus {
+  border-color: #843534;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
+}
+.has-error .input-group-addon {
+  color: #a94442;
+  background-color: #f2dede;
+  border-color: #a94442;
+}
+.has-error .form-control-feedback {
+  color: #a94442;
+}
+.has-feedback label.sr-only ~ .form-control-feedback {
+  top: 0;
+}
+.help-block {
+  display: block;
+  margin-top: 5px;
+  margin-bottom: 10px;
+  color: #737373;
+}
+@media (min-width: 768px) {
+  .form-inline .form-group {
+    display: inline-block;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .form-inline .form-control {
+    display: inline-block;
+    width: auto;
+    vertical-align: middle;
+  }
+  .form-inline .input-group {
+    display: inline-table;
+    vertical-align: middle;
+  }
+  .form-inline .input-group .input-group-addon,
+  .form-inline .input-group .input-group-btn,
+  .form-inline .input-group .form-control {
+    width: auto;
+  }
+  .form-inline .input-group > .form-control {
+    width: 100%;
+  }
+  .form-inline .control-label {
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .form-inline .radio,
+  .form-inline .checkbox {
+    display: inline-block;
+    margin-top: 0;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .form-inline .radio label,
+  .form-inline .checkbox label {
+    padding-left: 0;
+  }
+  .form-inline .radio input[type="radio"],
+  .form-inline .checkbox input[type="checkbox"] {
+    position: relative;
+    margin-left: 0;
+  }
+  .form-inline .has-feedback .form-control-feedback {
+    top: 0;
+  }
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox,
+.form-horizontal .radio-inline,
+.form-horizontal .checkbox-inline {
+  padding-top: 7px;
+  margin-top: 0;
+  margin-bottom: 0;
+}
+.form-horizontal .radio,
+.form-horizontal .checkbox {
+  min-height: 27px;
+}
+.form-horizontal .form-group {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+@media (min-width: 768px) {
+  .form-horizontal .control-label {
+    padding-top: 7px;
+    margin-bottom: 0;
+    text-align: right;
+  }
+}
+.form-horizontal .has-feedback .form-control-feedback {
+  top: 0;
+  right: 15px;
+}
+@media (min-width: 768px) {
+  .form-horizontal .form-group-lg .control-label {
+    padding-top: 14.3px;
+  }
+}
+@media (min-width: 768px) {
+  .form-horizontal .form-group-sm .control-label {
+    padding-top: 6px;
+  }
+}
+.btn {
+  display: inline-block;
+  padding: 6px 12px;
+  margin-bottom: 0;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1.42857143;
+  text-align: center;
+  white-space: nowrap;
+  vertical-align: middle;
+  cursor: pointer;
+  -webkit-user-select: none;
+     -moz-user-select: none;
+      -ms-user-select: none;
+          user-select: none;
+  background-image: none;
+  border: 1px solid transparent;
+  border-radius: 4px;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus {
+  outline: thin dotted;
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus {
+  color: #333;
+  text-decoration: none;
+}
+.btn:active,
+.btn.active {
+  background-image: none;
+  outline: 0;
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+  pointer-events: none;
+  cursor: not-allowed;
+  filter: alpha(opacity=65);
+  -webkit-box-shadow: none;
+          box-shadow: none;
+  opacity: .65;
+}
+.btn-default {
+  color: #333;
+  background-color: #fff;
+  border-color: #ccc;
+}
+.btn-default:hover,
+.btn-default:focus,
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+  color: #333;
+  background-color: #e6e6e6;
+  border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+  background-image: none;
+}
+.btn-default.disabled,
+.btn-default[disabled],
+fieldset[disabled] .btn-default,
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled:active,
+.btn-default[disabled]:active,
+fieldset[disabled] .btn-default:active,
+.btn-default.disabled.active,
+.btn-default[disabled].active,
+fieldset[disabled] .btn-default.active {
+  background-color: #fff;
+  border-color: #ccc;
+}
+.btn-default .badge {
+  color: #fff;
+  background-color: #333;
+}
+.btn-primary {
+  color: #fff;
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+.btn-primary:hover,
+.btn-primary:focus,
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+  color: #fff;
+  background-color: #3071a9;
+  border-color: #285e8e;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+  background-image: none;
+}
+.btn-primary.disabled,
+.btn-primary[disabled],
+fieldset[disabled] .btn-primary,
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled:active,
+.btn-primary[disabled]:active,
+fieldset[disabled] .btn-primary:active,
+.btn-primary.disabled.active,
+.btn-primary[disabled].active,
+fieldset[disabled] .btn-primary.active {
+  background-color: #428bca;
+  border-color: #357ebd;
+}
+.btn-primary .badge {
+  color: #428bca;
+  background-color: #fff;
+}
+.btn-success {
+  color: #fff;
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success:hover,
+.btn-success:focus,
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+  color: #fff;
+  background-color: #449d44;
+  border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+  background-image: none;
+}
+.btn-success.disabled,
+.btn-success[disabled],
+fieldset[disabled] .btn-success,
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled:active,
+.btn-success[disabled]:active,
+fieldset[disabled] .btn-success:active,
+.btn-success.disabled.active,
+.btn-success[disabled].active,
+fieldset[disabled] .btn-success.active {
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success .badge {
+  color: #5cb85c;
+  background-color: #fff;
+}
+.btn-info {
+  color: #fff;
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info:hover,
+.btn-info:focus,
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+  color: #fff;
+  background-color: #31b0d5;
+  border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+  background-image: none;
+}
+.btn-info.disabled,
+.btn-info[disabled],
+fieldset[disabled] .btn-info,
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled:active,
+.btn-info[disabled]:active,
+fieldset[disabled] .btn-info:active,
+.btn-info.disabled.active,
+.btn-info[disabled].active,
+fieldset[disabled] .btn-info.active {
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info .badge {
+  color: #5bc0de;
+  background-color: #fff;
+}
+.btn-warning {
+  color: #fff;
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning:hover,
+.btn-warning:focus,
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+  color: #fff;
+  background-color: #ec971f;
+  border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+  background-image: none;
+}
+.btn-warning.disabled,
+.btn-warning[disabled],
+fieldset[disabled] .btn-warning,
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled:active,
+.btn-warning[disabled]:active,
+fieldset[disabled] .btn-warning:active,
+.btn-warning.disabled.active,
+.btn-warning[disabled].active,
+fieldset[disabled] .btn-warning.active {
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning .badge {
+  color: #f0ad4e;
+  background-color: #fff;
+}
+.btn-danger {
+  color: #fff;
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger:hover,
+.btn-danger:focus,
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+  color: #fff;
+  background-color: #c9302c;
+  border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+  background-image: none;
+}
+.btn-danger.disabled,
+.btn-danger[disabled],
+fieldset[disabled] .btn-danger,
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled:active,
+.btn-danger[disabled]:active,
+fieldset[disabled] .btn-danger:active,
+.btn-danger.disabled.active,
+.btn-danger[disabled].active,
+fieldset[disabled] .btn-danger.active {
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger .badge {
+  color: #d9534f;
+  background-color: #fff;
+}
+.btn-link {
+  font-weight: normal;
+  color: #428bca;
+  cursor: pointer;
+  border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+  background-color: transparent;
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+  border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+  color: #2a6496;
+  text-decoration: underline;
+  background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+  color: #777;
+  text-decoration: none;
+}
+.btn-lg,
+.btn-group-lg > .btn {
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+.btn-sm,
+.btn-group-sm > .btn {
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-xs,
+.btn-group-xs > .btn {
+  padding: 1px 5px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-block {
+  display: block;
+  width: 100%;
+}
+.btn-block + .btn-block {
+  margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+  width: 100%;
+}
+.fade {
+  opacity: 0;
+  -webkit-transition: opacity .15s linear;
+       -o-transition: opacity .15s linear;
+          transition: opacity .15s linear;
+}
+.fade.in {
+  opacity: 1;
+}
+.collapse {
+  display: none;
+}
+.collapse.in {
+  display: block;
+}
+tr.collapse.in {
+  display: table-row;
+}
+tbody.collapse.in {
+  display: table-row-group;
+}
+.collapsing {
+  position: relative;
+  height: 0;
+  overflow: hidden;
+  -webkit-transition: height .35s ease;
+       -o-transition: height .35s ease;
+          transition: height .35s ease;
+}
+.caret {
+  display: inline-block;
+  width: 0;
+  height: 0;
+  margin-left: 2px;
+  vertical-align: middle;
+  border-top: 4px solid;
+  border-right: 4px solid transparent;
+  border-left: 4px solid transparent;
+}
+.dropdown {
+  position: relative;
+}
+.dropdown-toggle:focus {
+  outline: 0;
+}
+.dropdown-menu {
+  position: absolute;
+  top: 100%;
+  left: 0;
+  z-index: 1000;
+  display: none;
+  float: left;
+  min-width: 160px;
+  padding: 5px 0;
+  margin: 2px 0 0;
+  font-size: 14px;
+  text-align: left;
+  list-style: none;
+  background-color: #fff;
+  -webkit-background-clip: padding-box;
+          background-clip: padding-box;
+  border: 1px solid #ccc;
+  border: 1px solid rgba(0, 0, 0, .15);
+  border-radius: 4px;
+  -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+          box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
+}
+.dropdown-menu.pull-right {
+  right: 0;
+  left: auto;
+}
+.dropdown-menu .divider {
+  height: 1px;
+  margin: 9px 0;
+  overflow: hidden;
+  background-color: #e5e5e5;
+}
+.dropdown-menu > li > a {
+  display: block;
+  padding: 3px 20px;
+  clear: both;
+  font-weight: normal;
+  line-height: 1.42857143;
+  color: #333;
+  white-space: nowrap;
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+  color: #262626;
+  text-decoration: none;
+  background-color: #f5f5f5;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+  color: #fff;
+  text-decoration: none;
+  background-color: #428bca;
+  outline: 0;
+}
+.dropdown-menu > .disabled > a,
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+  color: #777;
+}
+.dropdown-menu > .disabled > a:hover,
+.dropdown-menu > .disabled > a:focus {
+  text-decoration: none;
+  cursor: not-allowed;
+  background-color: transparent;
+  background-image: none;
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+}
+.open > .dropdown-menu {
+  display: block;
+}
+.open > a {
+  outline: 0;
+}
+.dropdown-menu-right {
+  right: 0;
+  left: auto;
+}
+.dropdown-menu-left {
+  right: auto;
+  left: 0;
+}
+.dropdown-header {
+  display: block;
+  padding: 3px 20px;
+  font-size: 12px;
+  line-height: 1.42857143;
+  color: #777;
+  white-space: nowrap;
+}
+.dropdown-backdrop {
+  position: fixed;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 990;
+}
+.pull-right > .dropdown-menu {
+  right: 0;
+  left: auto;
+}
+.dropup .caret,
+.navbar-fixed-bottom .dropdown .caret {
+  content: "";
+  border-top: 0;
+  border-bottom: 4px solid;
+}
+.dropup .dropdown-menu,
+.navbar-fixed-bottom .dropdown .dropdown-menu {
+  top: auto;
+  bottom: 100%;
+  margin-bottom: 1px;
+}
+@media (min-width: 768px) {
+  .navbar-right .dropdown-menu {
+    right: 0;
+    left: auto;
+  }
+  .navbar-right .dropdown-menu-left {
+    right: auto;
+    left: 0;
+  }
+}
+.btn-group,
+.btn-group-vertical {
+  position: relative;
+  display: inline-block;
+  vertical-align: middle;
+}
+.btn-group > .btn,
+.btn-group-vertical > .btn {
+  position: relative;
+  float: left;
+}
+.btn-group > .btn:hover,
+.btn-group-vertical > .btn:hover,
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus,
+.btn-group > .btn:active,
+.btn-group-vertical > .btn:active,
+.btn-group > .btn.active,
+.btn-group-vertical > .btn.active {
+  z-index: 2;
+}
+.btn-group > .btn:focus,
+.btn-group-vertical > .btn:focus {
+  outline: 0;
+}
+.btn-group .btn + .btn,
+.btn-group .btn + .btn-group,
+.btn-group .btn-group + .btn,
+.btn-group .btn-group + .btn-group {
+  margin-left: -1px;
+}
+.btn-toolbar {
+  margin-left: -5px;
+}
+.btn-toolbar .btn-group,
+.btn-toolbar .input-group {
+  float: left;
+}
+.btn-toolbar > .btn,
+.btn-toolbar > .btn-group,
+.btn-toolbar > .input-group {
+  margin-left: 5px;
+}
+.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
+  border-radius: 0;
+}
+.btn-group > .btn:first-child {
+  margin-left: 0;
+}
+.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+.btn-group > .btn:last-child:not(:first-child),
+.btn-group > .dropdown-toggle:not(:first-child) {
+  border-top-left-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.btn-group > .btn-group {
+  float: left;
+}
+.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
+  border-radius: 0;
+}
+.btn-group > .btn-group:first-child > .btn:last-child,
+.btn-group > .btn-group:first-child > .dropdown-toggle {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+.btn-group > .btn-group:last-child > .btn:first-child {
+  border-top-left-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.btn-group .dropdown-toggle:active,
+.btn-group.open .dropdown-toggle {
+  outline: 0;
+}
+.btn-group > .btn + .dropdown-toggle {
+  padding-right: 8px;
+  padding-left: 8px;
+}
+.btn-group > .btn-lg + .dropdown-toggle {
+  padding-right: 12px;
+  padding-left: 12px;
+}
+.btn-group.open .dropdown-toggle {
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn-group.open .dropdown-toggle.btn-link {
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+.btn .caret {
+  margin-left: 0;
+}
+.btn-lg .caret {
+  border-width: 5px 5px 0;
+  border-bottom-width: 0;
+}
+.dropup .btn-lg .caret {
+  border-width: 0 5px 5px;
+}
+.btn-group-vertical > .btn,
+.btn-group-vertical > .btn-group,
+.btn-group-vertical > .btn-group > .btn {
+  display: block;
+  float: none;
+  width: 100%;
+  max-width: 100%;
+}
+.btn-group-vertical > .btn-group > .btn {
+  float: none;
+}
+.btn-group-vertical > .btn + .btn,
+.btn-group-vertical > .btn + .btn-group,
+.btn-group-vertical > .btn-group + .btn,
+.btn-group-vertical > .btn-group + .btn-group {
+  margin-top: -1px;
+  margin-left: 0;
+}
+.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
+  border-radius: 0;
+}
+.btn-group-vertical > .btn:first-child:not(:last-child) {
+  border-top-right-radius: 4px;
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn:last-child:not(:first-child) {
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+  border-bottom-left-radius: 4px;
+}
+.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
+  border-radius: 0;
+}
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,
+.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+}
+.btn-group-justified {
+  display: table;
+  width: 100%;
+  table-layout: fixed;
+  border-collapse: separate;
+}
+.btn-group-justified > .btn,
+.btn-group-justified > .btn-group {
+  display: table-cell;
+  float: none;
+  width: 1%;
+}
+.btn-group-justified > .btn-group .btn {
+  width: 100%;
+}
+.btn-group-justified > .btn-group .dropdown-menu {
+  left: auto;
+}
+[data-toggle="buttons"] > .btn > input[type="radio"],
+[data-toggle="buttons"] > .btn > input[type="checkbox"] {
+  position: absolute;
+  z-index: -1;
+  filter: alpha(opacity=0);
+  opacity: 0;
+}
+.input-group {
+  position: relative;
+  display: table;
+  border-collapse: separate;
+}
+.input-group[class*="col-"] {
+  float: none;
+  padding-right: 0;
+  padding-left: 0;
+}
+.input-group .form-control {
+  position: relative;
+  z-index: 2;
+  float: left;
+  width: 100%;
+  margin-bottom: 0;
+}
+.input-group-lg > .form-control,
+.input-group-lg > .input-group-addon,
+.input-group-lg > .input-group-btn > .btn {
+  height: 46px;
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.33;
+  border-radius: 6px;
+}
+select.input-group-lg > .form-control,
+select.input-group-lg > .input-group-addon,
+select.input-group-lg > .input-group-btn > .btn {
+  height: 46px;
+  line-height: 46px;
+}
+textarea.input-group-lg > .form-control,
+textarea.input-group-lg > .input-group-addon,
+textarea.input-group-lg > .input-group-btn > .btn,
+select[multiple].input-group-lg > .form-control,
+select[multiple].input-group-lg > .input-group-addon,
+select[multiple].input-group-lg > .input-group-btn > .btn {
+  height: auto;
+}
+.input-group-sm > .form-control,
+.input-group-sm > .input-group-addon,
+.input-group-sm > .input-group-btn > .btn {
+  height: 30px;
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+select.input-group-sm > .form-control,
+select.input-group-sm > .input-group-addon,
+select.input-group-sm > .input-group-btn > .btn {
+  height: 30px;
+  line-height: 30px;
+}
+textarea.input-group-sm > .form-control,
+textarea.input-group-sm > .input-group-addon,
+textarea.input-group-sm > .input-group-btn > .btn,
+select[multiple].input-group-sm > .form-control,
+select[multiple].input-group-sm > .input-group-addon,
+select[multiple].input-group-sm > .input-group-btn > .btn {
+  height: auto;
+}
+.input-group-addon,
+.input-group-btn,
+.input-group .form-control {
+  display: table-cell;
+}
+.input-group-addon:not(:first-child):not(:last-child),
+.input-group-btn:not(:first-child):not(:last-child),
+.input-group .form-control:not(:first-child):not(:last-child) {
+  border-radius: 0;
+}
+.input-group-addon,
+.input-group-btn {
+  width: 1%;
+  white-space: nowrap;
+  vertical-align: middle;
+}
+.input-group-addon {
+  padding: 6px 12px;
+  font-size: 14px;
+  font-weight: normal;
+  line-height: 1;
+  color: #555;
+  text-align: center;
+  background-color: #eee;
+  border: 1px solid #ccc;
+  border-radius: 4px;
+}
+.input-group-addon.input-sm {
+  padding: 5px 10px;
+  font-size: 12px;
+  border-radius: 3px;
+}
+.input-group-addon.input-lg {
+  padding: 10px 16px;
+  font-size: 18px;
+  border-radius: 6px;
+}
+.input-group-addon input[type="radio"],
+.input-group-addon input[type="checkbox"] {
+  margin-top: 0;
+}
+.input-group .form-control:first-child,
+.input-group-addon:first-child,
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group > .btn,
+.input-group-btn:first-child > .dropdown-toggle,
+.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle),
+.input-group-btn:last-child > .btn-group:not(:last-child) > .btn {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+.input-group-addon:first-child {
+  border-right: 0;
+}
+.input-group .form-control:last-child,
+.input-group-addon:last-child,
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group > .btn,
+.input-group-btn:last-child > .dropdown-toggle,
+.input-group-btn:first-child > .btn:not(:first-child),
+.input-group-btn:first-child > .btn-group:not(:first-child) > .btn {
+  border-top-left-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.input-group-addon:last-child {
+  border-left: 0;
+}
+.input-group-btn {
+  position: relative;
+  font-size: 0;
+  white-space: nowrap;
+}
+.input-group-btn > .btn {
+  position: relative;
+}
+.input-group-btn > .btn + .btn {
+  margin-left: -1px;
+}
+.input-group-btn > .btn:hover,
+.input-group-btn > .btn:focus,
+.input-group-btn > .btn:active {
+  z-index: 2;
+}
+.input-group-btn:first-child > .btn,
+.input-group-btn:first-child > .btn-group {
+  margin-right: -1px;
+}
+.input-group-btn:last-child > .btn,
+.input-group-btn:last-child > .btn-group {
+  margin-left: -1px;
+}
+.nav {
+  padding-left: 0;
+  margin-bottom: 0;
+  list-style: none;
+}
+.nav > li {
+  position: relative;
+  display: block;
+}
+.nav > li > a {
+  position: relative;
+  display: block;
+  padding: 10px 15px;
+}
+.nav > li > a:hover,
+.nav > li > a:focus {
+  text-decoration: none;
+  background-color: #eee;
+}
+.nav > li.disabled > a {
+  color: #777;
+}
+.nav > li.disabled > a:hover,
+.nav > li.disabled > a:focus {
+  color: #777;
+  text-decoration: none;
+  cursor: not-allowed;
+  background-color: transparent;
+}
+.nav .open > a,
+.nav .open > a:hover,
+.nav .open > a:focus {
+  background-color: #eee;
+  border-color: #428bca;
+}
+.nav .nav-divider {
+  height: 1px;
+  margin: 9px 0;
+  overflow: hidden;
+  background-color: #e5e5e5;
+}
+.nav > li > a > img {
+  max-width: none;
+}
+.nav-tabs {
+  border-bottom: 1px solid #ddd;
+}
+.nav-tabs > li {
+  float: left;
+  margin-bottom: -1px;
+}
+.nav-tabs > li > a {
+  margin-right: 2px;
+  line-height: 1.42857143;
+  border: 1px solid transparent;
+  border-radius: 4px 4px 0 0;
+}
+.nav-tabs > li > a:hover {
+  border-color: #eee #eee #ddd;
+}
+.nav-tabs > li.active > a,
+.nav-tabs > li.active > a:hover,
+.nav-tabs > li.active > a:focus {
+  color: #555;
+  cursor: default;
+  background-color: #fff;
+  border: 1px solid #ddd;
+  border-bottom-color: transparent;
+}
+.nav-tabs.nav-justified {
+  width: 100%;
+  border-bottom: 0;
+}
+.nav-tabs.nav-justified > li {
+  float: none;
+}
+.nav-tabs.nav-justified > li > a {
+  margin-bottom: 5px;
+  text-align: center;
+}
+.nav-tabs.nav-justified > .dropdown .dropdown-menu {
+  top: auto;
+  left: auto;
+}
+@media (min-width: 768px) {
+  .nav-tabs.nav-justified > li {
+    display: table-cell;
+    width: 1%;
+  }
+  .nav-tabs.nav-justified > li > a {
+    margin-bottom: 0;
+  }
+}
+.nav-tabs.nav-justified > li > a {
+  margin-right: 0;
+  border-radius: 4px;
+}
+.nav-tabs.nav-justified > .active > a,
+.nav-tabs.nav-justified > .active > a:hover,
+.nav-tabs.nav-justified > .active > a:focus {
+  border: 1px solid #ddd;
+}
+@media (min-width: 768px) {
+  .nav-tabs.nav-justified > li > a {
+    border-bottom: 1px solid #ddd;
+    border-radius: 4px 4px 0 0;
+  }
+  .nav-tabs.nav-justified > .active > a,
+  .nav-tabs.nav-justified > .active > a:hover,
+  .nav-tabs.nav-justified > .active > a:focus {
+    border-bottom-color: #fff;
+  }
+}
+.nav-pills > li {
+  float: left;
+}
+.nav-pills > li > a {
+  border-radius: 4px;
+}
+.nav-pills > li + li {
+  margin-left: 2px;
+}
+.nav-pills > li.active > a,
+.nav-pills > li.active > a:hover,
+.nav-pills > li.active > a:focus {
+  color: #fff;
+  background-color: #428bca;
+}
+.nav-stacked > li {
+  float: none;
+}
+.nav-stacked > li + li {
+  margin-top: 2px;
+  margin-left: 0;
+}
+.nav-justified {
+  width: 100%;
+}
+.nav-justified > li {
+  float: none;
+}
+.nav-justified > li > a {
+  margin-bottom: 5px;
+  text-align: center;
+}
+.nav-justified > .dropdown .dropdown-menu {
+  top: auto;
+  left: auto;
+}
+@media (min-width: 768px) {
+  .nav-justified > li {
+    display: table-cell;
+    width: 1%;
+  }
+  .nav-justified > li > a {
+    margin-bottom: 0;
+  }
+}
+.nav-tabs-justified {
+  border-bottom: 0;
+}
+.nav-tabs-justified > li > a {
+  margin-right: 0;
+  border-radius: 4px;
+}
+.nav-tabs-justified > .active > a,
+.nav-tabs-justified > .active > a:hover,
+.nav-tabs-justified > .active > a:focus {
+  border: 1px solid #ddd;
+}
+@media (min-width: 768px) {
+  .nav-tabs-justified > li > a {
+    border-bottom: 1px solid #ddd;
+    border-radius: 4px 4px 0 0;
+  }
+  .nav-tabs-justified > .active > a,
+  .nav-tabs-justified > .active > a:hover,
+  .nav-tabs-justified > .active > a:focus {
+    border-bottom-color: #fff;
+  }
+}
+.tab-content > .tab-pane {
+  display: none;
+}
+.tab-content > .active {
+  display: block;
+}
+.nav-tabs .dropdown-menu {
+  margin-top: -1px;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+}
+.navbar {
+  position: relative;
+  min-height: 50px;
+  margin-bottom: 20px;
+  border: 1px solid transparent;
+}
+@media (min-width: 768px) {
+  .navbar {
+    border-radius: 4px;
+  }
+}
+@media (min-width: 768px) {
+  .navbar-header {
+    float: left;
+  }
+}
+.navbar-collapse {
+  padding-right: 15px;
+  padding-left: 15px;
+  overflow-x: visible;
+  -webkit-overflow-scrolling: touch;
+  border-top: 1px solid transparent;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
+}
+.navbar-collapse.in {
+  overflow-y: auto;
+}
+@media (min-width: 768px) {
+  .navbar-collapse {
+    width: auto;
+    border-top: 0;
+    -webkit-box-shadow: none;
+            box-shadow: none;
+  }
+  .navbar-collapse.collapse {
+    display: block !important;
+    height: auto !important;
+    padding-bottom: 0;
+    overflow: visible !important;
+  }
+  .navbar-collapse.in {
+    overflow-y: visible;
+  }
+  .navbar-fixed-top .navbar-collapse,
+  .navbar-static-top .navbar-collapse,
+  .navbar-fixed-bottom .navbar-collapse {
+    padding-right: 0;
+    padding-left: 0;
+  }
+}
+.navbar-fixed-top .navbar-collapse,
+.navbar-fixed-bottom .navbar-collapse {
+  max-height: 340px;
+}
+@media (max-width: 480px) and (orientation: landscape) {
+  .navbar-fixed-top .navbar-collapse,
+  .navbar-fixed-bottom .navbar-collapse {
+    max-height: 200px;
+  }
+}
+.container > .navbar-header,
+.container-fluid > .navbar-header,
+.container > .navbar-collapse,
+.container-fluid > .navbar-collapse {
+  margin-right: -15px;
+  margin-left: -15px;
+}
+@media (min-width: 768px) {
+  .container > .navbar-header,
+  .container-fluid > .navbar-header,
+  .container > .navbar-collapse,
+  .container-fluid > .navbar-collapse {
+    margin-right: 0;
+    margin-left: 0;
+  }
+}
+.navbar-static-top {
+  z-index: 1000;
+  border-width: 0 0 1px;
+}
+@media (min-width: 768px) {
+  .navbar-static-top {
+    border-radius: 0;
+  }
+}
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  position: fixed;
+  right: 0;
+  left: 0;
+  z-index: 1030;
+  -webkit-transform: translate3d(0, 0, 0);
+       -o-transform: translate3d(0, 0, 0);
+          transform: translate3d(0, 0, 0);
+}
+@media (min-width: 768px) {
+  .navbar-fixed-top,
+  .navbar-fixed-bottom {
+    border-radius: 0;
+  }
+}
+.navbar-fixed-top {
+  top: 0;
+  border-width: 0 0 1px;
+}
+.navbar-fixed-bottom {
+  bottom: 0;
+  margin-bottom: 0;
+  border-width: 1px 0 0;
+}
+.navbar-brand {
+  float: left;
+  height: 50px;
+  padding: 15px 15px;
+  font-size: 18px;
+  line-height: 20px;
+}
+.navbar-brand:hover,
+.navbar-brand:focus {
+  text-decoration: none;
+}
+@media (min-width: 768px) {
+  .navbar > .container .navbar-brand,
+  .navbar > .container-fluid .navbar-brand {
+    margin-left: -15px;
+  }
+}
+.navbar-toggle {
+  position: relative;
+  float: right;
+  padding: 9px 10px;
+  margin-top: 8px;
+  margin-right: 15px;
+  margin-bottom: 8px;
+  background-color: transparent;
+  background-image: none;
+  border: 1px solid transparent;
+  border-radius: 4px;
+}
+.navbar-toggle:focus {
+  outline: 0;
+}
+.navbar-toggle .icon-bar {
+  display: block;
+  width: 22px;
+  height: 2px;
+  border-radius: 1px;
+}
+.navbar-toggle .icon-bar + .icon-bar {
+  margin-top: 4px;
+}
+@media (min-width: 768px) {
+  .navbar-toggle {
+    display: none;
+  }
+}
+.navbar-nav {
+  margin: 7.5px -15px;
+}
+.navbar-nav > li > a {
+  padding-top: 10px;
+  padding-bottom: 10px;
+  line-height: 20px;
+}
+@media (max-width: 767px) {
+  .navbar-nav .open .dropdown-menu {
+    position: static;
+    float: none;
+    width: auto;
+    margin-top: 0;
+    background-color: transparent;
+    border: 0;
+    -webkit-box-shadow: none;
+            box-shadow: none;
+  }
+  .navbar-nav .open .dropdown-menu > li > a,
+  .navbar-nav .open .dropdown-menu .dropdown-header {
+    padding: 5px 15px 5px 25px;
+  }
+  .navbar-nav .open .dropdown-menu > li > a {
+    line-height: 20px;
+  }
+  .navbar-nav .open .dropdown-menu > li > a:hover,
+  .navbar-nav .open .dropdown-menu > li > a:focus {
+    background-image: none;
+  }
+}
+@media (min-width: 768px) {
+  .navbar-nav {
+    float: left;
+    margin: 0;
+  }
+  .navbar-nav > li {
+    float: left;
+  }
+  .navbar-nav > li > a {
+    padding-top: 15px;
+    padding-bottom: 15px;
+  }
+  .navbar-nav.navbar-right:last-child {
+    margin-right: -15px;
+  }
+}
+@media (min-width: 768px) {
+  .navbar-left {
+    float: left !important;
+  }
+  .navbar-right {
+    float: right !important;
+  }
+}
+.navbar-form {
+  padding: 10px 15px;
+  margin-top: 8px;
+  margin-right: -15px;
+  margin-bottom: 8px;
+  margin-left: -15px;
+  border-top: 1px solid transparent;
+  border-bottom: 1px solid transparent;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
+}
+@media (min-width: 768px) {
+  .navbar-form .form-group {
+    display: inline-block;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .navbar-form .form-control {
+    display: inline-block;
+    width: auto;
+    vertical-align: middle;
+  }
+  .navbar-form .input-group {
+    display: inline-table;
+    vertical-align: middle;
+  }
+  .navbar-form .input-group .input-group-addon,
+  .navbar-form .input-group .input-group-btn,
+  .navbar-form .input-group .form-control {
+    width: auto;
+  }
+  .navbar-form .input-group > .form-control {
+    width: 100%;
+  }
+  .navbar-form .control-label {
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .navbar-form .radio,
+  .navbar-form .checkbox {
+    display: inline-block;
+    margin-top: 0;
+    margin-bottom: 0;
+    vertical-align: middle;
+  }
+  .navbar-form .radio label,
+  .navbar-form .checkbox label {
+    padding-left: 0;
+  }
+  .navbar-form .radio input[type="radio"],
+  .navbar-form .checkbox input[type="checkbox"] {
+    position: relative;
+    margin-left: 0;
+  }
+  .navbar-form .has-feedback .form-control-feedback {
+    top: 0;
+  }
+}
+@media (max-width: 767px) {
+  .navbar-form .form-group {
+    margin-bottom: 5px;
+  }
+}
+@media (min-width: 768px) {
+  .navbar-form {
+    width: auto;
+    padding-top: 0;
+    padding-bottom: 0;
+    margin-right: 0;
+    margin-left: 0;
+    border: 0;
+    -webkit-box-shadow: none;
+            box-shadow: none;
+  }
+  .navbar-form.navbar-right:last-child {
+    margin-right: -15px;
+  }
+}
+.navbar-nav > li > .dropdown-menu {
+  margin-top: 0;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+}
+.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+  border-bottom-right-radius: 0;
+  border-bottom-left-radius: 0;
+}
+.navbar-btn {
+  margin-top: 8px;
+  margin-bottom: 8px;
+}
+.navbar-btn.btn-sm {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+.navbar-btn.btn-xs {
+  margin-top: 14px;
+  margin-bottom: 14px;
+}
+.navbar-text {
+  margin-top: 15px;
+  margin-bottom: 15px;
+}
+@media (min-width: 768px) {
+  .navbar-text {
+    float: left;
+    margin-right: 15px;
+    margin-left: 15px;
+  }
+  .navbar-text.navbar-right:last-child {
+    margin-right: 0;
+  }
+}
+.navbar-default {
+  background-color: #f8f8f8;
+  border-color: #e7e7e7;
+}
+.navbar-default .navbar-brand {
+  color: #777;
+}
+.navbar-default .navbar-brand:hover,
+.navbar-default .navbar-brand:focus {
+  color: #5e5e5e;
+  background-color: transparent;
+}
+.navbar-default .navbar-text {
+  color: #777;
+}
+.navbar-default .navbar-nav > li > a {
+  color: #777;
+}
+.navbar-default .navbar-nav > li > a:hover,
+.navbar-default .navbar-nav > li > a:focus {
+  color: #333;
+  background-color: transparent;
+}
+.navbar-default .navbar-nav > .active > a,
+.navbar-default .navbar-nav > .active > a:hover,
+.navbar-default .navbar-nav > .active > a:focus {
+  color: #555;
+  background-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .disabled > a,
+.navbar-default .navbar-nav > .disabled > a:hover,
+.navbar-default .navbar-nav > .disabled > a:focus {
+  color: #ccc;
+  background-color: transparent;
+}
+.navbar-default .navbar-toggle {
+  border-color: #ddd;
+}
+.navbar-default .navbar-toggle:hover,
+.navbar-default .navbar-toggle:focus {
+  background-color: #ddd;
+}
+.navbar-default .navbar-toggle .icon-bar {
+  background-color: #888;
+}
+.navbar-default .navbar-collapse,
+.navbar-default .navbar-form {
+  border-color: #e7e7e7;
+}
+.navbar-default .navbar-nav > .open > a,
+.navbar-default .navbar-nav > .open > a:hover,
+.navbar-default .navbar-nav > .open > a:focus {
+  color: #555;
+  background-color: #e7e7e7;
+}
+@media (max-width: 767px) {
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a {
+    color: #777;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
+    color: #333;
+    background-color: transparent;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
+    color: #555;
+    background-color: #e7e7e7;
+  }
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
+  .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
+    color: #ccc;
+    background-color: transparent;
+  }
+}
+.navbar-default .navbar-link {
+  color: #777;
+}
+.navbar-default .navbar-link:hover {
+  color: #333;
+}
+.navbar-default .btn-link {
+  color: #777;
+}
+.navbar-default .btn-link:hover,
+.navbar-default .btn-link:focus {
+  color: #333;
+}
+.navbar-default .btn-link[disabled]:hover,
+fieldset[disabled] .navbar-default .btn-link:hover,
+.navbar-default .btn-link[disabled]:focus,
+fieldset[disabled] .navbar-default .btn-link:focus {
+  color: #ccc;
+}
+.navbar-inverse {
+  background-color: #222;
+  border-color: #080808;
+}
+.navbar-inverse .navbar-brand {
+  color: #777;
+}
+.navbar-inverse .navbar-brand:hover,
+.navbar-inverse .navbar-brand:focus {
+  color: #fff;
+  background-color: transparent;
+}
+.navbar-inverse .navbar-text {
+  color: #777;
+}
+.navbar-inverse .navbar-nav > li > a {
+  color: #777;
+}
+.navbar-inverse .navbar-nav > li > a:hover,
+.navbar-inverse .navbar-nav > li > a:focus {
+  color: #fff;
+  background-color: transparent;
+}
+.navbar-inverse .navbar-nav > .active > a,
+.navbar-inverse .navbar-nav > .active > a:hover,
+.navbar-inverse .navbar-nav > .active > a:focus {
+  color: #fff;
+  background-color: #080808;
+}
+.navbar-inverse .navbar-nav > .disabled > a,
+.navbar-inverse .navbar-nav > .disabled > a:hover,
+.navbar-inverse .navbar-nav > .disabled > a:focus {
+  color: #444;
+  background-color: transparent;
+}
+.navbar-inverse .navbar-toggle {
+  border-color: #333;
+}
+.navbar-inverse .navbar-toggle:hover,
+.navbar-inverse .navbar-toggle:focus {
+  background-color: #333;
+}
+.navbar-inverse .navbar-toggle .icon-bar {
+  background-color: #fff;
+}
+.navbar-inverse .navbar-collapse,
+.navbar-inverse .navbar-form {
+  border-color: #101010;
+}
+.navbar-inverse .navbar-nav > .open > a,
+.navbar-inverse .navbar-nav > .open > a:hover,
+.navbar-inverse .navbar-nav > .open > a:focus {
+  color: #fff;
+  background-color: #080808;
+}
+@media (max-width: 767px) {
+  .navbar-inverse .na

<TRUNCATED>

[60/61] [abbrv] ambari git commit: AMBARI-15679. Logsearch Rest API support (rnettleton via oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImplTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImplTest.java
new file mode 100644
index 0000000..08f945d
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImplTest.java
@@ -0,0 +1,133 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ServiceComponentHost;
+import org.easymock.EasyMockSupport;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+import static org.easymock.EasyMock.*;
+
+public class LoggingRequestHelperFactoryImplTest {
+
+  @Test
+  public void testHelperCreation() throws Exception {
+    final String expectedClusterName = "testclusterone";
+    final String expectedHostName = "c6410.ambari.apache.org";
+    final String expectedPortNumber = "61889";
+
+    EasyMockSupport mockSupport = new EasyMockSupport();
+
+    AmbariManagementController controllerMock =
+      mockSupport.createMock(AmbariManagementController.class);
+
+    Clusters clustersMock =
+      mockSupport.createMock(Clusters.class);
+
+    Cluster clusterMock =
+      mockSupport.createMock(Cluster.class);
+
+    Config logSearchSiteConfig =
+      mockSupport.createMock(Config.class);
+
+    ServiceComponentHost serviceComponentHostMock =
+      mockSupport.createMock(ServiceComponentHost.class);
+
+    Map<String, String> testProperties =
+      new HashMap<String, String>();
+    testProperties.put("logsearch.ui.port", expectedPortNumber);
+
+    expect(controllerMock.getClusters()).andReturn(clustersMock).atLeastOnce();
+    expect(clustersMock.getCluster(expectedClusterName)).andReturn(clusterMock).atLeastOnce();
+    expect(clusterMock.getDesiredConfigByType("logsearch-site")).andReturn(logSearchSiteConfig).atLeastOnce();
+    expect(clusterMock.getServiceComponentHosts("LOGSEARCH", "LOGSEARCH_SERVER")).andReturn(Collections.singletonList(serviceComponentHostMock)).atLeastOnce();
+    expect(logSearchSiteConfig.getProperties()).andReturn(testProperties).atLeastOnce();
+    expect(serviceComponentHostMock.getHostName()).andReturn(expectedHostName).atLeastOnce();
+
+    mockSupport.replayAll();
+
+    LoggingRequestHelperFactory helperFactory =
+      new LoggingRequestHelperFactoryImpl();
+
+    LoggingRequestHelper helper =
+      helperFactory.getHelper(controllerMock, expectedClusterName);
+
+    assertNotNull("LoggingRequestHelper object returned by the factory was null",
+      helper);
+
+    assertTrue("Helper created was not of the expected type",
+      helper instanceof LoggingRequestHelperImpl);
+
+    mockSupport.verifyAll();
+  }
+
+  @Test
+  public void testHelperCreationWithNoLogSearchServersAvailable() throws Exception {
+    final String expectedClusterName = "testclusterone";
+    final String expectedPortNumber = "61889";
+
+    EasyMockSupport mockSupport = new EasyMockSupport();
+
+    AmbariManagementController controllerMock =
+      mockSupport.createMock(AmbariManagementController.class);
+
+    Clusters clustersMock =
+      mockSupport.createMock(Clusters.class);
+
+    Cluster clusterMock =
+      mockSupport.createMock(Cluster.class);
+
+    Config logSearchSiteConfig =
+      mockSupport.createMock(Config.class);
+
+    Map<String, String> testProperties =
+      new HashMap<String, String>();
+    testProperties.put("logsearch.ui.port", expectedPortNumber);
+
+    expect(controllerMock.getClusters()).andReturn(clustersMock).atLeastOnce();
+    expect(clustersMock.getCluster(expectedClusterName)).andReturn(clusterMock).atLeastOnce();
+    expect(clusterMock.getDesiredConfigByType("logsearch-site")).andReturn(logSearchSiteConfig).atLeastOnce();
+    expect(clusterMock.getServiceComponentHosts("LOGSEARCH", "LOGSEARCH_SERVER")).andReturn(Collections.<ServiceComponentHost>emptyList()).atLeastOnce();
+
+    mockSupport.replayAll();
+
+    LoggingRequestHelperFactory helperFactory =
+      new LoggingRequestHelperFactoryImpl();
+
+    LoggingRequestHelper helper =
+      helperFactory.getHelper(controllerMock, expectedClusterName);
+
+    assertNull("LoggingRequestHelper object returned by the factory should have been null",
+      helper);
+
+    mockSupport.verifyAll();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
new file mode 100644
index 0000000..19c0756
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProviderTest.java
@@ -0,0 +1,170 @@
+/**
+ * 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.
+ */
+package org.apache.ambari.server.controller.logging;
+
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.PropertyProvider;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.ComponentInfo;
+import org.apache.ambari.server.state.LogDefinition;
+import org.apache.ambari.server.state.StackId;
+import org.easymock.Capture;
+import org.easymock.EasyMockSupport;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Set;
+
+import static org.junit.Assert.*;
+import static org.easymock.EasyMock.*;
+
+public class LoggingSearchPropertyProviderTest {
+
+  @Test
+  public void testBasicCall() throws Exception {
+    final String expectedLogFilePath =
+      "/var/log/hdfs/hdfs_namenode.log";
+
+    final String expectedSearchEnginePath = "/api/v1/clusters/clusterone/logging/searchEngine";
+
+    final String expectedAmbariURL = "http://c6401.ambari.apache.org:8080";
+
+    final String expectedTailFileQueryString = "?components_name=hdfs_namenode&host=c6401.ambari.apache.org&pageSize=50";
+
+    final String expectedStackName = "HDP";
+    final String expectedStackVersion = "2.4";
+    final String expectedComponentName = "NAMENODE";
+    final String expectedServiceName = "HDFS";
+    final String expectedLogSearchComponentName = "hdfs_namenode";
+
+    EasyMockSupport mockSupport = new EasyMockSupport();
+
+    Resource resourceMock =
+      mockSupport.createMock(Resource.class);
+    expect(resourceMock.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "component_name"))).andReturn(expectedComponentName).atLeastOnce();
+    expect(resourceMock.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "host_name"))).andReturn("c6401.ambari.apache.org").atLeastOnce();
+    expect(resourceMock.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "cluster_name"))).andReturn("clusterone").atLeastOnce();
+
+    Capture<HostComponentLoggingInfo> captureLogInfo = new Capture<HostComponentLoggingInfo>();
+    // expect set method to be called
+    resourceMock.setProperty(eq("logging"), capture(captureLogInfo));
+
+    LoggingRequestHelperFactory helperFactoryMock =
+      mockSupport.createMock(LoggingRequestHelperFactory.class);
+
+    LoggingRequestHelper helperMock =
+      mockSupport.createMock(LoggingRequestHelper.class);
+
+    expect(helperMock.sendGetLogFileNamesRequest(expectedLogSearchComponentName, "c6401.ambari.apache.org")).andReturn(Collections.singleton(expectedLogFilePath));
+
+    Request requestMock =
+      mockSupport.createMock(Request.class);
+
+    Predicate predicateMock =
+      mockSupport.createMock(Predicate.class);
+
+    LoggingSearchPropertyProvider.ControllerFactory factoryMock =
+      mockSupport.createMock(LoggingSearchPropertyProvider.ControllerFactory.class);
+
+    AmbariManagementController controllerMock =
+      mockSupport.createMock(AmbariManagementController.class);
+
+    AmbariMetaInfo metaInfoMock =
+      mockSupport.createMock(AmbariMetaInfo.class);
+
+    Clusters clustersMock =
+      mockSupport.createMock(Clusters.class);
+
+    Cluster clusterMock =
+      mockSupport.createMock(Cluster.class);
+
+    StackId stackIdMock =
+      mockSupport.createMock(StackId.class);
+
+    ComponentInfo componentInfoMock =
+      mockSupport.createMock(ComponentInfo.class);
+
+    LogDefinition logDefinitionMock =
+      mockSupport.createMock(LogDefinition.class);
+
+    expect(factoryMock.getAmbariManagementController()).andReturn(controllerMock);
+    expect(controllerMock.getAmbariServerURI(expectedSearchEnginePath)).
+      andReturn(expectedAmbariURL + expectedSearchEnginePath).atLeastOnce();
+    expect(controllerMock.getAmbariMetaInfo()).andReturn(metaInfoMock).atLeastOnce();
+    expect(controllerMock.getClusters()).andReturn(clustersMock).atLeastOnce();
+    expect(clustersMock.getCluster("clusterone")).andReturn(clusterMock).atLeastOnce();
+    expect(stackIdMock.getStackName()).andReturn(expectedStackName).atLeastOnce();
+    expect(stackIdMock.getStackVersion()).andReturn(expectedStackVersion).atLeastOnce();
+    expect(clusterMock.getCurrentStackVersion()).andReturn(stackIdMock).atLeastOnce();
+
+    expect(metaInfoMock.getComponentToService(expectedStackName, expectedStackVersion, expectedComponentName)).andReturn(expectedServiceName).atLeastOnce();
+    expect(metaInfoMock.getComponent(expectedStackName, expectedStackVersion, expectedServiceName, expectedComponentName)).andReturn(componentInfoMock).atLeastOnce();
+
+    expect(componentInfoMock.getLogs()).andReturn(Collections.singletonList(logDefinitionMock)).atLeastOnce();
+    expect(logDefinitionMock.getLogId()).andReturn(expectedLogSearchComponentName).atLeastOnce();
+
+    expect(helperFactoryMock.getHelper(controllerMock, "clusterone")).andReturn(helperMock).atLeastOnce();
+
+    mockSupport.replayAll();
+
+    PropertyProvider propertyProvider =
+      new LoggingSearchPropertyProvider(helperFactoryMock, factoryMock);
+
+
+    Set<Resource> returnedResources =
+      propertyProvider.populateResources(Collections.singleton(resourceMock), requestMock, predicateMock);
+
+    assertEquals("Returned resource set was of an incorrect size",
+      1, returnedResources.size());
+
+    HostComponentLoggingInfo returnedLogInfo =
+      captureLogInfo.getValue();
+
+    assertNotNull("Returned log info should not be null",
+      returnedLogInfo);
+
+    assertEquals("Returned component was not the correct name",
+      "hdfs_namenode", returnedLogInfo.getComponentName());
+
+    assertEquals("Returned list of log file names for this component was incorrect",
+      1, returnedLogInfo.getListOfLogFileDefinitions().size());
+
+    LogFileDefinitionInfo definitionInfo =
+      returnedLogInfo.getListOfLogFileDefinitions().get(0);
+
+    assertEquals("Incorrect log file type was found",
+      LogFileType.SERVICE, definitionInfo.getLogFileType());
+    assertEquals("Incorrect log file path found",
+      expectedLogFilePath, definitionInfo.getLogFileName());
+    assertEquals("Incorrect URL path to searchEngine",
+      expectedAmbariURL + expectedSearchEnginePath, definitionInfo.getSearchEngineURL());
+    assertEquals("Incorrect URL path to log file tail",
+      expectedAmbariURL + expectedSearchEnginePath + expectedTailFileQueryString, definitionInfo.getLogFileTailURL());
+
+
+
+    mockSupport.verifyAll();
+  }
+
+}


[37/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java
new file mode 100644
index 0000000..c32dc36
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGeneratorBase.java
@@ -0,0 +1,184 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.graph;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.ambari.logsearch.util.DateUtil;
+import org.apache.ambari.logsearch.view.VBarGraphData;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.solr.client.solrj.response.RangeFacet;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.ObjectWriter;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class GraphDataGeneratorBase {
+
+  @Autowired
+  DateUtil dateUtil;
+
+  @SuppressWarnings("unchecked")
+  protected void extractRangeStackValuesFromBucket(
+    SimpleOrderedMap<Object> jsonFacetResponse, String outerField,
+    String innerField, List<VBarGraphData> histogramData) {
+    NamedList<Object> stack = (NamedList<Object>) jsonFacetResponse
+      .get(outerField);
+    ArrayList<Object> stackBuckets = (ArrayList<Object>) stack
+      .get("buckets");
+    for (Object temp : stackBuckets) {
+      VBarGraphData vBarGraphData = new VBarGraphData();
+
+      SimpleOrderedMap<Object> level = (SimpleOrderedMap<Object>) temp;
+      String name = ((String) level.getVal(0)).toUpperCase();
+      vBarGraphData.setName(name);
+
+      Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+      vBarGraphData.setDataCounts(vNameValues);
+      ArrayList<Object> levelBuckets = (ArrayList<Object>) ((NamedList<Object>) level
+        .get(innerField)).get("buckets");
+      for (Object temp1 : levelBuckets) {
+        SimpleOrderedMap<Object> countValue = (SimpleOrderedMap<Object>) temp1;
+        String value = dateUtil
+          .convertDateWithMillisecondsToSolrDate((Date) countValue
+            .getVal(0));
+
+        String count = "" + countValue.getVal(1);
+        VNameValue vNameValue = new VNameValue();
+        vNameValue.setName(value);
+        vNameValue.setValue(count);
+        vNameValues.add(vNameValue);
+      }
+      histogramData.add(vBarGraphData);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  protected boolean extractNonRangeStackValuesFromBucket(
+    SimpleOrderedMap<Object> jsonFacetResponse, String level,
+    Collection<VBarGraphData> vGraphDatas, String typeXAxis) {
+
+    boolean zeroFlag = true;
+    if (jsonFacetResponse.get(level).toString().equals("{count=0}")) {
+      return false;
+    }
+
+    NamedList<Object> list = (NamedList<Object>) jsonFacetResponse
+      .get(level);
+
+    ArrayList<Object> list3 = (ArrayList<Object>) list.get("buckets");
+    int i = 0;
+    for (i = 0; i < list3.size(); i++) {
+      VBarGraphData vGraphData = new VBarGraphData();
+
+
+      Collection<VNameValue> levelCounts = new ArrayList<VNameValue>();
+      vGraphData.setDataCounts(levelCounts);
+
+      SimpleOrderedMap<Object> valueCount = (SimpleOrderedMap<Object>) list3
+        .get(i);
+      String name = ("" + valueCount.getVal(0)).trim();
+      if (isTypeNumber(typeXAxis)) {
+        VNameValue nameValue = new VNameValue();
+        String value = ("" + valueCount.getVal(2)).trim().substring(0, ("" + valueCount.getVal(2)).indexOf("."));
+        nameValue.setName(name);
+        nameValue.setValue(value);
+        levelCounts.add(nameValue);
+      } else {
+        SimpleOrderedMap<Object> l1 = (SimpleOrderedMap<Object>) valueCount
+          .getVal(2);
+        ArrayList<Object> l2 = (ArrayList<Object>) l1.get("buckets");
+        for (int j = 0; l2 != null && j < l2.size(); j++) {
+          VNameValue nameValue = new VNameValue();
+          SimpleOrderedMap<Object> innerValueCount = (SimpleOrderedMap<Object>) l2
+            .get(j);
+          nameValue.setName(("" + innerValueCount.getVal(0)).trim());
+          nameValue.setValue(("" + innerValueCount.getVal(1)).trim());
+          levelCounts.add(nameValue);
+        }
+      }
+
+      vGraphData.setName(name);
+      vGraphDatas.add(vGraphData);
+    }
+    return zeroFlag;
+  }
+
+  @SuppressWarnings("unchecked")
+  protected boolean extractValuesFromJson(
+    SimpleOrderedMap<Object> jsonFacetResponse, String level,
+    VBarGraphData histogramData, List<RangeFacet.Count> counts) {
+    histogramData.setName(level);
+    Collection<VNameValue> levelCounts = new ArrayList<VNameValue>();
+    histogramData.setDataCounts(levelCounts);
+    boolean zeroFlag = true;
+    if (jsonFacetResponse.get(level).toString().equals("{count=0}")) {
+      for (RangeFacet.Count date : counts) {
+        VNameValue nameValue = new VNameValue();
+
+        nameValue.setName(date.getValue());
+        nameValue.setValue("0");
+
+        levelCounts.add(nameValue);
+      }
+      return false;
+    }
+    NamedList<Object> list = (NamedList<Object>) jsonFacetResponse
+      .get(level);
+    NamedList<Object> list2 = (NamedList<Object>) list.getVal(1);
+    ArrayList<Object> list3 = (ArrayList<Object>) list2.get("buckets");
+    int i = 0;
+    for (RangeFacet.Count date : counts) {
+      VNameValue nameValue = new VNameValue();
+      SimpleOrderedMap<Object> valueCount = (SimpleOrderedMap<Object>) list3
+        .get(i);
+      String count = ("" + valueCount.getVal(1)).trim();
+      if (!"0".equals(count)) {
+        zeroFlag = false;
+      }
+      nameValue.setName(date.getValue());
+      nameValue.setValue(count);
+
+      levelCounts.add(nameValue);
+      i++;
+    }
+
+    return zeroFlag;
+  }
+
+  protected boolean isTypeNumber(String typeXAxis) {
+    return "long".contains(typeXAxis) || "int".contains(typeXAxis)
+      || "float".contains(typeXAxis) || "double".contains(typeXAxis);
+  }
+
+  public String convertObjToString(Object obj) throws IOException {
+    if (obj == null) {
+      return "";
+    }
+    ObjectMapper mapper = new ObjectMapper();
+    ObjectWriter w = mapper.writerWithDefaultPrettyPrinter();
+    return w.writeValueAsString(obj);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGnerator.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGnerator.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGnerator.java
new file mode 100644
index 0000000..44143f4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/graph/GraphDataGnerator.java
@@ -0,0 +1,397 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.graph;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.dao.SolrDaoBase;
+import org.apache.ambari.logsearch.query.QueryGeneration;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.DateUtil;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.view.VBarDataList;
+import org.apache.ambari.logsearch.view.VBarGraphData;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.FacetField;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.RangeFacet;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class GraphDataGnerator extends GraphDataGeneratorBase {
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  QueryGeneration queryGenerator;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  DateUtil dateUtil;
+
+  private static Logger logger = Logger.getLogger(GraphDataGnerator.class);
+
+  public String getAnyGraphData(SearchCriteria searchCriteria,
+                                SolrDaoBase solrDaoBase, SolrQuery solrQuery) {
+    // X axis credentials
+    String xAxisField = (String) searchCriteria.getParamValue("xAxis");
+    String stackField = (String) searchCriteria.getParamValue("stackBy");
+    String from = (String) searchCriteria.getParamValue("from");
+    String to = (String) searchCriteria.getParamValue("to");
+    String unit = (String) searchCriteria.getParamValue("unit");
+    String suffix = (String) searchCriteria.getParamValue("suffix");
+    String typeXAxis = ConfigUtil.schemaFieldsName.get(xAxisField + suffix);
+    typeXAxis = (stringUtil.isEmpty(typeXAxis)) ? "string" : typeXAxis;
+
+    // Y axis credentials
+    String yAxisField = (String) searchCriteria.getParamValue("yAxis");
+
+    searchCriteria.addParam("type", typeXAxis);
+    String fieldTime = (String) searchCriteria.getParamValue("feildTime");
+
+    int garphType = getGraphType(searchCriteria);
+
+    switch (garphType) {
+      case 1:
+        return normalGraph(xAxisField, yAxisField, from, to, solrDaoBase,
+          typeXAxis, fieldTime, solrQuery);
+      case 2:
+        return rangeNonStackGraph(xAxisField, yAxisField, from, to, unit,
+          solrDaoBase, typeXAxis, fieldTime, solrQuery);
+      case 3:
+        return nonRangeStackGraph(xAxisField, yAxisField, stackField, from,
+          to, solrDaoBase, typeXAxis, fieldTime, solrQuery);
+      case 4:
+        return rangeStackGraph(xAxisField, yAxisField, stackField, from,
+          to, unit, solrDaoBase, typeXAxis, fieldTime, solrQuery);
+      default:
+        return null;
+    }
+  }
+
+  private int getGraphType(SearchCriteria searchCriteria) {
+    // X axis credentials
+    String xAxisField = (String) searchCriteria.getParamValue("xAxis");
+    String stackField = (String) searchCriteria.getParamValue("stackBy");
+    String from = (String) searchCriteria.getParamValue("from");
+    String to = (String) searchCriteria.getParamValue("to");
+    String xType = (String) searchCriteria.getParamValue("type");
+
+    if (xType == null)
+      return 0;
+
+    // Y axis credentials
+    String yAxisField = (String) searchCriteria.getParamValue("yAxis");
+    if (stringUtil.isEmpty(xAxisField) || stringUtil.isEmpty(yAxisField)) {
+    }
+    // Normal Graph Type
+    else if (stringUtil.isEmpty(stackField) && !stringUtil.isEmpty(to)
+      && !stringUtil.isEmpty(from)
+      && !(xType.contains("date") || xType.contains("time")))
+      return 1;
+      // Range(Non-Stack) Graph Type
+    else if (stringUtil.isEmpty(stackField) && !stringUtil.isEmpty(to)
+      && !stringUtil.isEmpty(from)
+      && (xType.contains("date") || xType.contains("time")))
+      return 2;
+      // Non-Range Stack Graph Type
+    else if (!stringUtil.isEmpty(stackField) && !stringUtil.isEmpty(to)
+      && !stringUtil.isEmpty(from)
+      && !(xType.contains("date") || xType.contains("time")))
+      return 3;
+      // Range Stack GraphType
+    else if (!stringUtil.isEmpty(stackField) && !stringUtil.isEmpty(to)
+      && !stringUtil.isEmpty(from)
+      && (xType.contains("date") || xType.contains("time")))
+      return 4;
+
+    return 0;
+  }
+
+  @SuppressWarnings("unchecked")
+  private String normalGraph(String xAxisField, String yAxisField,
+                             String from, String to, SolrDaoBase solrDaoBase, String typeXAxis,
+                             String fieldTime, SolrQuery solrQuery) {
+    VBarDataList dataList = new VBarDataList();
+    Collection<VBarGraphData> vBarGraphDatas = new ArrayList<VBarGraphData>();
+    VBarGraphData vBarGraphData = new VBarGraphData();
+    Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setSingleIncludeFilter(solrQuery, fieldTime, "[" + from
+      + " TO " + to + "]");
+    if (typeXAxis.contains("string")
+      || typeXAxis.contains("key_lower_case")
+      || typeXAxis.contains("text")) {
+      queryGenerator.setFacetField(solrQuery, xAxisField);
+      try {
+        QueryResponse response = solrDaoBase.process(solrQuery);
+        Long count = response.getResults().getNumFound();
+
+        if (response != null && count > 0) {
+          FacetField facetField = response.getFacetField(xAxisField);
+          if (facetField != null) {
+            List<Count> countValues = facetField.getValues();
+            for (Count cnt : countValues) {
+              VNameValue vNameValue = new VNameValue();
+              vNameValue.setName(cnt.getName());
+              vNameValue.setValue("" + cnt.getCount());
+              vNameValues.add(vNameValue);
+            }
+            vBarGraphData.setDataCounts(vNameValues);
+            vBarGraphData.setName(xAxisField);
+            vBarGraphDatas.add(vBarGraphData);
+            dataList.setGraphData(vBarGraphDatas);
+          }
+        }
+        return convertObjToString(dataList);
+      } catch (SolrException | SolrServerException | IOException e) {
+
+      }
+    } else {
+      queryGenerator.setRowCount(solrQuery, 0);
+      String yAxis = yAxisField.contains("count") ? "sum" : yAxisField;
+      String jsonQuery = queryGenerator
+        .buildJSONFacetAggregatedFuncitonQuery(yAxis,
+          xAxisField);
+      queryGenerator.setJSONFacet(solrQuery, jsonQuery);
+      try {
+        QueryResponse response = solrDaoBase.process(solrQuery);
+
+        SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+          .getResponse().get("facets");
+        if (jsonFacetResponse.toString().equals("{count=0}"))
+          return convertObjToString(dataList);
+        VNameValue value = new VNameValue();
+        String sum = jsonFacetResponse.getVal(1).toString();
+        value.setName(xAxisField);
+        value.setValue(sum.substring(0, sum.indexOf(".")));
+
+        vNameValues.add(value);
+        vBarGraphData.setDataCounts(vNameValues);
+        vBarGraphData.setName(xAxisField);
+        vBarGraphDatas.add(vBarGraphData);
+        dataList.setGraphData(vBarGraphDatas);
+        return convertObjToString(dataList);
+      } catch (SolrException | SolrServerException | IOException e) {
+
+      }
+    }
+
+    return null;
+  }
+
+  @SuppressWarnings("unchecked")
+  private String nonRangeStackGraph(String xAxisField, String yAxisField,
+                                    String stackField, String from, String to, SolrDaoBase solrDaoBase,
+                                    String typeXAxis, String fieldTime, SolrQuery solrQuery) {
+    VBarDataList dataList = new VBarDataList();
+    Collection<VBarGraphData> vGraphData = new ArrayList<VBarGraphData>();
+
+    String mainQuery = queryGenerator.buildInclusiveRangeFilterQuery(
+      fieldTime, from, to);
+    queryGenerator.setMainQuery(solrQuery, mainQuery);
+    queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+    String jsonQuery = "";
+
+    if (isTypeNumber(typeXAxis)) {
+      String function = (yAxisField.contains("count")) ? "sum"
+        : yAxisField;
+      jsonQuery = queryGenerator.buidlJSONFacetRangeQueryForNumber(
+        stackField, xAxisField, function);
+    } else {
+      jsonQuery = queryGenerator.buildJsonFacetTermsRangeQuery(
+        stackField, xAxisField);
+    }
+
+    try {
+      queryGenerator.setJSONFacet(solrQuery, jsonQuery);
+      dataList.setGraphData(vGraphData);
+
+      QueryResponse response = solrDaoBase.process(solrQuery);
+      if (response == null) {
+        response = new QueryResponse();
+      }
+      Long count = response.getResults().getNumFound();
+      if (count <= 0)
+        return convertObjToString(dataList);
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+        .getResponse().get("facets");
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.toString().equals("{count=0}")) {
+        return convertObjToString(dataList);
+      }
+
+      extractNonRangeStackValuesFromBucket(jsonFacetResponse, stackField, vGraphData,
+        typeXAxis);
+
+      if (LogSearchConstants.SOLR_LEVEL.equalsIgnoreCase(stackField)
+        && LogSearchConstants.SOLR_LEVEL
+        .equalsIgnoreCase(xAxisField)) {
+        Collection<VBarGraphData> levelVGraphData = dataList.getGraphData();
+        List<String> logLevels = new ArrayList<String>();
+
+        logLevels.add(LogSearchConstants.FATAL);
+        logLevels.add(LogSearchConstants.ERROR);
+        logLevels.add(LogSearchConstants.WARN);
+        logLevels.add(LogSearchConstants.INFO);
+        logLevels.add(LogSearchConstants.DEBUG);
+        logLevels.add(LogSearchConstants.TRACE);
+
+        for (VBarGraphData garphData : levelVGraphData) {
+          Collection<VNameValue> valueList = garphData.getDataCount();
+          Collection<VNameValue> valueListSorted = new ArrayList<VNameValue>();
+          for (String level : logLevels) {
+            String val = "0";
+            for (VNameValue value : valueList) {
+              if (value.getName().equalsIgnoreCase(level)) {
+                val = value.getValue();
+                break;
+              }
+            }
+            VNameValue v1 = new VNameValue();
+            v1.setName(level.toUpperCase());
+            v1.setValue(val);
+            valueListSorted.add(v1);
+          }
+          garphData.setDataCounts(valueListSorted);
+        }
+      }
+
+      return convertObjToString(dataList);
+    } catch (SolrException | IOException | SolrServerException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.DATA_NOT_FOUND);
+    }
+
+  }
+
+  @SuppressWarnings("unchecked")
+  private String rangeNonStackGraph(String xAxisField, String yAxisField,
+                                    String from, String to, String unit, SolrDaoBase solrDaoBase,
+                                    String typeXAxis, String fieldTime, SolrQuery solrQuery) {
+    VBarDataList dataList = new VBarDataList();
+    Collection<VBarGraphData> vBarGraphDatas = new ArrayList<VBarGraphData>();
+    VBarGraphData vBarGraphData = new VBarGraphData();
+    Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+
+    queryGenerator.setMainQuery(solrQuery, null);
+
+    if (isTypeNumber(typeXAxis)) {
+      queryGenerator.setSingleRangeFilter(solrQuery, fieldTime, from, to);
+      return normalGraph(xAxisField, yAxisField, from, to, solrDaoBase,
+        typeXAxis, fieldTime, solrQuery);
+    } else {
+      try {
+        queryGenerator.setFacetRange(solrQuery, xAxisField, from, to,
+          unit);
+        QueryResponse response = solrDaoBase.process(solrQuery);
+        if (response == null)
+          response = new QueryResponse();
+        Long count = response.getResults().getNumFound();
+        if (count > 0) {
+
+          @SuppressWarnings("rawtypes")
+          List<RangeFacet> rangeFacet = response.getFacetRanges();
+          if (rangeFacet == null)
+            return convertObjToString(dataList);
+
+          List<RangeFacet.Count> listCount = rangeFacet.get(0)
+            .getCounts();
+          if (listCount != null) {
+            for (RangeFacet.Count cnt : listCount) {
+              VNameValue vNameValue = new VNameValue();
+              vNameValue.setName(cnt.getValue());
+              vNameValue.setValue("" + cnt.getCount());
+              vNameValues.add(vNameValue);
+            }
+            vBarGraphData.setDataCounts(vNameValues);
+            vBarGraphDatas.add(vBarGraphData);
+            vBarGraphData.setName(xAxisField);
+            dataList.setGraphData(vBarGraphDatas);
+          }
+        }
+        return convertObjToString(dataList);
+      } catch (SolrException | SolrServerException | IOException e) {
+
+      }
+    }
+    return null;
+  }
+
+  @SuppressWarnings("unchecked")
+  private String rangeStackGraph(String xAxisField, String yAxisField,
+                                 String stackField, String from, String to, String unit,
+                                 SolrDaoBase solrDaoBase, String typeXAxis, String fieldTime, SolrQuery solrQuery) {
+    VBarDataList dataList = new VBarDataList();
+    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+
+    String jsonHistogramQuery = queryGenerator
+      .buildJSONFacetTermTimeRangeQuery(stackField, xAxisField, from,
+        to, unit).replace("\\", "");
+
+    try {
+      solrQuery.set("json.facet", jsonHistogramQuery);
+      queryGenerator.setRowCount(solrQuery, 0);
+      QueryResponse response = solrDaoBase.process(solrQuery);
+      if (response == null)
+        response = new QueryResponse();
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+        .getResponse().get("facets");
+
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.toString().equals("{count=0}"))
+        return convertObjToString(dataList);
+
+      extractRangeStackValuesFromBucket(jsonFacetResponse, "x", "y", histogramData);
+
+      dataList.setGraphData(histogramData);
+      return convertObjToString(dataList);
+
+    } catch (SolrException | IOException | SolrServerException e) {
+    }
+
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java
new file mode 100644
index 0000000..e16faa0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/AuditMgr.java
@@ -0,0 +1,810 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.manager;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.ManageStartEndTime;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.dao.AuditSolrDao;
+import org.apache.ambari.logsearch.graph.GraphDataGnerator;
+import org.apache.ambari.logsearch.query.QueryGeneration;
+import org.apache.ambari.logsearch.util.BizUtil;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.DateUtil;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.view.VBarDataList;
+import org.apache.ambari.logsearch.view.VBarGraphData;
+import org.apache.ambari.logsearch.view.VGroupList;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.view.VSolrLogList;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.FacetField;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.RangeFacet;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditMgr extends MgrBase {
+  static Logger logger = Logger.getLogger(AuditMgr.class);
+
+  @Autowired
+  QueryGeneration queryGenerator;
+
+  @Autowired
+  AuditSolrDao auditSolrDao;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  BizUtil bizUtil;
+
+  @Autowired
+  DateUtil dateUtil;
+
+  @Autowired
+  GraphDataGnerator graphDataGnerator;
+
+  public String getAllSolrFields() {
+
+    Collection<String> fieldNames = new ArrayList<String>();
+    SolrQuery solrQuery = new SolrQuery();
+
+    int numberDocument = 0;
+    int size = 0;
+
+    try {
+      queryGenerator.setMainQuery(solrQuery, null);
+      queryGenerator.setRowCount(solrQuery, 10);
+
+      SearchCriteria searchCriteria = new SearchCriteria();
+      searchCriteria.setSortBy(LogSearchConstants.AUDIT_EVTTIME);
+      searchCriteria.setSortType(SolrQuery.ORDER.asc.toString());
+
+      queryGenerator.setSortOrderDefaultServiceLog(solrQuery,
+        searchCriteria);
+      SolrDocumentList docList = auditSolrDao.process(solrQuery)
+        .getResults();
+
+      if (docList.size() > 0) {
+        for (int i = 0; i < 10; i++) {
+          if (docList.get(i).size() > size) {
+            size = docList.get(i).size();
+            numberDocument = i;
+          }
+        }
+        fieldNames = docList.get(numberDocument).getFieldNames();
+        return convertObjToString(fieldNames);
+      }
+      return convertObjToString(fieldNames);
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getLogs(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    try {
+      QueryResponse response = auditSolrDao.process(solrQuery);
+      SolrDocumentList docList = response.getResults();
+      VSolrLogList collection = new VSolrLogList(docList);
+      collection.setStartIndex((int) docList.getStart());
+      collection.setTotalCount(docList.getNumFound());
+      collection.setPageSize(searchCriteria.getMaxRows());
+      return convertObjToString(collection);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public SolrDocumentList getComponents(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    try {
+      queryGenerator.setFacetField(solrQuery,
+        LogSearchConstants.AUDIT_COMPONENT);
+      queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+      List<FacetField> facetFields = null;
+      List<Count> componentsCount = new ArrayList<Count>();
+      FacetField facetField = null;
+
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+      if (queryResponse == null) {
+        queryResponse = new QueryResponse();
+      }
+
+      facetFields = queryResponse.getFacetFields();
+      if (facetFields == null) {
+        return new SolrDocumentList();
+      }
+      if (!facetFields.isEmpty()) {
+        facetField = facetFields.get(0);
+      }
+      if (facetField != null) {
+        componentsCount = facetField.getValues();
+      }
+      SolrDocumentList docList = new SolrDocumentList();
+      for (Count compnonet : componentsCount) {
+        SolrDocument solrDocument = new SolrDocument();
+        solrDocument.addField("type", compnonet.getName());
+        docList.add(solrDocument);
+      }
+      return docList;
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getAuditComponents(SearchCriteria searchCriteria) {
+    VGroupList vGroupList = new VGroupList();
+
+    try {
+
+      SolrDocumentList docList = getComponents(searchCriteria);
+
+      vGroupList.setGroupDocuments(docList);
+      return convertObjToString(vGroupList);
+    } catch (SolrException | IOException e) {
+      logger.error("Error", e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getAuditLineGraphData(SearchCriteria searchCriteria) {
+    VBarDataList dataList = new VBarDataList();
+    SolrQuery solrQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
+
+    String from = (String) searchCriteria.getParamValue("startTime");
+    String to = (String) searchCriteria.getParamValue("endTime");
+    String unit = (String) searchCriteria.getParamValue("unit");
+
+    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+    String jsonHistogramQuery = queryGenerator.buildJSONFacetTermTimeRangeQuery(
+      LogSearchConstants.AUDIT_COMPONENT,
+      LogSearchConstants.AUDIT_EVTTIME, from, to, unit).replace("\\",
+      "");
+
+    try {
+      queryGenerator.setJSONFacet(solrQuery, jsonHistogramQuery);
+      queryGenerator.setRowCount(solrQuery, 0);
+      QueryResponse response = auditSolrDao.process(solrQuery);
+      if (response == null)
+        response = new QueryResponse();
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+        .getResponse().get("facets");
+
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.toString().equals("{count=0}"))
+        return convertObjToString(dataList);
+
+      extractValuesFromBucket(jsonFacetResponse, "x", "y",
+        histogramData);
+
+      dataList.setGraphData(histogramData);
+      return convertObjToString(dataList);
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException("No Request Parameter",
+        MessageEnums.ERROR_SYSTEM);
+
+    }
+  }
+
+  public String getTopAuditFieldCount(SearchCriteria searchCriteria) {
+    Integer top = (Integer) searchCriteria.getParamValue("top");
+    String facetField = (String) searchCriteria.getParamValue("field");
+    if (top == null)
+      top = new Integer(10);
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    try {
+
+      List<VNameValue> nameValues = new ArrayList<VNameValue>();
+
+      VNameValueList nameValueList = new VNameValueList(nameValues);
+
+      queryGenerator.setFacetField(solrQuery, facetField);
+      queryGenerator.setFacetSort(solrQuery, "count");
+      queryGenerator.setFacetLimit(solrQuery, top.intValue());
+
+      List<Count> countList = new ArrayList<FacetField.Count>();
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+      if (queryResponse.getFacetField(facetField) != null) {
+        FacetField queryFacetField = queryResponse
+          .getFacetField(facetField);
+        if (queryFacetField != null) {
+          countList = queryFacetField.getValues();
+        }
+      }
+
+      for (Count cnt : countList) {
+        VNameValue nameValue = new VNameValue();
+        nameValue.setName(cnt.getName());
+
+        nameValue.setValue("" + cnt.getCount());
+        nameValues.add(nameValue);
+      }
+      return convertObjToString(nameValueList);
+
+    } catch (SolrException | IOException | SolrServerException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getLiveLogCounts() {
+    SolrQuery solrQuery = new SolrQuery();
+    solrQuery.setParam("event", "/getLiveLogsCount");
+    try {
+      String startDate = dateUtil
+        .convertGivenDateFormatToSolrDateFormat(ManageStartEndTime.startDate);
+
+      String endDate = dateUtil
+        .convertGivenDateFormatToSolrDateFormat(ManageStartEndTime.endDate);
+
+      queryGenerator.setMainQuery(solrQuery, null);
+      queryGenerator.setFacetRange(solrQuery,
+        LogSearchConstants.AUDIT_EVTTIME, startDate, endDate,
+        "+2MINUTE");
+      List<RangeFacet.Count> listCount;
+
+      QueryResponse response = auditSolrDao.process(solrQuery);
+      @SuppressWarnings("rawtypes")
+      List<RangeFacet> rangeFacet = response.getFacetRanges();
+      if (rangeFacet == null)
+        return convertObjToString(new VNameValueList());
+      listCount = rangeFacet.get(0).getCounts();
+
+      List<VNameValue> nameValues = new ArrayList<VNameValue>();
+      int count = 0;
+      for (RangeFacet.Count cnt : listCount) {
+        VNameValue nameValue = new VNameValue();
+        nameValue.setName("" + count);
+        nameValue.setValue("" + cnt.getCount());
+        nameValues.add(nameValue);
+        count++;
+      }
+      VNameValueList nameValueList = new VNameValueList(nameValues);
+
+      return convertObjToString(nameValueList);
+
+    } catch (SolrException | SolrServerException | ParseException
+      | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String topTenUsers(SearchCriteria searchCriteria) {
+
+    String jsonUserQuery = "{Users:{type:terms, field:reqUser, facet:{ Repo:{ type:terms, field:repo, facet:{eventCount:\"sum(event_count)\"}}}}}";
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    solrQuery.set("json.facet", jsonUserQuery);
+    queryGenerator.setRowCount(solrQuery, 0);
+    try {
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+
+      NamedList<Object> namedList = queryResponse.getResponse();
+      VBarDataList vBarDataList = new VBarDataList();
+      if (namedList == null) {
+        return convertObjToString(vBarDataList);
+      }
+
+      @SuppressWarnings("unchecked")
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList
+        .get("facets");
+      vBarDataList = bizUtil.buildSummaryForTopCounts(jsonFacetResponse);
+      return convertObjToString(vBarDataList);
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error("Error during solrQuery=" + e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String topTenResources(SearchCriteria searchCriteria) {
+
+    String jsonUserQuery = "{Users:{type:terms,field:resource,facet:{Repo:{type:terms,field:repo,facet:{eventCount:\"sum(event_count)\"}}}}}";
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    solrQuery.set("json.facet", jsonUserQuery);
+    queryGenerator.setRowCount(solrQuery, 0);
+    try {
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+
+      NamedList<Object> namedList = queryResponse.getResponse();
+      VBarDataList vBarDataList = new VBarDataList();
+      if (namedList == null) {
+        return convertObjToString(vBarDataList);
+      }
+
+      @SuppressWarnings("unchecked")
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList
+        .get("facets");
+
+      vBarDataList = bizUtil.buildSummaryForTopCounts(jsonFacetResponse);
+      return convertObjToString(vBarDataList);
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getRequestUserLineGraph(SearchCriteria searchCriteria) {
+
+    String from = (String) searchCriteria.getParamValue("startTime");
+    String to = (String) searchCriteria.getParamValue("endTime");
+    String unit = (String) searchCriteria.getParamValue("unit");
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+
+    VBarDataList dataList = new VBarDataList();
+    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+
+    queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+
+    String jsonHistogramQuery = queryGenerator
+      .buildJSONFacetTermTimeRangeQuery(
+        LogSearchConstants.AUDIT_REQUEST_USER,
+        LogSearchConstants.AUDIT_EVTTIME, from, to, unit)
+      .replace("\\", "");
+
+    try {
+      solrQuery.set("json.facet", jsonHistogramQuery);
+      queryGenerator.setRowCount(solrQuery, 0);
+      QueryResponse response = auditSolrDao.process(solrQuery);
+      if (response == null)
+        response = new QueryResponse();
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+        .getResponse().get("facets");
+
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.toString().equals("{count=0}"))
+        return convertObjToString(dataList);
+
+      extractValuesFromBucket(jsonFacetResponse, "x", "y", histogramData);
+
+      dataList.setGraphData(histogramData);
+      return convertObjToString(dataList);
+
+    } catch (SolrException | IOException | SolrServerException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+  }
+
+  public SolrDocumentList getRequestUser(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    try {
+      queryGenerator.setFacetField(solrQuery,
+        LogSearchConstants.AUDIT_REQUEST_USER);
+      queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+      List<FacetField> facetFields = null;
+      List<Count> componentsCount = new ArrayList<Count>();
+      FacetField facetField = null;
+
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+      if (queryResponse == null) {
+        queryResponse = new QueryResponse();
+      }
+
+      facetFields = queryResponse.getFacetFields();
+      if (facetFields == null) {
+        return new SolrDocumentList();
+      }
+      if (!facetFields.isEmpty()) {
+        facetField = facetFields.get(0);
+      }
+      if (facetField != null) {
+        componentsCount = facetField.getValues();
+      }
+      SolrDocumentList docList = new SolrDocumentList();
+      for (Count compnonet : componentsCount) {
+        SolrDocument solrDocument = new SolrDocument();
+        solrDocument.addField("type", compnonet.getName());
+        docList.add(solrDocument);
+      }
+      return docList;
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getAuditLogsSchemaFieldsName() {
+    String suffix = PropertiesUtil.getProperty("auditlog.solr.core.logs");
+    String excludeArray[] = PropertiesUtil
+      .getPropertyStringList("auditlog.exclude.columnlist");
+    List<String> fieldNames = new ArrayList<String>();
+    HashMap<String, String> uiFieldColumnMapping = new HashMap<String, String>();
+    ConfigUtil.getSchemaFieldsName(suffix, excludeArray, fieldNames);
+
+    for (String fieldName : fieldNames) {
+      String uiField = ConfigUtil.auditLogsColumnMapping.get(fieldName
+        + LogSearchConstants.SOLR_SUFFIX);
+      if (uiField == null) {
+        uiFieldColumnMapping.put(fieldName, fieldName);
+      } else {
+        uiFieldColumnMapping.put(fieldName, uiField);
+      }
+    }
+
+    try {
+      uiFieldColumnMapping = bizUtil
+        .sortHashMapByValuesD(uiFieldColumnMapping);
+      return convertObjToString(uiFieldColumnMapping);
+    } catch (IOException e) {
+      logger.error(e);
+    }
+    throw restErrorUtil.createRESTException(
+      "Cache is Empty for FieldsName", MessageEnums.DATA_NOT_FOUND);
+  }
+
+  public String getAnyGraphData(SearchCriteria searchCriteria) {
+    searchCriteria.addParam("feildTime", LogSearchConstants.AUDIT_EVTTIME);
+    String suffix = PropertiesUtil.getProperty("auditlog.solr.core.logs");
+    searchCriteria.addParam("suffix", suffix);
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    String result = graphDataGnerator.getAnyGraphData(searchCriteria,
+      auditSolrDao, solrQuery);
+    if (result != null)
+      return result;
+    try {
+      return convertObjToString(new VBarDataList());
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public void extractValuesFromBucket(
+    SimpleOrderedMap<Object> jsonFacetResponse, String outerField,
+    String innerField, List<VBarGraphData> histogramData) {
+    NamedList<Object> stack = (NamedList<Object>) jsonFacetResponse
+      .get(outerField);
+    ArrayList<Object> stackBuckets = (ArrayList<Object>) stack
+      .get("buckets");
+    for (Object temp : stackBuckets) {
+      VBarGraphData vBarGraphData = new VBarGraphData();
+
+      SimpleOrderedMap<Object> level = (SimpleOrderedMap<Object>) temp;
+      String name = ((String) level.getVal(0)).toUpperCase();
+      vBarGraphData.setName(name);
+
+      Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+      vBarGraphData.setDataCounts(vNameValues);
+      ArrayList<Object> levelBuckets = (ArrayList<Object>) ((NamedList<Object>) level
+        .get(innerField)).get("buckets");
+      for (Object temp1 : levelBuckets) {
+        SimpleOrderedMap<Object> countValue = (SimpleOrderedMap<Object>) temp1;
+        String value = dateUtil
+          .convertDateWithMillisecondsToSolrDate((Date) countValue
+            .getVal(0));
+
+        String count = "" + countValue.getVal(1);
+        VNameValue vNameValue = new VNameValue();
+        vNameValue.setName(value);
+        vNameValue.setValue(count);
+        vNameValues.add(vNameValue);
+      }
+      histogramData.add(vBarGraphData);
+    }
+  }
+
+  @SuppressWarnings({"unchecked", "resource"})
+  public Response exportUserTableToTextFile(SearchCriteria searchCriteria) {
+    String jsonUserQuery = "{ Users: { type: terms, field: reqUser, facet:  {Repo: {  type: terms, field: repo, facet: {  eventCount: \"sum(event_count)\"}}}},x:{ type: terms,field: resource, facet: {y: {  type: terms, field: repo,facet: {  eventCount: \"sum(event_count)\"}}}}}";
+
+    SolrQuery solrQuery = queryGenerator
+      .commonAuditFilterQuery(searchCriteria);
+    String startTime = (String) searchCriteria.getParamValue("startTime");
+    String endTime = (String) searchCriteria.getParamValue("endTime");
+
+    startTime = startTime == null ? "" : startTime;
+    endTime = endTime == null ? "" : "_" + endTime;
+
+    queryGenerator.setJSONFacet(solrQuery, jsonUserQuery);
+    queryGenerator.setRowCount(solrQuery, 0);
+
+    String dataFormat = (String) searchCriteria.getParamValue("format");
+    try {
+      QueryResponse queryResponse = auditSolrDao.process(solrQuery);
+
+      NamedList<Object> namedList = queryResponse.getResponse();
+      VBarDataList vBarUserDataList = new VBarDataList();
+      VBarDataList vBarResourceDataList = new VBarDataList();
+      if (namedList == null) {
+
+      }
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) namedList
+        .get("facets");
+      vBarUserDataList = bizUtil
+        .buildSummaryForTopCounts(jsonFacetResponse);
+      vBarResourceDataList = bizUtil
+        .buildSummaryForResourceCounts(jsonFacetResponse);
+      String data = "";
+      String summary = "";
+      if ("text".equals(dataFormat)) {
+        int users = 0;
+        int resources = 0;
+        summary += "\n\n\n\n";
+        data += addBlank("Users") + "Components/Access" + "\n";
+        data += "--------------------------------------------------------------------------\n";
+        Collection<VBarGraphData> tableUserData = vBarUserDataList
+          .getGraphData();
+        for (VBarGraphData graphData : tableUserData) {
+          String userName = graphData.getName();
+          String largeUserName = "";
+
+          if (userName.length() > 45) {
+            largeUserName = userName.substring(0, 45);
+            data += addBlank(largeUserName);
+          } else
+            data += addBlank(userName);
+
+          Collection<VNameValue> vnameValueList = graphData
+            .getDataCount();
+          int count = 0;
+          String blank = "";
+          for (VNameValue vNameValue : vnameValueList) {
+            data += blank + vNameValue.getName() + " "
+              + vNameValue.getValue() + "\n";
+            if (count == 0)
+              blank = addBlank(blank);
+            count++;
+
+          }
+          while (largeUserName.length() > 0) {
+            data += largeUserName.substring(0, 45) + "\n";
+          }
+
+          users += 1;
+        }
+        data += "\n\n\n\n\n\n";
+        data += addBlank("Resources") + "Components/Access" + "\n";
+        data += "--------------------------------------------------------------------------\n";
+        Collection<VBarGraphData> tableResourceData = vBarResourceDataList
+          .getGraphData();
+        for (VBarGraphData graphData : tableResourceData) {
+          String resourceName = graphData.getName();
+          String largeResourceName = resourceName;
+          if (largeResourceName.length() > 45) {
+            resourceName = largeResourceName.substring(0, 45);
+            largeResourceName = largeResourceName.substring(45, largeResourceName.length());
+          } else {
+            largeResourceName = "";
+          }
+
+          //resourceName = resourceName.replaceAll("(.{45})", resourceName.substring(0, 45)+"\n");
+          data += addBlank(resourceName);
+          Collection<VNameValue> vnameValueList = graphData
+            .getDataCount();
+          int count = 0;
+          String blank = "";
+          for (VNameValue vNameValue : vnameValueList) {
+            data += blank + vNameValue.getName() + " "
+              + vNameValue.getValue() + "\n";
+            if (count == 0)
+              blank = addBlank(blank);
+            count++;
+          }
+          String tempLargeResourceName = largeResourceName;
+          while (largeResourceName.length() > 45) {
+            largeResourceName = tempLargeResourceName.substring(0, 45);
+            tempLargeResourceName = tempLargeResourceName.substring(45, tempLargeResourceName.length());
+            data += largeResourceName + "\n";
+          }
+          if (largeResourceName.length() < 45 && !largeResourceName.isEmpty()) {
+            data += largeResourceName + "\n";
+          }
+          resources += 1;
+        }
+        String header = "--------------------------------SUMMARY-----------------------------------\n";
+        summary = header + "Users  = " + users + "\nResources  = " + resources + "\n" + summary;
+        data = summary + data;
+      } else {
+        data = "{" + convertObjToString(vBarUserDataList) + "," + convertObjToString(vBarResourceDataList) + "}";
+        dataFormat = "json";
+      }
+      String fileName = "Users_Resource" + startTime + endTime
+        + ".";
+      File file = File.createTempFile(fileName, dataFormat);
+
+      FileOutputStream fis = new FileOutputStream(file);
+      fis.write(data.getBytes());
+      return Response
+        .ok(file, MediaType.APPLICATION_OCTET_STREAM)
+        .header("Content-Disposition",
+          "attachment;filename=" + fileName + dataFormat)
+        .build();
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error("Error during solrQuery=" + e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  private String addBlank(String field) {
+    int blanks = 50;
+    int strSize = field.length();
+    String fieldWithBlank = field;
+    for (int i = 0; i < blanks - strSize; i++) {
+      fieldWithBlank += " ";
+    }
+    return fieldWithBlank;
+  }
+
+  public String getServiceLoad(SearchCriteria searchCriteria) {
+    VBarDataList dataList = new VBarDataList();
+    Collection<VBarGraphData> vaDatas = new ArrayList<VBarGraphData>();
+    dataList.setGraphData(vaDatas);
+
+    SolrQuery serivceLoadQuery = queryGenerator.commonAuditFilterQuery(searchCriteria);
+
+    try {
+      queryGenerator.setFacetField(serivceLoadQuery,
+        LogSearchConstants.AUDIT_COMPONENT);
+      QueryResponse serviceLoadResponse = auditSolrDao
+        .process(serivceLoadQuery);
+      if (serviceLoadResponse == null)
+        return "[]";
+      List<Count> serviceLoadFacets = serviceLoadResponse.getFacetField(
+        LogSearchConstants.AUDIT_COMPONENT).getValues();
+      for (Count cnt : serviceLoadFacets) {
+        List<VNameValue> valueList = new ArrayList<VNameValue>();
+        VBarGraphData vBarGraphData = new VBarGraphData();
+        vaDatas.add(vBarGraphData);
+        VNameValue vNameValue = new VNameValue();
+        vNameValue.setName(cnt.getName());
+        vBarGraphData.setName(cnt.getName().toUpperCase());
+        vNameValue.setValue("" + cnt.getCount());
+        valueList.add(vNameValue);
+        vBarGraphData.setDataCounts(valueList);
+      }
+
+
+      return convertObjToString(dataList);
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+    
+  /*  
+    String preDefinedJSON = getHadoopServiceConfigJSON();
+    try {
+      JSONObject serviceJSON = new JSONObject(preDefinedJSON).getJSONObject("service");
+      HashMap<String, Object> serviceMap = jsonUtil.jsonToMapObject(serviceJSON.toString());
+      Iterator<Entry<String, Object>> serviceMapIterator= serviceMap.entrySet().iterator();
+      List<VNameValue> newValueList = new ArrayList<VNameValue>();
+      for (VNameValue vNameValue : valueList) {
+        String name=vNameValue.getName();
+        while (serviceMapIterator.hasNext()) {
+          Map.Entry<String, Object> tempMap = serviceMapIterator
+              .next();
+          
+          String keyName = tempMap.getKey();
+          
+          JSONObject valueObj = new JSONObject(tempMap.toString().replace(keyName+"=", ""));
+          if(name.contains(keyName.toLowerCase())){
+            vNameValue.setName(valueObj.getString("label"));
+            break;
+          }
+          JSONArray componentsArray = valueObj.getJSONArray("components");
+          
+          for(int i =0;i< componentsArray.length();i++){
+            JSONObject jObj = componentsArray.getJSONObject(i);
+            String jsonName = jObj.getString("name");
+            if(name.contains(jsonName.toLowerCase())){
+              vNameValue.setName(valueObj.getString("label"));
+              break;
+            }
+          }
+          
+        }
+        if(newValueList.isEmpty()){
+          newValueList.add(vNameValue);
+        }else{
+          boolean isMatch = false;
+          for(VNameValue vValue: newValueList){
+            if(vValue.getName().equalsIgnoreCase(vNameValue.getName())){
+              isMatch =true;
+              Integer cnt1 = Integer.parseInt(vValue.getValue());
+              Integer cnt2 = Integer.parseInt(vNameValue.getValue());
+              vValue.setValue((cnt1+cnt2)+"");
+            }
+          }
+          if(!isMatch)
+            newValueList.add(vNameValue);
+        }
+      }
+      vBarGraphData.setDataCounts(newValueList);
+      vBarGraphData.setName("ServiceList");
+      return convertObjToString(dataList);
+      
+    } catch (Exception e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+          MessageEnums.ERROR_SYSTEM);
+    }*/
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileMgr.java
new file mode 100644
index 0000000..0388366
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogFileMgr.java
@@ -0,0 +1,170 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.manager;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.dao.AuditSolrDao;
+import org.apache.ambari.logsearch.dao.ServiceLogsSolrDao;
+import org.apache.ambari.logsearch.dao.SolrDaoBase;
+import org.apache.ambari.logsearch.view.VLogFile;
+import org.apache.ambari.logsearch.view.VLogFileList;
+import org.apache.ambari.logsearch.view.VSolrLogList;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.FacetField;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class LogFileMgr extends MgrBase {
+
+  private static Logger logger = Logger.getLogger(LogFileMgr.class);
+
+  private enum LOG_TYPE {
+    SERVICE, AUDIT
+  }
+
+  @Autowired
+  ServiceLogsSolrDao serviceLogsSolrDao;
+
+  @Autowired
+  AuditSolrDao auditSolrDao;
+
+  @Autowired
+  LogsMgr logMgr;
+
+  /**
+   * Search logFiles
+   *
+   * @param searchCriteria
+   * @return
+   */
+  public String searchLogFiles(SearchCriteria searchCriteria) {
+    VLogFileList logFileList = new VLogFileList();
+    List<VLogFile> logFiles = new ArrayList<VLogFile>();
+    String componentName = (String) searchCriteria.getParamValue("component");
+    String host = (String) searchCriteria.getParamValue("host");
+    int minCount = 1;// to remove zero count facet
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenrator.setMainQuery(solrQuery, null);
+    queryGenrator.setFacetField(solrQuery, LogSearchConstants.SOLR_PATH, minCount);
+    // adding filter
+    queryGenrator.setSingleIncludeFilter(solrQuery, LogSearchConstants.SOLR_COMPONENT, componentName);
+    queryGenrator.setSingleIncludeFilter(solrQuery, LogSearchConstants.SOLR_HOST, host);
+    try {
+      String logType = (String) searchCriteria.getParamValue("logType");
+      if (stringUtil.isEmpty(logType)) {
+        logType = LOG_TYPE.SERVICE.name();// default is service Log
+      }
+      SolrDaoBase daoMgr = null;
+      if (logType.equalsIgnoreCase(LOG_TYPE.SERVICE.name())) {
+        daoMgr = serviceLogsSolrDao;
+      } else if (logType.equalsIgnoreCase(LOG_TYPE.AUDIT.name())) {
+        daoMgr = auditSolrDao;
+      } else {
+        throw restErrorUtil.createRESTException(logType + " is not a valid logType", MessageEnums.INVALID_INPUT_DATA);
+      }
+      QueryResponse queryResponse = daoMgr.process(solrQuery);
+      if (queryResponse.getFacetField(LogSearchConstants.SOLR_PATH) != null) {
+        FacetField queryFacetField = queryResponse.getFacetField(LogSearchConstants.SOLR_PATH);
+        if (queryFacetField != null) {
+          List<Count> countList = queryFacetField.getValues();
+          for (Count count : countList) {
+            VLogFile vLogFile = new VLogFile();
+            String filePath = count.getName();
+            String fileName = FilenameUtils.getName(filePath);
+            vLogFile.setPath(filePath);
+            vLogFile.setName(fileName);
+            logFiles.add(vLogFile);
+          }
+        }
+      }
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error in solr query  :" + e.getLocalizedMessage() + "\n Query :" + solrQuery.toQueryString(),
+        e.getCause());
+      throw restErrorUtil.createRESTException("Please try later.", MessageEnums.ERROR_SYSTEM);
+    }
+    logFileList.setLogFiles(logFiles);
+    String jsonStr = "";
+    try {
+      jsonStr = convertObjToString(logFileList);
+    } catch (IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException("Please try later.", MessageEnums.ERROR_SYSTEM);
+    }
+    return jsonStr;
+  }
+
+  public String getLogFileTail(SearchCriteria searchCriteria) {
+    String host = (String) searchCriteria.getParamValue("host");
+    String logFile = (String) searchCriteria.getParamValue("name");
+    String component = (String) searchCriteria.getParamValue("component");
+    String tailSize = (String) searchCriteria.getParamValue("tailSize");
+    if (stringUtil.isEmpty(host)) {
+      throw restErrorUtil.createRESTException("missing Host Name",
+        MessageEnums.ERROR_SYSTEM);
+    }
+    tailSize = (stringUtil.isEmpty(tailSize)) ? "10" : tailSize;
+    SolrQuery logFileTailQuery = new SolrQuery();
+    try {
+      int tail = Integer.parseInt(tailSize);
+      tail = tail > 100 ? 100 : tail;
+      queryGenrator.setMainQuery(logFileTailQuery, null);
+      queryGenrator.setSingleIncludeFilter(logFileTailQuery,
+        LogSearchConstants.SOLR_HOST, host);
+      if (!stringUtil.isEmpty(logFile)) {
+        queryGenrator.setSingleIncludeFilter(logFileTailQuery,
+          LogSearchConstants.SOLR_PATH,
+          solrUtil.makeSolrSearchString(logFile));
+      } else if (!stringUtil.isEmpty(component)) {
+        queryGenrator.setSingleIncludeFilter(logFileTailQuery,
+          LogSearchConstants.SOLR_COMPONENT, component);
+      } else {
+        throw restErrorUtil.createRESTException("component or logfile parameter must be present",
+          MessageEnums.ERROR_SYSTEM);
+      }
+
+      queryGenrator.setRowCount(logFileTailQuery, tail);
+      queryGenrator.setSortOrderDefaultServiceLog(logFileTailQuery, new SearchCriteria());
+      VSolrLogList solrLogList = getLogAsPaginationProvided(logFileTailQuery, serviceLogsSolrDao);
+      return convertObjToString(solrLogList);
+
+    } catch (SolrException | IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    } catch (NumberFormatException ne) {
+
+      throw restErrorUtil.createRESTException(ne.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+
+    }
+  }
+}


[34/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/BizUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/BizUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/BizUtil.java
new file mode 100644
index 0000000..348ca4a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/BizUtil.java
@@ -0,0 +1,304 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.view.VBarDataList;
+import org.apache.ambari.logsearch.view.VBarGraphData;
+import org.apache.ambari.logsearch.view.VHost;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.ambari.logsearch.view.VSummary;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class BizUtil {
+  static Logger logger = Logger.getLogger(BizUtil.class);
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  public String convertObjectToNormalText(SolrDocumentList docList) {
+    String textToSave = "";
+    HashMap<String, String> blankFieldsMap = new HashMap<String, String>();
+    if (docList.isEmpty()) {
+      return "no data";
+    }
+    SolrDocument docForBlankCaculation = docList.get(0);
+    Collection<String> fieldsForBlankCaculation = docForBlankCaculation
+      .getFieldNames();
+
+    int maxLengthOfField = 0;
+    for (String field : fieldsForBlankCaculation) {
+      if (field.length() > maxLengthOfField)
+        maxLengthOfField = field.length();
+    }
+
+    for (String field : fieldsForBlankCaculation) {
+      blankFieldsMap
+        .put(field,
+          addBlanksToString(
+            maxLengthOfField - field.length(), field));
+    }
+
+    for (SolrDocument doc : docList) {
+
+      StringBuffer textTowrite = new StringBuffer();
+
+      if (doc.getFieldValue(LogSearchConstants.LOGTIME) != null) {
+        textTowrite.append(doc
+          .getFieldValue(LogSearchConstants.LOGTIME).toString()
+          + " ");
+      }
+      if (doc.getFieldValue(LogSearchConstants.SOLR_LEVEL) != null) {
+        textTowrite.append(
+          doc.getFieldValue(LogSearchConstants.SOLR_LEVEL)
+            .toString()).append(" ");
+      }
+      if (doc.getFieldValue(LogSearchConstants.SOLR_THREAD_NAME) != null) {
+        textTowrite.append(
+          doc.getFieldValue(LogSearchConstants.SOLR_THREAD_NAME)
+            .toString().trim()).append(" ");
+      }
+      if (doc.getFieldValue(LogSearchConstants.SOLR_LOGGER_NAME) != null) {
+        textTowrite.append(
+          doc.getFieldValue(LogSearchConstants.SOLR_LOGGER_NAME)
+            .toString().trim()).append(" ");
+      }
+      if (doc.getFieldValue(LogSearchConstants.SOLR_FILE) != null
+        && doc.getFieldValue(LogSearchConstants.SOLR_LINE_NUMBER) != null) {
+        textTowrite
+          .append(doc.getFieldValue(LogSearchConstants.SOLR_FILE)
+            .toString())
+          .append(":")
+          .append(doc.getFieldValue(
+            LogSearchConstants.SOLR_LINE_NUMBER).toString())
+          .append(" ");
+      }
+      if (doc.getFieldValue(LogSearchConstants.SOLR_LOG_MESSAGE) != null) {
+        textTowrite.append("- ").append(
+          doc.getFieldValue(LogSearchConstants.SOLR_LOG_MESSAGE)
+            .toString());
+      }
+      textTowrite.append("\n");
+      if (textTowrite != null)
+        textToSave += textTowrite.toString();
+    }
+    return textToSave;
+  }
+
+  public VSummary buildSummaryForLogFile(SolrDocumentList docList) {
+    VSummary vsummary = new VSummary();
+    int numLogs = 0;
+    List<VHost> vHosts = new ArrayList<VHost>();
+    vsummary.setHosts(vHosts);
+    String levels = "";
+    for (SolrDocument doc : docList) {
+      // adding Host and Component appropriately
+      String hostname = (String) doc.getFieldValue("host");
+      String comp = (String) doc.getFieldValue("type");
+      String level = (String) doc.getFieldValue("level");
+      boolean newHost = true;
+      for (VHost host : vHosts) {
+        if (host.getName().equals(hostname)) {
+          newHost = false;
+          host.getComponents().add(comp);
+          break;
+        }
+      }
+      if (newHost) {
+        VHost vHost = new VHost();
+        vHost.setName(hostname);
+        Set<String> component = new LinkedHashSet<String>();
+        component.add(comp);
+        vHost.setComponents(component);
+        vHosts.add(vHost);
+      }
+      // getting levels
+      if (!levels.contains(level))
+        levels = levels + ", " + level;
+      numLogs += 1;
+    }
+    levels = levels.replaceFirst(", ", "");
+    vsummary.setLevels(levels);
+    vsummary.setNumberLogs("" + numLogs);
+    return vsummary;
+  }
+
+  public String addBlanksToString(int count, String field) {
+    String temp = field;
+    for (int i = 0; i < count; i++) {
+      temp = temp + " ";
+    }
+    return temp;
+  }
+
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  public VBarDataList buildSummaryForTopCounts(
+    SimpleOrderedMap<Object> jsonFacetResponse) {
+
+    VBarDataList vBarDataList = new VBarDataList();
+
+    Collection<VBarGraphData> dataList = new ArrayList<VBarGraphData>();
+    if (jsonFacetResponse == null) {
+      logger.info("Solr document list in null");
+      return vBarDataList;
+    }
+    List<Object> userList = jsonFacetResponse.getAll("Users");
+    if (userList.isEmpty()) {
+      return vBarDataList;
+    }
+    SimpleOrderedMap<Map<String, Object>> userMap = (SimpleOrderedMap<Map<String, Object>>) userList
+      .get(0);
+    if (userMap == null) {
+      logger.info("No top user details found");
+      return vBarDataList;
+    }
+    List<SimpleOrderedMap> userUsageList = (List<SimpleOrderedMap>) userMap
+      .get("buckets");
+    for (SimpleOrderedMap usageMap : userUsageList) {
+      VBarGraphData vBarGraphData = new VBarGraphData();
+      String userName = (String) usageMap.get("val");
+      vBarGraphData.setName(userName);
+      SimpleOrderedMap repoMap = (SimpleOrderedMap) usageMap.get("Repo");
+      List<VNameValue> componetCountList = new ArrayList<VNameValue>();
+      List<SimpleOrderedMap> repoUsageList = (List<SimpleOrderedMap>) repoMap
+        .get("buckets");
+      for (SimpleOrderedMap repoUsageMap : repoUsageList) {
+        VNameValue componetCount = new VNameValue();
+        if (repoUsageMap.get("val") != null)
+          componetCount.setName(repoUsageMap.get("val").toString());
+        String eventCount = "";
+        if (repoUsageMap.get("eventCount") != null)
+          eventCount = repoUsageMap.get("eventCount").toString();
+        eventCount = eventCount.replace(".0", "");
+        eventCount = eventCount.replace(".00", "");
+
+        componetCount.setValue(eventCount);
+        componetCountList.add(componetCount);
+      }
+      vBarGraphData.setDataCounts(componetCountList);
+      dataList.add(vBarGraphData);
+
+    }
+    vBarDataList.setGraphData(dataList);
+    logger.info("getting graph data");
+
+    return vBarDataList;
+  }
+
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  public VBarDataList buildSummaryForResourceCounts(
+    SimpleOrderedMap<Object> jsonFacetResponse) {
+
+    VBarDataList vBarDataList = new VBarDataList();
+
+    Collection<VBarGraphData> dataList = new ArrayList<VBarGraphData>();
+    if (jsonFacetResponse == null) {
+      logger.info("Solr document list in null");
+      return vBarDataList;
+    }
+    List<Object> userList = jsonFacetResponse.getAll("x");
+    if (userList.isEmpty()) {
+      return vBarDataList;
+    }
+    SimpleOrderedMap<Map<String, Object>> userMap = (SimpleOrderedMap<Map<String, Object>>) userList
+      .get(0);
+    if (userMap == null) {
+      logger.info("No top user details found");
+      return vBarDataList;
+    }
+    List<SimpleOrderedMap> userUsageList = (List<SimpleOrderedMap>) userMap
+      .get("buckets");
+    for (SimpleOrderedMap usageMap : userUsageList) {
+      VBarGraphData vBarGraphData = new VBarGraphData();
+      String userName = (String) usageMap.get("val");
+      vBarGraphData.setName(userName);
+      SimpleOrderedMap repoMap = (SimpleOrderedMap) usageMap.get("y");
+      List<VNameValue> componetCountList = new ArrayList<VNameValue>();
+      List<SimpleOrderedMap> repoUsageList = (List<SimpleOrderedMap>) repoMap
+        .get("buckets");
+      for (SimpleOrderedMap repoUsageMap : repoUsageList) {
+        VNameValue componetCount = new VNameValue();
+        if (repoUsageMap.get("val") != null)
+          componetCount.setName(repoUsageMap.get("val").toString());
+        String eventCount = "";
+        if (repoUsageMap.get("eventCount") != null)
+          eventCount = repoUsageMap.get("eventCount").toString();
+        eventCount = eventCount.replace(".0", "");
+        eventCount = eventCount.replace(".00", "");
+
+        componetCount.setValue(eventCount);
+        componetCountList.add(componetCount);
+      }
+      vBarGraphData.setDataCounts(componetCountList);
+      dataList.add(vBarGraphData);
+
+    }
+    vBarDataList.setGraphData(dataList);
+    logger.info("getting graph data");
+
+    return vBarDataList;
+  }
+
+  public HashMap<String, String> sortHashMapByValuesD(
+    HashMap<String, String> passedMap) {
+    HashMap<String, String> sortedMap = new LinkedHashMap<String, String>();
+    List<String> mapValues = new ArrayList<String>(passedMap.values());
+    HashMap<String, String> invertedKeyValue = new HashMap<String, String>();
+    Collections.sort(mapValues, new Comparator<String>() {
+      @Override
+      public int compare(String s1, String s2) {
+        return s1.compareToIgnoreCase(s2);
+      }
+    });
+    Iterator<Entry<String, String>> it = passedMap.entrySet().iterator();
+    while (it.hasNext()) {
+      @SuppressWarnings("rawtypes")
+      Map.Entry pair = (Map.Entry) it.next();
+      invertedKeyValue.put("" + pair.getValue(), "" + pair.getKey());
+      it.remove();
+    }
+
+    for (String valueOfKey : mapValues) {
+      sortedMap.put(invertedKeyValue.get(valueOfKey), valueOfKey);
+    }
+
+    return sortedMap;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
new file mode 100644
index 0000000..320e589
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/CommonUtil.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.util;
+
+import java.io.Serializable;
+import java.security.SecureRandom;
+
+public class CommonUtil implements Serializable {
+  /**
+   *
+   */
+  private static final long serialVersionUID = -7284237762948427019L;
+
+  static SecureRandom secureRandom = new SecureRandom();
+  static int counter = 0;
+
+  static public String genGUI() {
+    return System.currentTimeMillis() + "_" + secureRandom.nextInt(1000)
+      + "_" + counter++;
+  }
+
+  static public String genGUI(int length) {
+    String str = "";
+    for (int i = 0; i < length; i++) {
+      int ascii = genInteger(65, 90);
+      str += (char) ascii;
+    }
+    return str;
+  }
+
+  static public int genInteger() {
+    return secureRandom.nextInt();
+  }
+
+  static public int genInteger(int min, int max) {
+    int value = secureRandom.nextInt(max - min);
+    return value + min;
+  }
+
+  /**
+   * @return
+   */
+  public static long genLong() {
+    return secureRandom.nextLong();
+  }
+
+  static public int genInteger(int n) {
+    return secureRandom.nextInt();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/ConfigUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/ConfigUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/ConfigUtil.java
new file mode 100644
index 0000000..036d5d1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/ConfigUtil.java
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.manager.MgrBase;
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+
+public class ConfigUtil {
+  static Logger logger = Logger.getLogger(MgrBase.class);
+
+  public static List<String> logLevels = new ArrayList<String>();
+
+  public static HashMap<String, String> serviceLogsColumnMapping = new HashMap<String, String>();
+
+  public static HashMap<String, String> auditLogsColumnMapping = new HashMap<String, String>();
+
+  public static HashMap<String, String> schemaFieldsName = new HashMap<String, String>();
+
+  public static void initializeApplicationConfig() {
+    intializeLogLevels();
+    initializeColumnMapping();
+  }
+
+  private static void intializeUISolrColumnMapping(
+    String columnMappingArray[],
+    HashMap<String, String> columnMappingMap) {
+
+    if (columnMappingArray != null && columnMappingArray.length > 0) {
+      for (String columnMapping : columnMappingArray) {
+        String mapping[] = columnMapping.split(":");
+        String solrField = mapping[0];
+        String uiField = mapping[1];
+        String modifiedUIField = getModifiedUIField(uiField);
+        columnMappingMap.put(
+          solrField + LogSearchConstants.SOLR_SUFFIX,
+          modifiedUIField);
+        columnMappingMap.put(modifiedUIField
+          + LogSearchConstants.UI_SUFFIX, solrField);
+      }
+    }
+  }
+
+  private static String getModifiedUIField(String uiField) {
+    String modifiedUIField = "";
+    String temp = serviceLogsColumnMapping.get(uiField
+      + LogSearchConstants.UI_SUFFIX);
+    if (temp == null)
+      return uiField;
+    else {
+      String lastChar = uiField.substring(uiField.length() - 1,
+        uiField.length());
+      int k = 1;
+      try {
+        k = Integer.parseInt(lastChar);
+        k = k + 1;
+        modifiedUIField = uiField.substring(0, uiField.length() - 2);
+      } catch (Exception e) {
+
+      }
+      modifiedUIField = uiField + "_" + k;
+    }
+    return getModifiedUIField(modifiedUIField);
+  }
+
+  private static void intializeLogLevels() {
+    logLevels.add(LogSearchConstants.TRACE);
+    logLevels.add(LogSearchConstants.DEBUG);
+    logLevels.add(LogSearchConstants.INFO);
+    logLevels.add(LogSearchConstants.WARN);
+    logLevels.add(LogSearchConstants.ERROR);
+    logLevels.add(LogSearchConstants.FATAL);
+  }
+
+  private static void initializeColumnMapping() {
+    String serviceLogsColumnMappingArray[] = PropertiesUtil
+      .getPropertyStringList("servicelog.column.mapping");
+    String auditLogsColumnMappingArray[] = PropertiesUtil
+      .getPropertyStringList("auditlog.column.mapping");
+
+    // Initializing column mapping for Service Logs
+    intializeUISolrColumnMapping(serviceLogsColumnMappingArray,
+      serviceLogsColumnMapping);
+
+    // Initializing column mapping for Audit Logs
+    intializeUISolrColumnMapping(auditLogsColumnMappingArray,
+      auditLogsColumnMapping);
+  }
+
+  public static void extractSchemaFieldsName(String responseString,
+                                             String suffix) {
+    try {
+      JSONObject jsonObject = new JSONObject(responseString);
+      JSONArray jsonArrayList = jsonObject.getJSONArray("fields");
+
+      for (int i = 0; i < jsonArrayList.length(); i++) {
+        JSONObject explrObject = jsonArrayList.getJSONObject(i);
+        String name = explrObject.getString("name");
+        String type = explrObject.getString("type");
+
+        if (!name.contains("@") && !name.startsWith("_")
+          && !name.contains("_md5") && !name.contains("_ms")
+          && !name.contains(LogSearchConstants.NGRAM_SUFFIX)) {
+          schemaFieldsName.put(name + suffix, type);
+        }
+      }
+
+    } catch (Exception e) {
+
+      logger.error(e + "Credentials not specified in logsearch.properties "
+        + MessageEnums.ERROR_SYSTEM);
+
+    }
+
+  }
+
+  @SuppressWarnings("rawtypes")
+  public static void getSchemaFieldsName(String suffix, String excludeArray[],
+                                         List<String> fieldNames) {
+    if (!schemaFieldsName.isEmpty()) {
+      Iterator iteratorSechmaFieldsName = schemaFieldsName.entrySet()
+        .iterator();
+
+      while (iteratorSechmaFieldsName.hasNext()) {
+
+        Map.Entry fieldName = (Map.Entry) iteratorSechmaFieldsName
+          .next();
+        String field = "" + fieldName.getKey();
+
+        if (field.contains(suffix)) {
+          field = field.replace(suffix, "");
+          if (!isExclude(field, excludeArray)) {
+            fieldNames.add(field);
+          }
+
+        }
+      }
+    }
+  }
+
+  private static boolean isExclude(String name, String excludeArray[]) {
+    if (excludeArray != null && excludeArray.length > 0) {
+      for (String exclude : excludeArray) {
+        if (name.equals(exclude))
+          return true;
+      }
+    }
+    return false;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/DateUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/DateUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/DateUtil.java
new file mode 100644
index 0000000..77dd536
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/DateUtil.java
@@ -0,0 +1,206 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Locale;
+import java.util.TimeZone;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class DateUtil {
+
+  static Logger logger = Logger.getLogger(DateUtil.class);
+
+  @Autowired
+  StringUtil stringUtil;
+
+  private DateUtil() {
+
+  }
+
+  public String addOffsetToDate(String date, Long utcOffset,
+                                String dateFormate) {
+    if (date == null || date.equals("")) {
+      return null;
+    }
+    if (utcOffset == null) {
+      return date;
+    }
+    String retDate = "";
+
+    try {
+      String modifiedDate = date;
+      if (date.contains(".")) {
+        modifiedDate = date.replace(".", ",");
+      }
+      SimpleDateFormat formatter = new SimpleDateFormat(dateFormate, Locale.ENGLISH);
+      Date startDate = (Date) formatter.parse(modifiedDate);
+      long toWithOffset = getTimeWithOffset(startDate, utcOffset,
+        dateFormate);
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTimeInMillis(toWithOffset);
+      retDate = formatter.format(calendar.getTime());
+
+    } catch (Exception e) {
+      logger.error(e);
+    }
+    return retDate;
+  }
+
+  public long getTimeWithOffset(Date date, Long utcOffset, String dateFormate) {
+    return date.getTime() + TimeUnit.MINUTES.toMillis(utcOffset);
+  }
+
+  public Date getUTCDate(long epoh) {
+    if (epoh == 0) {
+      return null;
+    }
+    try {
+      TimeZone gmtTimeZone = TimeZone.getTimeZone("GMT+0");
+      Calendar local = Calendar.getInstance();
+      int offset = local.getTimeZone().getOffset(epoh);
+      GregorianCalendar utc = new GregorianCalendar(gmtTimeZone);
+      utc.setTimeInMillis(epoh);
+      utc.add(Calendar.MILLISECOND, -offset);
+
+      return utc.getTime();
+    } catch (Exception ex) {
+      return null;
+    }
+  }
+
+  public String dateToString(Date date, String dateFormat) {
+    if (date == null || dateFormat == null || dateFormat.isEmpty()) {
+      return "";
+    }
+    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat, Locale.ENGLISH);
+    TimeZone timeZone = TimeZone.getTimeZone("GMT");
+    formatter.setTimeZone(timeZone);
+    return formatter.format(date);
+  }
+
+  public String getCurrentDateInString() {
+    DateFormat df = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss", Locale.ENGLISH);
+    Date today = Calendar.getInstance().getTime();
+    return df.format(today);
+  }
+
+  public String getTimeInSolrFormat(String timeString) {
+    String time;
+    if (stringUtil.isEmpty(timeString)) {
+      return null;
+    }
+    time = timeString.replace(" ", "T");
+    time = time.replace(",", ".");
+    time = time + "Z";
+
+    return time;
+  }
+
+  public Date addHoursToDate(Date date, int hours) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.HOUR_OF_DAY, hours);
+    return greorianCalendar.getTime();
+  }
+
+  public Date addMinsToDate(Date date, int mins) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.MINUTE, mins);
+    return greorianCalendar.getTime();
+  }
+
+  public Date addSecondsToDate(Date date, int secs) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.SECOND, secs);
+    return greorianCalendar.getTime();
+  }
+
+  public Date addMilliSecondsToDate(Date date, int secs) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.MILLISECOND, secs);
+    return greorianCalendar.getTime();
+  }
+
+  public String convertGivenDateFormatToSolrDateFormat(Date date)
+    throws ParseException {
+    String time = date.toString();
+    SimpleDateFormat input = new SimpleDateFormat(
+      "EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
+    SimpleDateFormat output = new SimpleDateFormat(
+      LogSearchConstants.SOLR_DATE_FORMAT_PREFIX_Z, Locale.ENGLISH);
+    Date d = input.parse(time);
+    TimeZone timeZone = TimeZone.getTimeZone("UTC");
+    output.setTimeZone(timeZone);
+
+    return output.format(d);
+  }
+
+  public String convertDateWithMillisecondsToSolrDate(Date date) {
+    SimpleDateFormat formatter = new SimpleDateFormat(
+      LogSearchConstants.SOLR_DATE_FORMAT_PREFIX_Z, Locale.ENGLISH);
+    TimeZone timeZone = TimeZone.getTimeZone("GMT");
+    formatter.setTimeZone(timeZone);
+
+    return formatter.format(date);
+  }
+
+  public String convertSolrDateToNormalDateFormat(long d, long utcOffset)
+    throws ParseException {
+    Date date = new Date(d);
+    SimpleDateFormat formatter = new SimpleDateFormat(
+      LogSearchConstants.SOLR_DATE_FORMAT, Locale.ENGLISH);
+    TimeZone timeZone = TimeZone.getTimeZone("GMT");
+    formatter.setTimeZone(timeZone);
+    String stringDate = formatter.format(date);
+    return addOffsetToDate(stringDate, Long.parseLong("" + utcOffset),
+      LogSearchConstants.SOLR_DATE_FORMAT);
+
+  }
+
+  public Date convertStringToDate(String dateString) {
+
+    SimpleDateFormat formatter = new SimpleDateFormat(
+      LogSearchConstants.SOLR_DATE_FORMAT_PREFIX_Z, Locale.ENGLISH);
+    TimeZone timeZone = TimeZone.getTimeZone("GMT");
+    formatter.setTimeZone(timeZone);
+
+    try {
+      return formatter.parse(dateString);
+    } catch (ParseException e) {
+      //do nothing
+    }
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/FileUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/FileUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/FileUtil.java
new file mode 100644
index 0000000..7981cb1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/FileUtil.java
@@ -0,0 +1,144 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.manager.UserConfigMgr;
+import org.apache.ambari.logsearch.view.VHost;
+import org.apache.ambari.logsearch.view.VSummary;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class FileUtil {
+
+  static Logger logger = Logger.getLogger(FileUtil.class);
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @SuppressWarnings("resource")
+  public Response saveToFile(String text, String fileName, VSummary vsummary) {
+    String mainExportedFile = "";
+    try {
+      mainExportedFile = mainExportedFile
+        + "**********************Summary**********************\n";
+      mainExportedFile = mainExportedFile + "Number of Logs : "
+        + vsummary.getNumberLogs() + "\n";
+      mainExportedFile = mainExportedFile + "From           : "
+        + vsummary.getFrom() + "\n";
+      mainExportedFile = mainExportedFile + "To             : "
+        + vsummary.getTo() + "\n";
+
+      List<VHost> hosts = vsummary.getHosts();
+      String blankCharacterForHost = "        ";
+      int numberHost = 0;
+      for (VHost host : hosts) {
+        numberHost += 1;
+        String h = host.getName();
+        String c = "";
+        Set<String> comp = host.getComponents();
+        boolean zonetar = true;
+        for (String component : comp) {
+          if (zonetar) {
+            c = component;
+            zonetar = false;
+          } else {
+            c = c + ", " + component;
+          }
+        }
+        if (numberHost > 9)
+          blankCharacterForHost = "       ";
+        else if (numberHost > 99)
+          blankCharacterForHost = "      ";
+        else if (numberHost > 999)
+          blankCharacterForHost = "     ";
+        else if (numberHost > 9999)
+          blankCharacterForHost = "    ";
+        else if (numberHost > 99999)
+          blankCharacterForHost = "   ";
+        if (numberHost == 1) {
+          mainExportedFile = mainExportedFile + "Host"
+            + blankCharacterForHost + "   : " + h + " [" + c
+            + "] " + "\n";
+        } else if (numberHost > 1) {
+          mainExportedFile = mainExportedFile + "Host_" + numberHost
+            + blankCharacterForHost + " : " + h + " [" + c
+            + "] " + "\n";
+        }
+
+      }
+      mainExportedFile = mainExportedFile + "Levels         : "
+        + vsummary.getLevels() + "\n";
+      mainExportedFile = mainExportedFile + "Format         : "
+        + vsummary.getFormat() + "\n";
+      mainExportedFile = mainExportedFile + "\n";
+
+      mainExportedFile = mainExportedFile + "Included String: ["
+        + vsummary.getIncludeString() + "]\n\n";
+      mainExportedFile = mainExportedFile + "Excluded String: ["
+        + vsummary.getExcludeString() + "]\n\n";
+      mainExportedFile = mainExportedFile
+        + "************************Logs***********************"
+        + "\n";
+      mainExportedFile = mainExportedFile + text + "\n";
+      File file = File.createTempFile(fileName, vsummary.getFormat());
+      FileOutputStream fis = new FileOutputStream(file);
+      fis.write(mainExportedFile.getBytes());
+      return Response
+        .ok(file, MediaType.APPLICATION_OCTET_STREAM)
+        .header("Content-Disposition",
+          "attachment;filename=" + fileName
+            + vsummary.getFormat()).build();
+    } catch (Exception e) {
+      logger.error(e.getMessage());
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  /**
+   * @param filename
+   * @return
+   */
+  public File getFileFromClasspath(String filename) {
+    URL fileCompleteUrl = Thread.currentThread().getContextClassLoader()
+      .getResource(filename);
+    logger.debug("File Complete URI :" + fileCompleteUrl);
+    File file = null;
+    try {
+      file = new File(fileCompleteUrl.toURI());
+    } catch (Exception exception) {
+      logger.debug(exception.getMessage(), exception.getCause());
+    }
+    return file;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/JSONUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/JSONUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/JSONUtil.java
new file mode 100644
index 0000000..417a0b1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/JSONUtil.java
@@ -0,0 +1,261 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.log4j.Logger;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.codehaus.jackson.type.TypeReference;
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+@Component
+public class JSONUtil {
+
+  static Logger logger = Logger.getLogger(JSONUtil.class);
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  public final static String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
+  Gson gson = new GsonBuilder().setDateFormat(DATE_FORMAT).create();
+
+  // Conversion from JSONArray to List<String>
+  public static List<String> JSONToList(JSONArray jarray)
+    throws JSONException {
+    ArrayList<String> list = new ArrayList<String>();
+    JSONArray jsonArray = jarray;
+    if (jsonArray != null) {
+      int len = jsonArray.length();
+      for (int i = 0; i < len; i++) {
+        list.add(jsonArray.get(i).toString());
+      }
+    }
+    return list;
+  }
+
+  @SuppressWarnings("unchecked")
+  public HashMap<String, String> jsonToMap(String jsonStr) {
+    if (stringUtil.isEmpty(jsonStr)) {
+      logger.info("jsonString is empty, cannot conver to map");
+      return null;
+    }
+    ObjectMapper mapper = new ObjectMapper();
+    try {
+      Object tempObject = mapper.readValue(jsonStr,
+        new TypeReference<HashMap<String, String>>() {
+        });
+      return (HashMap<String, String>) tempObject;
+
+    } catch (JsonParseException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (JsonMappingException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+  }
+
+  @SuppressWarnings("unchecked")
+  public HashMap<String, Object> jsonToMapObject(String jsonStr) {
+    if (stringUtil.isEmpty(jsonStr)) {
+      logger.info("jsonString is empty, cannot conver to map");
+      return null;
+    }
+    ObjectMapper mapper = new ObjectMapper();
+    try {
+      Object tempObject = mapper.readValue(jsonStr,
+        new TypeReference<HashMap<String, Object>>() {
+        });
+      return (HashMap<String, Object>) tempObject;
+
+    } catch (JsonParseException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (JsonMappingException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+  }
+
+  @SuppressWarnings("unchecked")
+  public List<HashMap<String, Object>> jsonToMapObjectList(String jsonStr) {
+    ObjectMapper mapper = new ObjectMapper();
+    try {
+      Object tempObject = mapper.readValue(jsonStr,
+        new TypeReference<List<HashMap<String, Object>>>() {
+        });
+      return (List<HashMap<String, Object>>) tempObject;
+
+    } catch (JsonParseException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (JsonMappingException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(
+        "Invalid input data: " + e.getMessage(),
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+  }
+
+  public boolean isJSONValid(String jsonString) {
+    try {
+      new JSONObject(jsonString);
+    } catch (JSONException ex) {
+      try {
+        new JSONArray(jsonString);
+      } catch (JSONException ex1) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * @param fileName
+   * @return
+   */
+  public HashMap<String, Object> readJsonFromFile(File jsonFile) {
+    ObjectMapper mapper = new ObjectMapper();
+    try {
+      HashMap<String, Object> jsonmap = mapper.readValue(jsonFile,
+        new TypeReference<HashMap<String, Object>>() {
+        });
+      return jsonmap;
+    } catch (JsonParseException e) {
+      logger.error(e, e.getCause());
+    } catch (JsonMappingException e) {
+      logger.error(e, e.getCause());
+    } catch (IOException e) {
+      logger.error(e, e.getCause());
+    }
+    return new HashMap<String, Object>();
+  }
+
+  public String mapToJSON(Map<String, Object> map) {
+    ObjectMapper om = new ObjectMapper();
+    try {
+      String json = om.writeValueAsString(map);
+
+      return json;
+    } catch (JsonGenerationException e) {
+      logger.error(e, e.getCause());
+    } catch (JsonMappingException e) {
+      logger.error(e, e.getCause());
+    } catch (IOException e) {
+      logger.error(e, e.getCause());
+    }
+    return "";
+  }
+
+  /**
+   * WRITE JOSN IN FILE ( Delete existing file and create new file)
+   *
+   * @param jsonStr
+   * @param outputFile
+   * @param beautify
+   */
+  public void writeJSONInFile(String jsonStr, File outputFile,
+                              boolean beautify) {
+    FileWriter fileWriter = null;
+    if (outputFile == null) {
+      logger.error("user_pass json file can't be null.");
+      return;
+    }
+    try {
+      boolean writePermission = false;
+      if (outputFile.exists() && outputFile.canWrite()) {
+        writePermission = true;
+      }
+      if (writePermission) {
+        fileWriter = new FileWriter(outputFile);
+        if (beautify) {
+          ObjectMapper mapper = new ObjectMapper();
+          Object json = mapper.readValue(jsonStr, Object.class);
+          jsonStr = mapper.writerWithDefaultPrettyPrinter()
+            .writeValueAsString(json);
+        }
+        fileWriter.write(jsonStr);
+      } else {
+        logger.error("Applcation does not have permission to update file to write enc_password. file="
+          + outputFile.getAbsolutePath());
+      }
+    } catch (IOException e) {
+      logger.error("Error writing to password file.", e.getCause());
+    } finally {
+      if (fileWriter != null) {
+        try {
+          fileWriter.flush();
+          fileWriter.close();
+        } catch (Exception exception) {
+          // ignore
+          logger.error(exception);
+        }
+      }
+    }
+  }
+
+  public String objToJson(Object obj) {
+    return gson.toJson(obj);
+  }
+
+  public Object jsonToObj(String json, Class<?> klass) {
+    return gson.fromJson(json, klass);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/LogsearchPropertiesConfiguration.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/LogsearchPropertiesConfiguration.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/LogsearchPropertiesConfiguration.java
new file mode 100644
index 0000000..c3ef20f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/LogsearchPropertiesConfiguration.java
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.util;
+
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.log4j.Logger;
+
+public class LogsearchPropertiesConfiguration extends PropertiesConfiguration {
+
+  Logger logger = Logger.getLogger(LogsearchPropertiesConfiguration.class);
+
+  public LogsearchPropertiesConfiguration() {
+    super();
+  }
+
+
+  public static LogsearchPropertiesConfiguration getInstance() {
+    return new LogsearchPropertiesConfiguration();
+  }
+
+  public void load(File file) {
+    if (!file.exists()) {
+      logger.error("File :" + file.getAbsolutePath() + " not exists");
+      return;
+    }
+    try {
+      super.load(file);
+    } catch (ConfigurationException e) {
+      logger.error(e);
+    }
+  }
+
+  public void load(String fileAbsolutePath) {
+    File file = new File(fileAbsolutePath);
+    load(file);
+  }
+
+  /**
+   * Load from classPath
+   *
+   * @param fileName
+   */
+  public void loadFromClasspath(String fileName) {
+    logger.debug("loading config properties : " + fileName);
+    // load file from classpath
+    try {
+      URL fileCompleteUrl = Thread.currentThread()
+        .getContextClassLoader().getResource(fileName);
+      logger.debug("File Complete URI :" + fileCompleteUrl);
+      File file = new File(fileCompleteUrl.toURI());
+      load(file);
+    } catch (Exception e) {
+      logger.error(e);
+    }
+  }
+
+  public HashMap<String, Object> getPropertyMap() {
+    HashMap<String, Object> propertyMap = new HashMap<String, Object>();
+    Iterator<String> keys = this.getKeys();
+    while (keys.hasNext()) {
+      String key = keys.next();
+      propertyMap.put(key, this.getProperty(key));
+    }
+    return propertyMap;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/PropertiesUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/PropertiesUtil.java
new file mode 100644
index 0000000..f31e8f8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/PropertiesUtil.java
@@ -0,0 +1,150 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
+
+public class PropertiesUtil extends PropertyPlaceholderConfigurer {
+  private static Map<String, String> propertiesMap;
+
+  private PropertiesUtil() {
+
+  }
+
+  @Override
+  protected void processProperties(
+    ConfigurableListableBeanFactory beanFactory, Properties props)
+    throws BeansException {
+    super.processProperties(beanFactory, props);
+
+    propertiesMap = new HashMap<String, String>();
+
+    // First add the system properties
+    Set<Object> keySet = System.getProperties().keySet();
+    for (Object key : keySet) {
+      String keyStr = key.toString();
+      propertiesMap.put(keyStr, System.getProperties()
+        .getProperty(keyStr).trim());
+    }
+
+    // add our properties now
+    keySet = props.keySet();
+    for (Object key : keySet) {
+      String keyStr = key.toString();
+      propertiesMap.put(keyStr, props.getProperty(keyStr).trim());
+    }
+  }
+
+  public static String getProperty(String key, String defaultValue) {
+    if (key == null) {
+      return null;
+    }
+    String rtrnVal = propertiesMap.get(key);
+    if (rtrnVal == null) {
+      rtrnVal = defaultValue;
+    }
+    return rtrnVal;
+  }
+
+  public static String getProperty(String key) {
+    if (key == null) {
+      return null;
+    }
+    return propertiesMap.get(key);
+  }
+
+  public static String[] getPropertyStringList(String key) {
+    if (key == null) {
+      return null;
+    }
+    String value = propertiesMap.get(key);
+    if (value == null || value.trim().equals("")) {
+      return new String[0];
+    } else {
+      String[] splitValues = value.split(",");
+      String[] returnValues = new String[splitValues.length];
+      for (int i = 0; i < splitValues.length; i++) {
+        returnValues[i] = splitValues[i].trim();
+      }
+      return returnValues;
+    }
+  }
+
+  public static Integer getIntProperty(String key, int defaultValue) {
+    if (key == null) {
+      return null;
+    }
+    String rtrnVal = propertiesMap.get(key);
+    if (rtrnVal == null) {
+      return defaultValue;
+    }
+    return Integer.valueOf(rtrnVal);
+  }
+
+  public static Integer getIntProperty(String key) {
+    if (key == null) {
+      return null;
+    }
+    String rtrnVal = propertiesMap.get(key);
+    if (rtrnVal == null) {
+      return null;
+    }
+    return Integer.valueOf(rtrnVal);
+  }
+
+  public static Long getLongProperty(String key, long defaultValue) {
+    if (key == null) {
+      return null;
+    }
+    String rtrnVal = propertiesMap.get(key);
+    if (rtrnVal == null) {
+      return defaultValue;
+    }
+    return Long.valueOf(rtrnVal);
+  }
+
+  public static Long getLongProperty(String key) {
+    if (key == null) {
+      return null;
+    }
+    String rtrnVal = propertiesMap.get(key);
+    if (rtrnVal == null) {
+      return null;
+    }
+    return Long.valueOf(rtrnVal);
+  }
+
+  public static boolean getBooleanProperty(String key, boolean defaultValue) {
+    if (key == null) {
+      return defaultValue;
+    }
+    String value = getProperty(key);
+    if (value == null) {
+      return defaultValue;
+    }
+    return Boolean.parseBoolean(value);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/QueryBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/QueryBase.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/QueryBase.java
new file mode 100644
index 0000000..4f65cf6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/QueryBase.java
@@ -0,0 +1,127 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import org.apache.solr.client.solrj.SolrQuery;
+
+public class QueryBase {
+
+  //Solr Facet Methods
+  public void setFacetField(SolrQuery solrQuery, String facetField) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("facet.field", facetField);
+    setFacetLimit(solrQuery, -1);
+  }
+
+  public void setJSONFacet(SolrQuery solrQuery, String jsonQuery) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("json.facet", jsonQuery);
+    setFacetLimit(solrQuery, -1);
+  }
+
+  public void setFacetSort(SolrQuery solrQuery, String sortType) {
+    solrQuery.setFacet(true);
+    solrQuery.setFacetSort(sortType);
+  }
+
+  public void setFacetPivot(SolrQuery solrQuery, int mincount,
+                            String... hirarchy) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("facet.pivot", hirarchy);
+    solrQuery.set("facet.pivot.mincount", mincount);
+    setFacetLimit(solrQuery, -1);
+  }
+
+  public void setFacetDate(SolrQuery solrQuery, String facetField,
+                           String from, String to, String unit) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("facet.date", facetField);
+    solrQuery.set("facet.date.start", from);
+    solrQuery.set("facet.date.end", to);
+    solrQuery.set("facet.date.gap", unit);
+    solrQuery.set("facet.mincount", 0);
+    setFacetLimit(solrQuery, -1);
+  }
+
+  public void setFacetRange(SolrQuery solrQuery, String facetField,
+                            String from, String to, String unit) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("facet.range", facetField);
+    solrQuery.set("facet.range.start", from);
+    solrQuery.set("facet.range.end", to);
+    solrQuery.set("facet.range.gap", unit);
+    solrQuery.set("facet.mincount", 0);
+    setFacetLimit(solrQuery, -1);
+  }
+
+  public void setFacetLimit(SolrQuery solrQuery, int limit) {
+    solrQuery.set("facet.limit", limit);
+  }
+
+  //Solr Group Mehtods
+  public void setGroupField(SolrQuery solrQuery, String groupField, int rows) {
+    solrQuery.set("group", true);
+    solrQuery.set("group.field", groupField);
+    solrQuery.set("group.main", true);
+    setRowCount(solrQuery, rows);
+  }
+
+  //Main Query
+  public void setMainQuery(SolrQuery solrQuery, String query) {
+    String defalultQuery = "*:*";
+    if (query == null || query.isEmpty())
+      solrQuery.setQuery(defalultQuery);
+    else
+      solrQuery.setQuery(query);
+  }
+
+  public void setStart(SolrQuery solrQuery, int start) {
+    if (start > 0) {
+      solrQuery.setStart(start);
+    } else {
+      solrQuery.setStart(0);
+    }
+  }
+
+  //Set Number of Rows
+  public void setRowCount(SolrQuery solrQuery, int rows) {
+    if (rows > 0) {
+      solrQuery.setRows(rows);
+    } else {
+      solrQuery.setRows(0);
+      solrQuery.remove("sort");
+    }
+  }
+
+  //Solr Facet Methods
+  public void setFacetField(SolrQuery solrQuery, String facetField, int minCount) {
+    solrQuery.setFacet(true);
+    setRowCount(solrQuery, 0);
+    solrQuery.set("facet.field", facetField);
+    solrQuery.set("facet.mincount", minCount);
+    setFacetLimit(solrQuery, -1);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/RESTErrorUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/RESTErrorUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/RESTErrorUtil.java
new file mode 100644
index 0000000..a3cb855
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/RESTErrorUtil.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.view.VMessage;
+import org.apache.ambari.logsearch.view.VResponse;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RESTErrorUtil {
+
+  static final Logger logger = Logger.getLogger("org.apache.ambari.logsearch");
+
+  public static final String TRUE = "true";
+
+  public WebApplicationException createRESTException(VResponse response) {
+    return createRESTException(response, HttpServletResponse.SC_BAD_REQUEST);
+  }
+
+  public WebApplicationException createRESTException(String errorMessage,
+                                                     MessageEnums messageEnum) {
+    List<VMessage> messageList = new ArrayList<VMessage>();
+    messageList.add(messageEnum.getMessage());
+
+    VResponse response = new VResponse();
+    response.setStatusCode(VResponse.STATUS_ERROR);
+    response.setMsgDesc(errorMessage);
+    response.setMessageList(messageList);
+    WebApplicationException webAppEx = createRESTException(response);
+    logger.error("Operation error. response=" + response, webAppEx);
+    return webAppEx;
+  }
+
+  public WebApplicationException createRESTException(VResponse response, int sc) {
+    Response errorResponse = Response.status(sc).entity(response).build();
+    WebApplicationException restException = new WebApplicationException(errorResponse);
+    restException.fillInStackTrace();
+    return restException;
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/SolrUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/SolrUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/SolrUtil.java
new file mode 100644
index 0000000..6fa513d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/SolrUtil.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.util.Collection;
+import java.util.Locale;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SolrUtil {
+  static final Logger logger = Logger.getLogger("org.apache.ambari.logsearch");
+
+  public String setField(String fieldName, String value) {
+    if (value == null || value.trim().length() == 0) {
+      return "";
+    }
+    return fieldName + ":" + value.trim().toLowerCase(Locale.ENGLISH);
+  }
+
+  /**
+   * @param string
+   * @param myClassTypes
+   * @return
+   */
+  public String inList(String fieldName, int[] values) {
+    if (values == null || values.length == 0) {
+      return "";
+    }
+    String expr = "";
+    // Add the filter queries
+    for (int i : values) {
+      expr += i + " ";
+    }
+    if (values.length == 0) {
+      return fieldName + ":" + expr;
+    } else {
+      return fieldName + ":(" + expr + ")";
+    }
+  }
+
+  /**
+   * @param familyUserIdSet
+   * @return
+   */
+  public String inList(Collection<Long> values) {
+    if (values == null || values.isEmpty()) {
+      return "";
+    }
+    String expr = "";
+    for (Long value : values) {
+      expr += value.toString() + " ";
+    }
+
+    if (values.isEmpty()) {
+      return expr.trim();
+    } else {
+      return "(" + expr.trim() + ")";
+    }
+
+  }
+
+  /**
+   * @param fuzzyStr
+   * @param string
+   * @param searchList
+   * @return
+   */
+  public String orList(String fieldName, String[] valueList, String fuzzyStr) {
+    if (valueList == null || valueList.length == 0) {
+      return "";
+    }
+    String expr = "";
+    int count = -1;
+    for (String value : valueList) {
+      count++;
+      if (count > 0) {
+        expr += " OR ";
+      }
+      expr += fieldName + ":*" + value + "*";
+
+    }
+    if (valueList.length == 0) {
+      return expr;
+    } else {
+      return "(" + expr + ")";
+    }
+
+  }
+  
+  /**
+   * @param fuzzyStr
+   * @param string
+   * @param searchList
+   * @return
+   */
+  public String orList(String fieldName, String[] valueList) {
+    if (valueList == null || valueList.length == 0) {
+      return "";
+    }
+    String expr = "";
+    int count = -1;
+    for (String value : valueList) {
+      count++;
+      if (count > 0) {
+        expr += " OR ";
+      }
+      expr += fieldName + ":" + value;
+
+    }
+    if (valueList.length == 0) {
+      return expr;
+    } else {
+      return "(" + expr + ")";
+    }
+
+  }
+  
+  
+
+  /**
+   * @param fuzzyStr
+   * @param string
+   * @param searchList
+   * @return
+   */
+  public String andList(String fieldName, String[] valueList, String fuzzyStr) {
+    if (valueList == null || valueList.length == 0) {
+      return "";
+    }
+    String expr = "";
+    int count = -1;
+    for (String value : valueList) {
+      count++;
+      if (count > 0) {
+        expr += " AND ";
+      }
+      expr += fieldName + ":*" + value + "*";
+    }
+    if (valueList.length == 0) {
+      return expr;
+    } else {
+      return "(" + expr + ")";
+    }
+
+  }
+
+  public String makeSolrSearchString(String search) {
+    String newString = search.trim();
+    String newSearch = newString.replaceAll(
+        "(?=[]\\[+&|!(){}^~*=$@%?:.\\\\])", "\\\\");
+    newSearch = newSearch.replace("\n", "*");
+    newSearch = newSearch.replace("\t", "*");
+    newSearch = newSearch.replace("\r", "*");
+    newSearch = newSearch.replace(" ", "\\ ");
+    newSearch = newSearch.replace("**", "*");
+    newSearch = newSearch.replace("***", "*");
+    return "*" + newSearch + "*";
+  }
+  
+  public String makeSolrSearchStringWithoutAsterisk(String search) {
+    String newString = search.trim();
+    String newSearch = newString.replaceAll(
+        "(?=[]\\[+&|!(){}^\"~=$@%?:.\\\\])", "\\\\");
+    newSearch = newSearch.replace("\n", "*");
+    newSearch = newSearch.replace("\t", "*");
+    newSearch = newSearch.replace("\r", "*");
+    newSearch = newSearch.replace(" ", "\\ ");
+    newSearch = newSearch.replace("**", "*");
+    newSearch = newSearch.replace("***", "*");
+    return newSearch;
+  }
+
+  public String makeSearcableString(String search) {
+    if(search == null || search.isEmpty())
+      return "";
+    String newSearch = search.replaceAll("[\\t\\n\\r]", " ");
+    newSearch = newSearch.replaceAll(
+        "(?=[]\\[+&|!(){}^~*=$/@%?:.\\\\-])", "\\\\");
+
+    return newSearch.replace(" ", "\\ ");
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/StringUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/StringUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/StringUtil.java
new file mode 100644
index 0000000..9a21e6a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/StringUtil.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StringUtil {
+  
+  static Logger logger = Logger.getLogger(StringUtil.class);
+  
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+  
+  public boolean isEmpty(String str) {
+    return str == null || str.trim().length() == 0;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/XMLPropertiesUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/XMLPropertiesUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/XMLPropertiesUtil.java
new file mode 100644
index 0000000..ea041dc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/util/XMLPropertiesUtil.java
@@ -0,0 +1,86 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.springframework.util.DefaultPropertiesPersister;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class XMLPropertiesUtil extends DefaultPropertiesPersister {
+  private static Logger logger = Logger.getLogger(XMLPropertiesUtil.class);
+
+  public XMLPropertiesUtil() {
+  }
+
+  @Override
+  public void loadFromXml(Properties properties, InputStream inputStream)
+    throws IOException {
+    try {
+      DocumentBuilderFactory xmlDocumentBuilderFactory = DocumentBuilderFactory
+        .newInstance();
+      xmlDocumentBuilderFactory.setIgnoringComments(true);
+      xmlDocumentBuilderFactory.setNamespaceAware(true);
+      DocumentBuilder xmlDocumentBuilder = xmlDocumentBuilderFactory
+        .newDocumentBuilder();
+      Document xmlDocument = xmlDocumentBuilder.parse(inputStream);
+      xmlDocument.getDocumentElement().normalize();
+
+      NodeList nList = xmlDocument.getElementsByTagName("property");
+
+      for (int temp = 0; temp < nList.getLength(); temp++) {
+
+        Node nNode = nList.item(temp);
+
+        if (nNode.getNodeType() == Node.ELEMENT_NODE) {
+
+          Element eElement = (Element) nNode;
+
+          String propertyName = "";
+          String propertyValue = "";
+          if (eElement.getElementsByTagName("name").item(0) != null) {
+            propertyName = eElement.getElementsByTagName("name")
+              .item(0).getTextContent().trim();
+          }
+          if (eElement.getElementsByTagName("value").item(0) != null) {
+            propertyValue = eElement.getElementsByTagName("value")
+              .item(0).getTextContent().trim();
+          }
+
+          properties.put(propertyName, propertyValue);
+
+        }
+        // logger.info("ranger site properties loaded successfully.");
+      }
+    } catch (Exception e) {
+      logger.error("Error loading : ", e);
+    }
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarDataList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarDataList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarDataList.java
new file mode 100644
index 0000000..9e88bd5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarDataList.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VBarDataList {
+  Collection<VBarGraphData> graphData = new ArrayList<VBarGraphData>();
+
+  public Collection<VBarGraphData> getGraphData() {
+    return graphData;
+  }
+
+  public void setGraphData(Collection<VBarGraphData> histogramData) {
+    this.graphData = histogramData;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarGraphData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarGraphData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarGraphData.java
new file mode 100644
index 0000000..50fe47e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VBarGraphData.java
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VBarGraphData {
+  protected Collection<VNameValue> dataCount = null;
+  protected String name;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String level) {
+    this.name = level;
+  }
+
+  public Collection<VNameValue> getDataCount() {
+    return dataCount;
+  }
+
+  public void setDataCounts(Collection<VNameValue> dateValueCounts) {
+    this.dataCount = dateValueCounts;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCount.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCount.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCount.java
new file mode 100644
index 0000000..7832fcc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCount.java
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VCount implements java.io.Serializable {
+  private static final long serialVersionUID = 1L;
+
+  protected String name;
+
+  protected Long count;
+
+  /**
+   * Default constructor. This will set all the attributes to default value.
+   */
+  public VCount() {
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Long getCount() {
+    return count;
+  }
+
+  public void setCount(Long count) {
+    this.count = count;
+  }
+
+  public String toString() {
+    String str = "VLogLevel={";
+    str += super.toString();
+    str += "name={" + name + "} ";
+    str += "count={" + count + "} ";
+    str += "}";
+    return str;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCountList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCountList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCountList.java
new file mode 100644
index 0000000..ed04db7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VCountList.java
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VCountList extends VList {
+  private static final long serialVersionUID = 1L;
+
+  List<VCount> vCounts = new ArrayList<VCount>();
+
+  public VCountList() {
+    super();
+  }
+
+  public VCountList(List<VCount> logList) {
+    super(logList);
+    this.vCounts = logList;
+  }
+
+  public void setCounts(List<VCount> list) {
+    this.vCounts = list;
+  }
+
+  @Override
+  public int getListSize() {
+    if (vCounts != null)
+      return vCounts.size();
+    return 0;
+  }
+
+  @Override
+  public List<VCount> getList() {
+    return vCounts;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphData.java
new file mode 100644
index 0000000..1eebfac
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphData.java
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VGraphData implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  protected String name;
+
+  protected Long count;
+
+  protected List<VGraphData> dataList;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Long getCount() {
+    return count;
+  }
+
+  public void setCount(Long info) {
+    this.count = info;
+  }
+
+  public List<VGraphData> getDataList() {
+    return dataList;
+  }
+
+  public void setDataList(List<VGraphData> dataList) {
+    this.dataList = dataList;
+  }
+
+  @Override
+  public String toString() {
+    String str = "VGraphData={";
+    str += super.toString();
+    str += "info={ " + count + " } ";
+    str += "dataList={ " + dataList + " } ";
+    return str;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphInfo.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphInfo.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphInfo.java
new file mode 100644
index 0000000..2bf75b5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGraphInfo.java
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VGraphInfo implements Serializable {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+
+  protected List<VGraphData> graphData;
+
+  public List<VGraphData> getGraphData() {
+    return graphData;
+  }
+
+  public void setGraphData(List<VGraphData> graphData) {
+    this.graphData = graphData;
+  }
+
+  @Override
+  public String toString() {
+    String str = "VGraphInfo={";
+    str += super.toString();
+    str += "graphData={ " + graphData + " }";
+    return str;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGroupList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGroupList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGroupList.java
new file mode 100644
index 0000000..25f44fc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VGroupList.java
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.solr.common.SolrDocumentList;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VGroupList extends VList {
+  private static final long serialVersionUID = 1L;
+
+  SolrDocumentList groupList = new SolrDocumentList();
+
+  public VGroupList() {
+    super();
+  }
+
+  public VGroupList(SolrDocumentList logList) {
+    super(logList);
+    this.groupList = logList;
+  }
+
+  public void setGroupDocuments(SolrDocumentList list) {
+    this.groupList = list;
+  }
+
+  @Override
+  public int getListSize() {
+    if (groupList != null)
+      return groupList.size();
+    return 0;
+  }
+
+  @Override
+  public SolrDocumentList getList() {
+    return groupList;
+  }
+
+}


[55/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
new file mode 100644
index 0000000..de67420
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-env.xml
@@ -0,0 +1,193 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_solr_port</name>
+    <value>8886</value>
+    <description>Solr port</description>
+    <display-name>Logsearch Solr port</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_pid_dir</name>
+    <value>/var/run/ambari-logsearch-solr</value>
+    <description>Solr Process ID Directory</description>
+    <display-name>Logsearch Solr pid dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_log_dir</name>
+    <value>/var/log/ambari-logsearch-solr</value>
+    <description>Directory for Solr logs</description>
+    <display-name>Logsearch Solr log dir</display-name>
+  </property>
+  
+  <property>
+    <name>logsearch_solr_user</name>
+    <value>solr</value>
+    <property-type>USER</property-type>
+    <description>Solr user</description>
+    <display-name>Logsearch Solr User</display-name>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+  </property>  
+
+  <property>
+    <name>logsearch_solr_group</name>
+    <value>solr</value>
+    <property-type>GROUP</property-type>
+    <description>Solr group</description>
+    <display-name>Logsearch Solr Group</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_datadir</name>
+    <value>/opt/logsearch_solr/data</value>
+    <display-name>Logsearch Solr data dir</display-name>
+    <description>Directory for storting Solr index. Make sure you have enough disk space</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_znode</name>
+    <value>/logsearch</value>
+    <description>Zookeeper znode</description>
+    <display-name>Logsearch Solr ZNode</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_minmem</name>
+    <value>512m</value>
+    <display-name>Logsearch minimum heap size</display-name>
+    <description>Solr minimum heap size e.g.512m </description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_maxmem</name>
+    <value>512m</value>
+    <description>Solr maximum heap size e.g. 512m</description>
+    <display-name>Logsearch maximum heap size</display-name>
+  </property>
+
+
+  <!-- logsearch-solr-env.sh -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch-solr-env.sh file</description>
+    <value>
+# By default the script will use JAVA_HOME to determine which java
+# to use, but you can set a specific path for Solr to use without
+# affecting other Java applications on your server/workstation.
+SOLR_JAVA_HOME={{java64_home}}
+
+# Increase Java Min/Max Heap as needed to support your indexing / query needs
+SOLR_JAVA_MEM="-Xms{{logsearch_solr_min_mem}} -Xmx{{logsearch_solr_max_mem}}"
+
+# Enable verbose GC logging
+GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
+-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
+
+# These GC settings have shown to work well for a number of common Solr workloads
+GC_TUNE="-XX:NewRatio=3 \
+-XX:SurvivorRatio=4 \
+-XX:TargetSurvivorRatio=90 \
+-XX:MaxTenuringThreshold=8 \
+-XX:+UseConcMarkSweepGC \
+-XX:+UseParNewGC \
+-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \
+-XX:+CMSScavengeBeforeRemark \
+-XX:PretenureSizeThreshold=64m \
+-XX:+UseCMSInitiatingOccupancyOnly \
+-XX:CMSInitiatingOccupancyFraction=50 \
+-XX:CMSMaxAbortablePrecleanTime=6000 \
+-XX:+CMSParallelRemarkEnabled \
+-XX:+ParallelRefProcEnabled"
+
+# Set the ZooKeeper connection string if using an external ZooKeeper ensemble
+# e.g. host1:2181,host2:2181/chroot
+# Leave empty if not using SolrCloud
+ZK_HOST="{{zookeeper_quorum}}{{logsearch_solr_znode}}"
+
+# Set the ZooKeeper client timeout (for SolrCloud mode)
+ZK_CLIENT_TIMEOUT="60000"
+
+# By default the start script uses "localhost"; override the hostname here
+# for production SolrCloud environments to control the hostname exposed to cluster state
+#SOLR_HOST="192.168.1.1"
+
+# By default the start script uses UTC; override the timezone if needed
+#SOLR_TIMEZONE="UTC"
+
+# Set to true to activate the JMX RMI connector to allow remote JMX client applications
+# to monitor the JVM hosting Solr; set to "false" to disable that behavior
+# (false is recommended in production environments)
+ENABLE_REMOTE_JMX_OPTS="false"
+
+# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here
+# RMI_PORT=18983
+
+# Anything you add to the SOLR_OPTS variable will be included in the java
+# start command line as-is, in ADDITION to other options. If you specify the
+# -a option on start script, those options will be appended as well. Examples:
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000"
+#SOLR_OPTS="$SOLR_OPTS -Dsolr.clustering.enabled=true"
+
+# Location where the bin/solr script will save PID files for running instances
+# If not set, the script will create PID files in $SOLR_TIP/bin
+SOLR_PID_DIR={{logsearch_solr_piddir}}
+
+# Path to a directory where Solr creates index files, the specified directory
+# must contain a solr.xml; by default, Solr will use server/solr
+SOLR_HOME={{logsearch_solr_datadir}}
+
+# Solr provides a default Log4J configuration properties file in server/resources
+# however, you may want to customize the log settings and file appender location
+# so you can point the script to use a different log4j.properties file
+LOG4J_PROPS={{logsearch_solr_conf}}/log4j.properties
+
+# Location where Solr should write logs to; should agree with the file appender
+# settings in server/resources/log4j.properties
+SOLR_LOGS_DIR={{logsearch_solr_log_dir}}
+
+# Sets the port Solr binds to, default is 8983
+SOLR_PORT={{logsearch_solr_port}}
+
+# Uncomment to set SSL-related system properties
+# Be sure to update the paths to the correct keystore for your environment
+#SOLR_SSL_OPTS="-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.keyStorePassword=secret \
+#-Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.trustStorePassword=secret"
+
+# Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set
+# and you are using SSL, then the start script will use SOLR_PORT for the SSL port
+#SOLR_SSL_PORT=
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
new file mode 100644
index 0000000..1f19c8d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-log4j.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for log4j.properties</description>
+    <value>
+#  Logging level
+solr.log={{logsearch_solr_log_dir}}
+#log4j.rootLogger=INFO, file, CONSOLE
+log4j.rootLogger=INFO, file
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x [%X{collection} %X{shard} %X{replica} %X{core}] \u2013 %m%n
+
+#- size rotation with log cleanup.
+log4j.appender.file=org.apache.log4j.RollingFileAppender
+log4j.appender.file.MaxFileSize=10MB
+log4j.appender.file.MaxBackupIndex=9
+
+#- File to log to and log format
+log4j.appender.file.File=${solr.log}/solr.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%X{collection} %X{shard} %X{replica} %X{core}] %C (%F:%L) - %m%n
+
+log4j.logger.org.apache.zookeeper=WARN
+log4j.logger.org.apache.hadoop=WARN
+
+# set to INFO to enable infostream log messages
+log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
new file mode 100644
index 0000000..01b32b5
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-solr-xml.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch solr.xml file</description>
+    <value>
+&lt;solr&gt;
+  &lt;solrcloud&gt;
+    &lt;str name="host"&gt;${host:}&lt;/str&gt;
+    &lt;int name="hostPort"&gt;${jetty.port:}&lt;/int&gt;
+    &lt;str name="hostContext"&gt;${hostContext:solr}&lt;/str&gt;
+    &lt;int name="zkClientTimeout"&gt;${zkClientTimeout:15000}&lt;/int&gt;
+    &lt;bool name="genericCoreNodeNames"&gt;${genericCoreNodeNames:true}&lt;/bool&gt;
+  &lt;/solrcloud&gt;
+&lt;/solr&gt;
+    </value>
+  </property>
+
+  
+</configuration>  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
new file mode 100644
index 0000000..6dd4aa7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/kerberos.json
@@ -0,0 +1,17 @@
+{
+  "services": [
+    {
+      "name": "LOGSEARCH",
+      "identities": [
+        {
+          "name": "/smokeuser"
+        }
+      ],
+      "components": [
+        {
+          "name": "LOGSEARCH_SERVER"
+        }
+      ]
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
new file mode 100644
index 0000000..9bf486b
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml
@@ -0,0 +1,119 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>LOGSEARCH</name>
+      <displayName>Log Search</displayName>
+      <comment>Log aggregation, analysis, and visualization for Ambari managed services</comment>
+      <version>0.5.0</version>
+
+      <components>
+
+        <component>
+          <name>LOGSEARCH_SERVER</name>
+          <timelineAppid>logsearch</timelineAppid>
+          <displayName>Log Search Server</displayName>
+          <category>MASTER</category>
+          <cardinality>1</cardinality>
+          <commandScript>
+            <script>scripts/logsearch.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+          <logs>
+            <log>
+              <logId>logsearch_app</logId>
+            </log>
+            <log>
+              <logId>logsearch_perf</logId>
+            </log>
+          </logs>
+        </component>
+
+        <component>
+          <name>LOGSEARCH_SOLR</name>
+          <displayName>Solr Instance</displayName>
+          <category>MASTER</category>
+          <cardinality>1+</cardinality>
+          <commandScript>
+            <script>scripts/solr.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+        </component>
+
+        <component>
+          <name>LOGSEARCH_LOGFEEDER</name>
+          <timelineAppid>logfeeder</timelineAppid>
+          <displayName>Log Feeder</displayName>
+          <category>SLAVE</category>
+          <cardinality>ALL</cardinality>
+          <commandScript>
+            <script>scripts/logfeeder.py</script>
+            <scriptType>PYTHON</scriptType>
+          </commandScript>
+          <logs>
+            <log>
+              <logId>logsearch_feeder</logId>
+            </log>
+          </logs>
+        </component>
+
+      </components>
+
+      <osSpecifics>
+        <osSpecific>
+          <osFamily>redhat6</osFamily>
+          <packages>
+            <package>
+              <name>ambari-logsearch-logfeeder</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
+              <name>ambari-logsearch-portal</name>
+              <skipUpgrade>true</skipUpgrade>
+            </package>
+            <package>
+              <name>ambari-logsearch-solr</name>
+              <skipUpgrade>true</skipUpgrade>
+              <condition>should_install_logsearch_solr</condition>
+            </package>
+          </packages>
+        </osSpecific>
+      </osSpecifics>
+
+      <requiredServices>
+        <service>ZOOKEEPER</service>
+      </requiredServices>
+
+      <configuration-dependencies>
+        <config-type>logsearch-site</config-type>
+        <config-type>solr-site</config-type>
+        <config-type>logfeeder-site</config-type>
+      </configuration-dependencies>
+      <restartRequiredAfterChange>false</restartRequiredAfterChange>
+
+      <quickLinksConfigurations>
+        <quickLinksConfiguration>
+          <fileName>quicklinks.json</fileName>
+          <default>true</default>
+        </quickLinksConfiguration>
+      </quickLinksConfigurations>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
new file mode 100644
index 0000000..ce0155d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logfeeder.py
@@ -0,0 +1,67 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+from setup_logfeeder import setup_logfeeder
+
+class LogFeeder(Script):
+
+  def install(self, env):
+    import params
+    env.set_params(params)
+    
+    self.install_packages(env)
+    
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    
+    setup_logfeeder()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(format("{logfeeder_dir}/run.sh"),
+            environment = {'LOGFEEDER_INCLUDE': format('{logsearch_logfeeder_conf}/logfeeder-env.sh')},
+            user=params.logfeeder_user
+            )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    Execute (format("kill `cat {logfeeder_pid_file}`"), 
+             user=params.logfeeder_user , 
+             only_if = format("test -f {logfeeder_pid_file}")
+    )
+    File(params.logfeeder_pid_file, 
+         action="delete"
+    )
+      	
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)  
+    
+    check_process_status(status_params.logfeeder_pid_file)
+
+
+if __name__ == "__main__":
+  LogFeeder().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
new file mode 100644
index 0000000..ac37788
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/logsearch.py
@@ -0,0 +1,65 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+from setup_logsearch import setup_logsearch
+
+class LogSearch(Script):
+
+  def install(self, env):
+    import params
+    env.set_params(params)
+    self.install_packages(env)
+
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    setup_logsearch()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(format("{logsearch_dir}/run.sh {logsearch_ui_port}"),
+            environment = {'LOGSEARCH_INCLUDE': format('{logsearch_server_conf}/logsearch-env.sh')},
+            user=params.logsearch_user
+    )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    Execute (format('kill `cat {logsearch_pid_file}` >/dev/null 2>&1'), 
+             user=params.logsearch_user, 
+             only_if=format("test -f {logsearch_pid_file}") # TODO: check if process is up
+    )
+    File(params.logsearch_pid_file, 
+         action="delete"
+    )
+      	
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)  
+    
+    check_process_status(status_params.logsearch_pid_file)  
+
+if __name__ == "__main__":
+  LogSearch().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
new file mode 100644
index 0000000..ee39629
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
@@ -0,0 +1,231 @@
+#!/usr/bin/env python
+
+"""
+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.
+
+"""
+from ambari_commons.constants import AMBARI_SUDO_BINARY
+from resource_management import *
+import os
+from resource_management.libraries.functions.default import default
+import status_params
+
+def get_port_from_url(address):
+  if not is_empty(address):
+    return address.split(':')[-1]
+  else:
+    return address
+    
+# config object that holds the configurations declared in the -site.xml file
+config = Script.get_config()
+tmp_dir = Script.get_tmp_dir()
+
+stack_version = default("/commandParams/version", None)
+sudo = AMBARI_SUDO_BINARY
+
+logsearch_solr_conf = "/etc/ambari-logsearch-solr/conf"
+logsearch_server_conf = "/etc/ambari-logsearch-portal/conf"
+logsearch_logfeeder_conf = "/etc/ambari-logsearch-logfeeder/conf"
+
+logsearch_solr_port = status_params.logsearch_solr_port
+logsearch_solr_piddir = status_params.logsearch_solr_piddir
+logsearch_solr_pidfile = status_params.logsearch_solr_pidfile
+
+#logsearch pid file
+logsearch_pid_dir = status_params.logsearch_pid_dir
+logsearch_pid_file = status_params.logsearch_pid_file
+
+#logfeeder pid file
+logfeeder_pid_dir = status_params.logfeeder_pid_dir
+logfeeder_pid_file = status_params.logfeeder_pid_file
+
+#shared configs
+java64_home = config['hostLevelParams']['java_home']  
+#get comma separated list of zookeeper hosts from clusterHostInfo
+zookeeper_hosts = ",".join(config['clusterHostInfo']['zookeeper_hosts'])
+cluster_name = str(config['clusterName'])
+
+#for now just pick first collector
+if 'metrics_collector_hosts' in config['clusterHostInfo']:
+  metrics_collector_hosts_list = ",".join(config['clusterHostInfo']['metrics_collector_hosts'])
+  metrics_collector_port = str(get_port_from_url(config['configurations']['ams-site']['timeline.metrics.service.webapp.address']))
+  metrics_collector_hosts = format('http://{metrics_collector_hosts_list}:{metrics_collector_port}/ws/v1/timeline/metrics')
+else:
+  metrics_collector_hosts = ''
+
+#####################################
+#Solr configs
+#####################################
+
+# Only supporting SolrCloud mode - so hardcode those options
+solr_cloudmode = 'true'
+solr_dir = '/usr/lib/ambari-logsearch-solr'
+solr_bindir = solr_dir + '/bin'
+cloud_scripts = solr_dir +'/server/scripts/cloud-scripts'
+
+logsearch_solr_znode = config['configurations']['logsearch-solr-env']['logsearch_solr_znode']
+logsearch_solr_min_mem = format(config['configurations']['logsearch-solr-env']['logsearch_solr_minmem'])
+logsearch_solr_max_mem = format(config['configurations']['logsearch-solr-env']['logsearch_solr_maxmem'])
+logsearch_solr_instance_count = len(config['clusterHostInfo']['logsearch_solr_hosts'])
+logsearch_solr_datadir = format(config['configurations']['logsearch-solr-env']['logsearch_solr_datadir'])
+logsearch_solr_data_resources_dir = os.path.join(logsearch_solr_datadir,'resources')
+logsearch_service_logs_max_retention = config['configurations']['logsearch-service_logs-solrconfig']['logsearch_service_logs_max_retention']
+logsearch_audit_logs_max_retention = config['configurations']['logsearch-audit_logs-solrconfig']['logsearch_audit_logs_max_retention']
+
+logsearch_service_logs_fields = config['configurations']['logsearch-site']['logsearch.service.logs.fields']
+
+logsearch_ui_port = config['configurations']['logsearch-site']["logsearch.ui.port"]
+logsearch_debug_enabled = str(config['configurations']['logsearch-env']["logsearch_debug_enabled"]).lower()
+logsearch_debug_port = config['configurations']['logsearch-env']["logsearch_debug_port"]
+logsearch_app_max_memory = config['configurations']['logsearch-env']['logsearch_app_max_memory']
+
+audit_logs_collection_splits_interval_mins = config['configurations']['logsearch-site']['logsearch.audit.logs.split.interval.mins']
+service_logs_collection_splits_interval_mins = config['configurations']['logsearch-site']['logsearch.service.logs.split.interval.mins']
+
+zookeeper_port=default('/configurations/zoo.cfg/clientPort', None)
+#get comma separated list of zookeeper hosts from clusterHostInfo
+index = 0 
+zookeeper_quorum = ""
+for host in config['clusterHostInfo']['zookeeper_hosts']:
+  zookeeper_quorum += host + ":"+str(zookeeper_port)
+  index += 1
+  if index < len(config['clusterHostInfo']['zookeeper_hosts']):
+    zookeeper_quorum += ","
+
+logsearch_solr_user = config['configurations']['logsearch-solr-env']['logsearch_solr_user']
+logsearch_solr_group = config['configurations']['logsearch-solr-env']['logsearch_solr_group']
+logsearch_solr_log_dir = config['configurations']['logsearch-solr-env']['logsearch_solr_log_dir']
+logsearch_solr_log = format("{logsearch_solr_log_dir}/solr-install.log")
+
+solr_env_content = config['configurations']['logsearch-solr-env']['content']
+
+solr_xml_content = config['configurations']['logsearch-solr-xml']['content']
+
+solr_log4j_content = config['configurations']['logsearch-solr-log4j']['content']
+
+
+#####################################
+#Logsearch configs
+#####################################
+logsearch_dir = '/usr/lib/ambari-logsearch-portal'
+logsearch_numshards_config = config['configurations']['logsearch-site']['logsearch.collection.numshards']
+
+if logsearch_numshards_config > 0:
+  logsearch_numshards = str(logsearch_numshards_config)
+else:
+  logsearch_numshards = format(str(logsearch_solr_instance_count))
+
+logsearch_repfactor = str(config['configurations']['logsearch-site']['logsearch.collection.replication.factor'])
+
+logsearch_solr_collection_service_logs = default('/configurations/logsearch-site/logsearch.solr.collection.service.logs', 'hadoop_logs')
+logsearch_solr_collection_audit_logs = default('/configurations/logsearch-site/logsearch.solr.collection.audit.logs', 'audit_logs')
+
+solr_audit_logs_use_ranger = default('/configurations/logsearch-env/logsearch_solr_audit_logs_use_ranger', False)
+solr_audit_logs_url = ''
+
+if solr_audit_logs_use_ranger:
+  #In Ranger, this contain the /zkNode also
+  ranger_audit_solr_zookeepers = default('/configurations/ranger-admin-site/ranger.audit.solr.zookeepers', None)
+  #TODO: ranger property already has zk node appended. We need to remove it.
+  #For now, let's assume it is going to be URL
+  solr_audit_logs_url = default('/configurations/ranger-admin-site/ranger.audit.solr.urls', solr_audit_logs_url)
+else:
+  solr_audit_logs_zk_node = default('/configurations/logsearch-env/logsearch_solr_audit_logs_zk_node', None)
+  solr_audit_logs_zk_quorum = default('/configurations/logsearch-env/logsearch_solr_audit_logs_zk_quorum', None)
+
+  if not(solr_audit_logs_zk_quorum):
+    solr_audit_logs_zk_quorum=zookeeper_quorum
+  if not(solr_audit_logs_zk_node):
+    solr_audit_logs_zk_node=logsearch_solr_znode
+
+  solr_audit_logs_zk_node = format(solr_audit_logs_zk_node)
+  solr_audit_logs_zk_quorum = format(solr_audit_logs_zk_quorum)
+
+
+# logsearch-env configs
+logsearch_user = config['configurations']['logsearch-env']['logsearch_user']
+logsearch_group = config['configurations']['logsearch-env']['logsearch_group']
+logsearch_log_dir = config['configurations']['logsearch-env']['logsearch_log_dir']
+logsearch_log = logsearch_log_dir + '/logsearch.out'
+
+# store the log file for the service from the 'solr.log' property of the 'logsearch-env.xml' file
+logsearch_env_content = config['configurations']['logsearch-env']['content']
+logsearch_service_logs_solrconfig_content = config['configurations']['logsearch-service_logs-solrconfig']['content']
+logsearch_audit_logs_solrconfig_content = config['configurations']['logsearch-audit_logs-solrconfig']['content']
+logsearch_app_log4j_content = config['configurations']['logsearch-log4j']['content']
+
+#Log dirs
+ambari_server_log_dir = '/var/log/ambari-server'
+ambari_agent_log_dir = '/var/log/ambari-agent'
+knox_log_dir = '/var/log/knox'
+
+metrics_collector_log_dir = default('/configurations/ams-env/metrics_collector_log_dir', '/var/log')
+metrics_monitor_log_dir = default('/configurations/ams-env/metrics_monitor_log_dir', '/var/log')
+
+
+atlas_log_dir = default('/configurations/atlas-env/metadata_log_dir', '/var/log/atlas')
+accumulo_log_dir = default('/configurations/accumulo-env/accumulo_log_dir', '/var/log/accumulo')
+falcon_log_dir = default('/configurations/falcon-env/falcon_log_dir','/var/log/falcon')
+hbase_log_dir = default('/configurations/hbase-env/hbase_log_dir','/var/log/hbase')
+hdfs_log_dir_prefix = default('/configurations/hadoop-env/hdfs_log_dir_prefix','/var/log/hadoop')
+hive_log_dir = default('/configurations/hive-env/hive_log_dir','/var/log/hive')
+kafka_log_dir = default('/configurations/kafka-env/kafka_log_dir','/var/log/kafka')
+oozie_log_dir = default('/configurations/oozie-env/oozie_log_dir','/var/log/oozie')
+ranger_usersync_log_dir = default('/configurations/ranger-env/ranger_usersync_log_dir', '/var/log/ranger/usersync')
+ranger_admin_log_dir = default('/configurations/ranger-env/ranger_admin_log_dir', '/var/log/ranger/admin')
+ranger_kms_log_dir = default('/configurations/kms-env/kms_log_dir', '/var/log/ranger/kms')
+storm_log_dir = default('/configurations/storm-env/storm_log_dir','/var/log/storm')
+yarn_log_dir_prefix = default('/configurations/yarn-env/yarn_log_dir_prefix','/var/log/hadoop')
+mapred_log_dir_prefix = default('/configurations/mapred-env/mapred_log_dir_prefix','/var/log/hadoop')
+zk_log_dir = default('/configurations/zookeeper-env/zk_log_dir','/var/log/zookeeper')
+
+
+#####################################
+#Logfeeder configs
+#####################################
+
+logfeeder_dir = "/usr/lib/ambari-logsearch-logfeeder"
+
+# logfeeder-site configs
+solr_service_logs_enable = default('/configurations/logfeeder-site/logfeeder.solr.service.logs.enable',True)
+solr_audit_logs_enable = default('/configurations/logfeeder-site/logfeeder.solr.audit.logs_enable',True)
+
+kafka_broker_list = default('/configurations/logfeeder-site/logfeeder.kafka.broker.list', '')
+kafka_security_protocol= default('/configurations/logfeeder-site/logfeeder.kafka.security.protocol', '')
+kafka_kerberos_service_name=default('/configurations/logfeeder-site/logfeeder.kafka.kerberos.service.name', '')
+
+kafka_service_logs_enable = default('/configurations/logfeeder-site/logfeeder.kafka.service.logs.enable',False)
+kafka_audit_logs_enable = default('/configurations/logfeeder-site/logfeeder.kafka.audit.logs.enable',False)
+kafka_topic_service_logs = default('/configurations/logfeeder-site/logfeeder.kafka.topic.service.logs','service_logs')
+kafka_topic_audit_logs = default('/configurations/logfeeder-site/logfeeder.kafka.topic.audit.logs','audit_logs')
+
+# logfeeder-env configs
+logfeeder_user = config['configurations']['logfeeder-env']['logfeeder_user']
+logfeeder_group = config['configurations']['logfeeder-env']['logfeeder_group']
+logfeeder_log_dir = config['configurations']['logfeeder-env']['logfeeder_log_dir']
+logfeeder_log = logfeeder_log_dir + '/logfeeder.out'
+logfeeder_max_mem = config['configurations']['logfeeder-env']['logfeeder_max_mem']
+logfeeder_env_content = config['configurations']['logfeeder-env']['content']
+logfeeder_log4j_content = config['configurations']['logfeeder-log4j']['content']
+
+logfeeder_checkpoint_folder = default('/configurations/logfeeder-env/logfeeder.checkpoint.folder', '/etc/ambari-logsearch-logfeeder/conf/checkpoints')
+logfeeder_supported_services = ['accumulo', 'ambari', 'ams', 'atlas', 'falcon', 'hbase', 'hdfs', 'hive', 'kafka',
+                                'knox', 'logsearch', 'oozie', 'ranger', 'storm', 'yarn', 'zookeeper']
+
+logfeeder_config_file_names = ['global.config.json', 'output.config.json'] + ['input.config-%s.json' % (tag) for tag in logfeeder_supported_services]
+
+logfeeder_config_files = ','.join(logfeeder_config_file_names)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
new file mode 100644
index 0000000..0c1cb6d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logfeeder.py
@@ -0,0 +1,67 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+
+def setup_logfeeder():
+  import params
+  
+  Directory([params.logfeeder_log_dir, params.logfeeder_pid_dir, params.logfeeder_dir,
+             params.logsearch_logfeeder_conf, params.logfeeder_checkpoint_folder],
+            mode = 0755,
+            cd_access = 'a',
+            owner = params.logfeeder_user,
+            group = params.logfeeder_group,
+            create_parents = True
+  )
+  
+  
+  File(params.logfeeder_log,
+       mode = 0644,
+       owner = params.logfeeder_user,
+       group = params.logfeeder_group,
+       content = ''
+  )
+
+  File(format("{logsearch_logfeeder_conf}/logfeeder.properties"),
+       content=Template("logfeeder.properties.j2"),
+       owner=params.logfeeder_user
+       )
+
+  File(format("{logsearch_logfeeder_conf}/logfeeder-env.sh"),
+       content = InlineTemplate(params.logfeeder_env_content),
+       owner = params.logfeeder_user
+       )
+  
+  File(format("{logsearch_logfeeder_conf}/log4j.xml"),
+       content = InlineTemplate(params.logfeeder_log4j_content),
+       owner = params.logfeeder_user
+  )
+  
+  File(format("{logsearch_logfeeder_conf}/grok-patterns"),
+       content = Template("grok-patterns.j2"),
+       owner = params.logfeeder_user,
+       encoding = "utf-8"
+  )
+  
+  for file_name in params.logfeeder_config_file_names:
+    File(format("{logsearch_logfeeder_conf}/" + file_name),
+         content = Template(file_name + ".j2"),
+         owner = params.logfeeder_user
+    )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
new file mode 100644
index 0000000..7cab1d9
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_logsearch.py
@@ -0,0 +1,93 @@
+"""
+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.
+
+"""
+
+import random
+from resource_management import *
+from resource_management.libraries.functions.decorator import retry
+
+def setup_logsearch():
+  import params
+  
+  Directory([params.logsearch_log_dir, params.logsearch_pid_dir, params.logsearch_dir, params.logsearch_server_conf],
+            mode=0755,
+            cd_access='a',
+            owner=params.logsearch_user,
+            group=params.logsearch_group,
+            create_parents=True
+            )
+
+  File(params.logsearch_log,
+       mode=0644,
+       owner=params.logsearch_user,
+       group=params.logsearch_group,
+       content=''
+       )
+
+  File(format("{logsearch_server_conf}/logsearch.properties"),
+       content=Template("logsearch.properties.j2"),
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/log4j.xml"),
+       content=InlineTemplate(params.logsearch_app_log4j_content), 
+       owner=params.logsearch_user
+  )
+
+  File(format("{logsearch_server_conf}/logsearch-env.sh"),
+       content=InlineTemplate(params.logsearch_env_content),
+       mode=0755,
+       owner=params.logsearch_user
+       )
+
+  File(format("{logsearch_server_conf}/solr_configsets/hadoop_logs/conf/solrconfig.xml"),
+       content=InlineTemplate(params.logsearch_service_logs_solrconfig_content), 
+       owner=params.logsearch_user
+  )
+
+  File(format("{logsearch_server_conf}/solr_configsets/audit_logs/conf/solrconfig.xml"),
+       content=InlineTemplate(params.logsearch_audit_logs_solrconfig_content),
+       owner=params.logsearch_user
+       )
+
+  random_num = random.random()
+
+  upload_configuration_dir_to_zk('hadoop_logs', random_num)
+
+  upload_configuration_dir_to_zk('history', random_num)
+
+  upload_configuration_dir_to_zk('audit_logs', random_num)
+
+  Execute(("chmod", "-R", "ugo+r", format("{logsearch_server_conf}/solr_configsets")),
+          sudo=True
+  )
+
+def upload_configuration_dir_to_zk(config_set, random_num):
+  import params
+
+  tmp_config_set_folder=format('{tmp_dir}/solr_config_{config_set}_{random_num}')
+  zk_cli_prefix = format('export JAVA_HOME={java64_home} ; {cloud_scripts}/zkcli.sh -zkhost {zookeeper_quorum}{logsearch_solr_znode}')
+
+  Execute(format('{zk_cli_prefix} -cmd downconfig -confdir {tmp_config_set_folder} -confname {config_set}'),
+          only_if = format("{zk_cli_prefix} -cmd get /configs/{config_set}"),
+          )
+
+  Execute(format('{zk_cli_prefix} -cmd upconfig -confdir {logsearch_server_conf}/solr_configsets/{config_set}/conf -confname {config_set}'),
+        not_if = format("test -d {tmp_config_set_folder}"),
+        )
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
new file mode 100644
index 0000000..0192277
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/setup_solr.py
@@ -0,0 +1,67 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+
+def setup_solr():
+  import params
+  
+  Directory([params.solr_dir, params.logsearch_solr_log_dir, params.logsearch_solr_piddir, params.logsearch_solr_conf,
+             params.logsearch_solr_datadir, params.logsearch_solr_data_resources_dir],
+            mode=0755,
+            cd_access='a',
+            owner=params.logsearch_solr_user,
+            group=params.logsearch_solr_group,
+            create_parents=True
+            )
+
+  File(params.logsearch_solr_log,
+       mode=0644,
+       owner=params.logsearch_solr_user,
+       group=params.logsearch_solr_group,
+       content=''
+       )
+
+  File(format("{logsearch_solr_conf}/logsearch-solr-env.sh"),
+       content=InlineTemplate(params.solr_env_content),
+       mode = 0755,
+       owner=params.logsearch_solr_user
+  )      
+  
+  File(format("{logsearch_solr_datadir}/solr.xml"),
+      content=InlineTemplate(params.solr_xml_content), 
+      owner=params.logsearch_solr_user
+  )    
+
+  File(format("{logsearch_solr_conf}/log4j.properties"),
+       content=InlineTemplate(params.solr_log4j_content), 
+       owner=params.logsearch_solr_user
+  )
+
+  File(format("{logsearch_solr_datadir}/zoo.cfg"),
+       content=Template("zoo.cfg.j2"),
+       owner=params.logsearch_solr_user
+       )
+  
+  zk_cli_prefix = format('export JAVA_HOME={java64_home}; {cloud_scripts}/zkcli.sh -zkhost {zookeeper_hosts}')
+  Execute (format('{zk_cli_prefix} -cmd makepath {logsearch_solr_znode}'),
+           not_if = format("{zk_cli_prefix} -cmd get /logsearch"),
+           ignore_failures = True,
+           user=params.logsearch_solr_user
+           )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
new file mode 100644
index 0000000..545505a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/solr.py
@@ -0,0 +1,66 @@
+"""
+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.
+
+"""
+
+from resource_management import *
+from setup_solr import setup_solr
+
+class Solr(Script):
+
+  def install(self, env):
+    import params
+    env.set_params(params)
+    self.install_packages(env)
+
+  def configure(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    setup_solr()
+
+  def start(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+    self.configure(env)
+
+    Execute(format('{solr_bindir}/solr start -cloud -noprompt -s {logsearch_solr_datadir} >> {logsearch_solr_log} 2>&1'),
+            environment = {'SOLR_INCLUDE': format('{logsearch_solr_conf}/logsearch-solr-env.sh')},
+            user=params.logsearch_solr_user
+    )
+
+  def stop(self, env, upgrade_type=None):
+    import params
+    env.set_params(params)
+
+    Execute (format('{solr_bindir}/solr stop -all >> {logsearch_solr_log}'),
+             environment = {'SOLR_INCLUDE': format('{logsearch_solr_conf}/logsearch-solr-env.sh')},
+             user=params.logsearch_solr_user,
+             only_if = format("test -f {logsearch_solr_pidfile}")
+             )
+    File(params.logsearch_solr_pidfile,
+         action="delete"
+         )
+      	
+  def status(self, env):
+    import status_params
+    env.set_params(status_params)  
+    
+    check_process_status(status_params.logsearch_solr_pidfile)
+
+if __name__ == "__main__":
+  Solr().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
new file mode 100644
index 0000000..3a293fd
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/status_params.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+
+"""
+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.
+
+"""
+
+from resource_management import *
+
+config = Script.get_config()
+
+logsearch_solr_port = config['configurations']['logsearch-solr-env']['logsearch_solr_port']
+logsearch_solr_piddir = config['configurations']['logsearch-solr-env']['logsearch_solr_pid_dir']
+logsearch_solr_pidfile = format("{logsearch_solr_piddir}/solr-{logsearch_solr_port}.pid")
+
+#logsearch pid file
+logsearch_pid_dir = config['configurations']['logsearch-env']['logsearch_pid_dir']
+logsearch_pid_file = format("{logsearch_pid_dir}/logsearch.pid")
+
+#logfeeder pid file
+logfeeder_pid_dir = config['configurations']['logfeeder-env']['logfeeder_pid_dir']
+logfeeder_pid_file = format("{logfeeder_pid_dir}/logfeeder.pid")

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
new file mode 100644
index 0000000..f337527
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/global.config.json.j2
@@ -0,0 +1,28 @@
+{#
+ # 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.
+ #}
+{
+  "global":{
+    "add_fields":{
+      "cluster":"{{cluster_name}}"
+    },
+    "source":"file",
+    "tail":"true",
+    "gen_event_md5":"true",
+    "start_position":"beginning"
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
new file mode 100644
index 0000000..c85a06a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/grok-patterns.j2
@@ -0,0 +1,144 @@
+# 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.
+
+#Updated JAVACLASS to be same as JAVAFILE. Because if class doesn't have package, then it doesn't work.
+JAVACLASS (?:[A-Za-z$0-9_. -]+)
+#JAVACLASS (?:[a-zA-Z$_][a-zA-Z$_0-9]*\.)*[a-zA-Z$_][a-zA-Z$_0-9]*
+#JAVACLASS (?:[a-zA-Z0-9-]+\.)+[A-Za-z0-9$]+
+
+#Space is an allowed character to match special cases like 'Native Method' or 'Unknown Source'
+JAVAFILE (?:[A-Za-z0-9_. -]+)
+#Allow special <init> or <clinit> method
+JAVAMETHOD (?:(<init>)|(<clinit>)|[a-zA-Z$_][a-zA-Z$_0-9]*)
+#Line number is optional in special cases 'Native method' or 'Unknown source'
+JAVASTACKTRACEPART %{SPACE}at %{JAVACLASS:class}\.%{JAVAMETHOD:method}\(%{JAVAFILE:file}(?::%{NUMBER:line})?\)
+# Java Logs
+JAVATHREAD (?:[A-Z]{2}-Processor[\d]+)
+
+JAVASTACKTRACEPART at %{JAVACLASS:class}\.%{WORD:method}\(%{JAVAFILE:file}:%{NUMBER:line}\)
+JAVALOGMESSAGE (.*)
+# MMM dd, yyyy HH:mm:ss eg: Jan 9, 2014 7:13:13 AM
+CATALINA_DATESTAMP %{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM)
+# yyyy-MM-dd HH:mm:ss,SSS ZZZ eg: 2014-01-09 17:32:25,527 -0800
+TOMCAT_DATESTAMP 20%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) %{ISO8601_TIMEZONE}
+CATALINALOG %{CATALINA_DATESTAMP:timestamp} %{JAVACLASS:class} %{JAVALOGMESSAGE:logmessage}
+# 2014-01-09 20:03:28,269 -0800 | ERROR | com.example.service.ExampleService - something compeletely unexpected happened...
+TOMCATLOG %{TOMCAT_DATESTAMP:timestamp} \| %{LOGLEVEL:level} \| %{JAVACLASS:class} - %{JAVALOGMESSAGE:logmessage}
+
+USERNAME [a-zA-Z0-9._-]+
+USER %{USERNAME}
+EMAILLOCALPART [a-zA-Z][a-zA-Z0-9_.+-=:]+
+EMAILADDRESS %{EMAILLOCALPART}@%{HOSTNAME}
+HTTPDUSER %{EMAILADDRESS}|%{USER}
+INT (?:[+-]?(?:[0-9]+))
+BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))
+NUMBER (?:%{BASE10NUM})
+BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
+BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
+
+POSINT \b(?:[1-9][0-9]*)\b
+NONNEGINT \b(?:[0-9]+)\b
+WORD \b\w+\b
+NOTSPACE \S+
+SPACE \s*
+DATA .*?
+GREEDYDATA .*
+QUOTEDSTRING (?>(?<!\\)(?>"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``))
+UUID [A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}
+
+# Networking
+MAC (?:%{CISCOMAC}|%{WINDOWSMAC}|%{COMMONMAC})
+CISCOMAC (?:(?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4})
+WINDOWSMAC (?:(?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2})
+COMMONMAC (?:(?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2})
+IPV6 ((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5
 ]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?
+IPV4 (?<![0-9])(?:(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]))(?![0-9])
+IP (?:%{IPV6}|%{IPV4})
+HOSTNAME \b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\.?|\b)
+IPORHOST (?:%{IP}|%{HOSTNAME})
+HOSTPORT %{IPORHOST}:%{POSINT}
+
+# paths
+PATH (?:%{UNIXPATH}|%{WINPATH})
+UNIXPATH (/([\w_%!$@:.,~-]+|\\.)*)+
+TTY (?:/dev/(pts|tty([pq])?)(\w+)?/?(?:[0-9]+))
+WINPATH (?>[A-Za-z]+:|\\)(?:\\[^\\?*]*)+
+URIPROTO [A-Za-z]+(\+[A-Za-z+]+)?
+URIHOST %{IPORHOST}(?::%{POSINT:port})?
+# uripath comes loosely from RFC1738, but mostly from what Firefox
+# doesn't turn into %XX
+URIPATH (?:/[A-Za-z0-9$.+!*'(){},~:;=@#%_\-]*)+
+#URIPARAM \?(?:[A-Za-z0-9]+(?:=(?:[^&]*))?(?:&(?:[A-Za-z0-9]+(?:=(?:[^&]*))?)?)*)?
+URIPARAM \?[A-Za-z0-9$.+!*'|(){},~@#%&/=:;_?\-\[\]<>]*
+URIPATHPARAM %{URIPATH}(?:%{URIPARAM})?
+URI %{URIPROTO}://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})?
+
+# Months: January, Feb, 3, 03, 12, December
+MONTH \b(?:Jan(?:uary|uar)?|Feb(?:ruary|ruar)?|M(?:a|ä)?r(?:ch|z)?|Apr(?:il)?|Ma(?:y|i)?|Jun(?:e|i)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|O(?:c|k)?t(?:ober)?|Nov(?:ember)?|De(?:c|z)(?:ember)?)\b
+MONTHNUM (?:0?[1-9]|1[0-2])
+MONTHNUM2 (?:0[1-9]|1[0-2])
+MONTHDAY (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])
+
+# Days: Monday, Tue, Thu, etc...
+DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)
+
+# Years?
+YEAR (?>\d\d){1,2}
+HOUR (?:2[0123]|[01]?[0-9])
+MINUTE (?:[0-5][0-9])
+# '60' is a leap second in most time standards and thus is valid.
+SECOND (?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?)
+TIME (?!<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9])
+# datestamp is YYYY/MM/DD-HH:MM:SS.UUUU (or something like it)
+DATE_US %{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR}
+DATE_EU %{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR}
+ISO8601_TIMEZONE (?:Z|[+-]%{HOUR}(?::?%{MINUTE}))
+ISO8601_SECOND (?:%{SECOND}|60)
+TIMESTAMP_ISO8601 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}?
+DATE %{DATE_US}|%{DATE_EU}
+DATESTAMP %{DATE}[- ]%{TIME}
+TZ (?:[PMCE][SD]T|UTC)
+DATESTAMP_RFC822 %{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ}
+DATESTAMP_RFC2822 %{DAY}, %{MONTHDAY} %{MONTH} %{YEAR} %{TIME} %{ISO8601_TIMEZONE}
+DATESTAMP_OTHER %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{TZ} %{YEAR}
+DATESTAMP_EVENTLOG %{YEAR}%{MONTHNUM2}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND}
+HTTPDERROR_DATE %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}
+
+# Syslog Dates: Month Day HH:MM:SS
+SYSLOGTIMESTAMP %{MONTH} +%{MONTHDAY} %{TIME}
+PROG [\x21-\x5a\x5c\x5e-\x7e]+
+SYSLOGPROG %{PROG:program}(?:\[%{POSINT:pid}\])?
+SYSLOGHOST %{IPORHOST}
+SYSLOGFACILITY <%{NONNEGINT:facility}.%{NONNEGINT:priority}>
+HTTPDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{INT}
+
+# Shortcuts
+QS %{QUOTEDSTRING}
+
+# Log formats
+SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}:
+COMMONAPACHELOG %{IPORHOST:clientip} %{HTTPDUSER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)
+COMBINEDAPACHELOG %{COMMONAPACHELOG} %{QS:referrer} %{QS:agent}
+HTTPD20_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IPORHOST:clientip}\] ){0,1}%{GREEDYDATA:errormsg}
+HTTPD24_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}:tid %{NUMBER:tid}\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_errormessage}:)?( \[client %{IPORHOST:client}:%{POSINT:clientport}\])? %{DATA:errorcode}: %{GREEDYDATA:message}
+HTTPD_ERRORLOG %{HTTPD20_ERRORLOG}|%{HTTPD24_ERRORLOG}
+
+
+# Log Levels
+LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo|INFO|[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
+
+
+# Custom
+USER_SYNC_DATE %{MONTHDAY} %{MONTH} %{YEAR} %{TIME}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
new file mode 100644
index 0000000..a6c7ab8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-accumulo.json.j2
@@ -0,0 +1,105 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"accumulo_gc",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/gc_*.log"
+    },
+    {
+      "type":"accumulo_master",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/master_*.log"
+    },
+    {
+      "type":"accumulo_monitor",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/monitor_*.log"
+    },
+    {
+      "type":"accumulo_tracer",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/tracer_*.log"
+    },
+    {
+      "type":"accumulo_tserver",
+      "rowtype":"service",
+      "path":"{{accumulo_log_dir}}/tserver_*.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "accumulo_master"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "comment":"This one has one extra space after LEVEL",
+      "conditions":{
+        "fields":{
+          "type":[
+            "accumulo_gc",
+            "accumulo_monitor",
+            "accumulo_tracer",
+            "accumulo_tserver"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
new file mode 100644
index 0000000..273b880
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ambari.json.j2
@@ -0,0 +1,93 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"ambari_agent",
+      "rowtype":"service",
+      "path":"{{ambari_agent_log_dir}}/ambari-agent.log"
+    },
+    {
+      "type":"ambari_server",
+      "rowtype":"service",
+      "path":"{{ambari_server_log_dir}}/ambari-server.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ambari_agent"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"",
+      "multiline_pattern":"^(%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime} %{JAVAFILE:file}:%{INT:line_number} - %{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        },
+        "level":{
+          "map_fieldvalue":{
+            "pre_value":"WARNING",
+            "post_value":"WARN"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ambari_server"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{DATE} %5p [%t] %c{1}:%L - %m%n",
+      "multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+      "message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"dd MMM yyyy HH:mm:ss"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
new file mode 100644
index 0000000..d2f3f1a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ams.json.j2
@@ -0,0 +1,92 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"ams_hbase_master",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/hbase-ams-master-*.log"
+    },
+    {
+      "type":"ams_hbase_regionserver",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/hbase-ams-regionserver-*.log"
+    },
+    {
+      "type":"ams_collector",
+      "rowtype":"service",
+      "path":"{{metrics_collector_log_dir}}/ambari-metrics-collector.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ams_collector"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %p %c: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ams_hbase_master",
+            "ams_hbase_regionserver"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
new file mode 100644
index 0000000..84bc84c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-atlas.json.j2
@@ -0,0 +1,55 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"atlas_app",
+      "rowtype":"service",
+      "path":"{{atlas_log_dir}}/application.log"
+    }
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "atlas_app"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
new file mode 100644
index 0000000..2e24e3f
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-falcon.json.j2
@@ -0,0 +1,55 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"falcon_app",
+      "rowtype":"service",
+      "path":"{{falcon_log_dir}}/falcon.application.log"
+    }
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "falcon_app"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
new file mode 100644
index 0000000..fe28f89
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hbase.json.j2
@@ -0,0 +1,62 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hbase_master",
+      "rowtype":"service",
+      "path":"{{hbase_log_dir}}/hbase-hbase-master-*.log"
+    },
+    {
+      "type":"hbase_regionserver",
+      "rowtype":"service",
+      "path":"{{hbase_log_dir}}/hbase-hbase-regionserver-*.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hbase_master",
+            "hbase_regionserver"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
new file mode 100644
index 0000000..5697012
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hdfs.json.j2
@@ -0,0 +1,246 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hdfs_datanode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-datanode-*.log"
+    },
+    {
+      "type":"hdfs_namenode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-namenode-*.log"
+    },
+    {
+      "type":"hdfs_journalnode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-journalnode-*.log"
+    },
+    {
+      "type":"hdfs_secondarynamenode",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-secondarynamenode-*.log"
+    },
+    {
+      "type":"hdfs_zkfc",
+      "rowtype":"service",
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-zkfc-*.log"
+    },
+    {
+      "type":"hdfs_audit",
+      "rowtype":"audit",
+      "is_enabled":"true",
+      "add_fields":{
+        "logType":"HDFSAudit",
+        "enforcer":"hadoop-acl",
+        "repoType":"1",
+        "repo":"hdfs"
+      },
+      "path":"{{hdfs_log_dir_prefix}}/hdfs/hdfs-audit.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_datanode",
+            "hdfs_journalnode",
+            "hdfs_secondarynamenode",
+            "hdfs_namenode",
+            "hdfs_zkfc"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:evtTime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:evtTime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "evtTime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"keyvalue",
+      "sort_order":1,
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+          
+        }
+        
+      },
+      "source_field":"log_message",
+      "value_split":"=",
+      "field_split":"\t",
+      "post_map_values":{
+        "src":{
+          "map_fieldname":{
+            "new_fieldname":"resource"
+          }
+          
+        },
+        "ip":{
+          "map_fieldname":{
+            "new_fieldname":"cliIP"
+          }
+          
+        },
+        "allowed":[
+          {
+            "map_fieldvalue":{
+              "pre_value":"true",
+              "post_value":"1"
+            }
+            
+          },
+          {
+            "map_fieldvalue":{
+              "pre_value":"false",
+              "post_value":"0"
+            }
+            
+          },
+          {
+            "map_fieldname":{
+              "new_fieldname":"result"
+            }
+            
+          }
+          
+        ],
+        "cmd":{
+          "map_fieldname":{
+            "new_fieldname":"action"
+          }
+          
+        },
+        "proto":{
+          "map_fieldname":{
+            "new_fieldname":"cliType"
+          }
+          
+        },
+        "callerContext":{
+          "map_fieldname":{
+            "new_fieldname":"req_caller_id"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "sort_order":2,
+      "source_field":"ugi",
+      "remove_source_field":"false",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hdfs_audit"
+          ]
+          
+        }
+        
+      },
+      "message_pattern":"%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+      "post_map_values":{
+        "user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+          
+        },
+        "x_user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+          
+        },
+        "p_user":{
+          "map_fieldname":{
+            "new_fieldname":"reqUser"
+          }
+          
+        },
+        "k_user":{
+          "map_fieldname":{
+            "new_fieldname":"proxyUsers"
+          }
+          
+        },
+        "p_authType":{
+          "map_fieldname":{
+            "new_fieldname":"authType"
+          }
+          
+        },
+        "k_authType":{
+          "map_fieldname":{
+            "new_fieldname":"proxyAuthType"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
new file mode 100644
index 0000000..1b8d9a1
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-hive.json.j2
@@ -0,0 +1,62 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"hive_hiveserver2",
+      "rowtype":"service",
+      "path":"{{hive_log_dir}}/hiveserver2.log"
+    },
+    {
+      "type":"hive_metastore",
+      "rowtype":"service",
+      "path":"{{hive_log_dir}}/hivemetastore.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "hive_hiveserver2",
+            "hive_metastore"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p [%t]: %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]:%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file


[19/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.js
new file mode 100644
index 0000000..6f8da79
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.js
@@ -0,0 +1,2883 @@
+/*!
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2014 Jimmy Yuen Ho Wong and contributors <wy...@gmail.com>
+  Licensed under the MIT license.
+*/
+
+(function (factory) {
+
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(module.exports,
+                             require("underscore"),
+                             require("backbone"));
+  }
+  // Browser
+  else factory(this, this._, this.Backbone);
+}(function (root, _, Backbone) {
+
+  "use strict";
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+// Copyright 2009, 2010 Kristopher Michael Kowal
+// https://github.com/kriskowal/es5-shim
+// ES5 15.5.4.20
+// http://es5.github.com/#x15.5.4.20
+var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" +
+  "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
+  "\u2029\uFEFF";
+if (!String.prototype.trim || ws.trim()) {
+  // http://blog.stevenlevithan.com/archives/faster-trim-javascript
+  // http://perfectionkills.com/whitespace-deviations/
+  ws = "[" + ws + "]";
+  var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
+  trimEndRegexp = new RegExp(ws + ws + "*$");
+  String.prototype.trim = function trim() {
+    if (this === undefined || this === null) {
+      throw new TypeError("can't convert " + this + " to object");
+    }
+    return String(this)
+      .replace(trimBeginRegexp, "")
+      .replace(trimEndRegexp, "");
+  };
+}
+
+function lpad(str, length, padstr) {
+  var paddingLen = length - (str + '').length;
+  paddingLen =  paddingLen < 0 ? 0 : paddingLen;
+  var padding = '';
+  for (var i = 0; i < paddingLen; i++) {
+    padding = padding + padstr;
+  }
+  return padding + str;
+}
+
+var $ = Backbone.$;
+
+var Backgrid = root.Backgrid = {
+
+  Extension: {},
+
+  resolveNameToClass: function (name, suffix) {
+    if (_.isString(name)) {
+      var key = _.map(name.split('-'), function (e) {
+        return e.slice(0, 1).toUpperCase() + e.slice(1);
+      }).join('') + suffix;
+      var klass = Backgrid[key] || Backgrid.Extension[key];
+      if (_.isUndefined(klass)) {
+        throw new ReferenceError("Class '" + key + "' not found");
+      }
+      return klass;
+    }
+
+    return name;
+  },
+
+  callByNeed: function () {
+    var value = arguments[0];
+    if (!_.isFunction(value)) return value;
+
+    var context = arguments[1];
+    var args = [].slice.call(arguments, 2);
+    return value.apply(context, !!(args + '') ? args : []);
+  }
+
+};
+_.extend(Backgrid, Backbone.Events);
+
+/**
+   Command translates a DOM Event into commands that Backgrid
+   recognizes. Interested parties can listen on selected Backgrid events that
+   come with an instance of this class and act on the commands.
+
+   It is also possible to globally rebind the keyboard shortcuts by replacing
+   the methods in this class' prototype.
+
+   @class Backgrid.Command
+   @constructor
+ */
+var Command = Backgrid.Command = function (evt) {
+  _.extend(this, {
+    altKey: !!evt.altKey,
+    "char": evt["char"],
+    charCode: evt.charCode,
+    ctrlKey: !!evt.ctrlKey,
+    key: evt.key,
+    keyCode: evt.keyCode,
+    locale: evt.locale,
+    location: evt.location,
+    metaKey: !!evt.metaKey,
+    repeat: !!evt.repeat,
+    shiftKey: !!evt.shiftKey,
+    which: evt.which
+  });
+};
+_.extend(Command.prototype, {
+  /**
+     Up Arrow
+
+     @member Backgrid.Command
+   */
+  moveUp: function () { return this.keyCode == 38; },
+  /**
+     Down Arrow
+
+     @member Backgrid.Command
+   */
+  moveDown: function () { return this.keyCode === 40; },
+  /**
+     Shift Tab
+
+     @member Backgrid.Command
+   */
+  moveLeft: function () { return this.shiftKey && this.keyCode === 9; },
+  /**
+     Tab
+
+     @member Backgrid.Command
+   */
+  moveRight: function () { return !this.shiftKey && this.keyCode === 9; },
+  /**
+     Enter
+
+     @member Backgrid.Command
+   */
+  save: function () { return this.keyCode === 13; },
+  /**
+     Esc
+
+     @member Backgrid.Command
+   */
+  cancel: function () { return this.keyCode === 27; },
+  /**
+     None of the above.
+
+     @member Backgrid.Command
+   */
+  passThru: function () {
+    return !(this.moveUp() || this.moveDown() || this.moveLeft() ||
+             this.moveRight() || this.save() || this.cancel());
+  }
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   Just a convenient class for interested parties to subclass.
+
+   The default Cell classes don't require the formatter to be a subclass of
+   Formatter as long as the fromRaw(rawData) and toRaw(formattedData) methods
+   are defined.
+
+   @abstract
+   @class Backgrid.CellFormatter
+   @constructor
+*/
+var CellFormatter = Backgrid.CellFormatter = function () {};
+_.extend(CellFormatter.prototype, {
+
+  /**
+     Takes a raw value from a model and returns an optionally formatted string
+     for display. The default implementation simply returns the supplied value
+     as is without any type conversion.
+
+     @member Backgrid.CellFormatter
+     @param {*} rawData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {*}
+  */
+  fromRaw: function (rawData, model) {
+    return rawData;
+  },
+
+  /**
+     Takes a formatted string, usually from user input, and returns a
+     appropriately typed value for persistence in the model.
+
+     If the user input is invalid or unable to be converted to a raw value
+     suitable for persistence in the model, toRaw must return `undefined`.
+
+     @member Backgrid.CellFormatter
+     @param {string} formattedData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {*|undefined}
+  */
+  toRaw: function (formattedData, model) {
+    return formattedData;
+  }
+
+});
+
+/**
+   A floating point number formatter. Doesn't understand scientific notation at
+   the moment.
+
+   @class Backgrid.NumberFormatter
+   @extends Backgrid.CellFormatter
+   @constructor
+   @throws {RangeError} If decimals < 0 or > 20.
+*/
+var NumberFormatter = Backgrid.NumberFormatter = function (options) {
+  _.extend(this, this.defaults, options || {});
+
+  if (this.decimals < 0 || this.decimals > 20) {
+    throw new RangeError("decimals must be between 0 and 20");
+  }
+};
+NumberFormatter.prototype = new CellFormatter();
+_.extend(NumberFormatter.prototype, {
+
+  /**
+     @member Backgrid.NumberFormatter
+     @cfg {Object} options
+
+     @cfg {number} [options.decimals=2] Number of decimals to display. Must be an integer.
+
+     @cfg {string} [options.decimalSeparator='.'] The separator to use when
+     displaying decimals.
+
+     @cfg {string} [options.orderSeparator=','] The separator to use to
+     separator thousands. May be an empty string.
+   */
+  defaults: {
+    decimals: 2,
+    decimalSeparator: '.',
+    orderSeparator: ','
+  },
+
+  HUMANIZED_NUM_RE: /(\d)(?=(?:\d{3})+$)/g,
+
+  /**
+     Takes a floating point number and convert it to a formatted string where
+     every thousand is separated by `orderSeparator`, with a `decimal` number of
+     decimals separated by `decimalSeparator`. The number returned is rounded
+     the usual way.
+
+     @member Backgrid.NumberFormatter
+     @param {number} number
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string}
+  */
+  fromRaw: function (number, model) {
+    if (_.isNull(number) || _.isUndefined(number)) return '';
+
+    number = number.toFixed(~~this.decimals);
+
+    var parts = number.split('.');
+    var integerPart = parts[0];
+    var decimalPart = parts[1] ? (this.decimalSeparator || '.') + parts[1] : '';
+
+    return integerPart.replace(this.HUMANIZED_NUM_RE, '$1' + this.orderSeparator) + decimalPart;
+  },
+
+  /**
+     Takes a string, possibly formatted with `orderSeparator` and/or
+     `decimalSeparator`, and convert it back to a number.
+
+     @member Backgrid.NumberFormatter
+     @param {string} formattedData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {number|undefined} Undefined if the string cannot be converted to
+     a number.
+  */
+  toRaw: function (formattedData, model) {
+    formattedData = formattedData.trim();
+
+    if (formattedData === '') return null;
+
+    var rawData = '';
+
+    var thousands = formattedData.split(this.orderSeparator);
+    for (var i = 0; i < thousands.length; i++) {
+      rawData += thousands[i];
+    }
+
+    var decimalParts = rawData.split(this.decimalSeparator);
+    rawData = '';
+    for (var i = 0; i < decimalParts.length; i++) {
+      rawData = rawData + decimalParts[i] + '.';
+    }
+
+    if (rawData[rawData.length - 1] === '.') {
+      rawData = rawData.slice(0, rawData.length - 1);
+    }
+
+    var result = (rawData * 1).toFixed(~~this.decimals) * 1;
+    if (_.isNumber(result) && !_.isNaN(result)) return result;
+  }
+
+});
+
+/**
+   A number formatter that converts a floating point number, optionally
+   multiplied by a multiplier, to a percentage string and vice versa.
+
+   @class Backgrid.PercentFormatter
+   @extends Backgrid.NumberFormatter
+   @constructor
+   @throws {RangeError} If decimals < 0 or > 20.
+ */
+var PercentFormatter = Backgrid.PercentFormatter = function () {
+  Backgrid.NumberFormatter.apply(this, arguments);
+};
+
+PercentFormatter.prototype = new Backgrid.NumberFormatter(),
+
+_.extend(PercentFormatter.prototype, {
+
+  /**
+     @member Backgrid.PercentFormatter
+     @cfg {Object} options
+
+     @cfg {number} [options.multiplier=1] The number used to multiply the model
+     value for display.
+
+     @cfg {string} [options.symbol='%'] The symbol to append to the percentage
+     string.
+   */
+  defaults: _.extend({}, NumberFormatter.prototype.defaults, {
+    multiplier: 1,
+    symbol: "%"
+  }),
+
+  /**
+     Takes a floating point number, where the number is first multiplied by
+     `multiplier`, then converted to a formatted string like
+     NumberFormatter#fromRaw, then finally append `symbol` to the end.
+
+     @member Backgrid.PercentFormatter
+     @param {number} rawValue
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string}
+  */
+  fromRaw: function (number, model) {
+    var args = [].slice.call(arguments, 1);
+    args.unshift(number * this.multiplier);
+    return (NumberFormatter.prototype.fromRaw.apply(this, args) || "0") + this.symbol;
+  },
+
+  /**
+     Takes a string, possibly appended with `symbol` and/or `decimalSeparator`,
+     and convert it back to a number for the model like NumberFormatter#toRaw,
+     and then dividing it by `multiplier`.
+
+     @member Backgrid.PercentFormatter
+     @param {string} formattedData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {number|undefined} Undefined if the string cannot be converted to
+     a number.
+  */
+  toRaw: function (formattedValue, model) {
+    var tokens = formattedValue.split(this.symbol);
+    if (tokens && tokens[0] && tokens[1] === "" || tokens[1] == null) {
+      var rawValue = NumberFormatter.prototype.toRaw.call(this, tokens[0]);
+      if (_.isUndefined(rawValue)) return rawValue;
+      return rawValue / this.multiplier;
+    }
+  }
+
+});
+
+/**
+   Formatter to converts between various datetime formats.
+
+   This class only understands ISO-8601 formatted datetime strings and UNIX
+   offset (number of milliseconds since UNIX Epoch). See
+   Backgrid.Extension.MomentFormatter if you need a much more flexible datetime
+   formatter.
+
+   @class Backgrid.DatetimeFormatter
+   @extends Backgrid.CellFormatter
+   @constructor
+   @throws {Error} If both `includeDate` and `includeTime` are false.
+*/
+var DatetimeFormatter = Backgrid.DatetimeFormatter = function (options) {
+  _.extend(this, this.defaults, options || {});
+
+  if (!this.includeDate && !this.includeTime) {
+    throw new Error("Either includeDate or includeTime must be true");
+  }
+};
+DatetimeFormatter.prototype = new CellFormatter();
+_.extend(DatetimeFormatter.prototype, {
+
+  /**
+     @member Backgrid.DatetimeFormatter
+
+     @cfg {Object} options
+
+     @cfg {boolean} [options.includeDate=true] Whether the values include the
+     date part.
+
+     @cfg {boolean} [options.includeTime=true] Whether the values include the
+     time part.
+
+     @cfg {boolean} [options.includeMilli=false] If `includeTime` is true,
+     whether to include the millisecond part, if it exists.
+   */
+  defaults: {
+    includeDate: true,
+    includeTime: true,
+    includeMilli: false
+  },
+
+  DATE_RE: /^([+\-]?\d{4})-(\d{2})-(\d{2})$/,
+  TIME_RE: /^(\d{2}):(\d{2}):(\d{2})(\.(\d{3}))?$/,
+  ISO_SPLITTER_RE: /T|Z| +/,
+
+  _convert: function (data, validate) {
+    if ((data + '').trim() === '') return null;
+
+    var date, time = null;
+    if (_.isNumber(data)) {
+      var jsDate = new Date(data);
+      date = lpad(jsDate.getUTCFullYear(), 4, 0) + '-' + lpad(jsDate.getUTCMonth() + 1, 2, 0) + '-' + lpad(jsDate.getUTCDate(), 2, 0);
+      time = lpad(jsDate.getUTCHours(), 2, 0) + ':' + lpad(jsDate.getUTCMinutes(), 2, 0) + ':' + lpad(jsDate.getUTCSeconds(), 2, 0);
+    }
+    else {
+      data = data.trim();
+      var parts = data.split(this.ISO_SPLITTER_RE) || [];
+      date = this.DATE_RE.test(parts[0]) ? parts[0] : '';
+      time = date && parts[1] ? parts[1] : this.TIME_RE.test(parts[0]) ? parts[0] : '';
+    }
+
+    var YYYYMMDD = this.DATE_RE.exec(date) || [];
+    var HHmmssSSS = this.TIME_RE.exec(time) || [];
+
+    if (validate) {
+      if (this.includeDate && _.isUndefined(YYYYMMDD[0])) return;
+      if (this.includeTime && _.isUndefined(HHmmssSSS[0])) return;
+      if (!this.includeDate && date) return;
+      if (!this.includeTime && time) return;
+    }
+
+    var jsDate = new Date(Date.UTC(YYYYMMDD[1] * 1 || 0,
+                                   YYYYMMDD[2] * 1 - 1 || 0,
+                                   YYYYMMDD[3] * 1 || 0,
+                                   HHmmssSSS[1] * 1 || null,
+                                   HHmmssSSS[2] * 1 || null,
+                                   HHmmssSSS[3] * 1 || null,
+                                   HHmmssSSS[5] * 1 || null));
+
+    var result = '';
+
+    if (this.includeDate) {
+      result = lpad(jsDate.getUTCFullYear(), 4, 0) + '-' + lpad(jsDate.getUTCMonth() + 1, 2, 0) + '-' + lpad(jsDate.getUTCDate(), 2, 0);
+    }
+
+    if (this.includeTime) {
+      result = result + (this.includeDate ? 'T' : '') + lpad(jsDate.getUTCHours(), 2, 0) + ':' + lpad(jsDate.getUTCMinutes(), 2, 0) + ':' + lpad(jsDate.getUTCSeconds(), 2, 0);
+
+      if (this.includeMilli) {
+        result = result + '.' + lpad(jsDate.getUTCMilliseconds(), 3, 0);
+      }
+    }
+
+    if (this.includeDate && this.includeTime) {
+      result += "Z";
+    }
+
+    return result;
+  },
+
+  /**
+     Converts an ISO-8601 formatted datetime string to a datetime string, date
+     string or a time string. The timezone is ignored if supplied.
+
+     @member Backgrid.DatetimeFormatter
+     @param {string} rawData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string|null|undefined} ISO-8601 string in UTC. Null and undefined
+     values are returned as is.
+  */
+  fromRaw: function (rawData, model) {
+    if (_.isNull(rawData) || _.isUndefined(rawData)) return '';
+    return this._convert(rawData);
+  },
+
+  /**
+     Converts an ISO-8601 formatted datetime string to a datetime string, date
+     string or a time string. The timezone is ignored if supplied. This method
+     parses the input values exactly the same way as
+     Backgrid.Extension.MomentFormatter#fromRaw(), in addition to doing some
+     sanity checks.
+
+     @member Backgrid.DatetimeFormatter
+     @param {string} formattedData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string|undefined} ISO-8601 string in UTC. Undefined if a date is
+     found when `includeDate` is false, or a time is found when `includeTime` is
+     false, or if `includeDate` is true and a date is not found, or if
+     `includeTime` is true and a time is not found.
+  */
+  toRaw: function (formattedData, model) {
+    return this._convert(formattedData, true);
+  }
+
+});
+
+/**
+   Formatter to convert any value to string.
+
+   @class Backgrid.StringFormatter
+   @extends Backgrid.CellFormatter
+   @constructor
+ */
+var StringFormatter = Backgrid.StringFormatter = function () {};
+StringFormatter.prototype = new CellFormatter();
+_.extend(StringFormatter.prototype, {
+  /**
+     Converts any value to a string using Ecmascript's implicit type
+     conversion. If the given value is `null` or `undefined`, an empty string is
+     returned instead.
+
+     @member Backgrid.StringFormatter
+     @param {*} rawValue
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string}
+   */
+  fromRaw: function (rawValue, model) {
+    if (_.isUndefined(rawValue) || _.isNull(rawValue)) return '';
+    return rawValue + '';
+  }
+});
+
+/**
+   Simple email validation formatter.
+
+   @class Backgrid.EmailFormatter
+   @extends Backgrid.CellFormatter
+   @constructor
+ */
+var EmailFormatter = Backgrid.EmailFormatter = function () {};
+EmailFormatter.prototype = new CellFormatter();
+_.extend(EmailFormatter.prototype, {
+  /**
+     Return the input if it is a string that contains an '@' character and if
+     the strings before and after '@' are non-empty. If the input does not
+     validate, `undefined` is returned.
+
+     @member Backgrid.EmailFormatter
+     @param {*} formattedData
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {string|undefined}
+   */
+  toRaw: function (formattedData, model) {
+    var parts = formattedData.trim().split("@");
+    if (parts.length === 2 && _.all(parts)) {
+      return formattedData;
+    }
+  }
+});
+
+/**
+   Formatter for SelectCell.
+
+   If the type of a model value is not a string, it is expected that a subclass
+   of this formatter is provided to the SelectCell, with #toRaw overridden to
+   convert the string value returned from the DOM back to whatever value is
+   expected in the model.
+
+   @class Backgrid.SelectFormatter
+   @extends Backgrid.CellFormatter
+   @constructor
+*/
+var SelectFormatter = Backgrid.SelectFormatter = function () {};
+SelectFormatter.prototype = new CellFormatter();
+_.extend(SelectFormatter.prototype, {
+
+  /**
+     Normalizes raw scalar or array values to an array.
+
+     @member Backgrid.SelectFormatter
+     @param {*} rawValue
+     @param {Backbone.Model} model Used for more complicated formatting
+     @return {Array.<*>}
+  */
+  fromRaw: function (rawValue, model) {
+    return _.isArray(rawValue) ? rawValue : rawValue != null ? [rawValue] : [];
+  }
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   Generic cell editor base class. Only defines an initializer for a number of
+   required parameters.
+
+   @abstract
+   @class Backgrid.CellEditor
+   @extends Backbone.View
+*/
+var CellEditor = Backgrid.CellEditor = Backbone.View.extend({
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backgrid.CellFormatter} options.formatter
+     @param {Backgrid.Column} options.column
+     @param {Backbone.Model} options.model
+
+     @throws {TypeError} If `formatter` is not a formatter instance, or when
+     `model` or `column` are undefined.
+  */
+  initialize: function (options) {
+    this.formatter = options.formatter;
+    this.column = options.column;
+    if (!(this.column instanceof Column)) {
+      this.column = new Column(this.column);
+    }
+
+    this.listenTo(this.model, "backgrid:editing", this.postRender);
+  },
+
+  /**
+     Post-rendering setup and initialization. Focuses the cell editor's `el` in
+     this default implementation. **Should** be called by Cell classes after
+     calling Backgrid.CellEditor#render.
+  */
+  postRender: function (model, column) {
+    if (column == null || column.get("name") == this.column.get("name")) {
+      this.$el.focus();
+    }
+    return this;
+  }
+
+});
+
+/**
+   InputCellEditor the cell editor type used by most core cell types. This cell
+   editor renders a text input box as its editor. The input will render a
+   placeholder if the value is empty on supported browsers.
+
+   @class Backgrid.InputCellEditor
+   @extends Backgrid.CellEditor
+*/
+var InputCellEditor = Backgrid.InputCellEditor = CellEditor.extend({
+
+  /** @property */
+  tagName: "input",
+
+  /** @property */
+  attributes: {
+    type: "text"
+  },
+
+  /** @property */
+  events: {
+    "blur": "saveOrCancel",
+    "keydown": "saveOrCancel"
+  },
+
+  /**
+     Initializer. Removes this `el` from the DOM when a `done` event is
+     triggered.
+
+     @param {Object} options
+     @param {Backgrid.CellFormatter} options.formatter
+     @param {Backgrid.Column} options.column
+     @param {Backbone.Model} options.model
+     @param {string} [options.placeholder]
+  */
+  initialize: function (options) {
+    InputCellEditor.__super__.initialize.apply(this, arguments);
+
+    if (options.placeholder) {
+      this.$el.attr("placeholder", options.placeholder);
+    }
+  },
+
+  /**
+     Renders a text input with the cell value formatted for display, if it
+     exists.
+  */
+  render: function () {
+    var model = this.model;
+    this.$el.val(this.formatter.fromRaw(model.get(this.column.get("name")), model));
+    return this;
+  },
+
+  /**
+     If the key pressed is `enter`, `tab`, `up`, or `down`, converts the value
+     in the editor to a raw value for saving into the model using the formatter.
+
+     If the key pressed is `esc` the changes are undone.
+
+     If the editor goes out of focus (`blur`) but the value is invalid, the
+     event is intercepted and cancelled so the cell remains in focus pending for
+     further action. The changes are saved otherwise.
+
+     Triggers a Backbone `backgrid:edited` event from the model when successful,
+     and `backgrid:error` if the value cannot be converted. Classes listening to
+     the `error` event, usually the Cell classes, should respond appropriately,
+     usually by rendering some kind of error feedback.
+
+     @param {Event} e
+  */
+  saveOrCancel: function (e) {
+
+    var formatter = this.formatter;
+    var model = this.model;
+    var column = this.column;
+
+    var command = new Command(e);
+    var blurred = e.type === "blur";
+
+    if (command.moveUp() || command.moveDown() || command.moveLeft() || command.moveRight() ||
+        command.save() || blurred) {
+
+      e.preventDefault();
+      e.stopPropagation();
+
+      var val = this.$el.val();
+      var newValue = formatter.toRaw(val, model);
+      if (_.isUndefined(newValue)) {
+        model.trigger("backgrid:error", model, column, val);
+      }
+      else {
+        model.set(column.get("name"), newValue);
+        model.trigger("backgrid:edited", model, column, command);
+      }
+    }
+    // esc
+    else if (command.cancel()) {
+      // undo
+      e.stopPropagation();
+      model.trigger("backgrid:edited", model, column, command);
+    }
+  },
+
+  postRender: function (model, column) {
+    if (column == null || column.get("name") == this.column.get("name")) {
+      // move the cursor to the end on firefox if text is right aligned
+      if (this.$el.css("text-align") === "right") {
+        var val = this.$el.val();
+        this.$el.focus().val(null).val(val);
+      }
+      else this.$el.focus();
+    }
+    return this;
+  }
+
+});
+
+/**
+   The super-class for all Cell types. By default, this class renders a plain
+   table cell with the model value converted to a string using the
+   formatter. The table cell is clickable, upon which the cell will go into
+   editor mode, which is rendered by a Backgrid.InputCellEditor instance by
+   default. Upon encountering any formatting errors, this class will add an
+   `error` CSS class to the table cell.
+
+   @abstract
+   @class Backgrid.Cell
+   @extends Backbone.View
+*/
+var Cell = Backgrid.Cell = Backbone.View.extend({
+
+  /** @property */
+  tagName: "td",
+
+  /**
+     @property {Backgrid.CellFormatter|Object|string} [formatter=CellFormatter]
+  */
+  formatter: CellFormatter,
+
+  /**
+     @property {Backgrid.CellEditor} [editor=Backgrid.InputCellEditor] The
+     default editor for all cell instances of this class. This value must be a
+     class, it will be automatically instantiated upon entering edit mode.
+
+     See Backgrid.CellEditor
+  */
+  editor: InputCellEditor,
+
+  /** @property */
+  events: {
+    "click": "enterEditMode"
+  },
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backbone.Model} options.model
+     @param {Backgrid.Column} options.column
+
+     @throws {ReferenceError} If formatter is a string but a formatter class of
+     said name cannot be found in the Backgrid module.
+  */
+  initialize: function (options) {
+    this.column = options.column;
+    if (!(this.column instanceof Column)) {
+      this.column = new Column(this.column);
+    }
+
+    var column = this.column, model = this.model, $el = this.$el;
+
+    var formatter = Backgrid.resolveNameToClass(column.get("formatter") ||
+                                                this.formatter, "Formatter");
+
+    if (!_.isFunction(formatter.fromRaw) && !_.isFunction(formatter.toRaw)) {
+      formatter = new formatter();
+    }
+
+    this.formatter = formatter;
+
+    this.editor = Backgrid.resolveNameToClass(this.editor, "CellEditor");
+
+    this.listenTo(model, "change:" + column.get("name"), function () {
+      if (!$el.hasClass("editor")) this.render();
+    });
+
+    this.listenTo(model, "backgrid:error", this.renderError);
+
+    this.listenTo(column, "change:editable change:sortable change:renderable",
+                  function (column) {
+                    var changed = column.changedAttributes();
+                    for (var key in changed) {
+                      if (changed.hasOwnProperty(key)) {
+                        $el.toggleClass(key, changed[key]);
+                      }
+                    }
+                  });
+
+    if (Backgrid.callByNeed(column.editable(), column, model)) $el.addClass("editable");
+    if (Backgrid.callByNeed(column.sortable(), column, model)) $el.addClass("sortable");
+    if (Backgrid.callByNeed(column.renderable(), column, model)) $el.addClass("renderable");
+  },
+
+  /**
+     Render a text string in a table cell. The text is converted from the
+     model's raw value for this cell's column.
+  */
+  render: function () {
+    this.$el.empty();
+    var model = this.model;
+    this.$el.text(this.formatter.fromRaw(model.get(this.column.get("name")), model));
+    this.delegateEvents();
+    return this;
+  },
+
+  /**
+     If this column is editable, a new CellEditor instance is instantiated with
+     its required parameters. An `editor` CSS class is added to the cell upon
+     entering edit mode.
+
+     This method triggers a Backbone `backgrid:edit` event from the model when
+     the cell is entering edit mode and an editor instance has been constructed,
+     but before it is rendered and inserted into the DOM. The cell and the
+     constructed cell editor instance are sent as event parameters when this
+     event is triggered.
+
+     When this cell has finished switching to edit mode, a Backbone
+     `backgrid:editing` event is triggered from the model. The cell and the
+     constructed cell instance are also sent as parameters in the event.
+
+     When the model triggers a `backgrid:error` event, it means the editor is
+     unable to convert the current user input to an apprpriate value for the
+     model's column, and an `error` CSS class is added to the cell accordingly.
+  */
+  enterEditMode: function () {
+    var model = this.model;
+    var column = this.column;
+
+    var editable = Backgrid.callByNeed(column.editable(), column, model);
+    if (editable) {
+
+      this.currentEditor = new this.editor({
+        column: this.column,
+        model: this.model,
+        formatter: this.formatter
+      });
+
+      model.trigger("backgrid:edit", model, column, this, this.currentEditor);
+
+      // Need to redundantly undelegate events for Firefox
+      this.undelegateEvents();
+      this.$el.empty();
+      this.$el.append(this.currentEditor.$el);
+      this.currentEditor.render();
+      this.$el.addClass("editor");
+
+      model.trigger("backgrid:editing", model, column, this, this.currentEditor);
+    }
+  },
+
+  /**
+     Put an `error` CSS class on the table cell.
+  */
+  renderError: function (model, column) {
+    if (column == null || column.get("name") == this.column.get("name")) {
+      this.$el.addClass("error");
+    }
+  },
+
+  /**
+     Removes the editor and re-render in display mode.
+  */
+  exitEditMode: function () {
+    this.$el.removeClass("error");
+    this.currentEditor.remove();
+    this.stopListening(this.currentEditor);
+    delete this.currentEditor;
+    this.$el.removeClass("editor");
+    this.render();
+  },
+
+  /**
+     Clean up this cell.
+
+     @chainable
+  */
+  remove: function () {
+    if (this.currentEditor) {
+      this.currentEditor.remove.apply(this.currentEditor, arguments);
+      delete this.currentEditor;
+    }
+    return Cell.__super__.remove.apply(this, arguments);
+  }
+
+});
+
+/**
+   StringCell displays HTML escaped strings and accepts anything typed in.
+
+   @class Backgrid.StringCell
+   @extends Backgrid.Cell
+*/
+var StringCell = Backgrid.StringCell = Cell.extend({
+
+  /** @property */
+  className: "string-cell",
+
+  formatter: StringFormatter
+
+});
+
+/**
+   UriCell renders an HTML `<a>` anchor for the value and accepts URIs as user
+   input values. No type conversion or URL validation is done by the formatter
+   of this cell. Users who need URL validation are encourage to subclass UriCell
+   to take advantage of the parsing capabilities of the HTMLAnchorElement
+   available on HTML5-capable browsers or using a third-party library like
+   [URI.js](https://github.com/medialize/URI.js).
+
+   @class Backgrid.UriCell
+   @extends Backgrid.Cell
+*/
+var UriCell = Backgrid.UriCell = Cell.extend({
+
+  /** @property */
+  className: "uri-cell",
+
+  /**
+     @property {string} [title] The title attribute of the generated anchor. It
+     uses the display value formatted by the `formatter.fromRaw` by default.
+  */
+  title: null,
+
+  /**
+     @property {string} [target="_blank"] The target attribute of the generated
+     anchor.
+  */
+  target: "_blank",
+
+  initialize: function (options) {
+    UriCell.__super__.initialize.apply(this, arguments);
+    this.title = options.title || this.title;
+    this.target = options.target || this.target;
+  },
+
+  render: function () {
+    this.$el.empty();
+    var rawValue = this.model.get(this.column.get("name"));
+    var formattedValue = this.formatter.fromRaw(rawValue, this.model);
+    this.$el.append($("<a>", {
+      tabIndex: -1,
+      href: rawValue,
+      title: this.title || formattedValue,
+      target: this.target
+    }).text(formattedValue));
+    this.delegateEvents();
+    return this;
+  }
+
+});
+
+/**
+   Like Backgrid.UriCell, EmailCell renders an HTML `<a>` anchor for the
+   value. The `href` in the anchor is prefixed with `mailto:`. EmailCell will
+   complain if the user enters a string that doesn't contain the `@` sign.
+
+   @class Backgrid.EmailCell
+   @extends Backgrid.StringCell
+*/
+var EmailCell = Backgrid.EmailCell = StringCell.extend({
+
+  /** @property */
+  className: "email-cell",
+
+  formatter: EmailFormatter,
+
+  render: function () {
+    this.$el.empty();
+    var model = this.model;
+    var formattedValue = this.formatter.fromRaw(model.get(this.column.get("name")), model);
+    this.$el.append($("<a>", {
+      tabIndex: -1,
+      href: "mailto:" + formattedValue,
+      title: formattedValue
+    }).text(formattedValue));
+    this.delegateEvents();
+    return this;
+  }
+
+});
+
+/**
+   NumberCell is a generic cell that renders all numbers. Numbers are formatted
+   using a Backgrid.NumberFormatter.
+
+   @class Backgrid.NumberCell
+   @extends Backgrid.Cell
+*/
+var NumberCell = Backgrid.NumberCell = Cell.extend({
+
+  /** @property */
+  className: "number-cell",
+
+  /**
+     @property {number} [decimals=2] Must be an integer.
+  */
+  decimals: NumberFormatter.prototype.defaults.decimals,
+
+  /** @property {string} [decimalSeparator='.'] */
+  decimalSeparator: NumberFormatter.prototype.defaults.decimalSeparator,
+
+  /** @property {string} [orderSeparator=','] */
+  orderSeparator: NumberFormatter.prototype.defaults.orderSeparator,
+
+  /** @property {Backgrid.CellFormatter} [formatter=Backgrid.NumberFormatter] */
+  formatter: NumberFormatter,
+
+  /**
+     Initializes this cell and the number formatter.
+
+     @param {Object} options
+     @param {Backbone.Model} options.model
+     @param {Backgrid.Column} options.column
+  */
+  initialize: function (options) {
+    NumberCell.__super__.initialize.apply(this, arguments);
+    var formatter = this.formatter;
+    formatter.decimals = this.decimals;
+    formatter.decimalSeparator = this.decimalSeparator;
+    formatter.orderSeparator = this.orderSeparator;
+  }
+
+});
+
+/**
+   An IntegerCell is just a Backgrid.NumberCell with 0 decimals. If a floating
+   point number is supplied, the number is simply rounded the usual way when
+   displayed.
+
+   @class Backgrid.IntegerCell
+   @extends Backgrid.NumberCell
+*/
+var IntegerCell = Backgrid.IntegerCell = NumberCell.extend({
+
+  /** @property */
+  className: "integer-cell",
+
+  /**
+     @property {number} decimals Must be an integer.
+  */
+  decimals: 0
+});
+
+/**
+   A PercentCell is another Backgrid.NumberCell that takes a floating number,
+   optionally multiplied by a multiplier and display it as a percentage.
+
+   @class Backgrid.PercentCell
+   @extends Backgrid.NumberCell
+ */
+var PercentCell = Backgrid.PercentCell = NumberCell.extend({
+
+  /** @property */
+  className: "percent-cell",
+
+  /** @property {number} [multiplier=1] */
+  multiplier: PercentFormatter.prototype.defaults.multiplier,
+
+  /** @property {string} [symbol='%'] */
+  symbol: PercentFormatter.prototype.defaults.symbol,
+
+  /** @property {Backgrid.CellFormatter} [formatter=Backgrid.PercentFormatter] */
+  formatter: PercentFormatter,
+
+  /**
+     Initializes this cell and the percent formatter.
+
+     @param {Object} options
+     @param {Backbone.Model} options.model
+     @param {Backgrid.Column} options.column
+  */
+  initialize: function () {
+    PercentCell.__super__.initialize.apply(this, arguments);
+    var formatter = this.formatter;
+    formatter.multiplier = this.multiplier;
+    formatter.symbol = this.symbol;
+  }
+
+});
+
+/**
+   DatetimeCell is a basic cell that accepts datetime string values in RFC-2822
+   or W3C's subset of ISO-8601 and displays them in ISO-8601 format. For a much
+   more sophisticated date time cell with better datetime formatting, take a
+   look at the Backgrid.Extension.MomentCell extension.
+
+   @class Backgrid.DatetimeCell
+   @extends Backgrid.Cell
+
+   See:
+
+   - Backgrid.Extension.MomentCell
+   - Backgrid.DatetimeFormatter
+*/
+var DatetimeCell = Backgrid.DatetimeCell = Cell.extend({
+
+  /** @property */
+  className: "datetime-cell",
+
+  /**
+     @property {boolean} [includeDate=true]
+  */
+  includeDate: DatetimeFormatter.prototype.defaults.includeDate,
+
+  /**
+     @property {boolean} [includeTime=true]
+  */
+  includeTime: DatetimeFormatter.prototype.defaults.includeTime,
+
+  /**
+     @property {boolean} [includeMilli=false]
+  */
+  includeMilli: DatetimeFormatter.prototype.defaults.includeMilli,
+
+  /** @property {Backgrid.CellFormatter} [formatter=Backgrid.DatetimeFormatter] */
+  formatter: DatetimeFormatter,
+
+  /**
+     Initializes this cell and the datetime formatter.
+
+     @param {Object} options
+     @param {Backbone.Model} options.model
+     @param {Backgrid.Column} options.column
+  */
+  initialize: function (options) {
+    DatetimeCell.__super__.initialize.apply(this, arguments);
+    var formatter = this.formatter;
+    formatter.includeDate = this.includeDate;
+    formatter.includeTime = this.includeTime;
+    formatter.includeMilli = this.includeMilli;
+
+    var placeholder = this.includeDate ? "YYYY-MM-DD" : "";
+    placeholder += (this.includeDate && this.includeTime) ? "T" : "";
+    placeholder += this.includeTime ? "HH:mm:ss" : "";
+    placeholder += (this.includeTime && this.includeMilli) ? ".SSS" : "";
+
+    this.editor = this.editor.extend({
+      attributes: _.extend({}, this.editor.prototype.attributes, this.editor.attributes, {
+        placeholder: placeholder
+      })
+    });
+  }
+
+});
+
+/**
+   DateCell is a Backgrid.DatetimeCell without the time part.
+
+   @class Backgrid.DateCell
+   @extends Backgrid.DatetimeCell
+*/
+var DateCell = Backgrid.DateCell = DatetimeCell.extend({
+
+  /** @property */
+  className: "date-cell",
+
+  /** @property */
+  includeTime: false
+
+});
+
+/**
+   TimeCell is a Backgrid.DatetimeCell without the date part.
+
+   @class Backgrid.TimeCell
+   @extends Backgrid.DatetimeCell
+*/
+var TimeCell = Backgrid.TimeCell = DatetimeCell.extend({
+
+  /** @property */
+  className: "time-cell",
+
+  /** @property */
+  includeDate: false
+
+});
+
+/**
+   BooleanCellEditor renders a checkbox as its editor.
+
+   @class Backgrid.BooleanCellEditor
+   @extends Backgrid.CellEditor
+*/
+var BooleanCellEditor = Backgrid.BooleanCellEditor = CellEditor.extend({
+
+  /** @property */
+  tagName: "input",
+
+  /** @property */
+  attributes: {
+    tabIndex: -1,
+    type: "checkbox"
+  },
+
+  /** @property */
+  events: {
+    "mousedown": function () {
+      this.mouseDown = true;
+    },
+    "blur": "enterOrExitEditMode",
+    "mouseup": function () {
+      this.mouseDown = false;
+    },
+    "change": "saveOrCancel",
+    "keydown": "saveOrCancel"
+  },
+
+  /**
+     Renders a checkbox and check it if the model value of this column is true,
+     uncheck otherwise.
+  */
+  render: function () {
+    var model = this.model;
+    var val = this.formatter.fromRaw(model.get(this.column.get("name")), model);
+    this.$el.prop("checked", val);
+    return this;
+  },
+
+  /**
+     Event handler. Hack to deal with the case where `blur` is fired before
+     `change` and `click` on a checkbox.
+  */
+  enterOrExitEditMode: function (e) {
+    if (!this.mouseDown) {
+      var model = this.model;
+      model.trigger("backgrid:edited", model, this.column, new Command(e));
+    }
+  },
+
+  /**
+     Event handler. Save the value into the model if the event is `change` or
+     one of the keyboard navigation key presses. Exit edit mode without saving
+     if `escape` was pressed.
+  */
+  saveOrCancel: function (e) {
+    var model = this.model;
+    var column = this.column;
+    var formatter = this.formatter;
+    var command = new Command(e);
+    // skip ahead to `change` when space is pressed
+    if (command.passThru() && e.type != "change") return true;
+    if (command.cancel()) {
+      e.stopPropagation();
+      model.trigger("backgrid:edited", model, column, command);
+    }
+
+    var $el = this.$el;
+    if (command.save() || command.moveLeft() || command.moveRight() || command.moveUp() ||
+        command.moveDown()) {
+      e.preventDefault();
+      e.stopPropagation();
+      var val = formatter.toRaw($el.prop("checked"), model);
+      model.set(column.get("name"), val);
+      model.trigger("backgrid:edited", model, column, command);
+    }
+    else if (e.type == "change") {
+      var val = formatter.toRaw($el.prop("checked"), model);
+      model.set(column.get("name"), val);
+      $el.focus();
+    }
+  }
+
+});
+
+/**
+   BooleanCell renders a checkbox both during display mode and edit mode. The
+   checkbox is checked if the model value is true, unchecked otherwise.
+
+   @class Backgrid.BooleanCell
+   @extends Backgrid.Cell
+*/
+var BooleanCell = Backgrid.BooleanCell = Cell.extend({
+
+  /** @property */
+  className: "boolean-cell",
+
+  /** @property */
+  editor: BooleanCellEditor,
+
+  /** @property */
+  events: {
+    "click": "enterEditMode"
+  },
+
+  /**
+     Renders a checkbox and check it if the model value of this column is true,
+     uncheck otherwise.
+  */
+  render: function () {
+    this.$el.empty();
+    var model = this.model, column = this.column;
+    var editable = Backgrid.callByNeed(column.editable(), column, model);
+    this.$el.append($("<input>", {
+      tabIndex: -1,
+      type: "checkbox",
+      checked: this.formatter.fromRaw(model.get(column.get("name")), model),
+      disabled: !editable
+    }));
+    this.delegateEvents();
+    return this;
+  }
+
+});
+
+/**
+   SelectCellEditor renders an HTML `<select>` fragment as the editor.
+
+   @class Backgrid.SelectCellEditor
+   @extends Backgrid.CellEditor
+*/
+var SelectCellEditor = Backgrid.SelectCellEditor = CellEditor.extend({
+
+  /** @property */
+  tagName: "select",
+
+  /** @property */
+  events: {
+    "change": "save",
+    "blur": "close",
+    "keydown": "close"
+  },
+
+  /** @property {function(Object, ?Object=): string} template */
+  template: _.template('<option value="<%- value %>" <%= selected ? \'selected="selected"\' : "" %>><%- text %></option>', null, {variable: null}),
+
+  setOptionValues: function (optionValues) {
+    this.optionValues = optionValues;
+    this.optionValues = _.result(this, "optionValues");
+  },
+
+  setMultiple: function (multiple) {
+    this.multiple = multiple;
+    this.$el.prop("multiple", multiple);
+  },
+
+  _renderOptions: function (nvps, selectedValues) {
+    var options = '';
+    for (var i = 0; i < nvps.length; i++) {
+      options = options + this.template({
+        text: nvps[i][0],
+        value: nvps[i][1],
+        selected: _.indexOf(selectedValues, nvps[i][1]) > -1
+      });
+    }
+    return options;
+  },
+
+  /**
+     Renders the options if `optionValues` is a list of name-value pairs. The
+     options are contained inside option groups if `optionValues` is a list of
+     object hashes. The name is rendered at the option text and the value is the
+     option value. If `optionValues` is a function, it is called without a
+     parameter.
+  */
+  render: function () {
+    this.$el.empty();
+
+    var optionValues = _.result(this, "optionValues");
+    var model = this.model;
+    var selectedValues = this.formatter.fromRaw(model.get(this.column.get("name")), model);
+
+    if (!_.isArray(optionValues)) throw new TypeError("optionValues must be an array");
+
+    var optionValue = null;
+    var optionText = null;
+    var optionValue = null;
+    var optgroupName = null;
+    var optgroup = null;
+
+    for (var i = 0; i < optionValues.length; i++) {
+      var optionValue = optionValues[i];
+
+      if (_.isArray(optionValue)) {
+        optionText  = optionValue[0];
+        optionValue = optionValue[1];
+
+        this.$el.append(this.template({
+          text: optionText,
+          value: optionValue,
+          selected: _.indexOf(selectedValues, optionValue) > -1
+        }));
+      }
+      else if (_.isObject(optionValue)) {
+        optgroupName = optionValue.name;
+        optgroup = $("<optgroup></optgroup>", { label: optgroupName });
+        optgroup.append(this._renderOptions.call(this, optionValue.values, selectedValues));
+        this.$el.append(optgroup);
+      }
+      else {
+        throw new TypeError("optionValues elements must be a name-value pair or an object hash of { name: 'optgroup label', value: [option name-value pairs] }");
+      }
+    }
+
+    this.delegateEvents();
+
+    return this;
+  },
+
+  /**
+     Saves the value of the selected option to the model attribute.
+  */
+  save: function (e) {
+    var model = this.model;
+    var column = this.column;
+    model.set(column.get("name"), this.formatter.toRaw(this.$el.val(), model));
+  },
+
+  /**
+     Triggers a `backgrid:edited` event from the model so the body can close
+     this editor.
+  */
+  close: function (e) {
+    var model = this.model;
+    var column = this.column;
+    var command = new Command(e);
+    if (command.cancel()) {
+      e.stopPropagation();
+      model.trigger("backgrid:edited", model, column, new Command(e));
+    }
+    else if (command.save() || command.moveLeft() || command.moveRight() ||
+             command.moveUp() || command.moveDown() || e.type == "blur") {
+      e.preventDefault();
+      e.stopPropagation();
+      this.save(e);
+      model.trigger("backgrid:edited", model, column, new Command(e));
+    }
+  }
+
+});
+
+/**
+   SelectCell is also a different kind of cell in that upon going into edit mode
+   the cell renders a list of options to pick from, as opposed to an input box.
+
+   SelectCell cannot be referenced by its string name when used in a column
+   definition because it requires an `optionValues` class attribute to be
+   defined. `optionValues` can either be a list of name-value pairs, to be
+   rendered as options, or a list of object hashes which consist of a key *name*
+   which is the option group name, and a key *values* which is a list of
+   name-value pairs to be rendered as options under that option group.
+
+   In addition, `optionValues` can also be a parameter-less function that
+   returns one of the above. If the options are static, it is recommended the
+   returned values to be memoized. `_.memoize()` is a good function to help with
+   that.
+
+   During display mode, the default formatter will normalize the raw model value
+   to an array of values whether the raw model value is a scalar or an
+   array. Each value is compared with the `optionValues` values using
+   Ecmascript's implicit type conversion rules. When exiting edit mode, no type
+   conversion is performed when saving into the model. This behavior is not
+   always desirable when the value type is anything other than string. To
+   control type conversion on the client-side, you should subclass SelectCell to
+   provide a custom formatter or provide the formatter to your column
+   definition.
+
+   See:
+     [$.fn.val()](http://api.jquery.com/val/)
+
+   @class Backgrid.SelectCell
+   @extends Backgrid.Cell
+*/
+var SelectCell = Backgrid.SelectCell = Cell.extend({
+
+  /** @property */
+  className: "select-cell",
+
+  /** @property */
+  editor: SelectCellEditor,
+
+  /** @property */
+  multiple: false,
+
+  /** @property */
+  formatter: SelectFormatter,
+
+  /**
+     @property {Array.<Array>|Array.<{name: string, values: Array.<Array>}>} optionValues
+  */
+  optionValues: undefined,
+
+  /** @property */
+  delimiter: ', ',
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backbone.Model} options.model
+     @param {Backgrid.Column} options.column
+
+     @throws {TypeError} If `optionsValues` is undefined.
+  */
+  initialize: function (options) {
+    SelectCell.__super__.initialize.apply(this, arguments);
+    this.listenTo(this.model, "backgrid:edit", function (model, column, cell, editor) {
+      if (column.get("name") == this.column.get("name")) {
+        editor.setOptionValues(this.optionValues);
+        editor.setMultiple(this.multiple);
+      }
+    });
+  },
+
+  /**
+     Renders the label using the raw value as key to look up from `optionValues`.
+
+     @throws {TypeError} If `optionValues` is malformed.
+  */
+  render: function () {
+    this.$el.empty();
+
+    var optionValues = _.result(this, "optionValues");
+    var model = this.model;
+    var rawData = this.formatter.fromRaw(model.get(this.column.get("name")), model);
+
+    var selectedText = [];
+
+    try {
+      if (!_.isArray(optionValues) || _.isEmpty(optionValues)) throw new TypeError;
+
+      for (var k = 0; k < rawData.length; k++) {
+        var rawDatum = rawData[k];
+
+        for (var i = 0; i < optionValues.length; i++) {
+          var optionValue = optionValues[i];
+
+          if (_.isArray(optionValue)) {
+            var optionText  = optionValue[0];
+            var optionValue = optionValue[1];
+
+            if (optionValue == rawDatum) selectedText.push(optionText);
+          }
+          else if (_.isObject(optionValue)) {
+            var optionGroupValues = optionValue.values;
+
+            for (var j = 0; j < optionGroupValues.length; j++) {
+              var optionGroupValue = optionGroupValues[j];
+              if (optionGroupValue[1] == rawDatum) {
+                selectedText.push(optionGroupValue[0]);
+              }
+            }
+          }
+          else {
+            throw new TypeError;
+          }
+        }
+      }
+
+      this.$el.append(selectedText.join(this.delimiter));
+    }
+    catch (ex) {
+      if (ex instanceof TypeError) {
+        throw new TypeError("'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}");
+      }
+      throw ex;
+    }
+
+    this.delegateEvents();
+
+    return this;
+  }
+
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   A Column is a placeholder for column metadata.
+
+   You usually don't need to create an instance of this class yourself as a
+   collection of column instances will be created for you from a list of column
+   attributes in the Backgrid.js view class constructors.
+
+   @class Backgrid.Column
+   @extends Backbone.Model
+*/
+var Column = Backgrid.Column = Backbone.Model.extend({
+
+  /**
+     @cfg {Object} defaults Column defaults. To override any of these default
+     values, you can either change the prototype directly to override
+     Column.defaults globally or extend Column and supply the custom class to
+     Backgrid.Grid:
+
+         // Override Column defaults globally
+         Column.prototype.defaults.sortable = false;
+
+         // Override Column defaults locally
+         var MyColumn = Column.extend({
+           defaults: _.defaults({
+             editable: false
+           }, Column.prototype.defaults)
+         });
+
+         var grid = new Backgrid.Grid(columns: new Columns([{...}, {...}], {
+           model: MyColumn
+         }));
+
+     @cfg {string} [defaults.name] The default name of the model attribute.
+
+     @cfg {string} [defaults.label] The default label to show in the header.
+
+     @cfg {string|Backgrid.Cell} [defaults.cell] The default cell type. If this
+     is a string, the capitalized form will be used to look up a cell class in
+     Backbone, i.e.: string => StringCell. If a Cell subclass is supplied, it is
+     initialized with a hash of parameters. If a Cell instance is supplied, it
+     is used directly.
+
+     @cfg {string|Backgrid.HeaderCell} [defaults.headerCell] The default header
+     cell type.
+
+     @cfg {boolean|string|function(): boolean} [defaults.sortable=true] Whether
+     this column is sortable. If the value is a string, a method will the same
+     name will be looked up from the column instance to determine whether the
+     column should be sortable. The method's signature must be `function
+     (Backgrid.Column, Backbone.Model): boolean`.
+
+     @cfg {boolean|string|function(): boolean} [defaults.editable=true] Whether
+     this column is editable. If the value is a string, a method will the same
+     name will be looked up from the column instance to determine whether the
+     column should be editable. The method's signature must be `function
+     (Backgrid.Column, Backbone.Model): boolean`.
+
+     @cfg {boolean|string|function(): boolean} [defaults.renderable=true]
+     Whether this column is renderable. If the value is a string, a method will
+     the same name will be looked up from the column instance to determine
+     whether the column should be renderable. The method's signature must be
+     `function (Backrid.Column, Backbone.Model): boolean`.
+
+     @cfg {Backgrid.CellFormatter | Object | string} [defaults.formatter] The
+     formatter to use to convert between raw model values and user input.
+
+     @cfg {"toggle"|"cycle"} [defaults.sortType="cycle"] Whether sorting will
+     toggle between ascending and descending order, or cycle between insertion
+     order, ascending and descending order.
+
+     @cfg {(function(Backbone.Model, string): *) | string} [defaults.sortValue]
+     The function to use to extract a value from the model for comparison during
+     sorting. If this value is a string, a method with the same name will be
+     looked up from the column instance.
+
+     @cfg {"ascending"|"descending"|null} [defaults.direction=null] The initial
+     sorting direction for this column. The default is ordered by
+     Backbone.Model.cid, which usually means the collection is ordered by
+     insertion order.
+  */
+  defaults: {
+    name: undefined,
+    label: undefined,
+    sortable: true,
+    editable: true,
+    renderable: true,
+    formatter: undefined,
+    sortType: "cycle",
+    sortValue: undefined,
+    direction: null,
+    cell: undefined,
+    headerCell: undefined
+  },
+
+  /**
+     Initializes this Column instance.
+
+     @param {Object} attrs
+
+     @param {string} attrs.name The model attribute this column is responsible
+     for.
+
+     @param {string|Backgrid.Cell} attrs.cell The cell type to use to render
+     this column.
+
+     @param {string} [attrs.label]
+
+     @param {string|Backgrid.HeaderCell} [attrs.headerCell]
+
+     @param {boolean|string|function(): boolean} [attrs.sortable=true]
+
+     @param {boolean|string|function(): boolean} [attrs.editable=true]
+
+     @param {boolean|string|function(): boolean} [attrs.renderable=true]
+
+     @param {Backgrid.CellFormatter | Object | string} [attrs.formatter]
+
+     @param {"toggle"|"cycle"}  [attrs.sortType="cycle"]
+
+     @param {(function(Backbone.Model, string): *) | string} [attrs.sortValue]
+
+     @throws {TypeError} If attrs.cell or attrs.options are not supplied.
+
+     @throws {ReferenceError} If formatter is a string but a formatter class of
+     said name cannot be found in the Backgrid module.
+
+     See:
+
+     - Backgrid.Column.defaults
+     - Backgrid.Cell
+     - Backgrid.CellFormatter
+   */
+  initialize: function () {
+    if (!this.has("label")) {
+      this.set({ label: this.get("name") }, { silent: true });
+    }
+
+    var headerCell = Backgrid.resolveNameToClass(this.get("headerCell"), "HeaderCell");
+
+    var cell = Backgrid.resolveNameToClass(this.get("cell"), "Cell");
+
+    this.set({cell: cell, headerCell: headerCell}, { silent: true });
+  },
+
+  /**
+     Returns an appropriate value extraction function from a model for sorting.
+
+     If the column model contains an attribute `sortValue`, if it is a string, a
+     method from the column instance identifified by the `sortValue` string is
+     returned. If it is a function, it it returned as is. If `sortValue` isn't
+     found from the column model's attributes, a default value extraction
+     function is returned which will compare according to the natural order of
+     the value's type.
+
+     @return {function(Backbone.Model, string): *}
+   */
+  sortValue: function () {
+    var sortValue = this.get("sortValue");
+    if (_.isString(sortValue)) return this[sortValue];
+    else if (_.isFunction(sortValue)) return sortValue;
+
+    return function (model, colName) {
+      return model.get(colName);
+    };
+  }
+
+  /**
+     @member Backgrid.Column
+     @protected
+     @method sortable
+     @return {function(Backgrid.Column, Backbone.Model): boolean | boolean}
+  */
+
+  /**
+     @member Backgrid.Column
+     @protected
+     @method editable
+     @return {function(Backgrid.Column, Backbone.Model): boolean | boolean}
+  */
+
+  /**
+     @member Backgrid.Column
+     @protected
+     @method renderable
+     @return {function(Backgrid.Column, Backbone.Model): boolean | boolean}
+  */
+});
+
+_.each(["sortable", "renderable", "editable"], function (key) {
+  Column.prototype[key] = function () {
+    var value = this.get(key);
+    if (_.isString(value)) return this[value];
+    else if (_.isFunction(value)) return value;
+
+    return !!value;
+  };
+});
+
+/**
+   A Backbone collection of Column instances.
+
+   @class Backgrid.Columns
+   @extends Backbone.Collection
+ */
+var Columns = Backgrid.Columns = Backbone.Collection.extend({
+
+  /**
+     @property {Backgrid.Column} model
+   */
+  model: Column
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   Row is a simple container view that takes a model instance and a list of
+   column metadata describing how each of the model's attribute is to be
+   rendered, and apply the appropriate cell to each attribute.
+
+   @class Backgrid.Row
+   @extends Backbone.View
+*/
+var Row = Backgrid.Row = Backbone.View.extend({
+
+  /** @property */
+  tagName: "tr",
+
+  /**
+     Initializes a row view instance.
+
+     @param {Object} options
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns Column metadata.
+     @param {Backbone.Model} options.model The model instance to render.
+
+     @throws {TypeError} If options.columns or options.model is undefined.
+  */
+  initialize: function (options) {
+
+    var columns = this.columns = options.columns;
+    if (!(columns instanceof Backbone.Collection)) {
+      columns = this.columns = new Columns(columns);
+    }
+
+    var cells = this.cells = [];
+    for (var i = 0; i < columns.length; i++) {
+      cells.push(this.makeCell(columns.at(i), options));
+    }
+
+    this.listenTo(columns, "add", function (column, columns) {
+      var i = columns.indexOf(column);
+      var cell = this.makeCell(column, options);
+      cells.splice(i, 0, cell);
+
+      var $el = this.$el;
+      if (i === 0) {
+        $el.prepend(cell.render().$el);
+      }
+      else if (i === columns.length - 1) {
+        $el.append(cell.render().$el);
+      }
+      else {
+        $el.children().eq(i).before(cell.render().$el);
+      }
+    });
+
+    this.listenTo(columns, "remove", function (column, columns, opts) {
+      cells[opts.index].remove();
+      cells.splice(opts.index, 1);
+    });
+  },
+
+  /**
+     Factory method for making a cell. Used by #initialize internally. Override
+     this to provide an appropriate cell instance for a custom Row subclass.
+
+     @protected
+
+     @param {Backgrid.Column} column
+     @param {Object} options The options passed to #initialize.
+
+     @return {Backgrid.Cell}
+  */
+  makeCell: function (column) {
+    return new (column.get("cell"))({
+      column: column,
+      model: this.model
+    });
+  },
+
+  /**
+     Renders a row of cells for this row's model.
+  */
+  render: function () {
+    this.$el.empty();
+
+    var fragment = document.createDocumentFragment();
+    for (var i = 0; i < this.cells.length; i++) {
+      fragment.appendChild(this.cells[i].render().el);
+    }
+
+    this.el.appendChild(fragment);
+
+    this.delegateEvents();
+
+    return this;
+  },
+
+  /**
+     Clean up this row and its cells.
+
+     @chainable
+  */
+  remove: function () {
+    for (var i = 0; i < this.cells.length; i++) {
+      var cell = this.cells[i];
+      cell.remove.apply(cell, arguments);
+    }
+    return Backbone.View.prototype.remove.apply(this, arguments);
+  }
+
+});
+
+/**
+   EmptyRow is a simple container view that takes a list of column and render a
+   row with a single column.
+
+   @class Backgrid.EmptyRow
+   @extends Backbone.View
+*/
+var EmptyRow = Backgrid.EmptyRow = Backbone.View.extend({
+
+  /** @property */
+  tagName: "tr",
+
+  /** @property {string|function(): string} */
+  emptyText: null,
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {string|function(): string} options.emptyText
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns Column metadata.
+   */
+  initialize: function (options) {
+    this.emptyText = options.emptyText;
+    this.columns =  options.columns;
+  },
+
+  /**
+     Renders an empty row.
+  */
+  render: function () {
+    this.$el.empty();
+
+    var td = document.createElement("td");
+    td.setAttribute("colspan", this.columns.length);
+    td.appendChild(document.createTextNode(_.result(this, "emptyText")));
+
+    this.el.className = "empty";
+    this.el.appendChild(td);
+
+    return this;
+  }
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   HeaderCell is a special cell class that renders a column header cell. If the
+   column is sortable, a sorter is also rendered and will trigger a table
+   refresh after sorting.
+
+   @class Backgrid.HeaderCell
+   @extends Backbone.View
+ */
+var HeaderCell = Backgrid.HeaderCell = Backbone.View.extend({
+
+  /** @property */
+  tagName: "th",
+
+  /** @property */
+  events: {
+    "click a": "onClick"
+  },
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backgrid.Column|Object} options.column
+
+     @throws {TypeError} If options.column or options.collection is undefined.
+   */
+  initialize: function (options) {
+    this.column = options.column;
+    if (!(this.column instanceof Column)) {
+      this.column = new Column(this.column);
+    }
+
+    var column = this.column, collection = this.collection, $el = this.$el;
+
+    this.listenTo(column, "change:editable change:sortable change:renderable",
+                  function (column) {
+                    var changed = column.changedAttributes();
+                    for (var key in changed) {
+                      if (changed.hasOwnProperty(key)) {
+                        $el.toggleClass(key, changed[key]);
+                      }
+                    }
+                  });
+    this.listenTo(column, "change:direction", this.setCellDirection);
+    this.listenTo(column, "change:name change:label", this.render);
+
+    if (Backgrid.callByNeed(column.editable(), column, collection)) $el.addClass("editable");
+    if (Backgrid.callByNeed(column.sortable(), column, collection)) $el.addClass("sortable");
+    if (Backgrid.callByNeed(column.renderable(), column, collection)) $el.addClass("renderable");
+
+    this.listenTo(collection.fullCollection || collection, "sort", this.removeCellDirection);
+  },
+
+  /**
+     Event handler for the collection's `sort` event. Removes all the CSS
+     direction classes.
+   */
+  removeCellDirection: function () {
+    this.$el.removeClass("ascending").removeClass("descending");
+    this.column.set("direction", null);
+  },
+
+  /**
+     Event handler for the column's `change:direction` event. If this
+     HeaderCell's column is being sorted on, it applies the direction given as a
+     CSS class to the header cell. Removes all the CSS direction classes
+     otherwise.
+   */
+  setCellDirection: function (column, direction) {
+    this.$el.removeClass("ascending").removeClass("descending");
+    if (column.cid == this.column.cid) this.$el.addClass(direction);
+  },
+
+  /**
+     Event handler for the `click` event on the cell's anchor. If the column is
+     sortable, clicking on the anchor will cycle through 3 sorting orderings -
+     `ascending`, `descending`, and default.
+   */
+  onClick: function (e) {
+    e.preventDefault();
+
+    var column = this.column;
+    var collection = this.collection;
+    var event = "backgrid:sort";
+
+    function cycleSort(header, col) {
+      if (column.get("direction") === "ascending") collection.trigger(event, col, "descending");
+      else if (column.get("direction") === "descending") collection.trigger(event, col, null);
+      else collection.trigger(event, col, "ascending");
+    }
+
+    function toggleSort(header, col) {
+      if (column.get("direction") === "ascending") collection.trigger(event, col, "descending");
+      else collection.trigger(event, col, "ascending");
+    }
+
+    var sortable = Backgrid.callByNeed(column.sortable(), column, this.collection);
+    if (sortable) {
+      var sortType = column.get("sortType");
+      if (sortType === "toggle") toggleSort(this, column);
+      else cycleSort(this, column);
+    }
+  },
+
+  /**
+     Renders a header cell with a sorter, a label, and a class name for this
+     column.
+   */
+  render: function () {
+    this.$el.empty();
+    var column = this.column;
+    var sortable = Backgrid.callByNeed(column.sortable(), column, this.collection);
+    var label;
+    if(sortable){
+      label = $("<a>").text(column.get("label")).append("<b class='sort-caret'></b>");
+    } else {
+      label = document.createTextNode(column.get("label"));
+    }
+
+    this.$el.append(label);
+    this.$el.addClass(column.get("name"));
+    this.$el.addClass(column.get("direction"));
+    this.delegateEvents();
+    return this;
+  }
+
+});
+
+/**
+   HeaderRow is a controller for a row of header cells.
+
+   @class Backgrid.HeaderRow
+   @extends Backgrid.Row
+ */
+var HeaderRow = Backgrid.HeaderRow = Backgrid.Row.extend({
+
+  requiredOptions: ["columns", "collection"],
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns
+     @param {Backgrid.HeaderCell} [options.headerCell] Customized default
+     HeaderCell for all the columns. Supply a HeaderCell class or instance to a
+     the `headerCell` key in a column definition for column-specific header
+     rendering.
+
+     @throws {TypeError} If options.columns or options.collection is undefined.
+   */
+  initialize: function () {
+    Backgrid.Row.prototype.initialize.apply(this, arguments);
+  },
+
+  makeCell: function (column, options) {
+    var headerCell = column.get("headerCell") || options.headerCell || HeaderCell;
+    headerCell = new headerCell({
+      column: column,
+      collection: this.collection
+    });
+    return headerCell;
+  }
+
+});
+
+/**
+   Header is a special structural view class that renders a table head with a
+   single row of header cells.
+
+   @class Backgrid.Header
+   @extends Backbone.View
+ */
+var Header = Backgrid.Header = Backbone.View.extend({
+
+  /** @property */
+  tagName: "thead",
+
+  /**
+     Initializer. Initializes this table head view to contain a single header
+     row view.
+
+     @param {Object} options
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns Column metadata.
+     @param {Backbone.Model} options.model The model instance to render.
+
+     @throws {TypeError} If options.columns or options.model is undefined.
+   */
+  initialize: function (options) {
+    this.columns = options.columns;
+    if (!(this.columns instanceof Backbone.Collection)) {
+      this.columns = new Columns(this.columns);
+    }
+
+    this.row = new Backgrid.HeaderRow({
+      columns: this.columns,
+      collection: this.collection
+    });
+  },
+
+  /**
+     Renders this table head with a single row of header cells.
+   */
+  render: function () {
+    this.$el.append(this.row.render().$el);
+    this.delegateEvents();
+    return this;
+  },
+
+  /**
+     Clean up this header and its row.
+
+     @chainable
+   */
+  remove: function () {
+    this.row.remove.apply(this.row, arguments);
+    return Backbone.View.prototype.remove.apply(this, arguments);
+  }
+
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   Body is the table body which contains the rows inside a table. Body is
+   responsible for refreshing the rows after sorting, insertion and removal.
+
+   @class Backgrid.Body
+   @extends Backbone.View
+*/
+var Body = Backgrid.Body = Backbone.View.extend({
+
+  /** @property */
+  tagName: "tbody",
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backbone.Collection} options.collection
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns
+     Column metadata.
+     @param {Backgrid.Row} [options.row=Backgrid.Row] The Row class to use.
+     @param {string|function(): string} [options.emptyText] The text to display in the empty row.
+
+     @throws {TypeError} If options.columns or options.collection is undefined.
+
+     See Backgrid.Row.
+  */
+  initialize: function (options) {
+
+    this.columns = options.columns;
+    if (!(this.columns instanceof Backbone.Collection)) {
+      this.columns = new Columns(this.columns);
+    }
+
+    this.row = options.row || Row;
+    this.rows = this.collection.map(function (model) {
+      var row = new this.row({
+        columns: this.columns,
+        model: model
+      });
+
+      return row;
+    }, this);
+
+    this.emptyText = options.emptyText;
+    this._unshiftEmptyRowMayBe();
+
+    var collection = this.collection;
+    this.listenTo(collection, "add", this.insertRow);
+    this.listenTo(collection, "remove", this.removeRow);
+    this.listenTo(collection, "sort", this.refresh);
+    this.listenTo(collection, "reset", this.refresh);
+    this.listenTo(collection, "backgrid:sort", this.sort);
+    this.listenTo(collection, "backgrid:edited", this.moveToNextCell);
+  },
+
+  _unshiftEmptyRowMayBe: function () {
+    if (this.rows.length === 0 && this.emptyText != null) {
+      this.rows.unshift(new EmptyRow({
+        emptyText: this.emptyText,
+        columns: this.columns
+      }));
+    }
+  },
+
+  /**
+     This method can be called either directly or as a callback to a
+     [Backbone.Collecton#add](http://backbonejs.org/#Collection-add) event.
+
+     When called directly, it accepts a model or an array of models and an
+     option hash just like
+     [Backbone.Collection#add](http://backbonejs.org/#Collection-add) and
+     delegates to it. Once the model is added, a new row is inserted into the
+     body and automatically rendered.
+
+     When called as a callback of an `add` event, splices a new row into the
+     body and renders it.
+
+     @param {Backbone.Model} model The model to render as a row.
+     @param {Backbone.Collection} collection When called directly, this
+     parameter is actually the options to
+     [Backbone.Collection#add](http://backbonejs.org/#Collection-add).
+     @param {Object} options When called directly, this must be null.
+
+     See:
+
+     - [Backbone.Collection#add](http://backbonejs.org/#Collection-add)
+  */
+  insertRow: function (model, collection, options) {
+
+    if (this.rows[0] instanceof EmptyRow) this.rows.pop().remove();
+
+    // insertRow() is called directly
+    if (!(collection instanceof Backbone.Collection) && !options) {
+      this.collection.add(model, (options = collection));
+      return;
+    }
+
+    var row = new this.row({
+      columns: this.columns,
+      model: model
+    });
+
+    var index = collection.indexOf(model);
+    this.rows.splice(index, 0, row);
+
+    var $el = this.$el;
+    var $children = $el.children();
+    var $rowEl = row.render().$el;
+
+    if (index >= $children.length) {
+      $el.append($rowEl);
+    }
+    else {
+      $children.eq(index).before($rowEl);
+    }
+
+    return this;
+  },
+
+  /**
+     The method can be called either directly or as a callback to a
+     [Backbone.Collection#remove](http://backbonejs.org/#Collection-remove)
+     event.
+
+     When called directly, it accepts a model or an array of models and an
+     option hash just like
+     [Backbone.Collection#remove](http://backbonejs.org/#Collection-remove) and
+     delegates to it. Once the model is removed, a corresponding row is removed
+     from the body.
+
+     When called as a callback of a `remove` event, splices into the rows and
+     removes the row responsible for rendering the model.
+
+     @param {Backbone.Model} model The model to remove from the body.
+     @param {Backbone.Collection} collection When called directly, this
+     parameter is actually the options to
+     [Backbone.Collection#remove](http://backbonejs.org/#Collection-remove).
+     @param {Object} options When called directly, this must be null.
+
+     See:
+
+     - [Backbone.Collection#remove](http://backbonejs.org/#Collection-remove)
+  */
+  removeRow: function (model, collection, options) {
+
+    // removeRow() is called directly
+    if (!options) {
+      this.collection.remove(model, (options = collection));
+      this._unshiftEmptyRowMayBe();
+      return;
+    }
+
+    if (_.isUndefined(options.render) || options.render) {
+      this.rows[options.index].remove();
+    }
+
+    this.rows.splice(options.index, 1);
+    this._unshiftEmptyRowMayBe();
+
+    return this;
+  },
+
+  /**
+     Reinitialize all the rows inside the body and re-render them. Triggers a
+     Backbone `backgrid:refresh` event from the collection along with the body
+     instance as its sole parameter when done.
+  */
+  refresh: function () {
+    for (var i = 0; i < this.rows.length; i++) {
+      this.rows[i].remove();
+    }
+
+    this.rows = this.collection.map(function (model) {
+      var row = new this.row({
+        columns: this.columns,
+        model: model
+      });
+
+      return row;
+    }, this);
+    this._unshiftEmptyRowMayBe();
+
+    this.render();
+
+    this.collection.trigger("backgrid:refresh", this);
+
+    return this;
+  },
+
+  /**
+     Renders all the rows inside this body. If the collection is empty and
+     `options.emptyText` is defined and not null in the constructor, an empty
+     row is rendered, otherwise no row is rendered.
+  */
+  render: function () {
+    this.$el.empty();
+
+    var fragment = document.createDocumentFragment();
+    for (var i = 0; i < this.rows.length; i++) {
+      var row = this.rows[i];
+      fragment.appendChild(row.render().el);
+    }
+
+    this.el.appendChild(fragment);
+
+    this.delegateEvents();
+
+    return this;
+  },
+
+  /**
+     Clean up this body and it's rows.
+
+     @chainable
+  */
+  remove: function () {
+    for (var i = 0; i < this.rows.length; i++) {
+      var row = this.rows[i];
+      row.remove.apply(row, arguments);
+    }
+    return Backbone.View.prototype.remove.apply(this, arguments);
+  },
+
+  /**
+     If the underlying collection is a Backbone.PageableCollection in
+     server-mode or infinite-mode, a page of models is fetched after sorting is
+     done on the server.
+
+     If the underlying collection is a Backbone.PageableCollection in
+     client-mode, or any
+     [Backbone.Collection](http://backbonejs.org/#Collection) instance, sorting
+     is done on the client side. If the collection is an instance of a
+     Backbone.PageableCollection, sorting will be done globally on all the pages
+     and the current page will then be returned.
+
+     Triggers a Backbone `backgrid:sorted` event from the collection when done
+     with the column, direction and a reference to the collection.
+
+     @param {Backgrid.Column} column
+     @param {null|"ascending"|"descending"} direction
+
+     See [Backbone.Collection#comparator](http://backbonejs.org/#Collection-comparator)
+  */
+  sort: function (column, direction) {
+
+    if (!_.contains(["ascending", "descending", null], direction)) {
+      throw new RangeError('direction must be one of "ascending", "descending" or `null`');
+    }
+
+    if (_.isString(column)) column = this.columns.findWhere({name: column});
+
+    var collection = this.collection;
+
+    var order;
+    if (direction === "ascending") order = -1;
+    else if (direction === "descending") order = 1;
+    else order = null;
+
+    var comparator = this.makeComparator(column.get("name"), order,
+                                         order ?
+                                         column.sortValue() :
+                                         function (model) {
+                                           return model.cid.replace('c', '') * 1;
+                                         });
+
+    if (Backbone.PageableCollection &&
+        collection instanceof Backbone.PageableCollection) {
+
+      collection.setSorting(order && column.get("name"), order,
+                            {sortValue: column.sortValue()});
+
+      if (collection.fullCollection) {
+        // If order is null, pageable will remove the comparator on both sides,
+        // in this case the default insertion order comparator needs to be
+        // attached to get back to the order before sorting.
+        if (collection.fullCollection.comparator == null) {
+          collection.fullCollection.comparator = comparator;
+        }
+        collection.fullCollection.sort();
+        collection.trigger("backgrid:sorted", column, direction, collection);
+      }
+      else collection.fetch({reset: true, success: function () {
+        collection.trigger("backgrid:sorted", column, direction, collection);
+      }});
+    }
+    else {
+      collection.comparator = comparator;
+      collection.sort();
+      collection.trigger("backgrid:sorted", column, direction, collection);
+    }
+
+    column.set("direction", direction);
+
+    return this;
+  },
+
+  makeComparator: function (attr, order, func) {
+
+    return function (left, right) {
+      // extract the values from the models
+      var l = func(left, attr), r = func(right, attr), t;
+
+      // if descending order, swap left and right
+      if (order === 1) t = l, l = r, r = t;
+
+      // compare as usual
+      if (l === r) return 0;
+      else if (l < r) return -1;
+      return 1;
+    };
+  },
+
+  /**
+     Moves focus to the next renderable and editable cell and return the
+     currently editing cell to display mode.
+
+     Triggers a `backgrid:next` event on the model with the indices of the row
+     and column the user *intended* to move to, and whether the intended move
+     was going to go out of bounds. Note that *out of bound* always means an
+     attempt to go past the end of the last row.
+
+     @param {Backbone.Model} model The originating model
+     @param {Backgrid.Column} column The originating model column
+     @param {Backgrid.Command} command The Command object constructed from a DOM
+     event
+  */
+  moveToNextCell: function (model, column, command) {
+    var i = this.collection.indexOf(model);
+    var j = this.columns.indexOf(column);
+    var cell, renderable, editable, m, n;
+
+    this.rows[i].cells[j].exitEditMode();
+
+    if (command.moveUp() || command.moveDown() || command.moveLeft() ||
+        command.moveRight() || command.save()) {
+      var l = this.columns.length;
+      var maxOffset = l * this.collection.length;
+
+      if (command.moveUp() || command.moveDown()) {
+        m = i + (command.moveUp() ? -1 : 1);
+        var row = this.rows[m];
+        if (row) {
+          cell = row.cells[j];
+          if (Backgrid.callByNeed(cell.column.editable(), cell.column, model)) {
+            cell.enterEditMode();
+            model.trigger("backgrid:next", m, j, false);
+          }
+        }
+        else model.trigger("backgrid:next", m, j, true);
+      }
+      else if (command.moveLeft() || command.moveRight()) {
+        var right = command.moveRight();
+        for (var offset = i * l + j + (right ? 1 : -1);
+             offset >= 0 && offset < maxOffset;
+             right ? offset++ : offset--) {
+          m = ~~(offset / l);
+          n = offset - m * l;
+          cell = this.rows[m].cells[n];
+          renderable = Backgrid.callByNeed(cell.column.renderable(), cell.column, cell.model);
+          editable = Backgrid.callByNeed(cell.column.editable(), cell.column, model);
+          if (renderable && editable) {
+            cell.enterEditMode();
+            model.trigger("backgrid:next", m, n, false);
+            break;
+          }
+        }
+
+        if (offset == maxOffset) {
+          model.trigger("backgrid:next", ~~(offset / l), offset - m * l, true);
+        }
+      }
+    }
+
+    return this;
+  }
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   A Footer is a generic class that only defines a default tag `tfoot` and
+   number of required parameters in the initializer.
+
+   @abstract
+   @class Backgrid.Footer
+   @extends Backbone.View
+ */
+var Footer = Backgrid.Footer = Backbone.View.extend({
+
+  /** @property */
+  tagName: "tfoot",
+
+  /**
+     Initializer.
+
+     @param {Object} options
+     @param {Backbone.Collection.<Backgrid.Column>|Array.<Backgrid.Column>|Array.<Object>} options.columns
+     Column metadata.
+     @param {Backbone.Collection} options.collection
+
+     @throws {TypeError} If options.columns or options.collection is undefined.
+  */
+  initialize: function (options) {
+    this.columns = options.columns;
+    if (!(this.columns instanceof Backbone.Collection)) {
+      this.columns = new Backgrid.Columns(this.columns);
+    }
+  }
+
+});
+
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+/**
+   Grid represents a data grid that has a header, body and an optional footer.
+
+   By default, a Grid treats each model in a collection as a row, and each
+   attribute in a model as a column. To render a grid you must provide a list of
+   column metadata and a collection to the Grid constructor. Just like any
+   Backbone.View class, the grid is rendered as a DOM node fragment when you
+   call render().
+
+       var grid = Backgrid.Grid({
+         columns: [{ name: "id", label: "ID", type: "string" },
+          // ...
+         ],
+         collections: books
+       });
+
+       $("#table-container").append(grid.render().el);
+
+   Optionally, if you want to customize the rendering of the grid's header and
+   footer, you may choose to extend Backgrid.Header and Backgrid.Footer, and
+   then supply that class or an instance of that class to the Grid constructor.
+   See the documentation for Header and Footer for further details.
+
+       var grid = Backgrid.Grid({
+         columns: [{ name: "id", label: "ID", type: "string" }],
+         collections: books,
+         header: Backgrid.Header.extend({
+              //...
+         }),
+         footer: Backgrid.Paginator
+       });
+
+   Finally, if you want to override how the rows are rendered in the table body,
+   you can supply a Body subclass as the `body` attribute that uses a different
+   Row class.
+
+   @class Backgrid.Grid
+   @extends Backbone.View
+
+   See:
+
+   - Backgrid.Column
+   - Backgrid.Header
+   - Backgrid.Body
+   - Backgrid.Row
+   - Backgrid.Footer
+*/
+var Grid = Backgrid.Grid = Backbone.View.extend({
+
+  /** @property */
+  tagName: "table",
+
+  /** @property */
+  className: "backgrid",
+
+  /** @property */
+  header: Header,
+
+  /** @property */
+  body: Body,
+
+  /** @property */
+  footer: null,
+
+  /**
+     Initializes a Grid instance.
+
+     @param {Object} options
+     @param {Backbone.Collection.<Backgrid.Columns>|Array.<Backgrid.Column>|Array.<Object>} options.columns Column metadata.
+     @param {Backbone.Collection} options.collection The collection of tabular model data to display.
+     @param {Backgrid.Header} [options.header=Backgrid.Header] An optional Header class to override the default.
+     @param {Backgrid.Body} [options.body=Backgrid.Body] An optional Body class to override the default.
+     @param {Backgrid.Row} [options.row=Backgrid.Row] An optional Row class to override the default.
+     @param {Backgrid.Footer} [options.footer=Backgrid.Footer] An optional Footer class.
+   */
+  initialize: function (options) {
+    // Convert the list of column objects here first so the subviews don't have
+    // to.
+    if (!(options.columns instanceof Backbone.Collection)) {
+      options.columns = new Columns(options.columns);
+    }
+    this.columns = options.columns;
+
+    var filteredOptions = _.omit(options, ["el", "id", "attributes",
+                                           "className", "tagName", "events"]);
+
+    // must construct body first so it listens to backgrid:sort first
+    this.body = options.body || this.body;
+    this.body = new this.body(filteredOptions);
+
+    this.header = options.header || this.header;
+    if (this.header) {
+      this.header = new this.header(filteredOptions);
+    }
+
+    this.footer = options.footer || this.footer;
+    if (this.footer) {
+      this.footer = new this.footer(filteredOptions);
+    }
+
+    this.listenTo(this.columns, "reset", function () {
+      if (this.header) {
+        this.header = new (this.header.remove().constructor)(filteredOptions);
+      }
+      this.body = new (this.body.remove().constructor)(filteredOptions);
+      if (this.footer) {
+        this.footer = new (this.footer.remove().constructor)(filteredOptions);
+      }
+      this.render();
+    });
+  },
+
+  /**
+     Delegates to Backgrid.Body#insertRow.
+   */
+  insertRow: function () {
+    this.body.insertRow.apply(this.body, arguments);
+    return this;
+  },
+
+  /**
+     Delegates to Backgrid.Body#removeRow.
+   */
+  removeRow: function () {
+    this.body.removeRow.apply(this.body, arguments);
+    return this;
+  },
+
+  /**
+     Delegates to Backgrid.Columns#add for adding a column. Subviews can listen
+     to the `add` event from their internal `columns` if rerendering needs to
+     happen.
+
+     @param {Object} [options] Options for `Backgrid.Columns#add`.
+   */
+  insertColumn: function () {
+    this.columns.add.apply(this.columns, arguments);
+    return this;
+  },
+
+  /**
+     Delegates to Backgrid.Columns#remove for removing a column. Subviews can
+     listen to the `remove` event from the internal `columns` if rerendering
+     needs to happen.
+
+     @param {Object} [options] Options for `Backgrid.Columns#remove`.
+   */
+  removeColumn: function () {
+    this.columns.remove.apply(this.columns, arguments);
+    return this;
+  },
+
+  /**
+     Delegates to Backgrid.Body#sort.
+   */
+  sort: function () {
+    this.body.sort.apply(this.body, arguments);
+    return this;
+  },
+
+  /**
+     Renders the grid's header, then footer, then finally the body. Triggers a
+     Backbone `backgrid:rendered` event along with a reference to the grid when
+     the it has successfully been rendered.
+   */
+  render: function () {
+    this.$el.empty();
+
+    if (this.header) {
+      this.$el.append(this.header.render().$el);
+    }
+
+    if (this.footer) {
+      this.$el.append(this.footer.render().$el);
+    }
+
+    this.$el.append(this.body.render().$el);
+
+    this.delegateEvents();
+
+    this.trigger("backgrid:rendered", this);
+
+    return this;
+  },
+
+  /**
+     Clean up this grid and its subviews.
+
+     @chainable
+   */
+  remove: function () {
+    this.header && this.header.remove.apply(this.header, arguments);
+    this.body.remove.apply(this.body, arguments);
+    this.footer && this.footer.remove.apply(this.footer, arguments);
+    return Backbone.View.prototype.remove.apply(this, arguments);
+  }
+
+});
+return Backgrid;
+}));
\ No newline at end of file


[41/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml.j2
new file mode 100644
index 0000000..c0d8b2f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml.j2
@@ -0,0 +1,1887 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+-->
+<config>
+  <!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    -->
+
+  <!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  -->
+  <luceneMatchVersion>5.0.0</luceneMatchVersion>
+
+  <!-- <lib/> directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that <lib/> directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              <lib dir="./lib" />
+    -->
+
+  <!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    -->
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
+
+  <!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    -->
+  <!--
+     <lib path="../a-jar-that-does-not-exist.jar" /> 
+  -->
+  
+  <!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    -->
+  <dataDir>${solr.data.dir:}</dataDir>
+
+
+  <!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    -->
+  <directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
+    
+         
+    <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. -->      
+    <!-- The root directory that collection data should be written to. -->     
+    <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
+    <!-- The hadoop configuration files to use for the hdfs client. -->    
+    <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
+    <!-- Enable/Disable the hdfs cache. -->    
+    <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
+    <!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. -->    
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
+    
+  </directoryFactory> 
+
+  <!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  -->
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
+  <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: -->
+  
+       <schemaFactory class="ManagedIndexSchemaFactory">
+         <bool name="mutable">true</bool>
+         <str name="managedSchemaResourceName">managed-schema</str>
+       </schemaFactory>
+<!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces <indexDefaults> and <mainIndex> from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <indexConfig>
+    <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
+    -->
+    <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
+    <!-- <writeLockTimeout>1000</writeLockTimeout>  -->
+    <!-- LogSearch customization to avoid timeouts -->
+    <writeLockTimeout>10000</writeLockTimeout>
+
+    <!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. -->
+    <!-- <maxIndexingThreads>8</maxIndexingThreads>  -->
+    <!-- LogSearch customization of increase performance -->
+    <maxIndexingThreads>50</maxIndexingThreads>
+
+    <!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
+    <!-- <useCompoundFile>false</useCompoundFile> -->
+
+    <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  -->
+    <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
+    <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
+
+    <!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      -->
+    <!--
+        <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
+          <int name="maxMergeAtOnce">10</int>
+          <int name="segmentsPerTier">10</int>
+        </mergePolicy>
+      -->
+       
+    <!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      -->
+    <!-- 
+    <mergeFactor>10</mergeFactor>
+      -->
+    <!-- LogSearch customization. Set to 5 to trigger purging of deleted documents more often -->
+    <mergeFactor>5</mergeFactor>
+
+    <!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     -->
+    <!-- 
+       <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
+       -->
+
+    <!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    -->
+    <lockType>${solr.lock.type:native}</lockType>
+
+    <!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     -->
+    <!--
+    <unlockOnStartup>false</unlockOnStartup>
+      -->
+
+    <!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    -->
+    <!-- 
+    <deletionPolicy class="solr.SolrDeletionPolicy">
+    -->
+      <!-- The number of commit points to be kept -->
+      <!-- <str name="maxCommitsToKeep">1</str> -->
+      <!-- The number of optimized commit points to be kept -->
+      <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
+      <!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        -->
+      <!--
+         <str name="maxCommitAge">30MINUTES</str>
+         <str name="maxCommitAge">1DAY</str>
+      -->
+    <!-- 
+    </deletionPolicy>
+    -->
+
+    <!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      -->
+     <infoStream>true</infoStream>
+  </indexConfig>
+
+
+  <!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    -->
+  <jmx />
+  <!-- If you want to connect to a particular server, specify the
+       agentId 
+    -->
+  <!-- <jmx agentId="myAgent" /> -->
+  <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
+  <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
+    -->
+
+  <!-- The default high-performance update handler -->
+  <updateHandler class="solr.DirectUpdateHandler2">
+
+    <!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --> 
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+    </updateLog>
+ 
+    <!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      -->
+     <autoCommit> 
+       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
+       <openSearcher>false</openSearcher> 
+     </autoCommit>
+
+    <!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      -->
+
+     <autoSoftCommit> 
+       <maxTime>${solr.autoSoftCommit.maxTime:5000}</maxTime> 
+     </autoSoftCommit>
+
+    <!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      -->
+    <!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      -->
+    <!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      -->
+    <!--
+       <listener event="postCommit" class="solr.RunExecutableListener">
+         <str name="exe">solr/bin/snapshooter</str>
+         <str name="dir">.</str>
+         <bool name="wait">true</bool>
+         <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
+         <arr name="env"> <str>MYVAR=val1</str> </arr>
+       </listener>
+      -->
+
+  </updateHandler>
+  
+  <!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    -->
+  <!--
+  <indexReaderFactory name="IndexReaderFactory" class="package.class">
+    <str name="someArg">Some Value</str>
+  </indexReaderFactory >
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <query>
+    <!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      -->
+    <maxBooleanClauses>1024</maxBooleanClauses>
+
+
+    <!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (> 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    -->
+
+    <!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      -->
+    <filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/>
+
+    <!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      -->
+    <queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/>
+   
+    <!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      -->
+    <documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/>
+    
+    <!-- custom cache currently used by block join --> 
+    <cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" />
+
+    <!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      -->
+    <!--
+       <fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" />
+      -->
+
+    <!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      -->
+    <!--
+       <cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              />
+      -->
+
+
+    <!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    -->
+    <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+   <!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     -->
+   <!--
+      <useFilterForSortedQuery>true</useFilterForSortedQuery>
+     -->
+
+   <!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     -->
+   <queryResultWindowSize>20</queryResultWindowSize>
+
+   <!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     -->
+   <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+   <!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     -->
+    <!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      -->
+    <listener event="newSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <!--
+           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
+           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
+          -->
+      </arr>
+    </listener>
+    <listener event="firstSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <lst>
+          <str name="q">static firstSearcher warming in solrconfig.xml</str>
+        </lst>
+      </arr>
+    </listener>
+
+    <!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      -->
+    <useColdSearcher>false</useColdSearcher>
+
+    <!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      -->
+    <maxWarmingSearchers>2</maxWarmingSearchers>
+
+  </query>
+
+
+  <!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    -->
+  <requestDispatcher handleSelect="false" >
+    <!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --> 
+    <requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/>
+
+    <!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      -->
+    <httpCaching never304="true" />
+    <!-- If you include a <cacheControl> directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the <cacheControl> option even if you have set
+         never304="true"
+      -->
+    <!--
+       <httpCaching never304="true" >
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+    <!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      -->
+    <!--
+       <httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr">
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+  </requestDispatcher>
+
+  <!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    -->
+
+  <requestHandler name="/dataimport" class="solr.DataImportHandler">
+    <lst name="defaults">
+      <str name="config">solr-data-config.xml</str>
+    </lst>
+  </requestHandler>
+
+  <!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    -->
+  <requestHandler name="/select" class="solr.SearchHandler">
+    <!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      -->
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <int name="rows">10</int>
+       <str name="df">text</str>
+     </lst>
+    <!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      -->
+    <!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="appends">
+         <str name="fq">inStock:true</str>
+       </lst>
+      -->
+    <!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="invariants">
+         <str name="facet.field">cat</str>
+         <str name="facet.field">manu_exact</str>
+         <str name="facet.query">price:[* TO 500]</str>
+         <str name="facet.query">price:[500 TO *]</str>
+       </lst>
+      -->
+    <!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      -->
+    <!--
+       <arr name="components">
+         <str>nameOfCustomComponent1</str>
+         <str>nameOfCustomComponent2</str>
+       </arr>
+      -->
+    </requestHandler>
+
+  <!-- A request handler that returns indented JSON by default -->
+  <requestHandler name="/query" class="solr.SearchHandler">
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+       <str name="df">text</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  -->
+  <requestHandler name="/get" class="solr.RealTimeGetHandler">
+     <lst name="defaults">
+       <str name="omitHeader">true</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    -->
+  <requestHandler name="/browse" class="solr.SearchHandler">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+
+      <!-- VelocityResponseWriter settings -->
+      <str name="wt">velocity</str>
+      <str name="v.template">browse</str>
+      <str name="v.layout">layout</str>
+
+      <!-- Query settings -->
+      <str name="defType">edismax</str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+
+      <!-- Faceting defaults -->
+      <str name="facet">on</str>
+      <str name="facet.mincount">1</str>
+    </lst>
+  </requestHandler>
+
+
+  <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <str name="update.chain">add-unknown-fields-to-the-schema</str>
+    </lst>
+  </initParams>
+
+  <!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    -->
+  <requestHandler name="/update" class="solr.UpdateRequestHandler">
+    <!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      -->
+    <!--
+       <lst name="defaults">
+         <str name="update.chain">dedupe</str>
+       </lst>
+       -->
+  </requestHandler>
+
+  <!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    -->
+  <requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" >
+    <lst name="defaults">
+      <str name="lowernames">true</str>
+      <str name="uprefix">ignored_</str>
+
+      <!-- capture link hrefs but ignore div attributes -->
+      <str name="captureAttr">true</str>
+      <str name="fmap.a">links</str>
+      <str name="fmap.div">ignored_</str>
+    </lst>
+  </requestHandler>
+
+
+  <!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   -->
+  <requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" />
+
+
+  <!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       <docs>
+         <doc>
+           <field name="id">1</field>
+           <field name="name">The Name</field>
+           <field name="text">The Text Value</field>
+         </doc>
+         <doc>...</doc>
+         <doc>...</doc>
+         ...
+       </docs>
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  -->
+  <requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" />
+
+  <!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    -->
+  <requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" />
+  <!-- This single handler is equivalent to the following... -->
+  <!--
+     <requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" />
+     <requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" />
+     <requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" />
+     <requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" />
+     <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
+     <requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" >
+    -->
+  <!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    -->
+  <!--
+     <requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" >
+       <lst name="invariants">
+         <str name="hidden">synonyms.txt</str> 
+         <str name="hidden">anotherfile.txt</str> 
+         <str name="hidden">*</str> 
+       </lst>
+     </requestHandler>
+    -->
+
+  <!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  -->
+  <!--
+  <requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" >
+    <lst name="invariants">
+         <str name="hidden">synonyms.txt</str>
+         <str name="hidden">anotherfile.txt</str>
+    </lst>
+  </requestHandler>
+  -->
+  <!-- ping/healthcheck -->
+  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
+    <lst name="invariants">
+      <str name="q">solrpingquery</str>
+    </lst>
+    <lst name="defaults">
+      <str name="echoParams">all</str>
+    </lst>
+    <!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      -->
+    <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
+  </requestHandler>
+
+  <!-- Echo the request contents back to the client -->
+  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
+    <lst name="defaults">
+     <str name="echoParams">explicit</str> 
+     <str name="echoHandler">true</str>
+    </lst>
+  </requestHandler>
+  
+  <!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    -->
+  <requestHandler name="/replication" class="solr.ReplicationHandler" > 
+    <!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    -->
+    <!--
+       <lst name="master">
+         <str name="replicateAfter">commit</str>
+         <str name="replicateAfter">startup</str>
+         <str name="confFiles">schema.xml,stopwords.txt</str>
+       </lst>
+    -->
+    <!--
+       <lst name="slave">
+         <str name="masterUrl">http://your-master-hostname:8983/solr</str>
+         <str name="pollInterval">00:00:60</str>
+       </lst>
+    -->
+  </requestHandler>
+
+  <!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       <searchComponent name="query"     class="solr.QueryComponent" />
+       <searchComponent name="facet"     class="solr.FacetComponent" />
+       <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
+       <searchComponent name="highlight" class="solr.HighlightComponent" />
+       <searchComponent name="stats"     class="solr.StatsComponent" />
+       <searchComponent name="debug"     class="solr.DebugComponent" />
+   
+       Default configuration in a requestHandler would look like:
+
+       <arr name="components">
+         <str>query</str>
+         <str>facet</str>
+         <str>mlt</str>
+         <str>highlight</str>
+         <str>stats</str>
+         <str>debug</str>
+       </arr>
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       <arr name="first-components">
+         <str>myFirstComponentName</str>
+       </arr>
+    
+       <arr name="last-components">
+         <str>myLastComponentName</str>
+       </arr>
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     -->
+  
+   <!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     -->
+  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
+
+    <str name="queryAnalyzerFieldType">key_lower_case</str>
+
+    <!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      -->
+
+    <!-- a spellchecker built from a field of the main index -->
+    <lst name="spellchecker">
+      <str name="name">default</str>
+      <str name="field">text</str>
+      <str name="classname">solr.DirectSolrSpellChecker</str>
+      <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
+      <str name="distanceMeasure">internal</str>
+      <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
+      <float name="accuracy">0.5</float>
+      <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
+      <int name="maxEdits">2</int>
+      <!-- the minimum shared prefix when enumerating terms -->
+      <int name="minPrefix">1</int>
+      <!-- maximum number of inspections per result. -->
+      <int name="maxInspections">5</int>
+      <!-- minimum length of a query term to be considered for correction -->
+      <int name="minQueryLength">4</int>
+      <!-- maximum threshold of documents a query term can appear to be considered for correction -->
+      <float name="maxQueryFrequency">0.01</float>
+      <!-- uncomment this to require suggestions to occur in 1% of the documents
+      	<float name="thresholdTokenFrequency">.01</float>
+      -->
+    </lst>
+    
+    <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
+    <lst name="spellchecker">
+      <str name="name">wordbreak</str>
+      <str name="classname">solr.WordBreakSolrSpellChecker</str>      
+      <str name="field">name</str>
+      <str name="combineWords">true</str>
+      <str name="breakWords">true</str>
+      <int name="maxChanges">10</int>
+    </lst>
+
+    <!-- a spellchecker that uses a different distance measure -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">jarowinkler</str>
+         <str name="field">spell</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="distanceMeasure">
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         </str>
+       </lst>
+     -->
+
+    <!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">freq</str>
+         <str name="field">lowerfilt</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="comparatorClass">freq</str>
+      -->
+
+    <!-- A spellchecker that reads the list of words from a file -->
+    <!--
+       <lst name="spellchecker">
+         <str name="classname">solr.FileBasedSpellChecker</str>
+         <str name="name">file</str>
+         <str name="sourceLocation">spellings.txt</str>
+         <str name="characterEncoding">UTF-8</str>
+         <str name="spellcheckIndexDir">spellcheckerFile</str>
+       </lst>
+      -->
+  </searchComponent>
+  
+  <!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    -->
+  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers -->
+      <str name="spellcheck.dictionary">default</str>
+      <str name="spellcheck.dictionary">wordbreak</str>
+      <str name="spellcheck">on</str>
+      <str name="spellcheck.extendedResults">true</str>       
+      <str name="spellcheck.count">10</str>
+      <str name="spellcheck.alternativeTermCount">5</str>
+      <str name="spellcheck.maxResultsForSuggest">5</str>       
+      <str name="spellcheck.collate">true</str>
+      <str name="spellcheck.collateExtendedResults">true</str>  
+      <str name="spellcheck.maxCollationTries">10</str>
+      <str name="spellcheck.maxCollations">5</str>         
+    </lst>
+    <arr name="last-components">
+      <str>spellcheck</str>
+    </arr>
+  </requestHandler>
+
+  <searchComponent name="suggest" class="solr.SuggestComponent">
+  	<lst name="suggester">
+      <str name="name">mySuggester</str>
+      <str name="lookupImpl">FuzzyLookupFactory</str>      <!-- org.apache.solr.spelling.suggest.fst -->
+      <str name="dictionaryImpl">DocumentDictionaryFactory</str>     <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --> 
+      <str name="field">cat</str>
+      <str name="weightField">price</str>
+      <str name="suggestAnalyzerFieldType">string</str>
+    </lst>
+  </searchComponent>
+
+  <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="suggest">true</str>
+      <str name="suggest.count">10</str>
+    </lst>
+    <arr name="components">
+      <str>suggest</str>
+    </arr>
+  </requestHandler>
+  <!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    -->
+  <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
+
+  <!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <bool name="tv">true</bool>
+    </lst>
+    <arr name="last-components">
+      <str>tvComponent</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    -->
+  <searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" >
+    <lst name="engine">
+      <str name="name">lingo</str>
+
+      <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        -->
+      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
+
+      <!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       -->
+      <str name="carrot.resourcesDir">clustering/carrot2</str>
+    </lst>
+
+    <!-- An example definition for the STC clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">stc</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
+    </lst>
+
+    <!-- An example definition for the bisecting kmeans clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">kmeans</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
+    </lst>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler">
+    <lst name="defaults">
+      <bool name="clustering">true</bool>
+      <bool name="clustering.results">true</bool>
+      <!-- Field name with the logical "title" of a each document (optional) -->
+      <str name="carrot.title">name</str>
+      <!-- Field name with the logical "URL" of a each document (optional) -->
+      <str name="carrot.url">id</str>
+      <!-- Field name with the logical "content" of a each document (optional) -->
+      <str name="carrot.snippet">features</str>
+      <!-- Apply highlighter to the title/ content and use this for clustering. -->
+      <bool name="carrot.produceSummary">true</bool>
+      <!-- the maximum number of labels per cluster -->
+      <!--<int name="carrot.numDescriptions">5</int>-->
+      <!-- produce sub clusters -->
+      <bool name="carrot.outputSubClusters">false</bool>
+
+      <!-- Configure the remaining request handler parameters. -->
+      <str name="defType">edismax</str>
+      <str name="qf">
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      </str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+    </lst>
+    <arr name="last-components">
+      <str>clustering</str>
+    </arr>
+  </requestHandler>
+  
+  <!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    -->
+  <searchComponent name="terms" class="solr.TermsComponent"/>
+
+  <!-- A request handler for demonstrating the terms component -->
+  <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
+     <lst name="defaults">
+      <bool name="terms">true</bool>
+      <bool name="distrib">false</bool>
+    </lst>     
+    <arr name="components">
+      <str>terms</str>
+    </arr>
+  </requestHandler>
+
+
+  <!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    -->
+  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
+    <!-- pick a fieldType to analyze queries -->
+    <str name="queryFieldType">string</str>
+    <str name="config-file">elevate.xml</str>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the elevator component -->
+  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+      <str name="df">text</str>
+    </lst>
+    <arr name="last-components">
+      <str>elevator</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    -->
+  <searchComponent class="solr.HighlightComponent" name="highlight">
+    <highlighting>
+      <!-- Configure the standard fragmenter -->
+      <!-- This could most likely be commented out in the "default" case -->
+      <fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter">
+        <lst name="defaults">
+          <int name="hl.fragsize">100</int>
+        </lst>
+      </fragmenter>
+
+      <!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        -->
+      <fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter">
+        <lst name="defaults">
+          <!-- slightly smaller fragsizes work better because of slop -->
+          <int name="hl.fragsize">70</int>
+          <!-- allow 50% slop on fragment sizes -->
+          <float name="hl.regex.slop">0.5</float>
+          <!-- a basic sentence pattern -->
+          <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
+        </lst>
+      </fragmenter>
+
+      <!-- Configure the standard formatter -->
+      <formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter">
+        <lst name="defaults">
+          <str name="hl.simple.pre"><![CDATA[<em>]]></str>
+          <str name="hl.simple.post"><![CDATA[</em>]]></str>
+        </lst>
+      </formatter>
+
+      <!-- Configure the standard encoder -->
+      <encoder name="html" 
+               class="solr.highlight.HtmlEncoder" />
+
+      <!-- Configure the standard fragListBuilder -->
+      <fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/>
+      
+      <!-- Configure the single fragListBuilder -->
+      <fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/>
+      
+      <!-- Configure the weighted fragListBuilder -->
+      <fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/>
+      
+      <!-- default tag FragmentsBuilder -->
+      <fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <!-- 
+        <lst name="defaults">
+          <str name="hl.multiValuedSeparatorChar">/</str>
+        </lst>
+        -->
+      </fragmentsBuilder>
+
+      <!-- multi-colored tag FragmentsBuilder -->
+      <fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <lst name="defaults">
+          <str name="hl.tag.pre"><![CDATA[
+               <b style="background:yellow">,<b style="background:lawgreen">,
+               <b style="background:aquamarine">,<b style="background:magenta">,
+               <b style="background:palegreen">,<b style="background:coral">,
+               <b style="background:wheat">,<b style="background:khaki">,
+               <b style="background:lime">,<b style="background:deepskyblue">]]></str>
+          <str name="hl.tag.post"><![CDATA[</b>]]></str>
+        </lst>
+      </fragmentsBuilder>
+      
+      <boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner">
+        <lst name="defaults">
+          <str name="hl.bs.maxScan">10</str>
+          <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
+        </lst>
+      </boundaryScanner>
+      
+      <boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner">
+        <lst name="defaults">
+          <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
+          <str name="hl.bs.type">WORD</str>
+          <!-- language and country are used when constructing Locale object.  -->
+          <!-- And the Locale object will be used when getting instance of BreakIterator -->
+          <str name="hl.bs.language">en</str>
+          <str name="hl.bs.country">US</str>
+        </lst>
+      </boundaryScanner>
+    </highlighting>
+  </searchComponent>
+
+  <!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --> 
+
+  <!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    -->
+  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
+
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+{{logsearch_service_logs_max_retention}}DAYS</str>
+    </processor>
+    <processor class="solr.processor.DocExpirationUpdateProcessorFactory">
+        <int name="autoDeletePeriodSeconds">86400</int>
+        <str name="ttlFieldName">_ttl_</str>
+        <str name="expirationFieldName">_expire_at_</str>
+    </processor>
+    <processor class="solr.FirstFieldValueUpdateProcessorFactory">
+      <str name="fieldName">_expire_at_</str>
+    </processor>
+
+
+    <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseLongFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDateFieldUpdateProcessorFactory">
+      <arr name="format">
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss</str>
+        <str>yyyy-MM-dd'T'HH:mmZ</str>
+        <str>yyyy-MM-dd'T'HH:mm</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd HH:mm:ssZ</str>
+        <str>yyyy-MM-dd HH:mm:ss</str>
+        <str>yyyy-MM-dd HH:mmZ</str>
+        <str>yyyy-MM-dd HH:mm</str>
+        <str>yyyy-MM-dd</str>
+      </arr>
+    </processor>
+    <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
+      <str name="defaultFieldType">key_lower_case</str>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Boolean</str>
+        <str name="fieldType">boolean</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.util.Date</str>
+        <str name="fieldType">tdate</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Long</str>
+        <str name="valueClass">java.lang.Integer</str>
+        <str name="fieldType">tlong</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Number</str>
+        <str name="fieldType">tdouble</str>
+      </lst>
+    </processor>
+
+    <processor class="solr.LogUpdateProcessorFactory"/>
+    <processor class="solr.RunUpdateProcessorFactory"/>
+  </updateRequestProcessorChain>
+
+
+  <!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    -->
+  <!--
+     <updateRequestProcessorChain name="dedupe">
+       <processor class="solr.processor.SignatureUpdateProcessorFactory">
+         <bool name="enabled">true</bool>
+         <str name="signatureField">id</str>
+         <bool name="overwriteDupes">false</bool>
+         <str name="fields">name,features,cat</str>
+         <str name="signatureClass">solr.processor.Lookup3Signature</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+  
+  <!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    -->
+    <!--
+     <updateRequestProcessorChain name="langid">
+       <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
+         <str name="langid.fl">text,title,subject,description</str>
+         <str name="langid.langField">language_s</str>
+         <str name="langid.fallback">en</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+
+  <!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  -->
+  <!--
+    <updateRequestProcessorChain name="script">
+      <processor class="solr.StatelessScriptUpdateProcessorFactory">
+        <str name="script">update-script.js</str>
+        <lst name="params">
+          <str name="config_param">example config parameter</str>
+        </lst>
+      </processor>
+      <processor class="solr.RunUpdateProcessorFactory" />
+    </updateRequestProcessorChain>
+  -->
+ 
+  <!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    -->
+  <!-- The following response writers are implicitly configured unless
+       overridden...
+    -->
+  <!--
+     <queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" />
+     <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+     <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+     <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
+     <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
+     <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
+     <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
+     <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
+    -->
+
+  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+     <!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     -->
+    <str name="content-type">text/plain; charset=UTF-8</str>
+  </queryResponseWriter>
+  
+  <!--
+     Custom response writers can be declared as needed...
+    -->
+  <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
+    <str name="template.base.dir">${velocity.template.base.dir:}</str>
+  </queryResponseWriter>
+
+  <!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    -->
+  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
+    <int name="xsltCacheLifetimeSeconds">5</int>
+  </queryResponseWriter>
+
+  <!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    -->
+  <!-- example of registering a query parser -->
+  <!--
+     <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
+    -->
+
+  <!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    -->
+  <!-- example of registering a custom function parser  -->
+  <!--
+     <valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" />
+    -->
+    
+  
+  <!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    -->
+  <!--
+     Could be something like:
+     <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
+       <int name="connection">jdbc://....</int>
+     </transformer>
+     
+     To add a constant value to all docs, use:
+     <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <int name="value">5</int>
+     </transformer>
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <double name="defaultValue">5</double>
+     </transformer>
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
+    -->
+    
+
+  <!-- Legacy config for the admin interface -->
+  <admin>
+    <defaultQuery>*:*</defaultQuery>
+  </admin>
+
+</config>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/core.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/core.properties.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/core.properties.j2
new file mode 100644
index 0000000..5185057
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/core.properties.j2
@@ -0,0 +1,20 @@
+{#
+ # 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.
+ #}
+name=audit_logs
+config=solrconfig.xml
+dataDir={{hadoop_logs_data_folder}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.html
new file mode 100755
index 0000000..fecab20
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.html
@@ -0,0 +1,24 @@
+<!--
+ 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.
+-->
+
+<!-- The content of this page will be statically included into the top-
+right box of the cores overview page. Uncomment this as an example to 
+see there the content will show up.
+
+<img src="img/ico/construction.png"> This line will appear at the top-
+right box on collection1's Overview
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-bottom.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-bottom.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-bottom.html
new file mode 100755
index 0000000..3359a46
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-bottom.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-bottom.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    LAST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-top.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-top.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-top.html
new file mode 100755
index 0000000..0886cee
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/admin-extra.menu-top.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-top.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    FIRST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/elevate.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/elevate.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/elevate.xml
new file mode 100644
index 0000000..25d5ceb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/elevate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- If this file is found in the config directory, it will only be
+     loaded once at startup.  If it is found in Solr's data
+     directory, it will be re-loaded every commit.
+
+   See http://wiki.apache.org/solr/QueryElevationComponent for more info
+
+-->
+<elevate>
+ <query text="foo bar">
+  <doc id="1" />
+  <doc id="2" />
+  <doc id="3" />
+ </query>
+ 
+ <query text="ipod">
+   <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
+   <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
+ </query>
+ 
+</elevate>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/enumsConfig.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/enumsConfig.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/enumsConfig.xml
new file mode 100644
index 0000000..458ee7e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/enumsConfig.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.
+-->
+<enumsConfig>
+  <enum name="log_levels">
+    <value>UNKNOWN</value>
+    <value>TRACE</value>
+    <value>DEBUG</value>
+    <value>INFO</value>
+    <value>WARN</value>
+    <value>ERROR</value>
+    <value>FATAL</value>
+  </enum>
+</enumsConfig>


[52/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 380fa39..dd82430 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -252,7 +252,19 @@ class RMFTestCase(TestCase):
       self.assertEquals(resource_type, resource.__class__.__name__)
       self.assertEquals(name, resource.name)
       self.assertEquals(kwargs, resource.arguments)
-    
+
+  def assertResourceCalledRegexp(self, resource_type, name, **kwargs):
+    with patch.object(UnknownConfiguration, '__getattr__', return_value=lambda: "UnknownConfiguration()"):
+      self.assertNotEqual(len(RMFTestCase.env.resource_list), 0, "There were no more resources executed!")
+      resource = RMFTestCase.env.resource_list.pop(0)
+      
+      self.assertRegexpMatches(resource.__class__.__name__, resource_type)
+      self.assertRegexpMatches(resource.name, name)
+      for key in set(resource.arguments.keys()) | set(kwargs.keys()):
+        resource_value = resource.arguments.get(key, '')
+        actual_value = kwargs.get(key, '')
+        self.assertRegexpMatches(resource_value, actual_value, msg="Key " + key + " doesn't match")
+
   def assertNoMoreResources(self):
     self.assertEquals(len(RMFTestCase.env.resource_list), 0, "There were other resources executed!")
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
index fb03cb3..b56b935 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0/upgrades/upgrade_test_checks.xml
@@ -85,6 +85,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js b/ambari-web/app/mappers/service_metrics_mapper.js
index 49f984d..2e15973 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -389,7 +389,8 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
       SPARK: [34],
       ACCUMULO: [35],
       ATLAS: [36],
-      AMBARI_METRICS: [37]
+      AMBARI_METRICS: [37],
+      LOGSEARCH: [38]
     };
     if (quickLinks[item.ServiceInfo.service_name])
       finalJson.quick_links = quickLinks[item.ServiceInfo.service_name];

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/models/quick_links.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js
index d7fbbc6..b7ad1ce 100644
--- a/ambari-web/app/models/quick_links.js
+++ b/ambari-web/app/models/quick_links.js
@@ -355,6 +355,19 @@ App.QuickLinks.FIXTURES = [
     regex: '^(\\d+)$',
     default_http_port: 3000,
     default_https_port: 3000
+  },
+  {
+    id:38,
+    label:'Logsearch UI',
+    url:'%@://%@:%@',
+    service_id: 'LOGSEARCH',
+    template:'%@://%@:%@',
+    http_config: 'logsearch.ui.port',
+    https_config: 'logsearch.ui.port',
+    site: 'logsearch-site',
+    regex: '^(\\d+)$',
+    default_http_port: 61888,
+    default_https_port: 61888
   }
 
 ];

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index b62b7b8..3a99d7a 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -43,7 +43,8 @@ App.QuickViewLinks = Em.View.extend({
     'ACCUMULO',
     'ATLAS',
     'RANGER',
-    'AMBARI_METRICS'
+    'AMBARI_METRICS',
+    'LOGSEARCH'
   ],
 
   /**
@@ -553,6 +554,9 @@ App.QuickViewLinks = Em.View.extend({
       case "AMBARI_METRICS":
         hosts = this.findHosts('METRICS_GRAFANA', response);
         break;
+      case "LOGSEARCH":
+        hosts = this.findHosts('LOGSEARCH_SERVER', response);
+        break;
       default:
         if (this.getWithDefault('content.hostComponents', []).someProperty('isMaster')) {
           hosts = this.findHosts(this.get('content.hostComponents').findProperty('isMaster').get('componentName'), response);

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index b9050f8..2b1c08f 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -964,6 +964,11 @@ describe('App.QuickViewLinks', function () {
       expect(quickViewLinks.findHosts.calledWith('METRICS_GRAFANA', {})).to.be.true;
     });
 
+    it("LOGSEARCH service", function() {
+      expect(quickViewLinks.getHosts({}, 'LOGSEARCH')).to.eql(['host1']);
+      expect(quickViewLinks.findHosts.calledWith('LOGSEARCH_SERVER', {})).to.be.true;
+    });
+
     it("custom service without master", function() {
       expect(quickViewLinks.getHosts({}, 'S1')).to.be.empty;
     });


[30/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.svg
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.svg b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.svg
new file mode 100644
index 0000000..8e63114
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.svg
@@ -0,0 +1,415 @@
+<?xml version="1.0" standalone="no"?>
+<!--
+   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.
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="fontawesomeregular" horiz-adv-x="1536" >
+<font-face units-per-em="1792" ascent="1536" descent="-256" />
+<missing-glyph horiz-adv-x="448" />
+<glyph unicode=" "  horiz-adv-x="448" />
+<glyph unicode="&#x09;" horiz-adv-x="448" />
+<glyph unicode="&#xa0;" horiz-adv-x="448" />
+<glyph unicode="&#xa8;" horiz-adv-x="1792" />
+<glyph unicode="&#xa9;" horiz-adv-x="1792" />
+<glyph unicode="&#xae;" horiz-adv-x="1792" />
+<glyph unicode="&#xb4;" horiz-adv-x="1792" />
+<glyph unicode="&#xc6;" horiz-adv-x="1792" />
+<glyph unicode="&#x2000;" horiz-adv-x="768" />
+<glyph unicode="&#x2001;" />
+<glyph unicode="&#x2002;" horiz-adv-x="768" />
+<glyph unicode="&#x2003;" />
+<glyph unicode="&#x2004;" horiz-adv-x="512" />
+<glyph unicode="&#x2005;" horiz-adv-x="384" />
+<glyph unicode="&#x2006;" horiz-adv-x="256" />
+<glyph unicode="&#x2007;" horiz-adv-x="256" />
+<glyph unicode="&#x2008;" horiz-adv-x="192" />
+<glyph unicode="&#x2009;" horiz-adv-x="307" />
+<glyph unicode="&#x200a;" horiz-adv-x="85" />
+<glyph unicode="&#x202f;" horiz-adv-x="307" />
+<glyph unicode="&#x205f;" horiz-adv-x="384" />
+<glyph unicode="&#x2122;" horiz-adv-x="1792" />
+<glyph unicode="&#x221e;" horiz-adv-x="1792" />
+<glyph unicode="&#x2260;" horiz-adv-x="1792" />
+<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
+<glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
+<glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
+<glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
+<glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
+<glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
+<glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t1
 9 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
+<glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28
 t28 -68z" />
+<glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
+<glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
+<glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
+<glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
+<glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
+<glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
+<glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
+<glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
+<glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
+<glyph unicode="&#xf016;" horiz-adv-x="1280" d="M128 0h1024v768h-416q-40 0 -68 28t-28 68v416h-512v-1280zM768 896h376q-10 29 -22 41l-313 313q-12 12 -41 22v-376zM1280 864v-896q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h640q40 0 88 -20t76 -48l312 -312q28 -28 48 -76t20 -88z " />
+<glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
+<glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
+<glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
+<glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
+<glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -1
 13 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
+<glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
+<glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
+<glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
+<glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
+<glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
+<glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
+<glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
+<glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
+<glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
+<glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
+<glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
+<glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
+<glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q73 -1 153.5 -2t119 -1.5t52.5 -0.5l29 2q-32 95 -92 241q-53 132 -92 211zM21 -128h-21l2 79q22 7 80 18q89 16 110 31q20 16 48 68l237 616l280 724h75h53l11 -21l205 -480q103 -242 124 -297q39 -102 96 -235q26 -58 65 -164q24 -67 65 -149 q22 -49 35 -57q22 -19 69 -23q47 -6 103 -27q6 -39 6 -57q0 -14 -1 -26q-80 0 -192 8q-93 8 -189 8q-79 0 -135 -2l-200 -11l-58 -2q0 45 4 78l131 28q56 13 68 23q12 12 12 27t-6 32l-47 114l-92 228l-450 2q-29 -65 -104 -274q-23 -64 -23 -84q0 -31 17 -43 q26 -21 103 -32q3 0 13.5 -2t30 -5t40.5 -6q1 -28 1 -58q0 -17 -2 -27q-66 0 -349 20l-48 -8q-81 -14 -167 -14z" />
+<glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q76 -32 140 -32q131 0 216 41t122 113q38 70 38 181q0 114 -41 180q-58 94 -141 126q-80 32 -247 32q-74 0 -101 -10v-144l-1 -173l3 -270q0 -15 12 -44zM541 761q43 -7 109 -7q175 0 264 65t89 224q0 112 -85 187q-84 75 -255 75q-52 0 -130 -13q0 -44 2 -77 q7 -122 6 -279l-1 -98q0 -43 1 -77zM0 -128l2 94q45 9 68 12q77 12 123 31q17 27 21 51q9 66 9 194l-2 497q-5 256 -9 404q-1 87 -11 109q-1 4 -12 12q-18 12 -69 15q-30 2 -114 13l-4 83l260 6l380 13l45 1q5 0 14 0.5t14 0.5q1 0 21.5 -0.5t40.5 -0.5h74q88 0 191 -27 q43 -13 96 -39q57 -29 102 -76q44 -47 65 -104t21 -122q0 -70 -32 -128t-95 -105q-26 -20 -150 -77q177 -41 267 -146q92 -106 92 -236q0 -76 -29 -161q-21 -62 -71 -117q-66 -72 -140 -108q-73 -36 -203 -60q-82 -15 -198 -11l-197 4q-84 2 -298 -11q-33 -3 -272 -11z" />
+<glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q4 1 77 20q76 19 116 39q29 37 41 101l27 139l56 268l12 64q8 44 17 84.5t16 67t12.5 46.5t9 30.5t3.5 11.5l29 157l16 63l22 135l8 50v38q-41 22 -144 28q-28 2 -38 4l19 103l317 -14q39 -2 73 -2q66 0 214 9q33 2 68 4.5t36 2.5q-2 -19 -6 -38 q-7 -29 -13 -51q-55 -19 -109 -31q-64 -16 -101 -31q-12 -31 -24 -88q-9 -44 -13 -82q-44 -199 -66 -306l-61 -311l-38 -158l-43 -235l-12 -45q-2 -7 1 -27q64 -15 119 -21q36 -5 66 -10q-1 -29 -7 -58q-7 -31 -9 -41q-18 0 -23 -1q-24 -2 -42 -2q-9 0 -28 3q-19 4 -145 17 l-198 2q-41 1 -174 -11q-74 -7 -98 -9z" />
+<glyph unicode="&#xf034;" horiz-adv-x="1792" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l215 -1h293l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -42.5 2t-103.5 -1t-111 -1 q-34 0 -67 -5q-10 -97 -8 -136l1 -152v-332l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-88 0 -233 -14q-48 -4 -70 -4q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q8 192 6 433l-5 428q-1 62 -0.5 118.5t0.5 102.5t-2 57t-6 15q-6 5 -14 6q-38 6 -148 6q-43 0 -100 -13.5t-73 -24.5q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1744 128q33 0 42 -18.5t-11 -44.5 l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80z" />
+<glyph unicode="&#xf035;" d="M81 1407l54 -27q20 -5 211 -5h130l19 3l115 1l446 -1h318l34 -2q14 -1 28 7t21 16l7 8l42 1q15 0 28 -1v-104.5t1 -131.5l1 -100l-1 -58q0 -32 -4 -51q-39 -15 -68 -18q-25 43 -54 128q-8 24 -15.5 62.5t-11.5 65.5t-6 29q-13 15 -27 19q-7 2 -58.5 2t-138.5 -1t-128 -1 q-94 0 -127 -5q-10 -97 -8 -136l1 -152v52l3 -359l-1 -147q-1 -46 11 -85q49 -25 89 -32q2 0 18 -5t44 -13t43 -12q30 -8 50 -18q5 -45 5 -50q0 -10 -3 -29q-14 -1 -34 -1q-110 0 -187 10q-72 8 -238 8q-82 0 -233 -13q-45 -5 -70 -5q-2 22 -2 26l-1 26v9q21 33 79 49 q139 38 159 50q9 21 12 56q6 137 6 433l-5 44q0 265 -2 278q-2 11 -6 15q-6 5 -14 6q-38 6 -148 6q-50 0 -168.5 -14t-132.5 -24q-13 -9 -22 -33t-22 -75t-24 -84q-6 -19 -19.5 -32t-20.5 -13q-44 27 -56 44v297v86zM1505 113q26 -20 26 -49t-26 -49l-162 -126 q-26 -20 -44.5 -11t-18.5 42v80h-1024v-80q0 -33 -18.5 -42t-44.5 11l-162 126q-26 20 -26 49t26 49l162 126q26 20 44.5 11t18.5 -42v-80h1024v80q0 33 18.5 42t44.5 -11z" />
+<glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t
 -22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
+<glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
+<glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
+<glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
+<glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
+<glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
+<glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
+<glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
+<glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
+<glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
+<glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
+<glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
+<glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
+<glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
+<glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
+<glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
+<glyph unicode="&#xf053;" horiz-adv-x="1152" d="M742 -37l-652 651q-37 37 -37 90.5t37 90.5l652 651q37 37 90.5 37t90.5 -37l75 -75q37 -37 37 -90.5t-37 -90.5l-486 -486l486 -485q37 -38 37 -91t-37 -90l-75 -75q-37 -37 -90.5 -37t-90.5 37z" />
+<glyph unicode="&#xf054;" horiz-adv-x="1152" d="M1099 704q0 -52 -37 -91l-652 -651q-37 -37 -90 -37t-90 37l-76 75q-37 39 -37 91q0 53 37 90l486 486l-486 485q-37 39 -37 91q0 53 37 90l76 75q36 38 90 38t90 -38l652 -651q37 -37 37 -90z" />
+<glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
+<glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
+<glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
+<glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
+<glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
+<glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
+<glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
+<glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
+<glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
+<glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
+<glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
+<glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
+<glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
+<glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
+<glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
+<glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
+<glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
+<glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
+<glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
+<glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
+<glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf077;" horiz-adv-x="1664" d="M1611 320q0 -53 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-486 485l-486 -485q-36 -38 -90 -38t-90 38l-75 75q-38 36 -38 90q0 53 38 91l651 651q37 37 90 37q52 0 91 -37l650 -651q38 -38 38 -91z" />
+<glyph unicode="&#xf078;" horiz-adv-x="1664" d="M1611 832q0 -53 -37 -90l-651 -651q-38 -38 -91 -38q-54 0 -90 38l-651 651q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l486 -486l486 486q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
+<glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
+<glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
+<glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
+<glyph unicode="&#xf080;" horiz-adv-x="1920" d="M512 512v-384h-256v384h256zM896 1024v-896h-256v896h256zM1280 768v-640h-256v640h256zM1664 1152v-1024h-256v1024h256zM1792 32v1216q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5z M1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
+<glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf082;" d="M1307 618l23 219h-198v109q0 49 15.5 68.5t71.5 19.5h110v219h-175q-152 0 -218 -72t-66 -213v-131h-131v-219h131v-635h262v635h175zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
+<glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
+<glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 
 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
+<glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
+<glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
+<glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
+<glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
+<glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
+<glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
+<glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
+<glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
+<glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
+<glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 
 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
+<glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
+<glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
+<glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
+<glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
+<glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
+<glyph unicode="&#xf09a;" horiz-adv-x="768" d="M511 980h257l-30 -284h-227v-824h-341v824h-170v284h170v171q0 182 86 275.5t283 93.5h227v-284h-142q-39 0 -62.5 -6.5t-34 -23.5t-13.5 -34.5t-3 -49.5v-142z" />
+<glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
+<glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
+<glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
+<glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
+<glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
+<glyph unicode="&#xf0a2;" horiz-adv-x="1664" d="M848 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM183 128h1298q-164 181 -246.5 411.5t-82.5 484.5q0 256 -320 256t-320 -256q0 -254 -82.5 -484.5t-246.5 -411.5zM1664 128q0 -52 -38 -90t-90 -38 h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q190 161 287 397.5t97 498.5q0 165 96 262t264 117q-8 18 -8 37q0 40 28 68t68 28t68 -28t28 -68q0 -19 -8 -37q168 -20 264 -117t96 -262q0 -262 97 -498.5t287 -397.5z" />
+<glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
+<glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
+<glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
+<glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
+<glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
+<glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
+<glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17
 t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-1
 5 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t

<TRUNCATED>

[33/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VHost.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VHost.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VHost.java
new file mode 100644
index 0000000..b157adc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VHost.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.Set;
+
+public class VHost {
+  String name;
+  Set<String> components;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Set<String> getComponents() {
+    return components;
+  }
+
+  public void setComponents(Set<String> components) {
+    this.components = components;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VList.java
new file mode 100644
index 0000000..97226d2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VList.java
@@ -0,0 +1,243 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public abstract class VList implements java.io.Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Start index for the result
+   */
+  protected int startIndex;
+  /**
+   * Page size used for the result
+   */
+  protected int pageSize;
+  /**
+   * Total records in the database for the given search conditions
+   */
+  protected long totalCount;
+  /**
+   * Number of rows returned for the search condition
+   */
+  protected int resultSize;
+  /**
+   * // * Sort type. Either desc or asc //
+   */
+  protected String sortType;
+  // /**
+  // * Comma seperated list of the fields for sorting
+  // */
+  protected String sortBy;
+
+  protected long queryTimeMS = System.currentTimeMillis();
+
+  /**
+   * Default constructor. This will set all the attributes to default value.
+   */
+  public VList() {
+  }
+
+  /**
+   * Initialize with existing list
+   * 
+   * @param size
+   */
+  public VList(@SuppressWarnings("rawtypes") List objectList) {
+    int size = 0;
+    if (objectList != null) {
+      size = objectList.size();
+    }
+
+    startIndex = 0;
+    pageSize = size;
+    totalCount = size;
+    resultSize = size;
+    sortType = null;
+    sortBy = null;
+  }
+
+  abstract public int getListSize();
+
+  abstract public List<?> getList();
+
+  /**
+   * This method sets the value to the member attribute <b>startIndex</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param startIndex
+   *            Value to set member attribute <b>startIndex</b>
+   */
+  public void setStartIndex(int startIndex) {
+    this.startIndex = startIndex;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>startIndex</b>
+   * 
+   * @return int - value of member attribute <b>startIndex</b>.
+   */
+  public int getStartIndex() {
+    return startIndex;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>pageSize</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param pageSize
+   *            Value to set member attribute <b>pageSize</b>
+   */
+  public void setPageSize(int pageSize) {
+    this.pageSize = pageSize;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>pageSize</b>
+   * 
+   * @return int - value of member attribute <b>pageSize</b>.
+   */
+  public int getPageSize() {
+    return pageSize;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>totalCount</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param totalCount
+   *            Value to set member attribute <b>totalCount</b>
+   */
+  public void setTotalCount(long totalCount) {
+    this.totalCount = totalCount;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>totalCount</b>
+   * 
+   * @return long - value of member attribute <b>totalCount</b>.
+   */
+  public long getTotalCount() {
+    return totalCount;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>resultSize</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param resultSize
+   *            Value to set member attribute <b>resultSize</b>
+   */
+  public void setResultSize(int resultSize) {
+    this.resultSize = resultSize;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>resultSize</b>
+   * 
+   * @return int - value of member attribute <b>resultSize</b>.
+   */
+  public int getResultSize() {
+    return getListSize();
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>sortType</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param sortType
+   *            Value to set member attribute <b>sortType</b>
+   */
+  public void setSortType(String sortType) {
+    this.sortType = sortType;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>sortType</b>
+   *
+   * @return String - value of member attribute <b>sortType</b>.
+   */
+  public String getSortType() {
+    return sortType;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>sortBy</b>. You
+   * cannot set null to the attribute.
+   *
+   * @param sortBy
+   *            Value to set member attribute <b>sortBy</b>
+   */
+  public void setSortBy(String sortBy) {
+    this.sortBy = sortBy;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>sortBy</b>
+   *
+   * @return String - value of member attribute <b>sortBy</b>.
+   */
+  public String getSortBy() {
+    return sortBy;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>sortBy</b>. You
+   * cannot set null to the attribute.
+   *
+   * @param sortBy
+   *            Value to set member attribute <b>sortBy</b>
+   */
+
+  /**
+   * @return the queryTimeMS
+   */
+  public long getQueryTimeMS() {
+    return queryTimeMS;
+  }
+
+  /**
+   * @param queryTimeMS
+   *            the queryTimeMS to set
+   */
+  public void setQueryTimeMS(long queryTimeMS) {
+    this.queryTimeMS = queryTimeMS;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see java.lang.Object#toString()
+   */
+  @Override
+  public String toString() {
+    return "VList [startIndex=" + startIndex + ", pageSize=" + pageSize
+        + ", totalCount=" + totalCount + ", resultSize=" + resultSize
+        + ","
+        // + " sortType=" + sortType + ", "
+        + "sortBy=" + sortBy + ", queryTimeMS=" + queryTimeMS + "]";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFile.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFile.java
new file mode 100644
index 0000000..57e32d2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFile.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogFile {
+
+  private String name;
+
+  private String path;
+
+ 
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getPath() {
+    return path;
+  }
+
+  public void setPath(String path) {
+    this.path = path;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFileList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFileList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFileList.java
new file mode 100644
index 0000000..a79dae7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogFileList.java
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogFileList extends VList {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+
+  private List<VLogFile> logFiles;
+
+  public VLogFileList() {
+    logFiles = new ArrayList<VLogFile>();
+  }
+
+  @Override
+  public int getListSize() {
+    if (logFiles == null) {
+      return 0;
+    }
+    return logFiles.size();
+  }
+
+  @Override
+  public List<?> getList() {
+    return logFiles;
+  }
+
+  public List<VLogFile> getLogFiles() {
+    return logFiles;
+  }
+
+  public void setLogFiles(List<VLogFile> logFiles) {
+    this.logFiles = logFiles;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilter.java
new file mode 100644
index 0000000..1836c4a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilter.java
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogfeederFilter {
+
+  private String label;
+  private List<String> hosts;
+  private List<String> defaultLevels;
+  private List<String> overrideLevels;
+  private String expiryTime;
+
+  public VLogfeederFilter() {
+    hosts = new ArrayList<String>();
+    defaultLevels = new ArrayList<String>();
+    overrideLevels = new ArrayList<String>();
+  }
+
+  public String getLabel() {
+    return label;
+  }
+
+  public void setLabel(String label) {
+    this.label = label;
+  }
+
+  public List<String> getHosts() {
+    return hosts;
+  }
+
+  public void setHosts(List<String> hosts) {
+    this.hosts = hosts;
+  }
+
+  public List<String> getDefaultLevels() {
+    return defaultLevels;
+  }
+
+  public void setDefaultLevels(List<String> defaultLevels) {
+    this.defaultLevels = defaultLevels;
+  }
+
+  public List<String> getOverrideLevels() {
+    return overrideLevels;
+  }
+
+  public void setOverrideLevels(List<String> overrideLevels) {
+    this.overrideLevels = overrideLevels;
+  }
+
+  public String getExpiryTime() {
+    return expiryTime;
+  }
+
+  public void setExpiryTime(String expiryTime) {
+    this.expiryTime = expiryTime;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilterWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilterWrapper.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilterWrapper.java
new file mode 100644
index 0000000..727de69
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VLogfeederFilterWrapper.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import java.util.HashMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogfeederFilterWrapper {
+
+  private HashMap<String, VLogfeederFilter> filter;
+  private String id;
+
+  public HashMap<String, VLogfeederFilter> getFilter() {
+    return filter;
+  }
+
+  public void setFilter(HashMap<String, VLogfeederFilter> filter) {
+    this.filter = filter;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VMessage.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VMessage.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VMessage.java
new file mode 100644
index 0000000..bc52981
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VMessage.java
@@ -0,0 +1,165 @@
+/*
+* 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.
+*/
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VMessage implements java.io.Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Message key
+   */
+  protected String name;
+  /**
+   * Resource bundle key
+   */
+  protected String rbKey;
+  /**
+   * Message description. Use rbKey for doing localized lookup
+   */
+  protected String message;
+  /**
+   * Id of the object to which this message is related to
+   */
+  protected Long objectId;
+  /**
+   * Name of the field or attribute to which this message is related to
+   */
+  protected String fieldName;
+
+  /**
+   * This method sets the value to the member attribute <b>name</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param name
+   *            Value to set member attribute <b>name</b>
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>name</b>
+   * 
+   * @return String - value of member attribute <b>name</b>.
+   */
+  public String getName() {
+    return this.name;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>rbKey</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param rbKey
+   *            Value to set member attribute <b>rbKey</b>
+   */
+  public void setRbKey(String rbKey) {
+    this.rbKey = rbKey;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>rbKey</b>
+   * 
+   * @return String - value of member attribute <b>rbKey</b>.
+   */
+  public String getRbKey() {
+    return this.rbKey;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>message</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param message
+   *            Value to set member attribute <b>message</b>
+   */
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>message</b>
+   * 
+   * @return String - value of member attribute <b>message</b>.
+   */
+  public String getMessage() {
+    return this.message;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>objectId</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param objectId
+   *            Value to set member attribute <b>objectId</b>
+   */
+  public void setObjectId(Long objectId) {
+    this.objectId = objectId;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>objectId</b>
+   * 
+   * @return Long - value of member attribute <b>objectId</b>.
+   */
+  public Long getObjectId() {
+    return this.objectId;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>fieldName</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param fieldName
+   *            Value to set member attribute <b>fieldName</b>
+   */
+  public void setFieldName(String fieldName) {
+    this.fieldName = fieldName;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>fieldName</b>
+   * 
+   * @return String - value of member attribute <b>fieldName</b>.
+   */
+  public String getFieldName() {
+    return this.fieldName;
+  }
+
+  /**
+   * This return the bean content in string format
+   * 
+   * @return formatedStr
+   */
+  public String toString() {
+    String str = "VMessage={";
+    str += super.toString();
+    str += "name={" + name + "} ";
+    str += "rbKey={" + rbKey + "} ";
+    str += "message={" + message + "} ";
+    str += "objectId={" + objectId + "} ";
+    str += "fieldName={" + fieldName + "} ";
+    str += "}";
+    return str;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValue.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValue.java
new file mode 100644
index 0000000..d8bdbfb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValue.java
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VNameValue implements java.io.Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Name
+   */
+  protected String name;
+  /**
+   * Value
+   */
+  protected String value;
+
+  /**
+   * Default constructor. This will set all the attributes to default value.
+   */
+  public VNameValue() {
+  }
+
+  /**
+   * @param name
+   *            the key
+   * @param value
+   *            the value
+   */
+  public VNameValue(String name, String value) {
+
+    this.name = name;
+    this.value = value;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>name</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param name
+   *            Value to set member attribute <b>name</b>
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>name</b>
+   * 
+   * @return String - value of member attribute <b>name</b>.
+   */
+  public String getName() {
+    return this.name;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>value</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param value
+   *            Value to set member attribute <b>value</b>
+   */
+  public void setValue(String value) {
+    if(value.contains(".") && (value.contains("e") || value.contains("E")))
+      this.value=getExponentialValueReplaced(value);
+    else
+      this.value = value;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>value</b>
+   * 
+   * @return String - value of member attribute <b>value</b>.
+   */
+  public String getValue() {
+    return this.value;
+  }
+
+  /**
+   * This return the bean content in string format
+   * 
+   * @return formatedStr
+   */
+  public String toString() {
+    String str = "VNameValue={";
+    str += super.toString();
+    str += "name={" + name + "} ";
+    str += "value={" + value + "} ";
+    str += "}";
+    return str;
+  }
+  
+  private String getExponentialValueReplaced(String value) {
+    try{
+      Double number = Double.parseDouble(value);
+      String newValue = String.format("%.0f", number);
+      return newValue;
+      
+    }catch(Exception e){
+      return value;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValueList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValueList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValueList.java
new file mode 100644
index 0000000..dc5c86c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNameValueList.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VNameValueList extends VList {
+  private static final long serialVersionUID = 1L;
+  List<VNameValue> vNameValues = new ArrayList<VNameValue>();
+
+  public VNameValueList() {
+    super();
+  }
+
+  public VNameValueList(List<VNameValue> objList) {
+    super(objList);
+    this.vNameValues = objList;
+  }
+
+  /**
+   * @return the vNameValues
+   */
+  public List<VNameValue> getVNameValues() {
+    return vNameValues;
+  }
+
+  /**
+   * @param vNameValues
+   *            the vNameValues to set
+   */
+  public void setVNameValues(List<VNameValue> vNameValues) {
+    this.vNameValues = vNameValues;
+  }
+
+  @Override
+  public int getListSize() {
+    if (vNameValues != null) {
+      return vNameValues.size();
+    }
+    return 0;
+  }
+
+  @Override
+  public List<?> getList() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+//  @Override
+//  public List<VNameValue> getList() {
+//    return vNameValues;
+//  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNode.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNode.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNode.java
new file mode 100644
index 0000000..a16ded8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNode.java
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.Collection;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VNode {
+
+  private String name;
+
+  private String type;
+  
+  private String value;
+
+  private boolean isRoot;
+
+  private Collection<VNode> childs;
+
+  private Collection<VNameValue> logLevelCount;
+
+  private boolean isParent;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public boolean isRoot() {
+    return isRoot;
+  }
+
+  public void setRoot(boolean isRoot) {
+    this.isRoot = isRoot;
+  }
+
+  public Collection<VNode> getChilds() {
+    return childs;
+  }
+
+  public void setChilds(Collection<VNode> childs) {
+    this.childs = childs;
+  }
+
+  public boolean isParent() {
+    return isParent;
+  }
+
+  public void setParent(boolean isParent) {
+    this.isParent = isParent;
+  }
+
+  public Collection<VNameValue> getLogLevelCount() {
+    return logLevelCount;
+  }
+
+  public void setLogLevelCount(Collection<VNameValue> logLevelCount) {
+    this.logLevelCount = logLevelCount;
+  }
+  
+  public String getValue() {
+    return value;
+  }
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  @Override
+  public String toString() {
+    String str = "VNode={";
+    str += "name={" + name + "} ";
+    str += "value={" + value + "} ";
+    str += "type={" + type + "} ";
+    str += "isRoot={" + isRoot + "} ";
+    str += "isParent={" + isParent + "} ";
+    str += "logLevelCount={" + logLevelCount + "} ";
+    str += "childs={" + childs + "} ";
+    str += "}";
+    return str;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNodeList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNodeList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNodeList.java
new file mode 100644
index 0000000..0cd10a2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VNodeList.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VNodeList extends VList {
+  private static final long serialVersionUID = 1L;
+  List<VNode> vNodeList = new ArrayList<VNode>();
+
+  public List<VNode> getvNodeList() {
+    return vNodeList;
+  }
+
+  public void setvNodeList(List<VNode> vNodeList) {
+    this.vNodeList = vNodeList;
+  }
+
+  @Override
+  public int getListSize() {
+    // TODO Auto-generated method stub
+    return 0;
+  }
+
+  @Override
+  public List<VNode> getList() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VResponse.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VResponse.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VResponse.java
new file mode 100644
index 0000000..b35c29b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VResponse.java
@@ -0,0 +1,164 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VResponse implements
+    java.io.Serializable {
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Enum values for ResponseStatus
+   */
+  /**
+   * STATUS_SUCCESS is an element of enum ResponseStatus. Its value is
+   * "STATUS_SUCCESS".
+   */
+  public static final int STATUS_SUCCESS = 0;
+  /**
+   * STATUS_ERROR is an element of enum ResponseStatus. Its value is
+   * "STATUS_ERROR".
+   */
+  public static final int STATUS_ERROR = 1;
+  /**
+   * STATUS_VALIDATION is an element of enum ResponseStatus. Its value is
+   * "STATUS_VALIDATION".
+   */
+  public static final int STATUS_VALIDATION = 2;
+  /**
+   * STATUS_WARN is an element of enum ResponseStatus. Its value is
+   * "STATUS_WARN".
+   */
+  public static final int STATUS_WARN = 3;
+  /**
+   * STATUS_INFO is an element of enum ResponseStatus. Its value is
+   * "STATUS_INFO".
+   */
+  public static final int STATUS_INFO = 4;
+  /**
+   * STATUS_PARTIAL_SUCCESS is an element of enum ResponseStatus. Its value is
+   * "STATUS_PARTIAL_SUCCESS".
+   */
+  public static final int STATUS_PARTIAL_SUCCESS = 5;
+
+  /**
+   * Max value for enum ResponseStatus_MAX
+   */
+  public static final int ResponseStatus_MAX = 5;
+
+  /**
+   * Status code This attribute is of type enum Response::ResponseStatus
+   */
+  protected int statusCode;
+  /**
+   * Message description
+   */
+  protected String msgDesc;
+  /**
+   * List of messages
+   */
+  protected List<VMessage> messageList;
+
+  /**
+   * Default constructor. This will set all the attributes to default value.
+   */
+  public VResponse() {
+    statusCode = 0;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>statusCode</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param statusCode
+   *            Value to set member attribute <b>statusCode</b>
+   */
+  public void setStatusCode(int statusCode) {
+    this.statusCode = statusCode;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>statusCode</b>
+   * 
+   * @return int - value of member attribute <b>statusCode</b>.
+   */
+  public int getStatusCode() {
+    return this.statusCode;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>msgDesc</b>. You
+   * cannot set null to the attribute.
+   * 
+   * @param msgDesc
+   *            Value to set member attribute <b>msgDesc</b>
+   */
+  public void setMsgDesc(String msgDesc) {
+    this.msgDesc = msgDesc;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>msgDesc</b>
+   * 
+   * @return String - value of member attribute <b>msgDesc</b>.
+   */
+  public String getMsgDesc() {
+    return this.msgDesc;
+  }
+
+  /**
+   * This method sets the value to the member attribute <b>messageList</b>.
+   * You cannot set null to the attribute.
+   * 
+   * @param messageList
+   *            Value to set member attribute <b>messageList</b>
+   */
+  public void setMessageList(List<VMessage> messageList) {
+    this.messageList = messageList;
+  }
+
+  /**
+   * Returns the value for the member attribute <b>messageList</b>
+   * 
+   * @return List<VMessage> - value of member attribute <b>messageList</b>.
+   */
+  public List<VMessage> getMessageList() {
+    return this.messageList;
+  }
+
+  /**
+   * This return the bean content in string format
+   * 
+   * @return formatedStr
+   */
+  public String toString() {
+    String str = "VResponse={";
+    str += super.toString();
+    str += "statusCode={" + statusCode + "} ";
+    str += "msgDesc={" + msgDesc + "} ";
+    str += "messageList={" + messageList + "} ";
+    str += "}";
+    return str;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSolrLogList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSolrLogList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSolrLogList.java
new file mode 100644
index 0000000..193b522
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSolrLogList.java
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.solr.common.SolrDocumentList;
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VSolrLogList extends VList {
+  private static final long serialVersionUID = 1L;
+
+  SolrDocumentList logList = new SolrDocumentList();
+
+  public VSolrLogList() {
+    super();
+  }
+
+  public VSolrLogList(SolrDocumentList logList) {
+    super(logList);
+    this.logList = logList;
+  }
+
+  public void setSolrDocuments(SolrDocumentList list) {
+    this.logList = list;
+  }
+
+  @Override
+  public int getListSize() {
+    if (logList != null)
+      return logList.size();
+    return 0;
+  }
+
+  @Override
+  public SolrDocumentList getList() {
+    return logList;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VString.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VString.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VString.java
new file mode 100644
index 0000000..bda7565
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VString.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class VString {
+
+  /**
+   * Value
+   */
+  protected String value;
+
+  /**
+   * Default constructor. This will set all the attributes to default value.
+   */
+  public VString() {
+  }
+
+  public String getValue() {
+    return value;
+  }
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public String toString() {
+    String str = "VString={";
+    str += super.toString();
+    str += "value={" + value + "} ";
+    str += "}";
+    return str;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummary.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummary.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummary.java
new file mode 100644
index 0000000..92b40b8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummary.java
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import java.util.List;
+
+public class VSummary {
+
+  List<VHost> hosts;
+  String levels;
+  String format;
+  String numberLogs;
+  String from;
+  String to;
+  String includeString;
+  String excludeString;
+  
+  public VSummary(){
+    includeString = "-";
+    excludeString = "-";
+  }
+
+  public String getIncludeString() {
+    return includeString;
+  }
+
+  public void setIncludeString(String includeString) {
+    this.includeString = includeString;
+  }
+
+  public String getExcludeString() {
+    return excludeString;
+  }
+
+  public void setExcludeString(String excludeString) {
+    this.excludeString = excludeString;
+  }
+
+  public String getFrom() {
+    return from;
+  }
+
+  public void setFrom(String from) {
+    this.from = from;
+  }
+
+  public String getTo() {
+    return to;
+  }
+
+  public void setTo(String to) {
+    this.to = to;
+  }
+
+  public List<VHost> getHosts() {
+    return hosts;
+  }
+
+  public void setHosts(List<VHost> hosts) {
+    this.hosts = hosts;
+  }
+
+  public String getLevels() {
+    return levels;
+  }
+
+  public void setLevels(String levels) {
+    this.levels = levels;
+  }
+
+  public String getFormat() {
+    return format;
+  }
+
+  public void setFormat(String format) {
+    this.format = format;
+  }
+
+  public String getNumberLogs() {
+    return numberLogs;
+  }
+
+  public void setNumberLogs(String numberLogs) {
+    this.numberLogs = numberLogs;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCount.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCount.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCount.java
new file mode 100644
index 0000000..ad1ff5c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCount.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.List;
+
+public class VSummaryCount {
+
+  String level;
+
+  List<String> cricticalMsg;
+
+  List<String> compName;
+
+  List<Long> countMsg;
+
+  public String getLevel() {
+    return level;
+  }
+
+  public void setLevel(String level) {
+    this.level = level;
+  }
+
+  public List<String> getCricticalMsg() {
+    return cricticalMsg;
+  }
+
+  public void setCricticalMsg(List<String> cricticalMsg) {
+    this.cricticalMsg = cricticalMsg;
+  }
+
+  public List<String> getCompName() {
+    return compName;
+  }
+
+  public void setCompName(List<String> compName) {
+    this.compName = compName;
+  }
+
+  public List<Long> getCountMsg() {
+    return countMsg;
+  }
+
+  public void setCountMsg(List<Long> countMsg) {
+    this.countMsg = countMsg;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCountList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCountList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCountList.java
new file mode 100644
index 0000000..3d8e262
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VSummaryCountList.java
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class VSummaryCountList {
+
+  Collection<VSummaryCount> countList = new ArrayList<VSummaryCount>();
+
+  public Collection<VSummaryCount> getCountList() {
+    return countList;
+  }
+
+  public void setCountList(Collection<VSummaryCount> countList) {
+    this.countList = countList;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfig.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfig.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfig.java
new file mode 100644
index 0000000..075df65
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfig.java
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.view;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VUserConfig {
+  String id;
+  String userName;
+
+  String filterName;
+  String values;
+  
+  List<String> shareNameList;
+  String rowType;
+  
+  boolean isOverwrite;
+  
+  public VUserConfig(){
+    setId(""+new Date().getTime());
+    isOverwrite=false;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public String getFilterName() {
+    return filterName;
+  }
+
+  public void setFilterName(String filterName) {
+    this.filterName = filterName;
+  }
+
+
+  public String getValues() {
+    return values;
+  }
+
+  public void setValues(String values) {
+    this.values = values;
+  }
+
+
+  public List<String> getShareNameList() {
+    return shareNameList;
+  }
+
+  public void setShareNameList(List<String> shareNameList) {
+    this.shareNameList = shareNameList;
+  }
+
+  public String getRowType() {
+    return rowType;
+  }
+
+  public void setRowType(String rowType) {
+    this.rowType = rowType;
+  }
+
+  public boolean isOverwrite() {
+    return isOverwrite;
+  }
+
+  public void setOverwrite(boolean isOverwrite) {
+    this.isOverwrite = isOverwrite;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfigList.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfigList.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfigList.java
new file mode 100644
index 0000000..3fc9d0d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/view/VUserConfigList.java
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.view;
+
+import java.util.Collection;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VUserConfigList extends VList {
+  String name;
+  Collection<VUserConfig> userConfigList;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public Collection<VUserConfig> getUserConfigList() {
+    return userConfigList;
+  }
+
+  public void setUserConfigList(Collection<VUserConfig> historyList) {
+    this.userConfigList = historyList;
+  }
+
+  @Override
+  public int getListSize() {
+    return userConfigList.size();
+  }
+
+  @Override
+  public List<VUserConfig> getList() {
+    return (List<VUserConfig>) userConfigList;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthFailureHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthFailureHandler.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthFailureHandler.java
new file mode 100644
index 0000000..d706beb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthFailureHandler.java
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.authenticate;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler;
+
+public class LogsearchAuthFailureHandler extends ExceptionMappingAuthenticationFailureHandler {
+
+  private static final Logger logger = Logger.getLogger(LogsearchAuthFailureHandler.class);
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
+                                      AuthenticationException exception) throws IOException, ServletException {
+    logger.debug(" AuthFailureHandler + onAuthenticationFailure");
+    // TODO UI side handle status and redirect to login page with proper
+    response.setContentType("application/json");
+    response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+    response.getOutputStream().println("{ \"error\": \"" + "login failed !!" + "\" }");
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
new file mode 100644
index 0000000..d400858
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchAuthSuccessHandler.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.authenticate;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
+
+public class LogsearchAuthSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {
+  private static final Logger logger = Logger.getLogger(LogsearchAuthSuccessHandler.class);
+
+  private String HOME_PAGE = "/index.html";
+
+  @Override
+  public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
+                                      Authentication authentication) throws ServletException, IOException {
+    logger.debug("Login successfully !!!!!! Redirecting to home page :" + HOME_PAGE);
+    response.sendRedirect(HOME_PAGE);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
new file mode 100644
index 0000000..c90f96d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/authenticate/LogsearchLogoutSuccessHandler.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.authenticate;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
+import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler;
+
+public class LogsearchLogoutSuccessHandler extends SimpleUrlLogoutSuccessHandler implements LogoutSuccessHandler {
+    private static final Logger logger = Logger.getLogger(LogsearchLogoutSuccessHandler.class);
+
+    @Override
+    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
+      throws IOException, ServletException {
+  logger.debug("AtlasLogoutSuccessHandler ::: onLogoutSuccess");
+//  super.onLogoutSuccess(request, response, authentication);
+  response.sendRedirect("/login.jsp");
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
new file mode 100644
index 0000000..62f762c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchAuthenticationEntryPoint.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.filters;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
+
+class LogsearchAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint {
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  public LogsearchAuthenticationEntryPoint(String loginFormUrl) {
+    super(loginFormUrl);
+  }
+
+  private static final Logger logger = Logger.getLogger(LogsearchAuthenticationEntryPoint.class);
+
+  @Override
+  public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException)
+    throws IOException, ServletException {
+    String ajaxRequestHeader = request.getHeader("X-Requested-With");
+    if (ajaxRequestHeader != null && ajaxRequestHeader.equalsIgnoreCase("XMLHttpRequest")) {
+      logger.debug("AJAX request. Authentication required. Returning URL=" + request.getRequestURI());
+      response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Session Timeout");
+    } else {
+      logger.debug("Redirecting to login page :" + this.getLoginFormUrl());
+      response.sendRedirect(this.getLoginFormUrl() + ((request.getQueryString() != null) ? "?" + request.getQueryString() : ""));
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
new file mode 100644
index 0000000..69132e8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchSecurityContextFormationFilter.java
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.filters;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.ambari.logsearch.common.RequestContext;
+import org.apache.ambari.logsearch.common.UserSessionInfo;
+import org.apache.ambari.logsearch.manager.SessionMgr;
+import org.apache.ambari.logsearch.security.context.LogsearchContextHolder;
+import org.apache.ambari.logsearch.security.context.LogsearchSecurityContext;
+import org.apache.ambari.logsearch.util.CommonUtil;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AnonymousAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.web.filter.GenericFilterBean;
+
+public class LogsearchSecurityContextFormationFilter extends GenericFilterBean {
+
+  static Logger logger = Logger.getLogger(LogsearchSecurityContextFormationFilter.class);
+
+  public static final String LOGSEARCH_SC_SESSION_KEY = "LOGSEARCH_SECURITY_CONTEXT";
+  public static final String USER_AGENT = "User-Agent";
+
+  @Autowired
+  SessionMgr sessionMgr;
+
+  public LogsearchSecurityContextFormationFilter() {
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest,
+   * javax.servlet.ServletResponse, javax.servlet.FilterChain)
+   */
+  @Override
+  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
+    ServletException {
+
+    try {
+      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
+
+      if (auth instanceof AnonymousAuthenticationToken) {
+        // ignore
+      } else {
+        HttpServletRequest httpRequest = (HttpServletRequest) request;
+        HttpSession httpSession = httpRequest.getSession(false);
+        Cookie[] cookieList = httpRequest.getCookies();
+        String msaCookie = null;
+        for (int i = 0; cookieList != null && i < cookieList.length; i++) {
+          if (cookieList[i].getName().equalsIgnoreCase("msa")) {
+            msaCookie = cookieList[i].getValue();
+          }
+        }
+        if (msaCookie == null) {
+          HttpServletResponse httpResponse = (HttpServletResponse) response;
+          msaCookie = CommonUtil.genGUI();
+          Cookie cookie = new Cookie("msa", msaCookie);
+          // TODO: Need to revisit this
+          cookie.setMaxAge(Integer.MAX_VALUE);
+          httpResponse.addCookie(cookie);
+        }
+        // [1]get the context from session
+        LogsearchSecurityContext context = (LogsearchSecurityContext) httpSession
+          .getAttribute(LOGSEARCH_SC_SESSION_KEY);
+        if (context == null) {
+          context = new LogsearchSecurityContext();
+          httpSession.setAttribute(LOGSEARCH_SC_SESSION_KEY, context);
+        }
+        String userAgent = httpRequest.getHeader(USER_AGENT);
+        // Get the request specific info
+        RequestContext requestContext = new RequestContext();
+        String reqIP = httpRequest.getRemoteAddr();
+        requestContext.setIpAddress(reqIP);
+        requestContext.setMsaCookie(msaCookie);
+        requestContext.setUserAgent(userAgent);
+        requestContext.setServerRequestId(CommonUtil.genGUI());
+        requestContext.setRequestURL(httpRequest.getRequestURI());
+        context.setRequestContext(requestContext);
+        LogsearchContextHolder.setSecurityContext(context);
+        UserSessionInfo userSession = sessionMgr.processSuccessLogin(0, userAgent);
+        context.setUserSession(userSession);
+      }
+      chain.doFilter(request, response);
+
+    } finally {
+      // [4]remove context from thread-local
+      LogsearchContextHolder.resetSecurityContext();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
new file mode 100644
index 0000000..2c83001
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/filters/LogsearchUsernamePasswordAuthenticationFilter.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.filters;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.RememberMeServices;
+import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
+
+public class LogsearchUsernamePasswordAuthenticationFilter extends UsernamePasswordAuthenticationFilter {
+  private static final Logger logger = Logger.getLogger(LogsearchUsernamePasswordAuthenticationFilter.class);
+
+  public void setRememberMeServices(RememberMeServices rememberMeServices) {
+    super.setRememberMeServices(rememberMeServices);
+
+  }
+
+  @Override
+  protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response,
+                                            AuthenticationException failed) throws IOException, ServletException {
+    logger.info("login failed :::::" + failed.getMessage());
+    super.unsuccessfulAuthentication(request, response, failed);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
new file mode 100644
index 0000000..ef6a410
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/listeners/SpringEventListener.java
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.listeners;
+
+import org.apache.log4j.Logger;
+import org.springframework.context.ApplicationListener;
+import org.springframework.security.authentication.event.AbstractAuthenticationEvent;
+
+public class SpringEventListener implements ApplicationListener<AbstractAuthenticationEvent> {
+  private static final Logger logger = Logger.getLogger(SpringEventListener.class);
+
+  @Override
+  public void onApplicationEvent(AbstractAuthenticationEvent event) {
+    logger.info(" On Application onApplicationEvent  SpringEventListener");
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Privilege.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Privilege.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Privilege.java
new file mode 100644
index 0000000..949a1ab
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Privilege.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.model;
+
+public class Privilege {
+
+  private String name;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("Privilege [name=");
+    builder.append(name);
+    builder.append("]");
+    return builder.toString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Role.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Role.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Role.java
new file mode 100644
index 0000000..9b08424
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/Role.java
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.model;
+
+import java.util.List;
+
+import org.springframework.security.core.GrantedAuthority;
+
+public class Role implements GrantedAuthority {
+
+  private static final long serialVersionUID = 1L;
+  private String name;
+
+  private List<Privilege> privileges;
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  @Override
+  public String getAuthority() {
+    return this.name;
+  }
+
+  public List<Privilege> getPrivileges() {
+    return privileges;
+  }
+
+  public void setPrivileges(List<Privilege> privileges) {
+    this.privileges = privileges;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("Role [name=");
+    builder.append(name);
+    builder.append(", privileges=");
+    builder.append(privileges);
+    builder.append("]");
+    return builder.toString();
+  }
+
+}


[12/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.js
new file mode 100644
index 0000000..7c1561a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.js
@@ -0,0 +1,6 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==type
 of b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b)
 ,this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("clic
 k.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();brea
 k;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.sli
 de("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].joi
 n(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),
 "object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in"
 )[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.f
 n.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:
 b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&e.find(f).trigge
 r("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f+', [role="menu"], [role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$elemen
 t=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.2.0",c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{
 relatedTarget:b});d?c.$element.find(".modal-dialog").one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(300):c.$element.trigger("focus").trigger(e)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard
 ?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;if(this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;e?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}else if(!this.isShown&&this.$b
 ackdrop){this.$backdrop.removeClass("in");var f=function(){c.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",f).emulateTransitionEnd(150):f()}else b&&b()},c.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal
 "]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.2.0",c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{sel
 ector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay})
 ,b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=fu
 nction(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var c=a.contains(document.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!c)return;var d=this,e=this.tip(),f=this.getUID(this.type);this.setContent(),e.attr("id",f),this.$element.attr("aria-describedby",f),this.options.animation&&e.addClass("fade");var g="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,h=/\s?auto?\s?/i,i=h.test(g);i&&(g=g.replace(h,"")||"top"),e.detach().css({top:0,left:0,display:"block"}).addClass(g).data("bs."+this.type,this),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element);var j=this.getPosition(),k=e[0].offsetWidth,l=e[0].offsetHeight;if(i){var m=g,n=this.$element.parent(),o=this.getPosition(n);g="bottom"==g&&j.top+j.height+l-o.scroll>o.height?"top":"top"==g&&j.top-o.scroll-l<0?"bottom":"right"==g&&j.right+k>o.width?"left":"left"==g&&j.
 left-k<o.left?"right":g,e.removeClass(m).addClass(g)}var p=this.getCalculatedOffset(g,j,k,l);this.applyPlacement(p,g);var q=function(){d.$element.trigger("shown.bs."+d.type),d.hoverState=null};a.support.transition&&this.$tip.hasClass("fade")?e.one("bsTransitionEnd",q).emulateTransitionEnd(150):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=k.left?2*k.left-e+i:2*k.top-f+j,m=k.left?"left":"top",n=k.left?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(l,d[0][n],m)},c.prototype.replaceArrow=function(a
 ,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one("bsTransitionEnd",b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName;return a.ex
 tend({},"function"==typeof c.getBoundingClientRect?c.getBoundingClientRect():null,{scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop(),width:d?a(window).width():b.outerWidth(),height:d?a(window).height():b.outerHeight()},d?{top:0,left:0}:b.offset())},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.
 getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){clearTime
 out(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.2.0",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=
 this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").empty()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c
 ).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.2.0",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.len
 gth&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var d=a.fn.scrollspy;a.fn.scr
 ollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.2.0",c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.closest("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},c.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find
 ("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one("bsTransitionEnd",e).emulateTransitionEnd(150):e(),f.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault(),b.call(a(this),"show")})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api
 ",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.2.0",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=a(document).height(),d=this.$target.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=b-h?"bottom":null!=g&&g>=d?"top":!1;if(t
 his.affixed!==i){null!=this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:b-this.$element.height()-h}))}}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},d.offsetBottom&&(d.offset.bottom=d.offsetBottom),d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.bower.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.bower.json b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.bower.json
new file mode 100644
index 0000000..cfebce4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.bower.json
@@ -0,0 +1,15 @@
+{
+  "name": "globalize",
+  "homepage": "https://github.com/jquery/globalize",
+  "version": "0.1.1",
+  "_release": "0.1.1",
+  "_resolution": {
+    "type": "version",
+    "tag": "v0.1.1",
+    "commit": "2cbbe9e30609735aab9dc29d8c53c5cd8f810149"
+  },
+  "_source": "git://github.com/jquery/globalize.git",
+  "_target": "~0.1.1",
+  "_originalSource": "globalize",
+  "_direct": true
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.gitignore
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.gitignore b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.gitignore
new file mode 100644
index 0000000..ee7a347
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.gitignore
@@ -0,0 +1,9 @@
+.project
+*~
+*.diff
+*.patch
+.DS_Store
+generator/bin
+generator/obj
+node_modules
+dist
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.npmignore
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.npmignore b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.npmignore
new file mode 100644
index 0000000..dba9ccc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/.npmignore
@@ -0,0 +1 @@
+generator/

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/LICENSE
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/LICENSE b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/LICENSE
new file mode 100644
index 0000000..9c8b022
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/LICENSE
@@ -0,0 +1,21 @@
+Copyright Software Freedom Conservancy, Inc.
+http://jquery.org/license
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/README.md b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/README.md
new file mode 100644
index 0000000..cfbbe61
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/README.md
@@ -0,0 +1,865 @@
+# Globalize
+
+A JavaScript library for globalization and localization. Enables complex
+culture-aware number and date parsing and formatting, including the raw
+culture information for hundreds of different languages and countries, as well
+as an extensible system for localization.
+
+<hr>
+<ul>
+<li><a href="#why">Why Globalization</a></li>
+<li><a href="#what">What is a Culture?</a></li>
+<li><a href="#addCultureInfo">Globalize.addCultureInfo</a></li>
+<li><a href="#cultures">Globalize.cultures</a></li>
+<li><a href="#culture">Globalize.culture</a></li>
+<li><a href="#find">Globalize.findClosestCulture</a></li>
+<li><a href="#format">Globalize.format</a></li>
+<li><a href="#localize">Globalize.localize</a></li>
+<li><a href="#parseInt">Globalize.parseInt</a></li>
+<li><a href="#parseFloat">Globalize.parseFloat</a></li>
+<li><a href="#parseDate">Globalize.parseDate</a></li>
+<li><a href="#extend">Utilizing and Extending Cultures</a></li>
+<li><a href="#defining">Defining Culture Information</a></li>
+<li><a href="#numbers">Number Formatting</a></li>
+<li><a href="#currency">Currency Formatting</a></li>
+<li><a href="#dates">Date Formatting</a></li>
+<li><a href="#generating">Generating Culture Files</a></li>
+<li><a href="#building">Building Globalize</a></li>
+</ul>
+
+<a name="why"></a>
+<h2 id="why">Why Globalization?</h2>
+<p>
+Each language, and the countries that speak that language, have different
+expectations when it comes to how numbers (including currency and percentages)
+and dates should appear. Obviously, each language has different names for the
+days of the week and the months of the year. But they also have different
+expectations for the structure of dates, such as what order the day, month and
+year are in. In number formatting, not only does the character used to
+delineate number groupings and the decimal portion differ, but the placement of
+those characters differ as well.
+</p>
+<p>
+A user using an application should be able to read and write dates and numbers
+in the format they are accustomed to. This library makes this possible,
+providing an API to convert user-entered number and date strings - in their
+own format - into actual numbers and dates, and conversely, to format numbers
+and dates into that string format.
+</p>
+
+<a name="what"></a>
+<h2 id="what">What is a Culture?</h2>
+<p>
+Globalize defines roughly 350 cultures. Part of the reason for this large
+number, besides there being a lot of cultures in the world, is because for
+some languages, expectations differ among the countries that speak it.
+English, for example, is an official language in dozens of countries. Despite
+the language being English, the expected date formatting still greatly differs
+between them.
+</p>
+<p>
+So, it does not seem useful to define cultures by their language alone. Nor
+is it useful to define a culture by its country alone, as many countries have
+several official languages, spoken by sizable populations. Therefore, cultures
+are defined as a combination of the language and the country speaking it. Each
+culture is given a unique code that is a combination of an ISO 639 two-letter
+lowercase culture code for the language, and a two-letter uppercase code for
+the country or region. For example, "en-US" is the culture code for English in
+the United States.
+</p>
+<p>
+Yet, it is perhaps unreasonable to expect application developers to cater to
+every possible language/country combination perfectly. It is important then to
+define so-called "neutral" cultures based on each language. These cultures
+define the most likely accepted set of rules by anyone speaking that language,
+whatever the country. Neutral cultures are defined only by their language code.
+For example, "es" is the neutral culture for Spanish.
+</p>
+
+<a name="addCultureInfo"></a>
+<h2 id="addCultureInfo">Globalize.addCultureInfo( cultureName, extendCultureName, info )</h2>
+<p>
+This method allows you to create a new culture based on an existing culture or
+add to existing culture info. If the optional argument <pre>extendCultureName</pre>
+is not supplied, it will extend the existing culture if it exists or create a new
+culture based on the default culture if it doesn't exist. If cultureName is not
+supplied, it will add the supplied info to the current culture. See .culture().
+</p>
+
+
+<a name="cultures"></a>
+<h2 id="cultures">Globalize.cultures</h2>
+<p>
+A mapping of culture codes to culture objects. For example,
+Globalize.cultures.fr is an object representing the complete culture
+definition for the neutral French culture. Note that the main globalize.js file
+alone only includes a neutral English culture. To get additional cultures, you
+must include one or more of the culture scripts that come with it. You
+can see in the section <a href="#defining">Defining Culture Information</a>
+below which fields are defined in each culture.
+</p>
+
+<a name="culture"></a>
+<h2 id="culture">Globalize.culture( selector )</h2>
+<p>
+An application that supports globalization and/or localization will need to
+have a way to determine the user's preference. Attempting to automatically
+determine the appropriate culture is useful, but it is good practice to always
+offer the user a choice, by whatever means.
+</p>
+<p>
+Whatever your mechanism, it is likely that you will have to correlate the
+user's preferences with the list of cultures supported in the app. This
+method allows you to select the best match given the culture scripts that you
+have included and to set the Globalize culture to the culture which the user
+prefers.
+</p>
+<p>
+If you pass an array of names instead of a single name string, the first
+culture for which there is a match (that culture's script has been referenced)
+will be used. If none match, the search restarts using the corresponding
+neutral cultures. For example, if the application has included only the neutral
+"fr" culture, any of these would select it:
+<pre>
+Globalize.culture( "fr" );
+console.log( Globalize.culture().name ) // "fr"
+
+Globalize.culture( "fr-FR" );
+console.log( Globalize.culture().name ) // "fr-FR"
+
+Globalize.culture([ "es-MX", "fr-FR" ]);
+console.log( Globalize.culture().name ) // "es-MX"
+</pre>
+
+In any case, if no match is found, the neutral English culture "en" is selected
+by default.
+
+If you don't pass a selector, .culture() will return the current Globalize
+culture.
+</p>
+<p>
+Each culture string may also follow the pattern defined in
+<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4"
+>RFC2616 sec 14.4</a>. That is, a culture name may include a "quality" value
+that indicates an estimate of the user's preference for the language.
+
+<pre>
+Globalize.culture( "fr;q=0.4, es;q=0.5, he" );
+</pre>
+In this example, the neutral Hebrew culture "he" is given top priority (an
+unspecified quality is equal to 1). If that language is not an exact match for
+any of the cultures available in Globalize.cultures, then "es" is the next
+highest priority with 0.5, etc. If none of these match, just like with the array
+syntax, the search starts over and the same rules are applied to the
+corresponding neutral language culture for each. If still none match, the
+neutral English culture "en" is used.
+</p>
+
+<a name="find"></a>
+<h2 id="find">Globalize.findClosestCulture( selector )</h2>
+<p>
+Just like .culture( selector ), but it just returns the matching culture, if
+any, without setting it to the current Globalize culture, returned by
+.culture().
+</p>
+
+<a name="format"></a>
+<h2 id="format">Globalize.format( value, format, culture )</h2>
+<p>
+Formats a date or number according to the given format string and the given
+culture (or the current culture if not specified). See the sections
+<a href="#numbers">Number Formatting</a> and
+<a href="#dates">Date Formatting</a> below for details on the available
+formats.
+<pre>
+// assuming a culture with number grouping of 3 digits,
+// using "," separator and "." decimal symbol.
+Globalize.format( 1234.567, "n" ); // "1,234.57"
+Globalize.format( 1234.567, "n1" ); // "1,234.6"
+Globalize.format( 1234.567, "n0" ); // "1,235"
+
+// assuming a culture with "/" as the date separator symbol
+Globalize.format( new Date(1955,10,5), "yyyy/MM/dd" ); // "1955/11/05"
+Globalize.format( new Date(1955,10,5), "dddd MMMM d, yyyy" ); // "Saturday November 5, 1955"
+</pre>
+</p>
+
+<a name="localize"></a>
+<h2 id="localize">Globalize.localize( key, culture )</h2>
+<p>
+Gets or sets a localized value. This method allows you to extend the
+information available to a particular culture, and to easily retrieve it
+without worrying about finding the most appropriate culture. For example, to
+define the word "translate" in French:
+<pre>
+Globalize.addCultureInfo( "fr", {
+	messages: {
+		"translate": "traduire"
+	}
+});
+console.log( Globalize.localize( "translate", "fr" ) ); // "traduire"
+</pre>
+Note that localize() will find the closest match available per the same
+semantics as the Globalize.findClosestCulture() method. If there is no
+match, the translation given is for the neutral English culture "en" by
+default.
+</p>
+
+
+<a name="parseInt"></a>
+<h2 id="parseInt">Globalize.parseInt( value, radix, culture )</h2>
+<p>
+Parses a string representing a whole number in the given radix (10 by default),
+taking into account any formatting rules followed by the given culture (or the
+current culture, if not specified).
+
+If a percentage is passed into parseInt, the percent sign will be removed and the number parsed as is.
+Example: 12.34% would be returned as 12.
+<pre>
+// assuming a culture where "," is the group separator
+// and "." is the decimal separator
+Globalize.parseInt( "1,234.56" ); // 1234
+// assuming a culture where "." is the group separator
+// and "," is the decimal separator
+Globalize.parseInt( "1.234,56" ); // 1234
+</pre>
+</p>
+
+<a name="parseFloat"></a>
+<h2 id="parseFloat">Globalize.parseFloat( value, radix, culture )</h2>
+<p>
+Parses a string representing a floating point number in the given radix (10 by
+default), taking into account any formatting rules followed by the given
+culture (or the current culture, if not specified).
+
+If a percentage is passed into parseFloat, the percent sign will be removed and the number parsed as is.
+Example: 12.34% would be returned as 12.34
+<pre>
+// assuming a culture where "," is the group separator
+// and "." is the decimal separator
+Globalize.parseFloat( "1,234.56" ); // 1234.56
+// assuming a culture where "." is the group separator
+// and "," is the decimal separator
+Globalize.parseFloat( "1.234,56" ); // 1234.56
+</pre>
+</p>
+
+<a name="parseDate"></a>
+<h2 id="parseDate">Globalize.parseDate( value, formats, culture )</h2>
+<p>
+Parses a string representing a date into a JavaScript Date object, taking into
+account the given possible formats (or the given culture's set of default
+formats if not given). As before, the current culture is used if one is not
+specified.
+<pre>
+Globalize.culture( "en" );
+Globalize.parseDate( "1/2/2003" ); // Thu Jan 02 2003
+Globalize.culture( "fr" );
+Globalize.parseDate( "1/2/2003" ); // Sat Feb 01 2003
+</pre>
+</p>
+
+<a name="extend"></a>
+<h2 id="extend">Utilizing and Extending Cultures</h2>
+<p>
+The culture information included with each culture is mostly necessary for the
+parsing and formatting methods, but not all of it. For example, the Native and
+English names for each culture is given, as well as a boolean indicating
+whether the language is right-to-left. This may be useful information for your
+own purposes. You may also add to the culture information directly if so
+desired.
+</p>
+<p>
+As an example, in the U.S., the word "billion" means the number 1,000,000,000
+(9 zeros). But in other countries, that number is "1000 million" or a
+"milliard", and a billion is 1,000,000,000,000 (12 zeros). If you needed to
+provide functionality to your app or custom plugin that needed to know how many
+zeros are in a "billion", you could extend the culture information as follows:
+<pre>
+// define additional culture information for a possibly existing culture
+Globalize.addCultureInfo( "fr", {
+	numberFormat: {
+		billionZeroes: 12
+	}
+});
+</pre>
+Using this mechanism, the "fr" culture will be created if it does not exist.
+And if it does, the given values will be added to it.
+</p>
+
+<a name="defining"></a>
+<h2 id="defining">Defining Culture Information</h2>
+<p>
+Each culture is defined in its own script with the naming scheme
+globalize.culture.&lt;name&gt;.js. You may include any number of these scripts,
+making them available in the Globalize.cultures mapping. Including one of
+these scripts does NOT automatically make it the current culture selected in the
+Globalize.culture property.
+</p>
+<p>
+The neutral English culture is defined directly in globalize.js, and set
+both to the properties "en" and "default" of the Globalize.cultures mapping.
+Extensive comments describe the purpose of each of the fields defined.
+</p>
+<p>
+Looking at the source code of the scripts for each culture, you will notice
+that each script uses Globalize.addCultureInfo() to have the "default" neutral
+English culture "en", as a common basis, and defines only the properties that
+differ from neutral English.
+</p>
+<p>
+The neutral English culture is listed here along with the comments:
+<pre>
+Globalize.cultures[ "default" ] = {
+	// A unique name for the culture in the form
+	// &lt;language code&gt;-&lt;country/region code&gt;
+	name: "English",
+	// the name of the culture in the English language
+	englishName: "English",
+	// the name of the culture in its own language
+	nativeName: "English",
+	// whether the culture uses right-to-left text
+	isRTL: false,
+	// "language" is used for so-called "specific" cultures.
+	// For example, the culture "es-CL" means Spanish in Chili.
+	// It represents the Spanish-speaking culture as it is in Chili,
+	// which might have different formatting rules or even translations
+	// than Spanish in Spain. A "neutral" culture is one that is not
+	// specific to a region. For example, the culture "es" is the generic
+	// Spanish culture, which may be a more generalized version of the language
+	// that may or may not be what a specific culture expects.
+	// For a specific culture like "es-CL", the "language" field refers to the
+	// neutral, generic culture information for the language it is using.
+	// This is not always a simple matter of the string before the dash.
+	// For example, the "zh-Hans" culture is neutral (Simplified Chinese).
+	// And the "zh-SG" culture is Simplified Chinese in Singapore, whose
+	// language field is "zh-CHS", not "zh".
+	// This field should be used to navigate from a specific culture to its
+	// more general, neutral culture. If a culture is already as general as it
+	// can get, the language may refer to itself.
+	language: "en",
+	// "numberFormat" defines general number formatting rules, like the digits
+	// in each grouping, the group separator, and how negative numbers are
+	// displayed.
+	numberFormat: {
+		// [negativePattern]
+		// Note, numberFormat.pattern has no "positivePattern" unlike percent
+		// and currency, but is still defined as an array for consistency with
+		// them.
+		//	  negativePattern: one of "(n)|-n|- n|n-|n -"
+		pattern: [ "-n" ],
+		// number of decimal places normally shown
+		decimals: 2,
+		// string that separates number groups, as in 1,000,000
+		",": ",",
+		// string that separates a number from the fractional portion,
+		// as in 1.99
+		".": ".",
+		// array of numbers indicating the size of each number group.
+		groupSizes: [ 3 ],
+		// symbol used for positive numbers
+		"+": "+",
+		// symbol used for negative numbers
+		"-": "-",
+		percent: {
+			// [negativePattern, positivePattern]
+			//	   negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
+			//	   positivePattern: one of "n %|n%|%n|% n"
+			pattern: [ "-n %", "n %" ],
+			// number of decimal places normally shown
+			decimals: 2,
+			// array of numbers indicating the size of each number group.
+			groupSizes: [ 3 ],
+			// string that separates number groups, as in 1,000,000
+			",": ",",
+			// string that separates a number from the fractional portion, as in 1.99
+			".": ".",
+			// symbol used to represent a percentage
+			symbol: "%"
+		},
+		currency: {
+			// [negativePattern, positivePattern]
+			//	   negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
+			//	   positivePattern: one of "$n|n$|$ n|n $"
+			pattern: [ "($n)", "$n" ],
+			// number of decimal places normally shown
+			decimals: 2,
+			// array of numbers indicating the size of each number group.
+			groupSizes: [ 3 ],
+			// string that separates number groups, as in 1,000,000
+			",": ",",
+			// string that separates a number from the fractional portion, as in 1.99
+			".": ".",
+			// symbol used to represent currency
+			symbol: "$"
+		}
+	},
+	// "calendars" property defines all the possible calendars used by this
+	// culture. There should be at least one defined with name "standard" which
+	// is the default calendar used by the culture.
+	// A calendar contains information about how dates are formatted,
+	// information about the calendar's eras, a standard set of the date
+	// formats, translations for day and month names, and if the calendar is
+	// not based on the Gregorian calendar, conversion functions to and from
+	// the Gregorian calendar.
+	calendars: {
+		standard: {
+			// name that identifies the type of calendar this is
+			name: "Gregorian_USEnglish",
+			// separator of parts of a date (e.g. "/" in 11/05/1955)
+			"/": "/",
+			// separator of parts of a time (e.g. ":" in 05:44 PM)
+			":": ":",
+			// the first day of the week (0 = Sunday, 1 = Monday, etc)
+			firstDay: 0,
+			days: {
+				// full day names
+				names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
+				// abbreviated day names
+				namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
+				// shortest day names
+				namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
+			},
+			months: [
+				// full month names (13 months for lunar calendars -- 13th month should be "" if not lunar)
+				names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
+				// abbreviated month names
+				namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
+			],
+			// AM and PM designators in one of these forms:
+			// The usual view, and the upper and lower case versions
+			//		[standard,lowercase,uppercase]
+			// The culture does not use AM or PM (likely all standard date
+			// formats use 24 hour time)
+			//		null
+			AM: [ "AM", "am", "AM" ],
+			PM: [ "PM", "pm", "PM" ],
+			eras: [
+				// eras in reverse chronological order.
+				// name: the name of the era in this culture (e.g. A.D., C.E.)
+				// start: when the era starts in ticks, null if it is the
+				//		  earliest supported era.
+				// offset: offset in years from gregorian calendar
+				{"name":"A.D.","start":null,"offset":0}
+			],
+			// when a two digit year is given, it will never be parsed as a
+			// four digit year greater than this year (in the appropriate era
+			// for the culture)
+			// Set it as a full year (e.g. 2029) or use an offset format
+			// starting from the current year: "+19" would correspond to 2029
+			// if the current year is 2010.
+			twoDigitYearMax: 2029,
+			// set of predefined date and time patterns used by the culture.
+			// These represent the format someone in this culture would expect
+			// to see given the portions of the date that are shown.
+			patterns: {
+				// short date pattern
+				d: "M/d/yyyy",
+				// long date pattern
+				D: "dddd, MMMM dd, yyyy",
+				// short time pattern
+				t: "h:mm tt",
+				// long time pattern
+				T: "h:mm:ss tt",
+				// long date, short time pattern
+				f: "dddd, MMMM dd, yyyy h:mm tt",
+				// long date, long time pattern
+				F: "dddd, MMMM dd, yyyy h:mm:ss tt",
+				// month/day pattern
+				M: "MMMM dd",
+				// month/year pattern
+				Y: "yyyy MMMM",
+				// S is a sortable format that does not vary by culture
+				S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
+			}
+			// optional fields for each calendar:
+			/*
+			monthsGenitive:
+				Same as months but used when the day preceeds the month.
+				Omit if the culture has no genitive distinction in month names.
+				For an explanation of genitive months, see
+				http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
+			convert:
+				Allows for the support of non-gregorian based calendars. This
+				"convert" object defines two functions to convert a date to and
+				from a gregorian calendar date:
+					fromGregorian( date )
+						Given the date as a parameter, return an array with
+						parts [ year, month, day ] corresponding to the
+						non-gregorian based year, month, and day for the
+						calendar.
+					toGregorian( year, month, day )
+						Given the non-gregorian year, month, and day, return a
+						new Date() object set to the corresponding date in the
+						gregorian calendar.
+			*/
+		}
+	},
+	// Map of messages used by .localize()
+	messages: {}
+}
+</pre>
+</p>
+<p>
+Each culture can have several possible calendars. The calendar named "standard"
+is the default calendar used by that culture. You may change the calendar in
+use by setting the "calendar" field. Take a look at the calendars defined by
+each culture by looking at the script or enumerating its calendars collection.
+<pre>
+// switch to a non-standard calendar
+Globalize.culture().calendar = Globalize.culture().calendars.SomeOtherCalendar;
+// back to the standard calendar
+Globalize.culture().calendar = Globalize.culture().calendars.standard;
+</pre>
+
+</p>
+
+<a name="numbers"></a>
+<h2 id="numbers">Number Formatting</h2>
+<p>
+When formatting a number with format(), the main purpose is to convert the
+number into a human readable string using the culture's standard grouping and
+decimal rules. The rules between cultures can vary a lot. For example, in some
+cultures, the grouping of numbers is done unevenly. In the "te-IN" culture
+(Telugu in India), groups have 3 digits and then 2 digits. The number 1000000
+(one million) is written as "10,00,000". Some cultures do not group numbers at
+all.
+</p>
+<p>
+There are four main types of number formatting:
+<ul>
+<li><strong>n</strong> for number</li>
+<li><strong>d</strong> for decimal digits</li>
+<li><strong>p</strong> for percentage</li>
+<li><strong>c</strong> for currency</li>
+</ul>
+Even within the same culture, the formatting rules can vary between these four
+types of numbers. For example, the expected number of decimal places may differ
+from the number format to the currency format. Each format token may also be
+followed by a number. The number determines how many decimal places to display
+for all the format types except decimal, for which it means the minimum number
+of digits to display, zero padding it if necessary. Also note that the way
+negative numbers are represented in each culture can vary, such as what the
+negative sign is, and whether the negative sign appears before or after the
+number. This is especially apparent with currency formatting, where many
+cultures use parentheses instead of a negative sign.
+<pre>
+// just for example - will vary by culture
+Globalize.format( 123.45, "n" ); // 123.45
+Globalize.format( 123.45, "n0" ); // 123
+Globalize.format( 123.45, "n1" ); // 123.5
+
+Globalize.format( 123.45, "d" ); // 123
+Globalize.format( 12, "d3" ); // 012
+
+Globalize.format( 123.45, "c" ); // $123.45
+Globalize.format( 123.45, "c0" ); // $123
+Globalize.format( 123.45, "c1" ); // $123.5
+Globalize.format( -123.45, "c" ); // ($123.45)
+
+Globalize.format( 0.12345, "p" ); // 12.35 %
+Globalize.format( 0.12345, "p0" ); // 12 %
+Globalize.format( 0.12345, "p4" ); // 12.3450 %
+</pre>
+Parsing with parseInt and parseFloat also accepts any of these formats.
+</p>
+
+<a name="currency"></a>
+<h2 id="currency">Currency Formatting</h2>
+<p>
+Globalize has a default currency symbol for each locale. This is used when
+formatting a currency value such as
+<pre>
+Globalize.format( 1234.56, "c" ); // $1,234.56
+</pre>
+You can change the currency symbol for a locale by modifying the culture's
+<code>numberFormat.currency.symbol</code> property:
+<pre>
+Globalize.culture( "en-US" ).numberFormat.currency.symbol = '\u20ac'; // euro sign U+20AC
+</pre>
+If you need to switch between currency symbols, you could write a function
+to do that, such as
+<pre>
+function setCurrency( currSym ) {
+  Globalize.culture().numberFormat.currency.symbol = currSym;
+}
+</pre>
+
+<a name="dates"></a>
+<h2 id="dates">Date Formatting</h2>
+<p>
+Date formatting varies wildly by culture, not just in the spelling of month and
+day names, and the date separator, but by the expected order of the various
+date components, whether to use a 12 or 24 hour clock, and how months and days
+are abbreviated. Many cultures even include "genitive" month names, which are
+different from the typical names and are used only in certain cases.
+</p>
+<p>
+Also, each culture has a set of "standard" or "typical" formats. For example,
+in "en-US", when displaying a date in its fullest form, it looks like
+"Saturday, November 05, 1955". Note the non-abbreviated day and month name, the
+zero padded date, and four digit year. So, Globalize expects a certain set
+of "standard" formatting strings for dates in the "patterns" property of the
+"standard" calendar of each culture, that describe specific formats for the
+culture. The third column shows example values in the neutral English culture
+"en-US"; see the second table for the meaning tokens used in date formats.
+
+<pre>
+// just for example - will vary by culture
+Globalize.format( new Date(2012, 1, 20), 'd' ); // 2/20/2012
+Globalize.format( new Date(2012, 1, 20), 'D' ); // Monday, February 20, 2012
+</pre>
+<p>
+
+</p>
+<table>
+<tr>
+  <th>Format</th>
+  <th>Meaning</th>
+  <th>"en-US"</th>
+</tr>
+<tr>
+   <td>f</td>
+   <td>Long Date, Short Time</td>
+   <td>dddd, MMMM dd, yyyy h:mm tt</td>
+</tr>
+<tr>
+   <td>F</td>
+   <td>Long Date, Long Time</td>
+   <td>dddd, MMMM dd, yyyy h:mm:ss tt</td>
+</tr>
+<tr>
+   <td>t</td>
+   <td>Short Time</td>
+   <td>h:mm tt</td>
+</tr>
+<tr>
+   <td>T</td>
+   <td>Long Time</td>
+   <td>h:mm:ss tt</td>
+</tr>
+<tr>
+   <td>d</td>
+   <td>Short Date</td>
+   <td>M/d/yyyy</td>
+</tr>
+<tr>
+   <td>D</td>
+   <td>Long Date</td>
+   <td>dddd, MMMM dd, yyyy</td>
+</tr>
+<tr>
+   <td>Y</td>
+   <td>Month/Year</td>
+   <td>MMMM, yyyy</td>
+</tr>
+<tr>
+   <td>M</td>
+   <td>Month/Day</td>
+   <td>MMMM dd</td>
+</tr>
+</table>
+</p>
+<p>
+In addition to these standard formats, there is the "S" format. This is a
+sortable format that is identical in every culture:
+"<strong>yyyy'-'MM'-'dd'T'HH':'mm':'ss</strong>".
+</p>
+<p>
+When more specific control is needed over the formatting, you may use any
+format you wish by specifying the following custom tokens:
+<table>
+<tr>
+   <th>Token</th>
+   <th>Meaning</th>
+   <th>Example</th>
+</tr>
+<tr>
+   <td>d</td>
+   <td>Day of month (no leading zero)</td>
+   <td>5</td>
+</tr>
+<tr>
+   <td>dd</td>
+   <td>Day of month (leading zero)</td>
+   <td>05</td>
+</tr>
+<tr>
+   <td>ddd</td>
+   <td>Day name (abbreviated)</td>
+   <td>Sat</td>
+</tr>
+<tr>
+   <td>dddd</td>
+   <td>Day name (full)</td>
+   <td>Saturday</td>
+</tr>
+<tr>
+   <td>M</td>
+   <td>Month of year (no leading zero)</td>
+   <td>9</td>
+</tr>
+<tr>
+   <td>MM</td>
+   <td>Month of year (leading zero)</td>
+   <td>09</td>
+</tr>
+<tr>
+   <td>MMM</td>
+   <td>Month name (abbreviated)</td>
+   <td>Sep</td>
+</tr>
+<tr>
+   <td>MMMM</td>
+   <td>Month name (full)</td>
+   <td>September</td>
+</tr>
+<tr>
+   <td>yy</td>
+   <td>Year (two digits)</td>
+   <td>55</td>
+</tr>
+<tr>
+   <td>yyyy</td>
+   <td>Year (four digits)</td>
+   <td>1955</td>
+</tr>
+<tr>
+   <td>'literal'</td>
+   <td>Literal Text</td>
+   <td>'of the clock'</td>
+</tr>
+<tr>
+   <td>\'</td>
+   <td>Single Quote</td>
+   <td>'o'\''clock'</td><!-- o'clock -->
+</tr>
+<tr>
+   <td>m</td>
+   <td>Minutes (no leading zero)</td>
+   <td>9</td>
+</tr>
+<tr>
+   <td>mm</td>
+   <td>Minutes (leading zero)</td>
+   <td>09</td>
+</tr>
+<tr>
+   <td>h</td>
+   <td>Hours (12 hour time, no leading zero)</td>
+   <td>6</td>
+</tr>
+<tr>
+   <td>hh</td>
+   <td>Hours (12 hour time, leading zero)</td>
+   <td>06</td>
+</tr>
+<tr>
+   <td>H</td>
+   <td>Hours (24 hour time, no leading zero)</td>
+   <td>5 (5am) 15 (3pm)</td>
+</tr>
+<tr>
+   <td>HH</td>
+   <td>Hours (24 hour time, leading zero)</td>
+   <td>05 (5am) 15 (3pm)</td>
+</tr>
+<tr>
+   <td>s</td>
+   <td>Seconds (no leading zero)</td>
+   <td>9</td>
+</tr>
+<tr>
+   <td>ss</td>
+   <td>Seconds (leading zero)</td>
+   <td>09</td>
+</tr>
+<tr>
+   <td>f</td>
+   <td>Deciseconds</td>
+   <td>1</td>
+</tr>
+<tr>
+   <td>ff</td>
+   <td>Centiseconds</td>
+   <td>11</td>
+</tr>
+<tr>
+   <td>fff</td>
+   <td>Milliseconds</td>
+   <td>111</td>
+</tr>
+<tr>
+   <td>t</td>
+   <td>AM/PM indicator (first letter)</td>
+   <td>A or P</td>
+</tr>
+<tr>
+   <td>tt</td>
+   <td>AM/PM indicator (full)</td>
+   <td>AM or PM</td>
+</tr>
+<tr>
+   <td>z</td>
+   <td>Timezone offset (hours only, no leading zero)</td>
+   <td>-8</td>
+</tr>
+<tr>
+   <td>zz</td>
+   <td>Timezone offset (hours only, leading zero)</td>
+   <td>-08</td>
+</tr>
+<tr>
+   <td>zzz</td>
+   <td>Timezone offset (full hours/minutes)</td>
+   <td>-08:00</td>
+</tr>
+<tr>
+   <td>g or gg</td>
+   <td>Era name</td>
+   <td>A.D.</td>
+</tr>
+</table>
+</p>
+
+<a name="generating"></a>
+<h1 id="generating">Generating Culture Files</h1>
+
+The Globalize culture files are generated JavaScript containing metadata and
+functions based on culture info in the Microsoft .Net Framework 4.
+
+<h2>Requirements</h2>
+
+<ul>
+	<li>Windows</li>
+	<li>Microsoft .Net Framework 4 (Full, not just Client Profile) <a href="http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7">download dotNetFx40_Full_x86_x64.exe</a></li>
+</ul>
+
+<h2>Building the generator</h2>
+
+1. Open a Windows Command Prompt ( Start -> Run... -> cmd )
+1. Change directory to root of Globalize project (where README.md file is located)
+1. >"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild" generator\generator.csproj
+
+<h2>Running the generator</h2>
+
+1. Open a Windows Command Prompt
+1. Change directory to root of Globalize project (where README.md file is located)
+1. >"generator\bin\Debug\generator.exe"
+
+<a name="building"></a>
+<h1 id="building">Building Globalize</h1>
+
+Globalize is built using <a href="https://github.com/cowboy/grunt">grunt</a>, a
+node-based build utility. First, make sure grunt is installed globally:
+
+<pre>
+> npm install -g grunt
+</pre>
+
+then you can lint and test by simply running grunt in the globalize folder
+
+<pre>
+> cd globalize
+> grunt
+</pre>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.css
new file mode 100644
index 0000000..3b8bc5b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.css
@@ -0,0 +1,80 @@
+body {
+	font-family: Arial
+}
+a {
+	color: #6D929B;
+}
+input {
+	width: 100px;
+	margin: 5px;
+}
+.results  {
+	border-collapse: collapse;
+}
+.results td {
+	border: 1px solid #C1DAD7;
+	padding: 2px 2px 2px 2px;
+	color: #6D929B;
+	font-size: x-small;
+	white-space: nowrap;
+	text-align: center;
+}
+.results th {
+	border: 1px solid #C1DAD7;
+	letter-spacing: 2px;
+	text-align: center;
+	padding: 6px 6px 6px 12px;
+	white-space: nowrap;
+}
+table {
+	width: 100%;
+}
+fieldset.info {
+	width: 45%;
+	float: left;
+}
+.info td {
+	font-size: x-small;
+}
+
+.tab {
+	margin-top: 5px;
+	margin-right: 5px;
+	padding: 2px;
+	cursor: pointer;
+	background-color: #EEEEEE;
+}
+
+.active {
+	border: 1px solid black;
+	float: left;
+}
+
+.inactive {
+	float: left;
+}
+
+.tab.active {
+	font-weight: bold;
+	border: 1px solid black;
+	float: left;
+}
+
+div.inactive {
+	display: none;
+}
+
+div.active {
+	clear: both;
+	min-width: 100%;
+}
+
+.pane {
+	margin-top: 10px;
+	clear: both;
+}
+
+#intro {
+	font-size: x-small;
+	margin-bottom: 10px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.js
new file mode 100644
index 0000000..a639435
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/browser.js
@@ -0,0 +1,115 @@
+(function( $ ) {
+
+$(function() {
+
+    // setup sample data
+    window.numbers = [
+       0, 1, 10, 100, 1000, 10000, 0.1, 0.12, 0.123, 0.1234, 0.12345, 1000.123, 10000.12345,
+          -1, -10, -100, -1000, -10000, -0.1, -0.12, -0.123, -0.1234, -0.12345, -1000.123, -10000.12345
+    ];
+    window.formats = [
+       "n", "n1", "n3", "d", "d2", "d3", "p", "p1", "p3", "c", "c0"
+    ];
+    window.dates = $.map([
+        "Jan 1, 1970 1:34 PM", "Dec 31, 1970 1:34 PM", "Apr 1, 1999 1:34 PM", "Dec 31, 1999 1:34 PM", "Jan 1, 2000 1:34 PM", "Nov 5, 1955 1:34 PM"
+    ], function(d) { return d instanceof Date ? d : new Date(Date.parse(d)); } );
+
+    window.dateFormats = [
+        "d", "D", "f", "F", "M", "S", "t", "T", "Y"
+    ];
+
+    // add template extensions to format numbers and dates declaratively
+    $.extend( $.tmplcmd, {
+        demoFormat: {
+            _default: [0,0],
+            prefix: "_.push(Globalize.format(numbers[$2],formats[$1]));"
+        },
+        demoDateFormat: {
+            _default: [0,0],
+            prefix: "_.push(Globalize.format(dates[$2],typeof $1 === 'number' ? dateFormats[$1] : $1));"
+        }
+    });
+
+    // activate tabs
+    $(".tab").click(function() {
+        $(".active").removeClass("active").addClass("inactive");
+        $("#" + this.id + "content").removeClass("inactive").addClass("active");
+        $(this).removeClass("inactive").addClass("active");
+    });
+
+    // fill cultures dropdown with the available cultures
+    $.each(sortByName(Globalize.cultures), function(i, culture) {
+        $("<option/>", {
+            value: culture.name,
+            text: culture.name + ": " + culture.englishName + " (" + culture.nativeName + ")"
+        }).appendTo("#cultures");
+    });
+
+    // re-render templates after selecting a culture
+    $("#cultures").bind("change keyup", selectCulture)
+        // set default culture to Japanese in Japan
+        .val("ja-JP");
+
+    // re-render templates after selecting a calendar
+    var calendars = $("#calendars").bind("change keyup", function() {
+        Globalize.culture().calendar = Globalize.culture().calendars[calendars.val()] || Globalize.culture().calendars.standard;
+        render();
+    });
+
+    $("#parseDate").change(function() {
+        $("#parseDateResult").text(Globalize.parseDate($(this).val()).toString());
+    });
+    $("#parseNumber").change(function() {
+        $("#parseNumberResult").text(Globalize.parseFloat($(this).val()).toString());
+    });
+
+    function sortByName(map) {
+        // converts a dictionary into a sorted dictionary based on obj.name
+        var arr = [];
+        $.each(map, function(name, value) {
+            arr.push(value);
+        });
+        arr.sort(function(a, b) {
+            return a.name < b.name ? -1 : 1;
+        });
+        return arr;
+    }
+
+    function selectCulture() {
+        // sets the current culture to the value specified in the cultures dropdown,
+        // populates the calendars dropdown with that cultures calendars,
+        // and renders the formatting templates.
+        Globalize.culture($("#cultures").val());
+
+        calendars.empty();
+        $.each(sortByName(Globalize.culture().calendars), function(i, cal) {
+            $("<option/>", { value: cal.name, text: cal.name }).appendTo(calendars);
+        });
+        calendars.val(Globalize.culture().calendar.name);
+
+        render();
+    }
+
+    function render() {
+        $("#dateformat").empty();
+        $("#dateformattmpl").render({}).appendTo("#dateformat");
+
+        $("#format").empty();
+        $("#formattmpl").render({}).appendTo("#format");
+
+        $("#englishName").text(Globalize.culture().englishName);
+        $("#nativeName").text(Globalize.culture().nativeName);
+        $("#isRTL").text(Globalize.culture().isRTL ? "YES" : "no");
+
+        $("#infonumber").empty();
+        $("#infonumbertmpl").render(Globalize.culture().numberFormat).appendTo("#infonumber");
+
+        $("#infodate").empty();
+        $("#infodatetmpl").render(Globalize.culture().calendar).appendTo("#infodate");
+    }
+
+    // initial rendering
+    selectCulture();
+});
+
+}( jQuery ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/index.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/index.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/index.html
new file mode 100644
index 0000000..c7af94d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/index.html
@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<meta charset="UTF-8">
+    <title>Globalization Demo</title>
+    <link type="text/css" rel="Stylesheet" href="browser.css">
+    <script src="../../lib/globalize.js"></script>
+    <script src="../../lib/cultures/globalize.cultures.js"></script>
+    <script src="jquery-1.4.4.js"></script>
+    <script src="jquery.tmpl.js"></script>
+    <script src="browser.js"></script>
+    <script id="formattmpl" type="text/x-jquery-tmpl">
+        <tr>
+            <th>Number</th>
+            {{each formats}}
+            <th>{{=}}</th>
+            {{/each}}
+        </tr>
+        {{each(i) numbers}}
+        <tr class="result">
+            <td>
+                ${numbers[i]}
+            </td>
+            {{each(j) formats}}
+            <td>
+            {{demoFormat(i) j}}
+            </td>
+            {{/each}}
+        </tr>
+        {{/each}}
+    </script>
+    <script id="dateformattmpl" type="text/x-jquery-tmpl">
+        <tr>
+            <th>Date</th>
+            {{each dateFormats}}
+            <th>{{=}}</th>
+            {{/each}}
+        </tr>
+        {{each(i) dates}}
+        <tr class="result">
+            <td>
+				{{=}}
+            </td>
+            {{each(j) dateFormats}}
+            <td>
+            {{demoDateFormat(i) j}}
+            </td>
+            {{/each}}
+        </tr>
+        {{/each}}
+    </script>
+    <script id="infonumbertmpl" type="text/x-jquery-tmpl">
+        <legend>Number Formatting</legend>
+        <table class="info">
+            <tr>
+                <td>Pattern</td>
+                <td>${pattern}</td>
+                <td>Decimals</td>
+                <td>${decimals} (${$data['.']})</td>
+            </tr>
+            <tr>
+                <td>Grouping</td>
+                <td>${$data[',']}</td>
+                <td>Group Size</td>
+                <td>${groupSizes}</td>
+            </tr>
+            <tr>
+                <td>Positive</td>
+                <td>${$data['+']}</td>
+                <td>Negative</td>
+                <td>${$data['-']}</td>
+            </tr>
+            <tr>
+                <td colspan="4" align="center">Percent (symbol = ${percent.symbol})</td>
+            </tr>
+            <tr>
+                <td>Pattern</td>
+                <td>${percent.pattern}</td>
+                <td>Decimals</td>
+                <td>${percent.decimals} (${percent['.']})</td>
+            </tr>
+            <tr>
+                <td>Grouping</td>
+                <td>${percent[',']}</td>
+                <td>Group Size</td>
+                <td>${percent.groupSizes}</td>
+            </tr>
+            <tr>
+                <td colspan="4" align="center">Currency (symbol = ${currency.symbol})</td>
+            </tr>
+            <tr>
+                <td>Pattern</td>
+                <td>${currency.pattern}</td>
+                <td>Decimals</td>
+                <td>${currency.decimals} (${currency['.']})</td>
+            </tr>
+            <tr>
+                <td>Grouping</td>
+                <td>${currency[',']}</td>
+                <td>Group Size</td>
+                <td>${currency.groupSizes}</td>
+            </tr>
+        </table>
+    </script>
+    <script id="infodatetmpl" type="text/x-jquery-tmpl">
+        <legend>Date Formatting</legend>
+        <table class="info">
+            <tr>
+                <td>Name</td>
+                <td colspan="3">${name}</td>
+            </tr>
+            <tr>
+                <td>AM</td>
+                <td>${AM}</td>
+                <td>PM</td>
+                <td>${PM}</td>
+            </tr>
+            <tr>
+                <td>Eras</td>
+                <td colspan="3">
+                    <ol>
+                    {{each eras}}
+                    <li>${name} (year offset ${offset})</li>
+                    {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            <tr>
+                <td>Days</td>
+                <td colspan="3">
+                    <ol>
+                        {{each days.names}}
+                        <li>{{=}}</li>
+                        {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            <tr>
+                <td>Days (abbreviated)</td>
+                <td colspan="3">
+                    <ol>
+                        {{each days.namesAbbr}}
+                        <li>{{=}}</li>
+                        {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            <tr>
+                <td>Days (shortest)</td>
+                <td colspan="3">
+                    <ol>
+                        {{each days.namesShort}}
+                        <li>{{=}}</li>
+                        {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            <tr>
+                <td>Months</td>
+                <td colspan="3">
+                    <ol>
+                        {{each months.names}}
+                        <li>{{=}}</li>
+                        {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            <tr>
+                <td>Months (abbreviated)</td>
+                <td colspan="3">
+                    <ol>
+                        {{each months.namesAbbr}}
+                        <li>{{=}}</li>
+                        {{/each}}
+                    </ol>
+                </td>
+            </tr>
+            {{if typeof monthsGenitive !== 'undefined'}}
+            <tr>
+                <td>Months (Genitive)</td>
+                <td>${monthsGenitive.names}</td>
+                <td>Months (Abbr. Gen.)</td>
+                <td>${monthsGenitive.namesAbbr}</td>
+            </tr>
+            {{/if}}
+            <tr>
+                <td align="center" colspan="4">Patterns</td>
+            </tr>
+            {{each(n,v) patterns}}
+            <tr>
+                <td>${n}</td>
+                <td colspan="3">{{=}}</td>
+            </tr>
+            {{/each}}
+        </table>
+    </script>
+</head>
+
+<body>
+<div id="intro">
+This is a demo of the Globalize library. You can follow the discussion and provide feedback on the planning page, here:
+<br/><a href="http://wiki.jqueryui.com/Globalization">Globalization wiki page</a>
+<br/>
+And you can view the source from here or keep up to date with it on github, here:
+<br/><a href="https://github.com/jquery/globalize/">Globalize on GitHub</a>
+</div>
+
+<div>
+    Culture:
+    <select id="cultures"></select>
+</div>
+<div>
+    Calendar:
+    <select id="calendars"></select>
+</div>
+
+<div class="pane">
+    <span class="tab active" id="dates">Dates</span>
+    <span class="tab inactive" id="numbers">Numbers</span>
+    <span class="tab inactive" id="info">Info</span>
+
+    <div id="datescontent" class="active">
+        <table id="dateformat" class="results">
+        </table>
+        <b>Parsing:</b> Type a date in one of the culture formats:
+        <input id="parseDate" type="text" /><span id="parseDateResult"></span>
+    </div>
+
+    <div id="numberscontent" class="inactive">
+        <table id="format" class="results">
+        </table>
+        <b>Parsing:</b> Type a number using the culture group and decimal separators:
+        <input id="parseNumber" type="text" /><span id="parseNumberResult"></span>
+    </div>
+
+    <div id="infocontent" class="inactive">
+        <p>
+            Name (in English) "<span id="englishName"></span>"<br />
+            Name (in Native Language) "<span id="nativeName"></span>".<br />
+            Is RTL culture? <span id="isRTL"></span>.
+        </p>
+        <fieldset id="infonumber" class="info">
+        </fieldset>
+        <fieldset id="infodate" class="info">
+        </fieldset>
+    </div>
+
+</div>
+
+<div class="pane">
+
+Interesting cultures to preview:
+<ul>
+    <li>ja-JP: Has an optional calendar that has 4 different eras.</li>
+    <li>th-TH: Standard calendar has a year offset.</li>
+    <li>te-IN: Numbers have unequal groupings.</li>
+    <li>ar-SA: Standard calendar is UmAlQura, a non-gregorian based calendar that requires custom conversion logic.
+    It also supports the Hijri calendar, and a standard gregorian calendar translated into one of <i>4 languages</i>.
+    </li>
+</ul>
+
+</div>
+
+</body>
+</html>


[61/61] [abbrv] ambari git commit: AMBARI-15679. Logsearch Rest API support (rnettleton via oleewre)

Posted by ol...@apache.org.
AMBARI-15679. Logsearch Rest API support (rnettleton via oleewre)


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

Branch: refs/heads/branch-dev-logsearch
Commit: c3a856e3370b3d921d2cc0c32f8d6489d722352e
Parents: cb6a7b9
Author: oleewere <ol...@gmail.com>
Authored: Sat Apr 9 12:04:25 2016 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Sat Apr 9 12:04:25 2016 +0200

----------------------------------------------------------------------
 .../resources/LoggingResourceDefinition.java    |  44 +++
 .../resources/ResourceInstanceFactoryImpl.java  |   4 +
 .../server/api/services/ClusterService.java     |  14 +
 .../server/api/services/LoggingService.java     | 232 ++++++++++++++
 .../AbstractControllerResourceProvider.java     |   2 +
 .../internal/AbstractProviderModule.java        |  14 +-
 .../internal/LoggingResourceProvider.java       | 145 +++++++++
 .../logging/HostComponentLoggingInfo.java       |  55 ++++
 .../logging/LogFileDefinitionInfo.java          |  84 +++++
 .../server/controller/logging/LogFileType.java  |  33 ++
 .../controller/logging/LogLineResult.java       | 315 +++++++++++++++++++
 .../controller/logging/LogQueryResponse.java    | 123 ++++++++
 .../logging/LoggingRequestHelper.java           |  29 ++
 .../logging/LoggingRequestHelperFactory.java    |  35 +++
 .../LoggingRequestHelperFactoryImpl.java        |  82 +++++
 .../logging/LoggingRequestHelperImpl.java       | 202 ++++++++++++
 .../logging/LoggingSearchPropertyProvider.java  | 187 +++++++++++
 .../ambari/server/controller/spi/Resource.java  |   5 +-
 .../src/main/resources/key_properties.json      |   3 +
 .../controller/logging/LogLineResultTest.java   | 135 ++++++++
 .../logging/LogQueryResponseTest.java           | 226 +++++++++++++
 .../LoggingRequestHelperFactoryImplTest.java    | 133 ++++++++
 .../LoggingSearchPropertyProviderTest.java      | 170 ++++++++++
 23 files changed, 2266 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LoggingResourceDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LoggingResourceDefinition.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LoggingResourceDefinition.java
new file mode 100644
index 0000000..b2c1a94
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/LoggingResourceDefinition.java
@@ -0,0 +1,44 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.api.resources;
+
+
+import org.apache.ambari.server.controller.spi.Resource;
+
+import java.util.Collections;
+import java.util.Set;
+
+public class LoggingResourceDefinition extends BaseResourceDefinition {
+
+  public LoggingResourceDefinition() {
+    super(Resource.Type.LoggingQuery);
+  }
+
+
+  @Override
+  public String getPluralName() {
+    return "logging";
+  }
+
+  @Override
+  public String getSingularName() {
+    return "logging";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
index c711bed..eed2703 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/ResourceInstanceFactoryImpl.java
@@ -429,6 +429,10 @@ public class ResourceInstanceFactoryImpl implements ResourceInstanceFactory {
         resourceDefinition = new SimpleResourceDefinition(Resource.Type.ClusterKerberosDescriptor, "kerberos_descriptor", "kerberos_descriptors");
         break;
 
+      case LoggingQuery:
+        resourceDefinition = new LoggingResourceDefinition();
+        break;
+
       default:
         throw new IllegalArgumentException("Unsupported resource type: " + type);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
index 371411d..072c4a2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java
@@ -651,6 +651,20 @@ public class ClusterService extends BaseService {
     return new ClusterKerberosDescriptorService(clusterName);
   }
 
+  /**
+   * Gets the Logging Service
+   *
+   * @param request the request
+   * @param clusterName the cluster name
+   *
+   * @return a new instance of the LoggingService
+   */
+  @Path("{clusterName}/logging")
+  public LoggingService getLogging(@Context javax.ws.rs.core.Request request,
+                                   @PathParam("clusterName") String clusterName) {
+    return new LoggingService(clusterName);
+  }
+
   // ----- helper methods ----------------------------------------------------
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
new file mode 100644
index 0000000..08ec06e
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/LoggingService.java
@@ -0,0 +1,232 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.api.services;
+
+import org.apache.ambari.server.api.resources.ResourceInstance;
+import org.apache.ambari.server.api.services.serializers.ResultSerializer;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariServer;
+import org.apache.ambari.server.controller.internal.ResourceImpl;
+import org.apache.ambari.server.controller.logging.LogQueryResponse;
+import org.apache.ambari.server.controller.logging.LoggingRequestHelper;
+import org.apache.ambari.server.controller.logging.LoggingRequestHelperFactory;
+import org.apache.ambari.server.controller.logging.LoggingRequestHelperFactoryImpl;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.utils.RetryHelper;
+import org.apache.log4j.Logger;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * This Service provides access to the LogSearch query services, including:
+ *     - Access to all service log files in a given cluster
+ *     - Search query capability across the service logs
+ *     - Metrics data regarding logging (log level counts, etc)
+ *
+ */
+public class LoggingService extends BaseService {
+
+  private static final Logger LOG = Logger.getLogger(LoggingService.class);
+
+  public static final String LOGSEARCH_SITE_CONFIG_TYPE_NAME = "logsearch-site";
+
+  public static final String LOGSEARCH_SERVICE_NAME = "LOGSEARCH";
+
+  public static final String LOGSEARCH_SERVER_COMPONENT_NAME = "LOGSEARCH_SERVER";
+
+  private final ControllerFactory controllerFactory;
+
+  private final LoggingRequestHelperFactory helperFactory;
+
+
+  private final String clusterName;
+
+  public LoggingService(String clusterName) {
+    this(clusterName, new DefaultControllerFactory(), new LoggingRequestHelperFactoryImpl());
+  }
+
+  public LoggingService(String clusterName, ControllerFactory controllerFactory, LoggingRequestHelperFactory helperFactory) {
+    this.clusterName = clusterName;
+    this.controllerFactory = controllerFactory;
+    this.helperFactory = helperFactory;
+  }
+
+  @GET
+  @Produces("text/plain")
+  public Response getLogSearchResource(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+    return handleRequest(headers, body, uri,  Request.Type.GET, createLoggingResource());
+  }
+
+  @GET
+  @Path("searchEngine")
+  @Produces("text/plain")
+  public Response getSearchEngine(String body, @Context HttpHeaders headers, @Context UriInfo uri) {
+    //TODO, fix this cast after testing,RWN
+    return handleDirectRequest(headers, body, uri,  Request.Type.GET, (MediaType)null);
+  }
+
+  @GET
+  @Path("levelCount")
+  @Produces("text/plain")
+  public Response getLevelCountForCluster(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
+    throw new IllegalStateException("not implemented yet");
+  }
+
+  @GET
+  @Path("graphing")
+  @Produces("text/plain")
+  public Response getGraphData(String body, @Context HttpHeaders headers, @Context UriInfo ui) {
+    throw new IllegalStateException("not implemented yet");
+  }
+
+
+  private ResourceInstance createLoggingResource() {
+    return createResource(Resource.Type.LoggingQuery,
+      Collections.singletonMap(Resource.Type.LoggingQuery, "logging"));
+  }
+
+
+  /**
+   * Handling method for REST services that don't require the QueryParameter and
+   * partial-response syntax support provided by the Ambari REST framework.
+   *
+   * In the case of the LoggingService, the query parameters passed to the search engine must
+   * be preserved, since they are passed to the LogSearch REST API.
+   *
+   * @param headers
+   * @param body
+   * @param uriInfo
+   * @param requestType
+   * @param mediaType
+   * @return
+   */
+  protected Response handleDirectRequest(HttpHeaders headers, String body, UriInfo uriInfo, Request.Type requestType, MediaType mediaType) {
+
+    MultivaluedMap<String, String> queryParameters =
+      uriInfo.getQueryParameters();
+
+    Map<String, String> enumeratedQueryParameters =
+      new HashMap<String, String>();
+
+
+    for (String queryName : queryParameters.keySet()) {
+      List<String> queryValue = queryParameters.get(queryName);
+      for (String value : queryValue) {
+        enumeratedQueryParameters.put(queryName, value);
+      }
+    }
+
+    AmbariManagementController controller =
+      controllerFactory.getController();
+
+    LoggingRequestHelper requestHelper =
+      helperFactory.getHelper(controller, clusterName);
+
+    LogQueryResponse response =
+      requestHelper.sendQueryRequest(enumeratedQueryParameters);
+
+    if (response != null) {
+      ResultSerializer serializer = mediaType == null ? getResultSerializer() : getResultSerializer(mediaType);
+
+      Result result = new ResultImpl(new ResultStatus(ResultStatus.STATUS.OK));
+
+      Resource loggingResource = new ResourceImpl(Resource.Type.LoggingQuery);
+      // include the top-level query result properties
+      loggingResource.setProperty("startIndex", response.getStartIndex());
+      loggingResource.setProperty("pageSize", response.getPageSize());
+      loggingResource.setProperty("resultSize", response.getResultSize());
+      loggingResource.setProperty("queryTimeMMS", response.getQueryTimeMS());
+      loggingResource.setProperty("totalCount", response.getTotalCount());
+
+      // include the individual responses
+      loggingResource.setProperty("logList", response.getListOfResults());
+
+      result.getResultTree().addChild(loggingResource, "logging");
+
+      Response.ResponseBuilder builder = Response.status(result.getStatus().getStatusCode()).entity(
+        serializer.serialize(result));
+
+
+      if (mediaType != null) {
+        builder.type(mediaType);
+      }
+
+      RetryHelper.clearAffectedClusters();
+      return builder.build();
+    }
+
+
+
+    //TODO, add error handling and logging here, RWN
+    return null;
+  }
+
+
+  /**
+   * Internal interface that defines an access factory for the
+   * AmbariManagementController.  This facilitates simpler unit testing.
+   *
+   */
+  interface ControllerFactory {
+    AmbariManagementController getController();
+  }
+
+  /**
+   * Default implementation of the internal ControllerFactory interface,
+   * which uses the AmbariServer static method to obtain the controller.
+   */
+  private static class DefaultControllerFactory implements ControllerFactory {
+    @Override
+    public AmbariManagementController getController() {
+      return AmbariServer.getController();
+    }
+  }
+
+  private static class LogSearchConnectionInfo {
+
+    private final String hostName;
+    private final String portNumber;
+
+    public LogSearchConnectionInfo(String hostName, String portNumber) {
+      this.hostName = hostName;
+      this.portNumber = portNumber;
+    }
+
+    public String getHostName() {
+      return this.hostName;
+    }
+
+    public String getPortNumber() {
+      return this.portNumber;
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
index f24da8d..3721113 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractControllerResourceProvider.java
@@ -223,6 +223,8 @@ public abstract class AbstractControllerResourceProvider extends AbstractAuthori
         return new VersionDefinitionResourceProvider();
       case ClusterKerberosDescriptor:
         return new ClusterKerberosDescriptorResourceProvider(managementController);
+      case LoggingQuery:
+        return new LoggingResourceProvider(propertyIds, keyPropertyIds, managementController);
       default:
         throw new IllegalArgumentException("Unknown type " + type);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index ca491f2..4ce974d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -30,6 +30,7 @@ import org.apache.ambari.server.controller.ServiceComponentHostRequest;
 import org.apache.ambari.server.controller.ServiceComponentHostResponse;
 import org.apache.ambari.server.controller.jmx.JMXHostProvider;
 import org.apache.ambari.server.controller.jmx.JMXPropertyProvider;
+import org.apache.ambari.server.controller.logging.LoggingSearchPropertyProvider;
 import org.apache.ambari.server.controller.metrics.MetricHostProvider;
 import org.apache.ambari.server.controller.metrics.MetricsPropertyProvider;
 import org.apache.ambari.server.controller.metrics.MetricsReportPropertyProvider;
@@ -800,11 +801,14 @@ public abstract class AbstractProviderModule implements ProviderModule,
               gpp));
 
           providers.add(new HttpPropertyProvider(streamProvider,
-              managementController.getClusters(),
-              PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
-              PropertyHelper.getPropertyId("HostRoles", "host_name"),
-              PropertyHelper.getPropertyId("HostRoles", "component_name"),
-              HTTP_PROPERTY_REQUESTS));
+            managementController.getClusters(),
+            PropertyHelper.getPropertyId("HostRoles", "cluster_name"),
+            PropertyHelper.getPropertyId("HostRoles", "host_name"),
+            PropertyHelper.getPropertyId("HostRoles", "component_name"),
+            HTTP_PROPERTY_REQUESTS));
+
+          //TODO, this may need to be conditional based on the presence/absence of LogSearch
+          providers.add(new LoggingSearchPropertyProvider());
         }
         break;
         case RootServiceComponent:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
new file mode 100644
index 0000000..f2e07bd
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LoggingResourceProvider.java
@@ -0,0 +1,145 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.logging.LogQueryResponse;
+import org.apache.ambari.server.controller.logging.LoggingRequestHelperImpl;
+import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
+import org.apache.ambari.server.controller.spi.NoSuchResourceException;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class LoggingResourceProvider extends AbstractControllerResourceProvider {
+
+  private static final String LOGGING_SEARCH_SERVICE_PROPERTY_ID = PropertyHelper.getPropertyId("Logging", "search_service_name");
+  private static final String LOGGING_SEARCH_TERM_PROPERTY_ID = PropertyHelper.getPropertyId("Logging", "searchTerm");
+  private static final String LOGGING_COMPONENT_PROPERTY_ID = PropertyHelper.getPropertyId("Logging", "component");
+
+  private static final Set<String> PROPERTY_IDS;
+
+  private static final Map<Resource.Type, String> KEY_PROPERTY_IDS;
+
+  static {
+    Set<String> localSet = new HashSet<String>();
+    localSet.add(LOGGING_SEARCH_SERVICE_PROPERTY_ID);
+    localSet.add(LOGGING_SEARCH_TERM_PROPERTY_ID);
+    localSet.add(LOGGING_COMPONENT_PROPERTY_ID);
+
+    PROPERTY_IDS = Collections.unmodifiableSet(localSet);
+
+    Map<Resource.Type, String> localMap =
+      new HashMap<Resource.Type, String>();
+
+    localMap.put(Resource.Type.LoggingQuery, LOGGING_SEARCH_SERVICE_PROPERTY_ID);
+    KEY_PROPERTY_IDS = Collections.unmodifiableMap(localMap);
+
+  }
+
+
+  public LoggingResourceProvider(Set<String> propertyIds,
+                                 Map<Resource.Type, String> keyPropertyIds,
+                                 AmbariManagementController controller) {
+
+
+
+    super(PROPERTY_IDS, KEY_PROPERTY_IDS, controller);
+  }
+
+  @Override
+  protected Set<String> getPKPropertyIds() {
+    return Collections.emptySet();
+  }
+
+  @Override
+  public Set<Resource> getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
+    // just a simple text resource for now, to describe the logging service
+    Resource resource = new ResourceImpl(Resource.Type.LoggingQuery);
+    setResourceProperty(resource, LOGGING_SEARCH_SERVICE_PROPERTY_ID, "logging", getRequestPropertyIds(request, predicate));
+
+    LoggingRequestHelperImpl requestHelper =
+      new LoggingRequestHelperImpl();
+
+    Map<String, String> queryParameters =
+      new HashMap<String, String>();
+
+    queryParameters.put("level", "ERROR");
+
+    LogQueryResponse response =
+      requestHelper.sendQueryRequest(queryParameters);
+
+    // include the top-level query result properties
+    resource.setProperty("startIndex", response.getStartIndex());
+    resource.setProperty("pageSize", response.getPageSize());
+    resource.setProperty("resultSize", response.getResultSize());
+    resource.setProperty("queryTimeMMS", response.getQueryTimeMS());
+    resource.setProperty("totalCount", response.getTotalCount());
+
+    // include the individual responses
+    resource.setProperty("logList", response.getListOfResults());
+
+    return Collections.singleton(resource);
+  }
+
+  private static List<Map<String, String>> createTestData(Resource resource) {
+    // just create some test data for verifying basic resource code, not an actual result
+    Map<String, String> levelCounts = new HashMap<String, String>();
+    levelCounts.put("INFO", "100");
+    levelCounts.put("WARN", "250");
+    levelCounts.put("DEBUG", "300");
+
+    resource.setProperty("logLevels", levelCounts);
+
+    List<Map <String, String>> listOfResults = new LinkedList<Map<String, String>>();
+    Map<String, String> resultOne = new HashMap<String, String>();
+    resultOne.put("data", "This is a test sentence.");
+    resultOne.put("score", "100");
+    resultOne.put("level", "INFO");
+    resultOne.put("type", "hdfs_namenode");
+    resultOne.put("host", "c6401.ambari.apache.org");
+    resultOne.put("LoggerName", "NameNodeLogger");
+
+    listOfResults.add(resultOne);
+    return listOfResults;
+  }
+
+  @Override
+  public Set<String> checkPropertyIds(Set<String> propertyIds) {
+    Set<String> unSupportedProperties =
+      super.checkPropertyIds(propertyIds);
+
+    unSupportedProperties.remove("searchTerm");
+
+    return unSupportedProperties;
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/HostComponentLoggingInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/HostComponentLoggingInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/HostComponentLoggingInfo.java
new file mode 100644
index 0000000..516c322
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/HostComponentLoggingInfo.java
@@ -0,0 +1,55 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+public class HostComponentLoggingInfo {
+
+  private String componentName;
+
+  private List<LogFileDefinitionInfo> listOfLogFileDefinitions;
+
+
+  public HostComponentLoggingInfo() {
+  }
+
+  @JsonProperty("name")
+  public String getComponentName() {
+    return componentName;
+  }
+
+  @JsonProperty("name")
+  public void setComponentName(String componentName) {
+    this.componentName = componentName;
+  }
+
+  @JsonProperty("logs")
+  public List<LogFileDefinitionInfo> getListOfLogFileDefinitions() {
+    return listOfLogFileDefinitions;
+  }
+
+  @JsonProperty("logs")
+  public void setListOfLogFileDefinitions(List<LogFileDefinitionInfo> listOfLogFileDefinitions) {
+    this.listOfLogFileDefinitions = listOfLogFileDefinitions;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileDefinitionInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileDefinitionInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileDefinitionInfo.java
new file mode 100644
index 0000000..12fa1ab
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileDefinitionInfo.java
@@ -0,0 +1,84 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class LogFileDefinitionInfo {
+
+  private String logFileName;
+
+  private LogFileType logFileType;
+
+  private String searchEngineURL;
+
+  private String logFileTailURL;
+
+  // default, no args constructor, required for Jackson usage
+  public LogFileDefinitionInfo() {
+  }
+
+  protected LogFileDefinitionInfo(String logFileName, LogFileType logFileType, String searchEngineURL, String logFileTailURL) {
+    this.logFileName = logFileName;
+    this.logFileType = logFileType;
+    this.searchEngineURL = searchEngineURL;
+    this.logFileTailURL = logFileTailURL;
+  }
+
+  @JsonProperty("name")
+  public String getLogFileName() {
+    return logFileName;
+  }
+
+  @JsonProperty("name")
+  public void setLogFileName(String logFileName) {
+    this.logFileName = logFileName;
+  }
+
+  @JsonProperty("type")
+  public LogFileType getLogFileType() {
+    return logFileType;
+  }
+
+  @JsonProperty("type")
+  public void setLogFileType(LogFileType logFileType) {
+    this.logFileType = logFileType;
+  }
+
+  @JsonProperty("searchEngineURL")
+  public String getSearchEngineURL() {
+    return searchEngineURL;
+  }
+
+  @JsonProperty("searchEngineURL")
+  public void setSearchEngineURL(String searchEngineURL) {
+    this.searchEngineURL = searchEngineURL;
+  }
+
+  @JsonProperty("logFileTailURL")
+  public String getLogFileTailURL() {
+    return logFileTailURL;
+  }
+
+  @JsonProperty("logFileTailURL")
+  public void setLogFileTailURL(String logFileTailURL) {
+    this.logFileTailURL = logFileTailURL;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileType.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileType.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileType.java
new file mode 100644
index 0000000..3914f8d
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogFileType.java
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+
+/**
+ * Simple Enumerated type to describe the type of log file, as defined by LogSearch.
+ *
+ */
+public enum LogFileType {
+
+  // service logs include most log files in Hadoop
+  SERVICE,
+  // audit logs include security access information, not normally enabled by default
+  AUDIT
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
new file mode 100644
index 0000000..b6ab6bd
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogLineResult.java
@@ -0,0 +1,315 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class represents a single entry from a LogSearch query.
+ *
+ */
+public class LogLineResult {
+
+  private final Map<String, String> mapOfLogLineProperties =
+    new HashMap<String, String>();
+
+  private String clusterName;
+
+  private String logMethod;
+
+  private String logLevel;
+
+  private String eventCount;
+
+  private String ipAddress;
+
+  private String componentType;
+
+  private String sequenceNumber;
+
+  private String logFilePath;
+
+  private String sourceFile;
+
+  private String sourceFileLineNumber;
+
+  private String hostName;
+
+  private String logMessage;
+
+  private String loggerName;
+
+  private String id;
+
+  private String messageMD5;
+
+  private String logTime;
+
+  private String eventMD5;
+
+  private String logFileLineNumber;
+
+  private String ttl;
+
+  private String expirationTime;
+
+  private String version;
+
+  private String thread_name;
+
+  public LogLineResult() {
+
+  }
+
+  public LogLineResult(Map<String, String> propertiesMap) {
+    mapOfLogLineProperties.putAll(propertiesMap);
+  }
+
+  public String getProperty(String propertyName) {
+    return mapOfLogLineProperties.get(propertyName);
+  }
+
+  public boolean doesPropertyExist(String propertyName) {
+    return mapOfLogLineProperties.containsKey(propertyName);
+  }
+
+
+  @JsonProperty("cluster")
+  public String getClusterName() {
+    return clusterName;
+  }
+
+  @JsonProperty("cluster")
+  public void setClusterName(String clusterName) {
+    this.clusterName = clusterName;
+  }
+
+  @JsonProperty("method")
+  public String getLogMethod() {
+    return logMethod;
+  }
+
+  @JsonProperty("method")
+  public void setLogMethod(String logMethod) {
+    this.logMethod = logMethod;
+  }
+
+  @JsonProperty("level")
+  public String getLogLevel() {
+    return logLevel;
+  }
+
+  @JsonProperty("level")
+  public void setLogLevel(String logLevel) {
+    this.logLevel = logLevel;
+  }
+
+  @JsonProperty("event_count")
+  public String getEventCount() {
+    return eventCount;
+  }
+
+  @JsonProperty("event_count")
+  public void setEventCount(String eventCount) {
+    this.eventCount = eventCount;
+  }
+
+  @JsonProperty("ip")
+  public String getIpAddress() {
+    return ipAddress;
+  }
+
+  @JsonProperty("ip")
+  public void setIpAddress(String ipAddress) {
+    this.ipAddress = ipAddress;
+  }
+
+  @JsonProperty("type")
+  public String getComponentType() {
+    return componentType;
+  }
+
+  @JsonProperty("type")
+  public void setComponentType(String componentType) {
+    this.componentType = componentType;
+  }
+
+  @JsonProperty("seq_num")
+  public String getSequenceNumber() {
+    return sequenceNumber;
+  }
+
+  @JsonProperty("seq_num")
+  public void setSequenceNumber(String sequenceNumber) {
+    this.sequenceNumber = sequenceNumber;
+  }
+
+  @JsonProperty("path")
+  public String getLogFilePath() {
+    return logFilePath;
+  }
+
+  @JsonProperty("path")
+  public void setLogFilePath(String logFilePath) {
+    this.logFilePath = logFilePath;
+  }
+
+  @JsonProperty("file")
+  public String getSourceFile() {
+    return sourceFile;
+  }
+
+  @JsonProperty("file")
+  public void setSourceFile(String sourceFile) {
+    this.sourceFile = sourceFile;
+  }
+
+  @JsonProperty("line_number")
+  public String getSourceFileLineNumber() {
+    return sourceFileLineNumber;
+  }
+
+  @JsonProperty("line_number")
+  public void setSourceFileLineNumber(String sourceFileLineNumber) {
+    this.sourceFileLineNumber = sourceFileLineNumber;
+  }
+
+  @JsonProperty("host")
+  public String getHostName() {
+    return hostName;
+  }
+
+  @JsonProperty("host")
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  @JsonProperty("log_message")
+  public String getLogMessage() {
+    return logMessage;
+  }
+
+  @JsonProperty("log_message")
+  public void setLogMessage(String logMessage) {
+    this.logMessage = logMessage;
+  }
+
+  @JsonProperty("logger_name")
+  public String getLoggerName() {
+    return loggerName;
+  }
+
+  @JsonProperty("logger_name")
+  public void setLoggerName(String loggerName) {
+    this.loggerName = loggerName;
+  }
+
+  @JsonProperty("id")
+  public String getId() {
+    return id;
+  }
+
+  @JsonProperty("id")
+  public void setId(String id) {
+    this.id = id;
+  }
+
+  @JsonProperty("message_md5")
+  public String getMessageMD5() {
+    return messageMD5;
+  }
+
+  @JsonProperty("message_md5")
+  public void setMessageMD5(String messageMD5) {
+    this.messageMD5 = messageMD5;
+  }
+
+  @JsonProperty("logtime")
+  public String getLogTime() {
+    return logTime;
+  }
+
+  @JsonProperty("logtime")
+  public void setLogTime(String logTime) {
+    this.logTime = logTime;
+  }
+
+  @JsonProperty("event_md5")
+  public String getEventMD5() {
+    return eventMD5;
+  }
+
+  @JsonProperty("event_md5")
+  public void setEventMD5(String eventMD5) {
+    this.eventMD5 = eventMD5;
+  }
+
+  @JsonProperty("logfile_line_number")
+  public String getLogFileLineNumber() {
+    return logFileLineNumber;
+  }
+
+  @JsonProperty("logfile_line_number")
+  public void setLogFileLineNumber(String logFileLineNumber) {
+    this.logFileLineNumber = logFileLineNumber;
+  }
+
+  @JsonProperty("_ttl_")
+  public String getTtl() {
+    return ttl;
+  }
+
+  @JsonProperty("_ttl_")
+  public void setTtl(String ttl) {
+    this.ttl = ttl;
+  }
+
+  @JsonProperty("_expire_at_")
+  public String getExpirationTime() {
+    return expirationTime;
+  }
+
+  @JsonProperty("_expire_at_")
+  public void setExpirationTime(String expirationTime) {
+    this.expirationTime = expirationTime;
+  }
+
+  @JsonProperty("_version_")
+  public String getVersion() {
+    return version;
+  }
+
+  @JsonProperty("_version_")
+  public void setVersion(String version) {
+    this.version = version;
+  }
+
+  @JsonProperty("thread_name")
+  public String getThreadName() {
+    return thread_name;
+  }
+
+  @JsonProperty("thread_name")
+  public void setThreadName(String thread_name) {
+    this.thread_name = thread_name;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogQueryResponse.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogQueryResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogQueryResponse.java
new file mode 100644
index 0000000..9bde7a5
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogQueryResponse.java
@@ -0,0 +1,123 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.util.JSONPObject;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * This class respresents the results of a LogSearch query, as returned by
+ * a call to the LogSearch service.
+ *
+ */
+public class LogQueryResponse {
+
+
+  private String startIndex;
+
+  private String pageSize;
+
+  private String totalCount;
+
+  private String resultSize;
+
+  private String queryTimeMS;
+
+
+  private List<LogLineResult> listOfResults;
+
+  private StringBuffer resultString;
+
+  public LogQueryResponse() {
+
+  }
+
+  public LogQueryResponse(StringBuffer resultString) {
+    this.resultString = resultString;
+  }
+
+  @JsonProperty("logList")
+  public List<LogLineResult> getListOfResults() {
+    return listOfResults;
+  }
+
+  @JsonProperty("logList")
+  public void setLogList(List<LogLineResult> logList) {
+    this.listOfResults = logList;
+  }
+
+  @JsonProperty("startIndex")
+  public String getStartIndex() {
+    return startIndex;
+  }
+
+  @JsonProperty("startIndex")
+  public void setStartIndex(String startIndex) {
+    this.startIndex = startIndex;
+  }
+
+  @JsonProperty("pageSize")
+  public String getPageSize() {
+    return pageSize;
+  }
+
+  @JsonProperty("pageSize")
+  public void setPageSize(String pageSize) {
+    this.pageSize = pageSize;
+  }
+
+  @JsonProperty("totalCount")
+  public String getTotalCount() {
+    return totalCount;
+  }
+
+  @JsonProperty("totalCount")
+  public void setTotalCount(String totalCount) {
+    this.totalCount = totalCount;
+  }
+
+  @JsonProperty("resultSize")
+  public String getResultSize() {
+    return resultSize;
+  }
+
+  @JsonProperty("resultSize")
+  public void setResultSize(String resultSize) {
+    this.resultSize = resultSize;
+  }
+
+  @JsonProperty("queryTimeMS")
+  public String getQueryTimeMS() {
+    return queryTimeMS;
+  }
+
+  @JsonProperty("queryTimeMS")
+  public void setQueryTimeMS(String queryTimeMS) {
+    this.queryTimeMS = queryTimeMS;
+  }
+
+  public StringBuffer getResultString() {
+    return resultString;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelper.java
new file mode 100644
index 0000000..c1fe1d2
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelper.java
@@ -0,0 +1,29 @@
+package org.apache.ambari.server.controller.logging;
+
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+public interface LoggingRequestHelper {
+
+  public LogQueryResponse sendQueryRequest(Map<String, String> queryParameters);
+
+  public Set<String> sendGetLogFileNamesRequest(String componentName, String hostName);
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactory.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactory.java
new file mode 100644
index 0000000..5ccab6f
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactory.java
@@ -0,0 +1,35 @@
+package org.apache.ambari.server.controller.logging;
+
+import org.apache.ambari.server.controller.AmbariManagementController;
+
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+public interface LoggingRequestHelperFactory {
+
+  /**
+   * Obtain a new instance of a LoggingRequestHelper, which can
+   * be used to connect to the given cluster
+   * @param ambariManagementController
+   * @param clusterName name of cluster that includes a LogSearch deployment
+   *
+   * @return an instance of LoggingRequestHelper that can be used to
+   *         connect to this cluster's LogSearch service
+   */
+  LoggingRequestHelper getHelper(AmbariManagementController ambariManagementController, String clusterName);
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImpl.java
new file mode 100644
index 0000000..69d4f3c
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperFactoryImpl.java
@@ -0,0 +1,82 @@
+/**
+ * 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.
+ */
+package org.apache.ambari.server.controller.logging;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ServiceComponentHost;
+import org.apache.log4j.Logger;
+
+import java.util.List;
+
+public class LoggingRequestHelperFactoryImpl implements LoggingRequestHelperFactory {
+
+  private static final Logger LOG = Logger.getLogger(LoggingRequestHelperFactoryImpl.class);
+
+  private static final String LOGSEARCH_SITE_CONFIG_TYPE_NAME = "logsearch-site";
+
+  private static final String LOGSEARCH_SERVICE_NAME = "LOGSEARCH";
+
+  private static final String LOGSEARCH_SERVER_COMPONENT_NAME = "LOGSEARCH_SERVER";
+
+  private static final String LOGSEARCH_UI_PORT_PROPERTY_NAME = "logsearch.ui.port";
+
+
+  @Override
+  public LoggingRequestHelper getHelper(AmbariManagementController ambariManagementController, String clusterName) {
+    Clusters clusters =
+      ambariManagementController.getClusters();
+
+    try {
+      Cluster cluster = clusters.getCluster(clusterName);
+      if (cluster != null) {
+        Config logSearchSiteConfig =
+          cluster.getDesiredConfigByType(LOGSEARCH_SITE_CONFIG_TYPE_NAME);
+
+        List<ServiceComponentHost> listOfMatchingHosts =
+          cluster.getServiceComponentHosts(LOGSEARCH_SERVICE_NAME, LOGSEARCH_SERVER_COMPONENT_NAME);
+
+        if (listOfMatchingHosts.size() == 0) {
+          LOG.info("No matching LOGSEARCH_SERVER instances found, this may indicate a deployment problem.  Please verify that LogSearch is deployed and running.");
+          return null;
+        }
+
+        if (listOfMatchingHosts.size() > 1) {
+          LOG.warn("More than one LOGSEARCH_SERVER instance found, this may be a deployment error.  Only the first LOGSEARCH_SERVER instance will be used.");
+        }
+
+        ServiceComponentHost serviceComponentHost =
+          listOfMatchingHosts.get(0);
+
+        final String logSearchHostName = serviceComponentHost.getHostName();
+        final String logSearchPortNumber =
+          logSearchSiteConfig.getProperties().get(LOGSEARCH_UI_PORT_PROPERTY_NAME);
+
+        return new LoggingRequestHelperImpl(logSearchHostName, logSearchPortNumber);
+      }
+    } catch (AmbariException ambariException) {
+      LOG.error("Error occurred while trying to obtain the cluster, cluster name = " + clusterName, ambariException);
+    }
+
+
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
new file mode 100644
index 0000000..2c3d941
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java
@@ -0,0 +1,202 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.log4j.Logger;
+import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.ObjectReader;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Convenience class to handle the connection details of a LogSearch query request.
+ *
+ */
+public class LoggingRequestHelperImpl implements LoggingRequestHelper {
+
+  private Logger LOG = Logger.getLogger(LoggingRequestHelperImpl.class);
+
+  //TODO, hardcoded localhost for LogSearch service for dev purposes, will switch to config after POC finished
+
+
+  private static String DEFAULT_HOSTNAME = "localhost";
+
+  private static String DEFAULT_PORT = "61888";
+
+  private static String LOGSEARCH_QUERY_PATH = "/service/dashboard/solr/logs_search";
+
+  private static String DEFAULT_LOGSEARCH_USER = "admin";
+
+  private static String DEFAULT_LOGSEARCH_PWD = "admin";
+
+  private final String hostName;
+
+  private final String portNumber;
+
+
+  public LoggingRequestHelperImpl() {
+    this(DEFAULT_HOSTNAME, DEFAULT_PORT);
+  }
+
+  public LoggingRequestHelperImpl(String hostName, String portNumber) {
+    this.hostName = hostName;
+    this.portNumber = portNumber;
+  }
+
+  public LogQueryResponse sendQueryRequest(Map<String, String> queryParameters) {
+    try {
+      // use the Apache builder to create the correct URI
+      URI logSearchURI = createLogSearchQueryURI(queryParameters);
+      LOG.info("Attempting to connect to LogSearch server at " + logSearchURI);
+
+      HttpURLConnection httpURLConnection  = (HttpURLConnection)logSearchURI.toURL().openConnection();
+      httpURLConnection.setRequestMethod("GET");
+      setupBasicAuthentication(httpURLConnection);
+      StringBuffer buffer = readQueryResponseFromServer(httpURLConnection);
+
+      // setup a reader for the JSON response
+      StringReader stringReader =
+        new StringReader(buffer.toString());
+
+      // setup the Jackson mapper/reader to read in the data structure
+      ObjectMapper mapper = createJSONObjectMapper();
+
+      ObjectReader logQueryResponseReader =
+        mapper.reader(LogQueryResponse.class);
+
+      LogQueryResponse queryResult =
+        logQueryResponseReader.readValue(stringReader);
+
+      LOG.debug("DEBUG: response from LogSearch was: " + buffer);
+
+      return queryResult;
+
+    } catch (MalformedURLException e) {
+      // TODO, need better error handling here
+      e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+    } catch (IOException e) {
+      e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+    } catch (URISyntaxException e) {
+      e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+    }
+
+    return null;
+  }
+
+  public Set<String> sendGetLogFileNamesRequest(String componentName, String hostName) {
+    Map<String, String> queryParameters =
+      new HashMap<String, String>();
+
+    // TODO, this current method will be a temporary workaround
+    // TODO, until the new LogSearch API method is available to handle this request
+
+    queryParameters.put("host", hostName);
+    queryParameters.put("components_name",componentName);
+    // ask for page size of 1, since we really only want a single entry to
+    // get the file path name
+    queryParameters.put("pageSize", "1");
+
+    LogQueryResponse response = sendQueryRequest(queryParameters);
+    if ((response != null) && (!response.getListOfResults().isEmpty())) {
+      LogLineResult lineOne = response.getListOfResults().get(0);
+      // this assumes that each component has only one associated log file,
+      // which may not always hold true
+      LOG.info("For componentName = " + componentName + ", log file name is = " + lineOne.getLogFilePath());
+      return Collections.singleton(lineOne.getLogFilePath());
+
+    }
+
+    return Collections.emptySet();
+  }
+
+  private URI createLogSearchQueryURI(Map<String, String> queryParameters) throws URISyntaxException {
+    URIBuilder uriBuilder = new URIBuilder();
+    uriBuilder.setScheme("http");
+    uriBuilder.setHost(hostName);
+    uriBuilder.setPort(Integer.valueOf(portNumber));
+    uriBuilder.setPath(LOGSEARCH_QUERY_PATH);
+
+    // add any query strings specified
+    for (String key : queryParameters.keySet()) {
+      uriBuilder.addParameter(key, queryParameters.get(key));
+    }
+
+    return uriBuilder.build();
+  }
+
+  protected ObjectMapper createJSONObjectMapper() {
+    ObjectMapper mapper =
+      new ObjectMapper();
+    AnnotationIntrospector introspector =
+      new JacksonAnnotationIntrospector();
+    mapper.setAnnotationIntrospector(introspector);
+    mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+    return mapper;
+  }
+
+  private StringBuffer readQueryResponseFromServer(HttpURLConnection httpURLConnection) throws IOException {
+    InputStream resultStream = null;
+    try {
+      // read in the response from LogSearch
+      resultStream = httpURLConnection.getInputStream();
+      BufferedReader reader = new BufferedReader(new InputStreamReader(resultStream));
+      LOG.info("Response code from LogSearch Service is = " + httpURLConnection.getResponseCode());
+
+      String line = reader.readLine();
+      StringBuffer buffer = new StringBuffer();
+      while (line != null) {
+        buffer.append(line);
+        line = reader.readLine();
+      }
+      return buffer;
+    } finally {
+      // make sure to close the stream after request is completed
+      if (resultStream != null) {
+        resultStream.close();
+      }
+    }
+  }
+
+  private static void setupBasicAuthentication(HttpURLConnection httpURLConnection) {
+    //TODO, using hard-coded Base64 auth for now, need to revisit this
+    String encodedCredentials =
+      Base64.encodeBase64String((DEFAULT_LOGSEARCH_USER + ":" + DEFAULT_LOGSEARCH_PWD).getBytes());
+    httpURLConnection.setRequestProperty("Authorization", "Basic " + encodedCredentials);
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
new file mode 100644
index 0000000..6b4a8a4
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingSearchPropertyProvider.java
@@ -0,0 +1,187 @@
+/**
+ * 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.
+ */
+package org.apache.ambari.server.controller.logging;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.controller.AmbariManagementController;
+import org.apache.ambari.server.controller.AmbariServer;
+import org.apache.ambari.server.controller.spi.Predicate;
+import org.apache.ambari.server.controller.spi.PropertyProvider;
+import org.apache.ambari.server.controller.spi.Request;
+import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.utilities.PropertyHelper;
+import org.apache.ambari.server.state.ComponentInfo;
+import org.apache.ambari.server.state.LogDefinition;
+import org.apache.ambari.server.state.StackId;
+import org.apache.log4j.Logger;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+public class LoggingSearchPropertyProvider implements PropertyProvider {
+
+  private static final Logger LOG = Logger.getLogger(LoggingSearchPropertyProvider.class);
+
+  private static final String CLUSTERS_PATH = "/api/v1/clusters";
+
+  private static final String PATH_TO_SEARCH_ENGINE = "/logging/searchEngine";
+
+  private static final String DEFAULT_PAGE_SIZE = "50";
+
+  private static final String COMPONENT_QUERY_PARAMETER_NAME = "components_name";
+
+  private static final String HOST_QUERY_PARAMETER_NAME = "host";
+
+  private static final String PAGE_SIZE_QUERY_PARAMETER_NAME = "pageSize";
+
+  private final LoggingRequestHelperFactory requestHelperFactory;
+
+  private final ControllerFactory controllerFactory;
+
+  public LoggingSearchPropertyProvider() {
+    this(new LoggingRequestHelperFactoryImpl(), new DefaultControllerFactory());
+  }
+
+  protected LoggingSearchPropertyProvider(LoggingRequestHelperFactory requestHelperFactory, ControllerFactory controllerFactory) {
+    this.requestHelperFactory = requestHelperFactory;
+    this.controllerFactory = controllerFactory;
+  }
+
+
+
+  @Override
+  public Set<Resource> populateResources(Set<Resource> resources, Request request, Predicate predicate) throws SystemException {
+
+    AmbariManagementController controller =
+      controllerFactory.getAmbariManagementController();
+
+    for (Resource resource : resources) {
+      // obtain the required identifying properties on the host component resource
+      final String componentName = (String)resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "component_name"));
+      final String hostName = (String) resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "host_name"));
+      final String clusterName = (String) resource.getPropertyValue(PropertyHelper.getPropertyId("HostRoles", "cluster_name"));
+
+      // query the stack definitions to find the correct component name (stack name mapped to LogSearch-defined name)
+      final String mappedComponentNameForLogSearch =
+        getMappedComponentNameForSearch(clusterName, componentName, controller);
+
+      if (mappedComponentNameForLogSearch != null) {
+        HostComponentLoggingInfo loggingInfo =
+          new HostComponentLoggingInfo();
+
+        // make query to LogSearch server to find the associated file names
+        // create helper instance using factory
+        LoggingRequestHelper requestHelper =
+          requestHelperFactory.getHelper(controller, clusterName);
+
+        // send query to obtain logging metadata
+        Set<String> logFileNames =
+          requestHelper.sendGetLogFileNamesRequest(mappedComponentNameForLogSearch, hostName);
+
+        if ((logFileNames != null) && (!logFileNames.isEmpty())) {
+          loggingInfo.setComponentName(mappedComponentNameForLogSearch);
+          List<LogFileDefinitionInfo> listOfFileDefinitions =
+            new LinkedList<LogFileDefinitionInfo>();
+
+          for (String fileName : logFileNames) {
+            // generate the URIs that can be used by clients to obtain search results/tail log results/etc
+            final String searchEngineURI = controller.getAmbariServerURI(getFullPathToSearchEngine(clusterName));
+            final String logFileTailURI = createLogFileTailURI(searchEngineURI, mappedComponentNameForLogSearch, hostName);
+            // all log files are assumed to be service types for now
+            listOfFileDefinitions.add(new LogFileDefinitionInfo(fileName, LogFileType.SERVICE, searchEngineURI, logFileTailURI));
+          }
+
+          loggingInfo.setListOfLogFileDefinitions(listOfFileDefinitions);
+
+          LOG.info("Adding logging info for component name = " + componentName + " on host name = " + hostName);
+          // add the logging metadata for this host component
+          resource.setProperty("logging", loggingInfo);
+        } else {
+          LOG.error("Error occurred while making request to LogSearch service, unable to populate logging properties on this resource");
+        }
+      }
+
+    }
+
+    return resources;
+  }
+
+  private String getMappedComponentNameForSearch(String clusterName, String componentName, AmbariManagementController controller) {
+    try {
+      AmbariMetaInfo metaInfo = controller.getAmbariMetaInfo();
+      StackId stackId =
+        controller.getClusters().getCluster(clusterName).getCurrentStackVersion();
+      final String stackName = stackId.getStackName();
+      final String stackVersion = stackId.getStackVersion();
+      final String serviceName =
+        metaInfo.getComponentToService(stackName, stackVersion, componentName);
+
+      ComponentInfo componentInfo =
+        metaInfo.getComponent(stackName, stackVersion, serviceName, componentName);
+      if (componentInfo != null) {
+        List<LogDefinition> listOfLogs =
+          componentInfo.getLogs();
+        // for now, the assumption is that there is only one log file associated with each
+        // component in LogSearch, but this may change in the future
+        if ((listOfLogs != null) && (!listOfLogs.isEmpty())) {
+          LogDefinition definition = listOfLogs.get(0);
+          // return the first log id we find
+          return definition.getLogId();
+        }
+      }
+
+    } catch (AmbariException e) {
+      LOG.error("Error occurred while attempting to locate the log component name for component = " + componentName, e);
+    }
+
+    return null;
+  }
+
+  private String getFullPathToSearchEngine(String clusterName) {
+    return CLUSTERS_PATH + "/" + clusterName + PATH_TO_SEARCH_ENGINE;
+  }
+
+  protected static String createLogFileTailURI(String searchEngineURI, String componentName, String hostName) {
+    return searchEngineURI + "?" + COMPONENT_QUERY_PARAMETER_NAME + "=" + componentName + "&" + HOST_QUERY_PARAMETER_NAME + "=" + hostName
+      + "&" + PAGE_SIZE_QUERY_PARAMETER_NAME + "=" + DEFAULT_PAGE_SIZE;
+  }
+
+  @Override
+  public Set<String> checkPropertyIds(Set<String> propertyIds) {
+    return Collections.emptySet();
+  }
+
+  /**
+   * Internal interface used to control how the AmbariManagementController
+   * instance is obtained.  This is useful for unit testing as well.
+   */
+  interface ControllerFactory {
+    AmbariManagementController getAmbariManagementController();
+  }
+
+  private static class DefaultControllerFactory implements ControllerFactory {
+    @Override
+    public AmbariManagementController getAmbariManagementController() {
+      return AmbariServer.getController();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
index 63af4c4..5a8476d 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/spi/Resource.java
@@ -154,7 +154,8 @@ public interface Resource {
     RoleAuthorization,
     UserAuthorization,
     VersionDefinition,
-    ClusterKerberosDescriptor;
+    ClusterKerberosDescriptor,
+    LoggingQuery;
 
     /**
      * Get the {@link Type} that corresponds to this InternalType.
@@ -270,6 +271,8 @@ public interface Resource {
     public static final Type UserAuthorization = InternalType.UserAuthorization.getType();
     public static final Type VersionDefinition = InternalType.VersionDefinition.getType();
     public static final Type ClusterKerberosDescriptor = InternalType.ClusterKerberosDescriptor.getType();
+    public static final Type LoggingQuery = InternalType.LoggingQuery.getType();
+
     /**
      * The type name.
      */

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/main/resources/key_properties.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/key_properties.json b/ambari-server/src/main/resources/key_properties.json
index 46a6cf9..8069349 100644
--- a/ambari-server/src/main/resources/key_properties.json
+++ b/ambari-server/src/main/resources/key_properties.json
@@ -150,5 +150,8 @@
   },
   "KerberosDescriptor": {
     "KerberosDescriptor": "KerberosDescriptors/kerberos_descriptor_name"
+  },
+  "LoggingQuery": {
+      "Cluster" : "logging/cluster_name"
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogLineResultTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogLineResultTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogLineResultTest.java
new file mode 100644
index 0000000..069f448
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogLineResultTest.java
@@ -0,0 +1,135 @@
+/**
+ * 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.
+ */
+
+
+package org.apache.ambari.server.controller.logging;
+
+
+import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.ObjectReader;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
+import org.junit.Test;
+
+import java.io.StringReader;
+
+import static org.junit.Assert.*;
+
+public class LogLineResultTest {
+
+  private static final String TEST_JSON_DATA_SINGLE_ENTRY =
+    "{" +
+
+      "    \"cluster\" : \"clusterone\"," +
+      "    \"method\" : \"chooseUnderReplicatedBlocks\"," +
+      "    \"level\" : \"INFO\"," +
+      "    \"event_count\" : 1," +
+      "    \"ip\" : \"192.168.1.1\"," +
+      "    \"type\" : \"hdfs_namenode\"," +
+      "    \"thread_name\" : \"thread-id-one\"," +
+      "    \"seq_num\" : 10584," +
+      "    \"path\" : \"/var/log/hadoop/hdfs/hadoop-hdfs-namenode-c6401.ambari.apache.org.log\"," +
+      "    \"file\" : \"UnderReplicatedBlocks.java\"," +
+      "    \"line_number\" : 394," +
+      "    \"host\" : \"c6401.ambari.apache.org\"," +
+      "    \"log_message\" : \"chooseUnderReplicatedBlocks selected 2 blocks at priority level 0;  Total=2 Reset bookmarks? false\"," +
+      "    \"logger_name\" : \"BlockStateChange\"," +
+      "    \"id\" : \"9c5562fb-123f-47c8-aaf5-b5e407326c08\"," +
+      "    \"message_md5\" : \"-3892769501348410581\"," +
+      "    \"logtime\" : 1458148749036," +
+      "    \"event_md5\" : \"1458148749036-2417481968206345035\"," +
+      "    \"logfile_line_number\" : 2084," +
+      "    \"_ttl_\" : \"+7DAYS\"," +
+      "    \"_expire_at_\" : 1458753550322," +
+      "    \"_version_\" : 1528979784023932928" +
+      "  }";
+
+
+
+  @Test
+  public void testBasicParsing() throws Exception {
+    // setup a reader for the test JSON data
+    StringReader stringReader =
+      new StringReader(TEST_JSON_DATA_SINGLE_ENTRY);
+
+    // setup the Jackson mapper/reader to read in the data structure
+    ObjectMapper mapper =
+      new ObjectMapper();
+    AnnotationIntrospector introspector =
+      new JacksonAnnotationIntrospector();
+    mapper.setAnnotationIntrospector(introspector);
+    mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+
+
+    ObjectReader logLineResultReader =
+      mapper.reader(LogLineResult.class);
+
+    LogLineResult result =
+      logLineResultReader.readValue(stringReader);
+
+    // verify that all fields in this class are parsed as expected
+    assertEquals("Cluster name not parsed properly",
+      "clusterone", result.getClusterName());
+    assertEquals("Method Name not parsed properly",
+      "chooseUnderReplicatedBlocks", result.getLogMethod());
+    assertEquals("Log Level not parsed properly",
+      "INFO", result.getLogLevel());
+    assertEquals("event_count not parsed properly",
+      "1", result.getEventCount());
+    assertEquals("ip address not parsed properly",
+      "192.168.1.1", result.getIpAddress());
+    assertEquals("component type not parsed properly",
+      "hdfs_namenode", result.getComponentType());
+    assertEquals("sequence number not parsed properly",
+      "10584", result.getSequenceNumber());
+    assertEquals("log file path not parsed properly",
+      "/var/log/hadoop/hdfs/hadoop-hdfs-namenode-c6401.ambari.apache.org.log", result.getLogFilePath());
+    assertEquals("log src file name not parsed properly",
+      "UnderReplicatedBlocks.java", result.getSourceFile());
+    assertEquals("log src line number not parsed properly",
+      "394", result.getSourceFileLineNumber());
+    assertEquals("host name not parsed properly",
+      "c6401.ambari.apache.org", result.getHostName());
+    assertEquals("log message not parsed properly",
+      "chooseUnderReplicatedBlocks selected 2 blocks at priority level 0;  Total=2 Reset bookmarks? false", result.getLogMessage());
+    assertEquals("logger name not parsed properly",
+      "BlockStateChange", result.getLoggerName());
+    assertEquals("id not parsed properly",
+      "9c5562fb-123f-47c8-aaf5-b5e407326c08", result.getId());
+    assertEquals("message MD5 not parsed properly",
+      "-3892769501348410581", result.getMessageMD5());
+    assertEquals("log time not parsed properly",
+      "1458148749036", result.getLogTime());
+    assertEquals("event MD5 not parsed properly",
+      "1458148749036-2417481968206345035", result.getEventMD5());
+    assertEquals("logfile line number not parsed properly",
+      "2084", result.getLogFileLineNumber());
+    assertEquals("ttl not parsed properly",
+      "+7DAYS", result.getTtl());
+    assertEquals("expire at not parsed properly",
+      "1458753550322", result.getExpirationTime());
+    assertEquals("version not parsed properly",
+      "1528979784023932928", result.getVersion());
+    assertEquals("thread_name not parsed properly",
+      "thread-id-one", result.getThreadName());
+
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c3a856e3/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogQueryResponseTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogQueryResponseTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogQueryResponseTest.java
new file mode 100644
index 0000000..d281d6e
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogQueryResponseTest.java
@@ -0,0 +1,226 @@
+/**
+ * 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.
+ */
+
+package org.apache.ambari.server.controller.logging;
+
+
+import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.ObjectReader;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
+import org.junit.Test;
+
+import java.io.StringReader;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class LogQueryResponseTest {
+
+  private static final String TEST_JSON_INPUT_TWO_LIST_ENTRIES =
+    "{" +
+      "  \"startIndex\" : 0," +
+      "  \"pageSize\" : 5," +
+      "  \"totalCount\" : 10452," +
+      "  \"resultSize\" : 5," +
+      "  \"queryTimeMS\" : 1458148754113," +
+      "  \"logList\" : [ {" +
+      "    \"cluster\" : \"clusterone\"," +
+      "    \"method\" : \"chooseUnderReplicatedBlocks\"," +
+      "    \"level\" : \"INFO\"," +
+      "    \"event_count\" : 1," +
+      "    \"ip\" : \"192.168.1.1\"," +
+      "    \"type\" : \"hdfs_namenode\"," +
+      "    \"seq_num\" : 10584," +
+      "    \"path\" : \"/var/log/hadoop/hdfs/hadoop-hdfs-namenode-c6401.ambari.apache.org.log\"," +
+      "    \"file\" : \"UnderReplicatedBlocks.java\"," +
+      "    \"line_number\" : 394," +
+      "    \"host\" : \"c6401.ambari.apache.org\"," +
+      "    \"log_message\" : \"chooseUnderReplicatedBlocks selected 2 blocks at priority level 0;  Total=2 Reset bookmarks? false\"," +
+      "    \"logger_name\" : \"BlockStateChange\"," +
+      "    \"id\" : \"9c5562fb-123f-47c8-aaf5-b5e407326c08\"," +
+      "    \"message_md5\" : \"-3892769501348410581\"," +
+      "    \"logtime\" : 1458148749036," +
+      "    \"event_md5\" : \"1458148749036-2417481968206345035\"," +
+      "    \"logfile_line_number\" : 2084," +
+      "    \"_ttl_\" : \"+7DAYS\"," +
+      "    \"_expire_at_\" : 1458753550322," +
+      "    \"_version_\" : 1528979784023932928" +
+      "  }, {" +
+      "    \"cluster\" : \"clusterone\"," +
+      "    \"method\" : \"putMetrics\"," +
+      "    \"level\" : \"WARN\"," +
+      "    \"event_count\" : 1," +
+      "    \"ip\" : \"192.168.1.1\"," +
+      "    \"type\" : \"yarn_resourcemanager\"," +
+      "    \"seq_num\" : 10583," +
+      "    \"path\" : \"/var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-c6401.ambari.apache.org.log\"," +
+      "    \"file\" : \"HadoopTimelineMetricsSink.java\"," +
+      "    \"line_number\" : 262," +
+      "    \"host\" : \"c6401.ambari.apache.org\"," +
+      "    \"log_message\" : \"Unable to send metrics to collector by address:http://c6401.ambari.apache.org:6188/ws/v1/timeline/metrics\"," +
+      "    \"logger_name\" : \"timeline.HadoopTimelineMetricsSink\"," +
+      "    \"id\" : \"8361c5a9-5b1c-4f44-bc8f-4c6f07d94228\"," +
+      "    \"message_md5\" : \"5942185045779825717\"," +
+      "    \"logtime\" : 1458148746937," +
+      "    \"event_md5\" : \"14581487469371427138486123628676\"," +
+      "    \"logfile_line_number\" : 549," +
+      "    \"_ttl_\" : \"+7DAYS\"," +
+      "    \"_expire_at_\" : 1458753550322," +
+      "    \"_version_\" : 1528979784022884357" +
+      "  }" +
+      "]" +
+      "}";
+
+
+  @Test
+  public void testBasicParsing() throws Exception {
+    // setup a reader for the test JSON data
+    StringReader stringReader =
+      new StringReader(TEST_JSON_INPUT_TWO_LIST_ENTRIES);
+
+    // setup the Jackson mapper/reader to read in the data structure
+    ObjectMapper mapper =
+      new ObjectMapper();
+    AnnotationIntrospector introspector =
+      new JacksonAnnotationIntrospector();
+    mapper.setAnnotationIntrospector(introspector);
+    mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+
+
+    ObjectReader logQueryResponseReader =
+      mapper.reader(LogQueryResponse.class);
+
+    LogQueryResponse result =
+      logQueryResponseReader.readValue(stringReader);
+
+    assertEquals("startIndex not parsed properly",
+      "0", result.getStartIndex());
+    assertEquals("pageSize not parsed properly",
+      "5", result.getPageSize());
+    assertEquals("totalCount not parsed properly",
+      "10452", result.getTotalCount());
+    assertEquals("resultSize not parsed properly",
+      "5", result.getResultSize());
+    assertEquals("queryTimeMS not parsed properly",
+      "1458148754113", result.getQueryTimeMS());
+
+    assertEquals("incorrect number of LogLineResult items parsed",
+      2, result.getListOfResults().size());
+
+    List<LogLineResult> listOfLineResults =
+      result.getListOfResults();
+
+    {
+      LogLineResult resultOne = listOfLineResults.get(0);
+      // verify that all fields in this class are parsed as expected
+      assertEquals("Cluster name not parsed properly",
+        "clusterone", resultOne.getClusterName());
+      assertEquals("Method Name not parsed properly",
+        "chooseUnderReplicatedBlocks", resultOne.getLogMethod());
+      assertEquals("Log Level not parsed properly",
+        "INFO", resultOne.getLogLevel());
+      assertEquals("event_count not parsed properly",
+        "1", resultOne.getEventCount());
+      assertEquals("ip address not parsed properly",
+        "192.168.1.1", resultOne.getIpAddress());
+      assertEquals("component type not parsed properly",
+        "hdfs_namenode", resultOne.getComponentType());
+      assertEquals("sequence number not parsed properly",
+        "10584", resultOne.getSequenceNumber());
+      assertEquals("log file path not parsed properly",
+        "/var/log/hadoop/hdfs/hadoop-hdfs-namenode-c6401.ambari.apache.org.log", resultOne.getLogFilePath());
+      assertEquals("log src file name not parsed properly",
+        "UnderReplicatedBlocks.java", resultOne.getSourceFile());
+      assertEquals("log src line number not parsed properly",
+        "394", resultOne.getSourceFileLineNumber());
+      assertEquals("host name not parsed properly",
+        "c6401.ambari.apache.org", resultOne.getHostName());
+      assertEquals("log message not parsed properly",
+        "chooseUnderReplicatedBlocks selected 2 blocks at priority level 0;  Total=2 Reset bookmarks? false", resultOne.getLogMessage());
+      assertEquals("logger name not parsed properly",
+        "BlockStateChange", resultOne.getLoggerName());
+      assertEquals("id not parsed properly",
+        "9c5562fb-123f-47c8-aaf5-b5e407326c08", resultOne.getId());
+      assertEquals("message MD5 not parsed properly",
+        "-3892769501348410581", resultOne.getMessageMD5());
+      assertEquals("log time not parsed properly",
+        "1458148749036", resultOne.getLogTime());
+      assertEquals("event MD5 not parsed properly",
+        "1458148749036-2417481968206345035", resultOne.getEventMD5());
+      assertEquals("logfile line number not parsed properly",
+        "2084", resultOne.getLogFileLineNumber());
+      assertEquals("ttl not parsed properly",
+        "+7DAYS", resultOne.getTtl());
+      assertEquals("expire at not parsed properly",
+        "1458753550322", resultOne.getExpirationTime());
+      assertEquals("version not parsed properly",
+        "1528979784023932928", resultOne.getVersion());
+    }
+
+    {
+      LogLineResult resultTwo = listOfLineResults.get(1);
+      // verify second log line record's data is parsed correctly
+      assertEquals("Cluster name not parsed properly",
+        "clusterone", resultTwo.getClusterName());
+      assertEquals("Method Name not parsed properly",
+        "putMetrics", resultTwo.getLogMethod());
+      assertEquals("Log Level not parsed properly",
+        "WARN", resultTwo.getLogLevel());
+      assertEquals("event_count not parsed properly",
+        "1", resultTwo.getEventCount());
+      assertEquals("ip address not parsed properly",
+        "192.168.1.1", resultTwo.getIpAddress());
+      assertEquals("component type not parsed properly",
+        "yarn_resourcemanager", resultTwo.getComponentType());
+      assertEquals("sequence number not parsed properly",
+        "10583", resultTwo.getSequenceNumber());
+      assertEquals("log file path not parsed properly",
+        "/var/log/hadoop-yarn/yarn/yarn-yarn-resourcemanager-c6401.ambari.apache.org.log", resultTwo.getLogFilePath());
+      assertEquals("log src file name not parsed properly",
+        "HadoopTimelineMetricsSink.java", resultTwo.getSourceFile());
+      assertEquals("log src line number not parsed properly",
+        "262", resultTwo.getSourceFileLineNumber());
+      assertEquals("host name not parsed properly",
+        "c6401.ambari.apache.org", resultTwo.getHostName());
+      assertEquals("log message not parsed properly",
+        "Unable to send metrics to collector by address:http://c6401.ambari.apache.org:6188/ws/v1/timeline/metrics", resultTwo.getLogMessage());
+      assertEquals("logger name not parsed properly",
+        "timeline.HadoopTimelineMetricsSink", resultTwo.getLoggerName());
+      assertEquals("id not parsed properly",
+        "8361c5a9-5b1c-4f44-bc8f-4c6f07d94228", resultTwo.getId());
+      assertEquals("message MD5 not parsed properly",
+        "5942185045779825717", resultTwo.getMessageMD5());
+      assertEquals("log time not parsed properly",
+        "1458148746937", resultTwo.getLogTime());
+      assertEquals("event MD5 not parsed properly",
+        "14581487469371427138486123628676", resultTwo.getEventMD5());
+      assertEquals("logfile line number not parsed properly",
+        "549", resultTwo.getLogFileLineNumber());
+      assertEquals("ttl not parsed properly",
+        "+7DAYS", resultTwo.getTtl());
+      assertEquals("expire at not parsed properly",
+        "1458753550322", resultTwo.getExpirationTime());
+      assertEquals("version not parsed properly",
+        "1528979784022884357", resultTwo.getVersion());
+    }
+
+  }
+
+}


[47/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
new file mode 100644
index 0000000..dd67d07
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.output;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.ConfigBlock;
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.MetricCount;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.log4j.Logger;
+
+import com.google.gson.reflect.TypeToken;
+
+public abstract class Output extends ConfigBlock {
+  static private Logger logger = Logger.getLogger(Output.class);
+
+  String destination = null;
+
+  Type jsonType = new TypeToken<Map<String, String>>() {
+  }.getType();
+
+  public MetricCount writeBytesMetric = new MetricCount();
+
+  @Override
+  public String getShortDescription() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public String getNameForThread() {
+    if (destination != null) {
+      return destination;
+    }
+    return super.getNameForThread();
+  }
+
+  public void write(String block, InputMarker inputMarker) throws Exception {
+    // No-op. Please implement in sub classes
+  }
+
+  /**
+   * @param jsonObj
+   * @param input
+   * @throws Exception
+   */
+  public void write(Map<String, Object> jsonObj, InputMarker inputMarker)
+    throws Exception {
+    write(LogFeederUtil.getGson().toJson(jsonObj), inputMarker);
+  }
+
+  boolean isClosed = false;
+
+  /**
+   * Extend this method to clean up
+   */
+  public void close() {
+    logger.info("Calling base close()." + getShortDescription());
+    isClosed = true;
+  }
+
+  /**
+   * This is called on shutdown. All output should extend it.
+   *
+   * @return
+   */
+  public boolean isClosed() {
+    return isClosed;
+  }
+
+  public long getPendingCount() {
+    return 0;
+  }
+
+  public String getDestination() {
+    return destination;
+  }
+
+  public void setDestination(String destination) {
+    this.destination = destination;
+  }
+
+  @Override
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    super.addMetricsContainers(metricsList);
+    metricsList.add(writeBytesMetric);
+  }
+
+  @Override
+  public synchronized void logStat() {
+    super.logStat();
+
+    //Printing stat for writeBytesMetric
+    logStatForMetric(writeBytesMetric, "Stat: Bytes Written");
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputData.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputData.java
new file mode 100644
index 0000000..8df1d29
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputData.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.output;
+
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.input.InputMarker;
+
+/**
+ * This contains the output json object and InputMarker.
+ */
+public class OutputData {
+  Map<String, Object> jsonObj;
+  InputMarker inputMarker;
+
+  /**
+   * @param jsonObj
+   * @param inputMarker
+   */
+  public OutputData(Map<String, Object> jsonObj, InputMarker inputMarker) {
+    super();
+    this.jsonObj = jsonObj;
+    this.inputMarker = inputMarker;
+  }
+
+  @Override
+  public String toString() {
+    return "OutputData [jsonObj=" + jsonObj + ", inputMarker="
+      + inputMarker + "]";
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputFile.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputFile.java
new file mode 100644
index 0000000..b6e36d6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputFile.java
@@ -0,0 +1,138 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.output;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.log4j.Logger;
+
+public class OutputFile extends Output {
+  static Logger logger = Logger.getLogger(OutputFile.class);
+
+  PrintWriter outWriter = null;
+  String filePath = null;
+  String codec;
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+
+    filePath = getStringValue("path");
+    if (filePath == null || filePath.isEmpty()) {
+      logger.error("Filepath config property <path> is not set in config file.");
+      return;
+    }
+    codec = getStringValue("codec");
+    if (codec == null || codec.trim().isEmpty()) {
+      codec = "json";
+    } else {
+      if (codec.trim().equalsIgnoreCase("csv")) {
+        codec = "csv";
+      } else if (codec.trim().equalsIgnoreCase("json")) {
+        codec = "csv";
+      } else {
+        logger.error("Unsupported codec type. codec=" + codec
+          + ", will use json");
+        codec = "json";
+      }
+    }
+    logger.info("Out filePath=" + filePath + ", codec=" + codec);
+    File outFile = new File(filePath);
+    if (outFile.getParentFile() != null) {
+      File parentDir = outFile.getParentFile();
+      if (!parentDir.isDirectory()) {
+        parentDir.mkdirs();
+      }
+    }
+
+    outWriter = new PrintWriter(new BufferedWriter(new FileWriter(outFile,
+      true)));
+
+    logger.info("init() is successfull. filePath="
+      + outFile.getAbsolutePath());
+  }
+
+  @Override
+  public void close() {
+    logger.info("Closing file." + getShortDescription());
+    if (outWriter != null) {
+      try {
+        outWriter.close();
+      } catch (Throwable t) {
+        // Ignore this exception
+      }
+    }
+    isClosed = true;
+  }
+
+  @Override
+  public void write(Map<String, Object> jsonObj, InputMarker inputMarker)
+    throws Exception {
+    String outStr = null;
+    if (codec.equals("csv")) {
+      // Convert to CSV
+      CSVPrinter csvPrinter = new CSVPrinter(outWriter, CSVFormat.RFC4180);
+      //TODO:
+    } else {
+      outStr = LogFeederUtil.getGson().toJson(jsonObj);
+    }
+    if (outWriter != null && outStr != null) {
+      statMetric.count++;
+
+      outWriter.println(outStr);
+      outWriter.flush();
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.output.Output#write()
+   */
+  @Override
+  synchronized public void write(String block, InputMarker inputMarker) throws Exception {
+    if (outWriter != null && block != null) {
+      statMetric.count++;
+
+      outWriter.println(block);
+      outWriter.flush();
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.ConfigBlock#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "output:destination=file,path=" + filePath;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputKafka.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputKafka.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputKafka.java
new file mode 100644
index 0000000..c594dd4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputKafka.java
@@ -0,0 +1,313 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.output;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.LinkedTransferQueue;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.kafka.clients.producer.Callback;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.apache.kafka.clients.producer.RecordMetadata;
+import org.apache.kafka.common.serialization.StringSerializer;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+public class OutputKafka extends Output {
+  static private Logger logger = Logger.getLogger(OutputKafka.class);
+
+  String brokerList = null;
+  String topic = null;
+  boolean isAsync = true;
+  long messageCount = 0;
+  int batchSize = 5000;
+  int lingerMS = 1000;
+
+  private KafkaProducer<String, String> producer = null;
+  BlockingQueue<KafkaCallBack> failedMessages = new LinkedTransferQueue<KafkaCallBack>();
+
+  // Let's start with the assumption Kafka is down
+  boolean isKafkaBrokerUp = false;
+
+  static final int FAILED_RETRY_INTERVAL = 30;
+  static final int CATCHUP_RETRY_INTERVAL = 5;
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+    statMetric.metricsName = "output.kafka.write_logs";
+    writeBytesMetric.metricsName = "output.kafka.write_bytes";
+
+    brokerList = getStringValue("broker_list");
+    topic = getStringValue("topic");
+    isAsync = getBooleanValue("is_async", true);
+    batchSize = getIntValue("batch_size", batchSize);
+    lingerMS = getIntValue("linger_ms", lingerMS);
+
+    Map<String, Object> kafkaCustomProperties = new HashMap<String, Object>();
+    // Get all kafka custom properties
+    for (String key : configs.keySet()) {
+      if (key.startsWith("kafka.")) {
+        Object value = configs.get(key);
+        if (value == null || value.toString().length() == 0) {
+          continue;
+        }
+        String kafkaKey = key.substring("kafka.".length());
+        kafkaCustomProperties.put(kafkaKey, value);
+      }
+    }
+
+    if (StringUtils.isEmpty(brokerList)) {
+      throw new Exception(
+        "For kafka output, bootstrap broker_list is needed");
+    }
+
+    if (StringUtils.isEmpty(topic)) {
+      throw new Exception("For kafka output, topic is needed");
+    }
+
+    Properties props = new Properties();
+    // 0.9.0
+    props.put("bootstrap.servers", brokerList);
+    props.put("client.id", "logfeeder_producer");
+    props.put("key.serializer", StringSerializer.class.getName());
+    props.put("value.serializer", StringSerializer.class.getName());
+    props.put("compression.type", "snappy");
+    // props.put("retries", "3");
+    props.put("batch.size", batchSize);
+    props.put("linger.ms", lingerMS);
+
+    for (String kafkaKey : kafkaCustomProperties.keySet()) {
+      logger.info("Adding custom Kafka property. " + kafkaKey + "="
+        + kafkaCustomProperties.get(kafkaKey));
+      props.put(kafkaKey, kafkaCustomProperties.get(kafkaKey));
+    }
+
+    // props.put("metadata.broker.list", brokerList);
+
+    producer = new KafkaProducer<String, String>(props);
+    Thread retryThread = new Thread("kafka-writer-retry,topic=" + topic) {
+      @Override
+      public void run() {
+        KafkaCallBack kafkaCallBack = null;
+        logger.info("Started thread to monitor failed messsages. "
+          + getShortDescription());
+        while (true) {
+          try {
+            if (kafkaCallBack == null) {
+              kafkaCallBack = failedMessages.take();
+            }
+            if (publishMessage(kafkaCallBack.message,
+              kafkaCallBack.inputMarker)) {
+              // logger.info("Sent message. count="
+              // + kafkaCallBack.thisMessageNumber);
+              kafkaCallBack = null;
+            } else {
+              // Should wait for sometime
+              logger.error("Kafka is down. messageNumber="
+                + kafkaCallBack.thisMessageNumber
+                + ". Going to sleep for "
+                + FAILED_RETRY_INTERVAL + " seconds");
+              Thread.sleep(FAILED_RETRY_INTERVAL * 1000);
+            }
+
+          } catch (Throwable t) {
+            final String LOG_MESSAGE_KEY = this.getClass()
+              .getSimpleName() + "_KAFKA_RETRY_WRITE_ERROR";
+            LogFeederUtil.logErrorMessageByInterval(
+              LOG_MESSAGE_KEY,
+              "Error sending message to Kafka during retry. message="
+                + (kafkaCallBack == null ? null
+                : kafkaCallBack.message), t,
+              logger, Level.ERROR);
+          }
+        }
+
+      }
+    };
+    retryThread.setDaemon(true);
+    retryThread.start();
+  }
+
+  @Override
+  public void setDrain(boolean drain) {
+    super.setDrain(drain);
+  }
+
+  /**
+   * Flush document buffer
+   */
+  public void flush() {
+    logger.info("Flush called...");
+    setDrain(true);
+  }
+
+  @Override
+  public void close() {
+    logger.info("Closing Kafka client...");
+    flush();
+    if (producer != null) {
+      try {
+        producer.close();
+      } catch (Throwable t) {
+        logger.error("Error closing Kafka topic. topic=" + topic);
+      }
+    }
+    logger.info("Closed Kafka client");
+    super.close();
+  }
+
+  @Override
+  synchronized public void write(String block, InputMarker inputMarker) throws Exception {
+    while (!isDrain() && !inputMarker.input.isDrain()) {
+      try {
+        if (failedMessages.size() == 0) {
+          if (publishMessage(block, inputMarker)) {
+            break;
+          }
+        }
+        if (isDrain() || inputMarker.input.isDrain()) {
+          break;
+        }
+        if (!isKafkaBrokerUp) {
+          logger.error("Kafka is down. Going to sleep for "
+            + FAILED_RETRY_INTERVAL + " seconds");
+          Thread.sleep(FAILED_RETRY_INTERVAL * 1000);
+
+        } else {
+          logger.warn("Kafka is still catching up from previous failed messages. outstanding messages="
+            + failedMessages.size()
+            + " Going to sleep for "
+            + CATCHUP_RETRY_INTERVAL + " seconds");
+          Thread.sleep(CATCHUP_RETRY_INTERVAL * 1000);
+        }
+      } catch (Throwable t) {
+        // ignore
+        break;
+      }
+    }
+  }
+
+  private boolean publishMessage(String block, InputMarker inputMarker) {
+    if (isAsync && isKafkaBrokerUp) { // Send asynchronously
+      producer.send(new ProducerRecord<String, String>(topic, block),
+        new KafkaCallBack(this, block, inputMarker, ++messageCount));
+      return true;
+    } else { // Send synchronously
+      try {
+        // Not using key. Let it round robin
+        RecordMetadata metadata = producer.send(
+          new ProducerRecord<String, String>(topic, block)).get();
+        if (metadata != null) {
+          statMetric.count++;
+          writeBytesMetric.count += block.length();
+        }
+        if (!isKafkaBrokerUp) {
+          logger.info("Started writing to kafka. "
+            + getShortDescription());
+          isKafkaBrokerUp = true;
+        }
+        return true;
+      } catch (InterruptedException e) {
+        isKafkaBrokerUp = false;
+        final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+          + "_KAFKA_INTERRUPT";
+        LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+          "InterruptedException-Error sending message to Kafka",
+          e, logger, Level.ERROR);
+      } catch (ExecutionException e) {
+        isKafkaBrokerUp = false;
+        final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+          + "_KAFKA_EXECUTION";
+        LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+          "ExecutionException-Error sending message to Kafka", e,
+          logger, Level.ERROR);
+      } catch (Throwable t) {
+        isKafkaBrokerUp = false;
+        final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+          + "_KAFKA_WRITE_ERROR";
+        LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+          "GenericException-Error sending message to Kafka", t,
+          logger, Level.ERROR);
+      }
+    }
+    return false;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.ConfigBlock#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "output:destination=kafka,topic=" + topic;
+  }
+
+}
+
+class KafkaCallBack implements Callback {
+  static private Logger logger = Logger.getLogger(KafkaCallBack.class);
+
+  long thisMessageNumber;
+  OutputKafka output = null;
+  String message;
+  InputMarker inputMarker;
+
+  public KafkaCallBack(OutputKafka output, String message, InputMarker inputMarker,
+                       long messageCount) {
+    this.thisMessageNumber = messageCount;
+    this.output = output;
+    this.inputMarker = inputMarker;
+    this.message = message;
+  }
+
+  public void onCompletion(RecordMetadata metadata, Exception exception) {
+    if (metadata != null) {
+      if (!output.isKafkaBrokerUp) {
+        logger.info("Started writing to kafka. "
+          + output.getShortDescription());
+        output.isKafkaBrokerUp = true;
+      }
+      output.incrementStat(1);
+      output.writeBytesMetric.count += message.length();
+
+      // metadata.partition();
+      // metadata.offset();
+    } else {
+      output.isKafkaBrokerUp = false;
+      final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+        + "_KAFKA_ASYNC_ERROR";
+      LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+        "Error sending message to Kafka. Async Callback",
+        exception, logger, Level.ERROR);
+
+      output.failedMessages.add(this);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
new file mode 100644
index 0000000..7cd911d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/OutputSolr.java
@@ -0,0 +1,475 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.output;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.impl.LBHttpSolrClient;
+import org.apache.solr.client.solrj.response.SolrPingResponse;
+import org.apache.solr.client.solrj.response.UpdateResponse;
+import org.apache.solr.common.SolrInputDocument;
+
+public class OutputSolr extends Output {
+  static private Logger logger = Logger.getLogger(OutputSolr.class);
+
+  private static final String ROUTER_FIELD = "_router_field_";
+
+  String solrUrl = null;
+  String zkHosts = null;
+  String collection = null;
+  String splitMode = "none";
+  int splitInterval = 0;
+  int numberOfShards = 1;
+  boolean isComputeCurrentCollection = false;
+
+  int maxBufferSize = 5000;
+  int maxIntervalMS = 3000;
+  int workers = 1;
+
+  BlockingQueue<OutputData> outgoingBuffer = null;
+  List<SolrWorkerThread> writerThreadList = new ArrayList<SolrWorkerThread>();
+  private static final int RETRY_INTERVAL = 30;
+
+  int lastSlotByMin = -1;
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+    statMetric.metricsName = "output.solr.write_logs";
+    writeBytesMetric.metricsName = "output.solr.write_bytes";
+
+    solrUrl = getStringValue("url");
+    zkHosts = getStringValue("zk_hosts");
+    splitMode = getStringValue("splits_interval_mins", splitMode);
+    if (!splitMode.equalsIgnoreCase("none")) {
+      splitInterval = getIntValue("split_interval_mins", 30);
+    }
+    numberOfShards = getIntValue("number_of_shards", numberOfShards);
+
+    maxBufferSize = getIntValue("flush_size", maxBufferSize);
+    if (maxBufferSize < 1) {
+      logger.warn("maxBufferSize is less than 1. Making it 1");
+    }
+    maxIntervalMS = getIntValue("idle_flush_time_ms", maxIntervalMS);
+    workers = getIntValue("workers", workers);
+
+    logger.info("Config: Number of workers=" + workers + ", splitMode="
+        + splitMode + ", splitInterval=" + splitInterval
+        + ", numberOfShards=" + numberOfShards + ". "
+        + getShortDescription());
+
+    if (StringUtils.isEmpty(solrUrl) && StringUtils.isEmpty(zkHosts)) {
+      throw new Exception(
+          "For solr output, either url or zk_hosts property need to be set");
+    }
+
+    int bufferSize = maxBufferSize * (workers + 3);
+    logger.info("Creating blocking queue with bufferSize=" + bufferSize);
+    // outgoingBuffer = new ArrayBlockingQueue<OutputData>(bufferSize);
+    outgoingBuffer = new LinkedBlockingQueue<OutputData>(bufferSize);
+
+    for (int count = 0; count < workers; count++) {
+      SolrClient solrClient = null;
+      CloudSolrClient solrClouldClient = null;
+      if (zkHosts != null) {
+        logger.info("Using zookeepr. zkHosts=" + zkHosts);
+        collection = getStringValue("collection");
+        if (StringUtils.isEmpty(collection)) {
+          throw new Exception(
+              "For solr cloud property collection is mandatory");
+        }
+        logger.info("Using collection=" + collection);
+        solrClouldClient = new CloudSolrClient(zkHosts);
+        solrClouldClient.setDefaultCollection(collection);
+        solrClient = solrClouldClient;
+        if (splitMode.equalsIgnoreCase("none")) {
+          isComputeCurrentCollection = false;
+        } else {
+          isComputeCurrentCollection = true;
+        }
+      } else {
+        String[] solrUrls = StringUtils.split(solrUrl, ",");
+        if (solrUrls.length == 1) {
+          logger.info("Using SolrURL=" + solrUrl);
+          solrClient = new HttpSolrClient(solrUrl);
+        } else {
+          logger.info("Using load balance solr client. solrUrls="
+              + solrUrl);
+          logger.info("Initial URL for LB solr=" + solrUrls[0]);
+          @SuppressWarnings("resource")
+          LBHttpSolrClient lbSolrClient = new LBHttpSolrClient(
+              solrUrls[0]);
+          for (int i = 1; i < solrUrls.length; i++) {
+            logger.info("Adding URL for LB solr=" + solrUrls[i]);
+            lbSolrClient.addSolrServer(solrUrls[i]);
+          }
+          solrClient = lbSolrClient;
+        }
+      }
+      try {
+        logger.info("Pinging Solr server. zkHosts=" + zkHosts
+            + ", urls=" + solrUrl);
+        SolrPingResponse response = solrClient.ping();
+        if (response.getStatus() == 0) {
+          logger.info("Ping to Solr server is successful for writer="
+              + count);
+        } else {
+          logger.warn("Ping to Solr server failed. It would check again. writer="
+              + count
+              + ", solrUrl="
+              + solrUrl
+              + ", zkHosts="
+              + zkHosts
+              + ", collection="
+              + collection
+              + ", response=" + response);
+        }
+      } catch (Throwable t) {
+        logger.warn(
+            "Ping to Solr server failed. It would check again. writer="
+                + count + ", solrUrl=" + solrUrl + ", zkHosts="
+                + zkHosts + ", collection=" + collection, t);
+      }
+
+      // Let's start the thread
+      SolrWorkerThread solrWriterThread = new SolrWorkerThread(solrClient);
+      solrWriterThread.setName(getNameForThread() + "," + collection
+          + ",writer=" + count);
+      solrWriterThread.setDaemon(true);
+      solrWriterThread.start();
+      writerThreadList.add(solrWriterThread);
+    }
+  }
+
+  @Override
+  public void setDrain(boolean drain) {
+    super.setDrain(drain);
+  }
+
+  /**
+   * Flush document buffer
+   */
+  public void flush() {
+    logger.info("Flush called...");
+    setDrain(true);
+
+    int wrapUpTimeSecs = 30;
+    // Give wrapUpTimeSecs seconds to wrap up
+    boolean isPending = false;
+    for (int i = 0; i < wrapUpTimeSecs; i++) {
+      for (SolrWorkerThread solrWorkerThread : writerThreadList) {
+        if (solrWorkerThread.isDone()) {
+          try {
+            solrWorkerThread.interrupt();
+          } catch (Throwable t) {
+            // ignore
+          }
+        } else {
+          isPending = true;
+        }
+      }
+      if (isPending) {
+        try {
+          logger.info("Will give " + (wrapUpTimeSecs - i)
+              + " seconds to wrap up");
+          Thread.sleep(1000);
+        } catch (InterruptedException e) {
+          // ignore
+        }
+      }
+      isPending = false;
+    }
+  }
+
+  @Override
+  public long getPendingCount() {
+    long totalCount = 0;
+    for (SolrWorkerThread solrWorkerThread : writerThreadList) {
+      totalCount += solrWorkerThread.localBuffer.size();
+    }
+    return totalCount;
+  }
+
+  @Override
+  public void close() {
+    logger.info("Closing Solr client...");
+    flush();
+
+    logger.info("Closed Solr client");
+    super.close();
+  }
+
+  @Override
+  public void write(Map<String, Object> jsonObj, InputMarker inputMarker)
+      throws Exception {
+    try {
+      outgoingBuffer.put(new OutputData(jsonObj, inputMarker));
+    } catch (InterruptedException e) {
+      // ignore
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.ConfigBlock#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "output:destination=solr,collection=" + collection;
+  }
+
+  class SolrWorkerThread extends Thread {
+    /**
+     * 
+     */
+    SolrClient solrClient = null;
+    Collection<SolrInputDocument> localBuffer = new ArrayList<SolrInputDocument>();
+    long localBufferBytesSize = 0;
+    Map<String, InputMarker> latestInputMarkerList = new HashMap<String, InputMarker>();
+
+    /**
+     * 
+     */
+    public SolrWorkerThread(SolrClient solrClient) {
+      this.solrClient = solrClient;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Runnable#run()
+     */
+    @Override
+    public void run() {
+      logger.info("SolrWriter thread started");
+      long lastDispatchTime = System.currentTimeMillis();
+
+      //long totalWaitTimeMS = 0;
+      while (true) {
+        long currTimeMS = System.currentTimeMillis();
+        OutputData outputData = null;
+        try {
+          long nextDispatchDuration = maxIntervalMS
+              - (currTimeMS - lastDispatchTime);
+          outputData = outgoingBuffer.poll();
+          if (outputData == null && !isDrain()
+              && nextDispatchDuration > 0) {
+            outputData = outgoingBuffer.poll(nextDispatchDuration,
+                TimeUnit.MILLISECONDS);
+//            long diffTimeMS = System.currentTimeMillis()
+//                - currTimeMS;
+            // logger.info("Waited for " + diffTimeMS +
+            // " ms, planned for "
+            // + nextDispatchDuration + " ms, localBuffer.size="
+            // + localBuffer.size() + ", timedOut="
+            // + (outputData == null ? "true" : "false"));
+          }
+
+          if (isDrain() && outputData == null
+              && outgoingBuffer.size() == 0) {
+            break;
+          }
+          if (outputData != null) {
+            if (outputData.jsonObj.get("id") == null) {
+              outputData.jsonObj.put("id", UUID.randomUUID()
+                  .toString());
+            }
+            SolrInputDocument document = new SolrInputDocument();
+            for (String name : outputData.jsonObj.keySet()) {
+              Object obj = outputData.jsonObj.get(name);
+              document.addField(name, obj);
+              try {
+                localBufferBytesSize += obj.toString().length();
+              } catch (Throwable t) {
+                final String LOG_MESSAGE_KEY = this.getClass()
+                    .getSimpleName() + "_BYTE_COUNT_ERROR";
+                LogFeederUtil.logErrorMessageByInterval(
+                    LOG_MESSAGE_KEY,
+                    "Error calculating byte size. object="
+                        + obj, t, logger, Level.ERROR);
+
+              }
+            }
+            latestInputMarkerList.put(
+                outputData.inputMarker.base64FileKey,
+                outputData.inputMarker);
+            localBuffer.add(document);
+          }
+
+          if (localBuffer.size() > 0
+              && ((outputData == null && isDrain()) || (nextDispatchDuration <= 0 || localBuffer
+                  .size() >= maxBufferSize))) {
+            try {
+              if (isComputeCurrentCollection) {
+                // Compute the current router value
+
+                int weekDay = Calendar.getInstance().get(
+                    Calendar.DAY_OF_WEEK);
+                int currHour = Calendar.getInstance().get(
+                    Calendar.HOUR_OF_DAY);
+                int currMin = Calendar.getInstance().get(
+                    Calendar.MINUTE);
+
+                int minOfWeek = (weekDay - 1) * 24 * 60
+                    + currHour * 60 + currMin;
+                int slotByMin = minOfWeek / splitInterval
+                    % numberOfShards;
+
+                String shard = "shard" + slotByMin;
+
+                if (lastSlotByMin != slotByMin) {
+                  logger.info("Switching to shard " + shard
+                      + ", output="
+                      + getShortDescription());
+                  lastSlotByMin = slotByMin;
+                }
+
+                for (SolrInputDocument solrInputDocument : localBuffer) {
+                  solrInputDocument.addField(ROUTER_FIELD,
+                      shard);
+                }
+              }
+
+//              long beginTime = System.currentTimeMillis();
+              UpdateResponse response = solrClient
+                  .add(localBuffer);
+//              long endTime = System.currentTimeMillis();
+//              logger.info("Adding to Solr. Document count="
+//                  + localBuffer.size() + ". Took "
+//                  + (endTime - beginTime) + " ms");
+
+              if (response.getStatus() != 0) {
+                final String LOG_MESSAGE_KEY = this.getClass()
+                    .getSimpleName() + "_SOLR_UPDATE_ERROR";
+                LogFeederUtil
+                    .logErrorMessageByInterval(
+                        LOG_MESSAGE_KEY,
+                        "Error writing to Solr. response="
+                            + response.toString()
+                            + ", log="
+                            + (outputData == null ? null
+                                : outputData
+                                    .toString()),
+                        null, logger, Level.ERROR);
+              }
+              statMetric.count += localBuffer.size();
+              writeBytesMetric.count += localBufferBytesSize;
+              for (InputMarker inputMarker : latestInputMarkerList
+                  .values()) {
+                inputMarker.input.checkIn(inputMarker);
+              }
+
+              resetLocalBuffer();
+              lastDispatchTime = System.currentTimeMillis();
+            } catch (IOException ioException) {
+              // Transient error, lets block till it is available
+              while (!isDrain()) {
+                try {
+                  logger.warn("Solr is down. Going to sleep for "
+                      + RETRY_INTERVAL
+                      + " seconds. output="
+                      + getShortDescription());
+                  Thread.sleep(RETRY_INTERVAL * 1000);
+                } catch (Throwable t) {
+                  // ignore
+                  break;
+                }
+                if (isDrain()) {
+                  break;
+                }
+                try {
+                  SolrPingResponse pingResponse = solrClient
+                      .ping();
+                  if (pingResponse.getStatus() == 0) {
+                    logger.info("Solr seems to be up now. Resuming... output="
+                        + getShortDescription());
+                    break;
+                  }
+                } catch (Throwable t) {
+                  // Ignore
+                }
+              }
+            } catch (Throwable serverException) {
+              // Clear the buffer
+              resetLocalBuffer();
+              final String LOG_MESSAGE_KEY = this.getClass()
+                  .getSimpleName() + "_SOLR_UPDATE_EXCEPTION";
+              LogFeederUtil.logErrorMessageByInterval(
+                  LOG_MESSAGE_KEY,
+                  "Error sending log message to server. "
+                      + (outputData == null ? null
+                          : outputData.toString()),
+                  serverException, logger, Level.ERROR);
+            }
+          }
+        } catch (InterruptedException e) {
+          // Handle thread exiting
+        } catch (Throwable t) {
+          final String LOG_MESSAGE_KEY = this.getClass()
+              .getSimpleName() + "_SOLR_MAINLOOP_EXCEPTION";
+          LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+              "Caught exception in main loop. " + outputData, t,
+              logger, Level.ERROR);
+        }
+      }
+
+      if (solrClient != null) {
+        try {
+          solrClient.close();
+        } catch (IOException e) {
+          // Ignore
+        }
+      }
+
+      resetLocalBuffer();
+      logger.info("Exiting Solr writer thread. output="
+          + getShortDescription());
+    }
+
+    public boolean isDone() {
+      return localBuffer.size() == 0;
+    }
+
+    public void resetLocalBuffer() {
+      localBuffer.clear();
+      localBufferBytesSize = 0;
+      latestInputMarkerList.clear();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
new file mode 100644
index 0000000..4265dc6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.util;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.logconfig.LogFeederConstants;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.SolrRequest.METHOD;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.response.CollectionAdminResponse;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+
+public class SolrUtil {
+
+  private static Logger logger = Logger.getLogger(SolrUtil.class);
+
+  private static SolrUtil instance = null;
+  SolrClient solrClient = null;
+  CloudSolrClient solrClouldClient = null;
+
+  boolean isSolrCloud = true;
+  String solrDetail = "";
+  String collectionName = null;
+
+  private SolrUtil() throws Exception {
+    String url = LogFeederUtil.getStringProperty("logfeeder.solr.url");
+    String zkHosts = LogFeederUtil.getStringProperty("logfeeder.solr.zkhosts");
+    String collection = LogFeederUtil.getStringProperty("logfeeder.solr.core.history", "history");
+    connectToSolr(url, zkHosts, collection);
+  }
+
+  public static SolrUtil getInstance() {
+    if (instance == null) {
+      synchronized (SolrUtil.class) {
+        if (instance == null) {
+          try {
+            instance = new SolrUtil();
+          } catch (Exception e) {
+            logger.error(e);
+          }
+        }
+      }
+    }
+    return instance;
+  }
+
+  public SolrClient connectToSolr(String url, String zkHosts,
+                                  String collection) throws Exception {
+    this.collectionName = collection;
+    solrDetail = "zkHosts=" + zkHosts + ", collection=" + collection
+      + ", url=" + url;
+
+    logger.info("connectToSolr() " + solrDetail);
+    if (collection == null || collection.isEmpty()) {
+      throw new Exception("For solr, collection name is mandatory. "
+        + solrDetail);
+    }
+    if (zkHosts != null && !zkHosts.isEmpty()) {
+      solrDetail = "zkHosts=" + zkHosts + ", collection=" + collection;
+      logger.info("Using zookeepr. " + solrDetail);
+      solrClouldClient = new CloudSolrClient(zkHosts);
+      solrClouldClient.setDefaultCollection(collection);
+      solrClient = solrClouldClient;
+      int waitDurationMS = 3 * 60 * 1000;
+      checkSolrStatus(waitDurationMS);
+    } else {
+      if (url == null || url.trim().isEmpty()) {
+        throw new Exception("Both zkHosts and URL are empty. zkHosts="
+          + zkHosts + ", collection=" + collection + ", url="
+          + url);
+      }
+      solrDetail = "collection=" + collection + ", url=" + url;
+      String collectionURL = url + "/" + collection;
+      logger.info("Connecting to  solr : " + collectionURL);
+      solrClient = new HttpSolrClient(collectionURL);
+
+    }
+    return solrClient;
+  }
+
+  /**
+   * @param waitDurationMS
+   * @return
+   */
+  public boolean checkSolrStatus(int waitDurationMS) {
+    boolean status = false;
+    try {
+      long beginTimeMS = System.currentTimeMillis();
+      long waitIntervalMS = 2000;
+      int pingCount = 0;
+      while (true) {
+        pingCount++;
+        CollectionAdminResponse response = null;
+        try {
+          CollectionAdminRequest.List colListReq = new CollectionAdminRequest.List();
+          response = colListReq.process(solrClient);
+        } catch (Exception ex) {
+          logger.error("Con't connect to Solr. solrDetail=" + solrDetail, ex);
+        }
+        if (response != null && response.getStatus() == 0) {
+          logger.info("Solr getCollections() is success. solr=" + solrDetail);
+          status = true;
+          break;
+        }
+        if (System.currentTimeMillis() - beginTimeMS > waitDurationMS) {
+          logger.error("Solr is not reachable even after "
+            + (System.currentTimeMillis() - beginTimeMS)
+            + " ms. If you are using alias, then you might have to restart LogSearch after Solr is up and running. solr="
+            + solrDetail + ", response=" + response);
+          break;
+        } else {
+          logger.warn("Solr is not not reachable yet. getCollections() attempt count=" + pingCount
+            + ". Will sleep for " + waitIntervalMS + " ms and try again." + " solr=" + solrDetail
+            + ", response=" + response);
+
+        }
+        Thread.sleep(waitIntervalMS);
+      }
+    } catch (Throwable t) {
+      logger.error("Seems Solr is not up. solrDetail=" + solrDetail);
+    }
+    return status;
+  }
+
+  /**
+   * @param solrQuery
+   * @return
+   * @throws SolrServerException
+   * @throws IOException
+   * @throws SolrException
+   */
+  public QueryResponse process(SolrQuery solrQuery) throws SolrServerException, IOException, SolrException {
+    if (solrClient != null) {
+      QueryResponse queryResponse = solrClient.query(solrQuery, METHOD.POST);
+      return queryResponse;
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * @return
+   */
+  public HashMap<String, Object> getConfigDoc() {
+    HashMap<String, Object> configMap = new HashMap<String, Object>();
+    SolrQuery solrQuery = new SolrQuery();
+    solrQuery.setQuery("*:*");
+    String fq = LogFeederConstants.ROW_TYPE + ":" + LogFeederConstants.NAME;
+    solrQuery.setFilterQueries(fq);
+    try {
+      QueryResponse response = SolrUtil.getInstance().process(solrQuery);
+      SolrDocumentList documentList = response.getResults();
+      if (documentList != null && documentList.size() > 0) {
+        SolrDocument configDoc = documentList.get(0);
+        String configJson = LogFeederUtil.getGson().toJson(configDoc);
+        configMap = (HashMap<String, Object>) LogFeederUtil.toJSONObject(configJson);
+      }
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+    }
+    return configMap;
+  }
+
+  /**
+   * @param solrInputDocument
+   * @throws SolrServerException
+   * @throws IOException
+   */
+  public void addDoc(SolrInputDocument solrInputDocument) throws SolrServerException, IOException {
+    solrClient.add(solrInputDocument);
+    solrClient.commit();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilter.java
new file mode 100644
index 0000000..f030040
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilter.java
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.view;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogfeederFilter {
+
+  private String label;
+  private List<String> hosts;
+  private List<String> defaultLevels;
+  private List<String> overrideLevels;
+  private String expiryTime;
+
+  public VLogfeederFilter() {
+    hosts = new ArrayList<String>();
+    defaultLevels = new ArrayList<String>();
+    overrideLevels = new ArrayList<String>();
+  }
+
+  public String getLabel() {
+    return label;
+  }
+
+  public void setLabel(String label) {
+    this.label = label;
+  }
+
+  public List<String> getHosts() {
+    return hosts;
+  }
+
+  public void setHosts(List<String> hosts) {
+    this.hosts = hosts;
+  }
+
+  public List<String> getDefaultLevels() {
+    return defaultLevels;
+  }
+
+  public void setDefaultLevels(List<String> defaultLevels) {
+    this.defaultLevels = defaultLevels;
+  }
+
+  public List<String> getOverrideLevels() {
+    return overrideLevels;
+  }
+
+  public void setOverrideLevels(List<String> overrideLevels) {
+    this.overrideLevels = overrideLevels;
+  }
+
+  public String getExpiryTime() {
+    return expiryTime;
+  }
+
+  public void setExpiryTime(String expiryTime) {
+    this.expiryTime = expiryTime;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilterWrapper.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilterWrapper.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilterWrapper.java
new file mode 100644
index 0000000..4ddef3f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/view/VLogfeederFilterWrapper.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.view;
+
+import java.util.HashMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.annotate.JsonAutoDetect;
+import org.codehaus.jackson.annotate.JsonAutoDetect.Visibility;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+@JsonAutoDetect(getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, fieldVisibility = Visibility.ANY)
+@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class VLogfeederFilterWrapper {
+
+  private HashMap<String, VLogfeederFilter> filter;
+  private String id;
+
+  public HashMap<String, VLogfeederFilter> getFilter() {
+    return filter;
+  }
+
+  public void setFilter(HashMap<String, VLogfeederFilter> filter) {
+    this.filter = filter;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public void setId(String id) {
+    this.id = id;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
new file mode 100644
index 0000000..956af16
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/AbstractTimelineMetricsSink.java
@@ -0,0 +1,95 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+public abstract class AbstractTimelineMetricsSink {
+  public static final String TAGS_FOR_PREFIX_PROPERTY_PREFIX = "tagsForPrefix.";
+  public static final String MAX_METRIC_ROW_CACHE_SIZE = "maxRowCacheSize";
+  public static final String METRICS_SEND_INTERVAL = "sendInterval";
+  public static final String METRICS_POST_TIMEOUT_SECONDS = "timeout";
+  public static final String COLLECTOR_HOST_PROPERTY = "collector";
+  public static final String COLLECTOR_PORT_PROPERTY = "port";
+  public static final int DEFAULT_POST_TIMEOUT_SECONDS = 10;
+
+  protected final Log LOG;
+
+  protected static ObjectMapper mapper;
+
+  static {
+    mapper = new ObjectMapper();
+    AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
+    mapper.setAnnotationIntrospector(introspector);
+    mapper.getSerializationConfig()
+        .setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
+  }
+
+  public AbstractTimelineMetricsSink() {
+    LOG = LogFactory.getLog(this.getClass());
+  }
+
+  protected void emitMetrics(TimelineMetrics metrics) {
+    String connectUrl = getCollectorUri();
+    int timeout = getTimeoutSeconds() * 1000;
+    try {
+      String jsonData = mapper.writeValueAsString(metrics);
+      LOG.info("Posting JSON=" + jsonData);
+      
+      HttpURLConnection connection =
+        (HttpURLConnection) new URL(connectUrl).openConnection();
+
+      connection.setRequestMethod("POST");
+      connection.setRequestProperty("Content-Type", "application/json");
+      connection.setConnectTimeout(timeout);
+      connection.setReadTimeout(timeout);
+      connection.setDoOutput(true);
+
+      if (jsonData != null) {
+        try (OutputStream os = connection.getOutputStream()) {
+          os.write(jsonData.getBytes("UTF-8"));
+        }
+      }
+
+      int statusCode = connection.getResponseCode();
+
+      if (statusCode != 200) {
+        LOG.info("Unable to POST metrics to collector, " + connectUrl + ", " +
+          "statusCode = " + statusCode);
+      } else {
+        LOG.debug("Metrics posted to Collector " + connectUrl);
+      }
+    } catch (IOException e) {
+      throw new UnableToConnectException(e).setConnectUrl(connectUrl);
+    }
+  }
+
+  abstract protected String getCollectorUri();
+
+  abstract protected int getTimeoutSeconds();
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/Precision.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/Precision.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/Precision.java
new file mode 100644
index 0000000..31044cc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/Precision.java
@@ -0,0 +1,79 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+/**
+ * Is used to determine metrics aggregate table.
+ *
+ * @see org.apache.hadoop.yarn.server.applicationhistoryservice.webapp.TimelineWebServices#getTimelineMetric
+ */
+public enum Precision {
+  SECONDS,
+  MINUTES,
+  HOURS,
+  DAYS;
+
+  public static class PrecisionFormatException extends IllegalArgumentException {
+    public PrecisionFormatException(String message, Throwable cause) {
+      super(message, cause);
+    }
+  }
+
+  public static Precision getPrecision(String precision) throws PrecisionFormatException {
+    if (precision == null ) {
+      return null;
+    }
+    try {
+      return Precision.valueOf(precision.toUpperCase());
+    } catch (IllegalArgumentException e) {
+      throw new PrecisionFormatException("precision should be seconds, " +
+        "minutes, hours or days", e);
+    }
+  }
+
+  public static Precision getPrecision(long startTime, long endTime) {
+    long HOUR = 3600000; // 1 hour
+    long DAY = 86400000; // 1 day
+    long timeRange = endTime - startTime;
+    if (timeRange > 30 * DAY) {
+      return Precision.DAYS;
+    } else if (timeRange > 1 * DAY) {
+      return Precision.HOURS;
+    } else if (timeRange > 2 * HOUR) {
+      return Precision.MINUTES;
+    } else {
+      return Precision.SECONDS;
+    }
+  }
+
+  public static Precision getHigherPrecision(Precision precision) {
+
+    if (precision == null)
+      return null;
+
+    if (precision.equals(Precision.SECONDS)) {
+      return Precision.MINUTES;
+    } else if (precision.equals(Precision.MINUTES)) {
+      return Precision.HOURS;
+    } else if (precision.equals(Precision.HOURS)) {
+      return Precision.DAYS;
+    } else {
+      return null;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/PrecisionLimitExceededException.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/PrecisionLimitExceededException.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/PrecisionLimitExceededException.java
new file mode 100644
index 0000000..962a071
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/PrecisionLimitExceededException.java
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+public class PrecisionLimitExceededException extends IllegalArgumentException {
+
+  private static final long serialVersionUID = 1L;
+
+  public PrecisionLimitExceededException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public PrecisionLimitExceededException(String message) {
+    super(message);
+  }
+
+  public PrecisionLimitExceededException(Throwable cause) {
+    super(cause);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
new file mode 100644
index 0000000..8ecca54
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/SingleValuedTimelineMetric.java
@@ -0,0 +1,107 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+/**
+ * This class prevents creating a TreeMap for every instantiation of a metric
+ * read from the store. The methods are meant to provide interoperability
+ * with @TimelineMetric
+ */
+public class SingleValuedTimelineMetric {
+  private Long timestamp;
+  private Double value;
+  private String metricName;
+  private String appId;
+  private String instanceId;
+  private String hostName;
+  private Long startTime;
+  private String type;
+
+  public void setSingleTimeseriesValue(Long timestamp, Double value) {
+    this.timestamp = timestamp;
+    this.value = value;
+  }
+
+  public SingleValuedTimelineMetric(String metricName, String appId,
+                                    String instanceId, String hostName,
+                                    long timestamp, long startTime, String type) {
+    this.metricName = metricName;
+    this.appId = appId;
+    this.instanceId = instanceId;
+    this.hostName = hostName;
+    this.timestamp = timestamp;
+    this.startTime = startTime;
+    this.type = type;
+  }
+
+  public Long getTimestamp() {
+    return timestamp;
+  }
+
+  public long getStartTime() {
+    return startTime;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public Double getValue() {
+    return value;
+  }
+
+  public String getMetricName() {
+    return metricName;
+  }
+
+  public String getAppId() {
+    return appId;
+  }
+
+  public String getInstanceId() {
+    return instanceId;
+  }
+
+  public String getHostName() {
+    return hostName;
+  }
+
+  public boolean equalsExceptTime(TimelineMetric metric) {
+    if (!metricName.equals(metric.getMetricName())) return false;
+    if (hostName != null ? !hostName.equals(metric.getHostName()) : metric.getHostName() != null)
+      return false;
+    if (appId != null ? !appId.equals(metric.getAppId()) : metric.getAppId() != null)
+      return false;
+    if (instanceId != null ? !instanceId.equals(metric.getInstanceId()) : metric.getInstanceId() != null) return false;
+
+    return true;
+  }
+
+  public TimelineMetric getTimelineMetric() {
+    TimelineMetric metric = new TimelineMetric();
+    metric.setMetricName(this.metricName);
+    metric.setAppId(this.appId);
+    metric.setHostName(this.hostName);
+    metric.setType(this.type);
+    metric.setInstanceId(this.instanceId);
+    metric.setStartTime(this.startTime);
+    metric.setTimestamp(this.timestamp);
+    metric.getMetricValues().put(timestamp, value);
+    return metric;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
new file mode 100644
index 0000000..0e74f2d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetric.java
@@ -0,0 +1,188 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.codehaus.jackson.map.annotate.JsonDeserialize;
+
+@XmlRootElement(name = "metric")
+@XmlAccessorType(XmlAccessType.NONE)
+public class TimelineMetric implements Comparable<TimelineMetric> {
+
+  private String metricName;
+  private String appId;
+  private String instanceId;
+  private String hostName;
+  private long timestamp;
+  private long startTime;
+  private String type;
+  private TreeMap<Long, Double> metricValues = new TreeMap<Long, Double>();
+
+  // default
+  public TimelineMetric() {
+
+  }
+
+  // copy constructor
+  public TimelineMetric(TimelineMetric metric) {
+    setMetricName(metric.getMetricName());
+    setType(metric.getType());
+    setTimestamp(metric.getTimestamp());
+    setAppId(metric.getAppId());
+    setInstanceId(metric.getInstanceId());
+    setHostName(metric.getHostName());
+    setStartTime(metric.getStartTime());
+    setMetricValues(new TreeMap<Long, Double>(metric.getMetricValues()));
+  }
+
+  @XmlElement(name = "metricname")
+  public String getMetricName() {
+    return metricName;
+  }
+
+  public void setMetricName(String metricName) {
+    this.metricName = metricName;
+  }
+
+  @XmlElement(name = "appid")
+  public String getAppId() {
+    return appId;
+  }
+
+  public void setAppId(String appId) {
+    this.appId = appId;
+  }
+
+  @XmlElement(name = "instanceid")
+  public String getInstanceId() {
+    return instanceId;
+  }
+
+  public void setInstanceId(String instanceId) {
+    this.instanceId = instanceId;
+  }
+
+  @XmlElement(name = "hostname")
+  public String getHostName() {
+    return hostName;
+  }
+
+  public void setHostName(String hostName) {
+    this.hostName = hostName;
+  }
+
+  @XmlElement(name = "timestamp")
+  public long getTimestamp() {
+    return timestamp;
+  }
+
+  public void setTimestamp(long timestamp) {
+    this.timestamp = timestamp;
+  }
+
+  @XmlElement(name = "starttime")
+  public long getStartTime() {
+    return startTime;
+  }
+
+  public void setStartTime(long startTime) {
+    this.startTime = startTime;
+  }
+
+  @XmlElement(name = "type")
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  @XmlElement(name = "metrics")
+  public TreeMap<Long, Double> getMetricValues() {
+    return metricValues;
+  }
+
+  public void setMetricValues(TreeMap<Long, Double> metricValues) {
+    this.metricValues = metricValues;
+  }
+
+  public void addMetricValues(Map<Long, Double> metricValues) {
+    this.metricValues.putAll(metricValues);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) return true;
+    if (o == null || getClass() != o.getClass()) return false;
+
+    TimelineMetric metric = (TimelineMetric) o;
+
+    if (!metricName.equals(metric.metricName)) return false;
+    if (hostName != null ? !hostName.equals(metric.hostName) : metric.hostName != null)
+      return false;
+    if (appId != null ? !appId.equals(metric.appId) : metric.appId != null)
+      return false;
+    if (instanceId != null ? !instanceId.equals(metric.instanceId) : metric.instanceId != null)
+      return false;
+    if (timestamp != metric.timestamp) return false;
+    if (startTime != metric.startTime) return false;
+
+    return true;
+  }
+
+  public boolean equalsExceptTime(TimelineMetric metric) {
+    if (!metricName.equals(metric.metricName)) return false;
+    if (hostName != null ? !hostName.equals(metric.hostName) : metric.hostName != null)
+      return false;
+    if (appId != null ? !appId.equals(metric.appId) : metric.appId != null)
+      return false;
+    if (instanceId != null ? !instanceId.equals(metric.instanceId) : metric.instanceId != null)
+      return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = metricName.hashCode();
+    result = 31 * result + (appId != null ? appId.hashCode() : 0);
+    result = 31 * result + (instanceId != null ? instanceId.hashCode() : 0);
+    result = 31 * result + (hostName != null ? hostName.hashCode() : 0);
+    result = 31 * result + (int) (timestamp ^ (timestamp >>> 32));
+    return result;
+  }
+
+  @Override
+  public int compareTo(TimelineMetric other) {
+    if (timestamp > other.timestamp) {
+      return -1;
+    } else if (timestamp < other.timestamp) {
+      return 1;
+    } else {
+      return metricName.compareTo(other.metricName);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetrics.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetrics.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetrics.java
new file mode 100644
index 0000000..11ca665
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/TimelineMetrics.java
@@ -0,0 +1,123 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * The class that hosts a list of timeline entities.
+ */
+@XmlRootElement(name = "metrics")
+@XmlAccessorType(XmlAccessType.NONE)
+public class TimelineMetrics {
+
+  private List<TimelineMetric> allMetrics = new ArrayList<TimelineMetric>();
+
+  public TimelineMetrics() {}
+
+  @XmlElement(name = "metrics")
+  public List<TimelineMetric> getMetrics() {
+    return allMetrics;
+  }
+
+  public void setMetrics(List<TimelineMetric> allMetrics) {
+    this.allMetrics = allMetrics;
+  }
+
+  private boolean isEqualTimelineMetrics(TimelineMetric metric1,
+                                         TimelineMetric metric2) {
+
+    boolean isEqual = true;
+
+    if (!metric1.getMetricName().equals(metric2.getMetricName())) {
+      return false;
+    }
+
+    if (metric1.getHostName() != null) {
+      isEqual = metric1.getHostName().equals(metric2.getHostName());
+    }
+
+    if (metric1.getAppId() != null) {
+      isEqual = metric1.getAppId().equals(metric2.getAppId());
+    }
+
+    return isEqual;
+  }
+
+  /**
+   * Merge with existing TimelineMetric if everything except startTime is
+   * the same.
+   * @param metric {@link TimelineMetric}
+   */
+  public void addOrMergeTimelineMetric(TimelineMetric metric) {
+    TimelineMetric metricToMerge = null;
+
+    if (!allMetrics.isEmpty()) {
+      for (TimelineMetric timelineMetric : allMetrics) {
+        if (timelineMetric.equalsExceptTime(metric)) {
+          metricToMerge = timelineMetric;
+          break;
+        }
+      }
+    }
+
+    if (metricToMerge != null) {
+      metricToMerge.addMetricValues(metric.getMetricValues());
+      if (metricToMerge.getTimestamp() > metric.getTimestamp()) {
+        metricToMerge.setTimestamp(metric.getTimestamp());
+      }
+      if (metricToMerge.getStartTime() > metric.getStartTime()) {
+        metricToMerge.setStartTime(metric.getStartTime());
+      }
+    } else {
+      allMetrics.add(metric);
+    }
+  }
+
+  // Optimization that addresses too many TreeMaps from getting created.
+  public void addOrMergeTimelineMetric(SingleValuedTimelineMetric metric) {
+    TimelineMetric metricToMerge = null;
+
+    if (!allMetrics.isEmpty()) {
+      for (TimelineMetric timelineMetric : allMetrics) {
+        if (metric.equalsExceptTime(timelineMetric)) {
+          metricToMerge = timelineMetric;
+          break;
+        }
+      }
+    }
+
+    if (metricToMerge != null) {
+      metricToMerge.getMetricValues().put(metric.getTimestamp(), metric.getValue());
+      if (metricToMerge.getTimestamp() > metric.getTimestamp()) {
+        metricToMerge.setTimestamp(metric.getTimestamp());
+      }
+      if (metricToMerge.getStartTime() > metric.getStartTime()) {
+        metricToMerge.setStartTime(metric.getStartTime());
+      }
+    } else {
+      allMetrics.add(metric.getTimelineMetric());
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/UnableToConnectException.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/UnableToConnectException.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/UnableToConnectException.java
new file mode 100644
index 0000000..797924f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/UnableToConnectException.java
@@ -0,0 +1,46 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline;
+
+public class UnableToConnectException extends RuntimeException {
+
+  private static final long serialVersionUID = 1L;
+
+  private String connectUrl;
+
+  public UnableToConnectException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public UnableToConnectException(String message) {
+    super(message);
+  }
+
+  public UnableToConnectException(Throwable cause) {
+    super(cause);
+  }
+
+  public UnableToConnectException setConnectUrl(String connectUrl) {
+    this.connectUrl = connectUrl;
+    return this;
+  }
+
+  public String getConnectUrl() {
+    return connectUrl;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
new file mode 100644
index 0000000..a331c77
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/cache/TimelineMetricsCache.java
@@ -0,0 +1,175 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.timeline.cache;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class TimelineMetricsCache {
+
+  private final TimelineMetricHolder timelineMetricCache = new TimelineMetricHolder();
+  private static final Log LOG = LogFactory.getLog(TimelineMetric.class);
+  public static final int MAX_RECS_PER_NAME_DEFAULT = 10000;
+  public static final int MAX_EVICTION_TIME_MILLIS = 59000; // ~ 1 min
+  private final int maxRecsPerName;
+  private final int maxEvictionTimeInMillis;
+  private final Map<String, Double> counterMetricLastValue = new HashMap<String, Double>();
+
+  public TimelineMetricsCache(int maxRecsPerName, int maxEvictionTimeInMillis) {
+    this.maxRecsPerName = maxRecsPerName;
+    this.maxEvictionTimeInMillis = maxEvictionTimeInMillis;
+  }
+
+  class TimelineMetricWrapper {
+    private long timeDiff = -1;
+    private long oldestTimestamp = -1;
+    private TimelineMetric timelineMetric;
+
+    TimelineMetricWrapper(TimelineMetric timelineMetric) {
+      this.timelineMetric = timelineMetric;
+      this.oldestTimestamp = timelineMetric.getStartTime();
+    }
+
+    private void updateTimeDiff(long timestamp) {
+      if (oldestTimestamp != -1 && timestamp > oldestTimestamp) {
+        timeDiff = timestamp - oldestTimestamp;
+      } else {
+        oldestTimestamp = timestamp;
+      }
+    }
+
+    public void putMetric(TimelineMetric metric) {
+      this.timelineMetric.addMetricValues(metric.getMetricValues());
+      updateTimeDiff(metric.getStartTime());
+    }
+
+    public long getTimeDiff() {
+      return timeDiff;
+    }
+
+    public TimelineMetric getTimelineMetric() {
+      return timelineMetric;
+    }
+  }
+
+  // TODO: Change to ConcurentHashMap with weighted eviction
+  class TimelineMetricHolder extends LinkedHashMap<String, TimelineMetricWrapper> {//
+    private static final long serialVersionUID = 1L;
+    private boolean gotOverflow = false;
+    // To avoid duplication at the end of the buffer and beginning of the next
+    // segment of values
+    private Map<String, Long> endOfBufferTimestamps = new HashMap<String, Long>();
+
+    @Override
+    protected boolean removeEldestEntry(Map.Entry<String, TimelineMetricWrapper> eldest) {
+      boolean overflow = size() > maxRecsPerName;
+      if (overflow && !gotOverflow) {
+        LOG.warn("Metrics cache overflow at "+ size() +" for "+ eldest);
+        gotOverflow = true;
+      }
+      return overflow;
+    }
+
+    public TimelineMetric evict(String metricName) {
+      TimelineMetricWrapper metricWrapper = this.get(metricName);
+
+      if (metricWrapper == null
+        || metricWrapper.getTimeDiff() < getMaxEvictionTimeInMillis()) {
+        return null;
+      }
+
+      TimelineMetric timelineMetric = metricWrapper.getTimelineMetric();
+      this.remove(metricName);
+
+      return timelineMetric;
+    }
+
+    public void put(String metricName, TimelineMetric timelineMetric) {
+      if (isDuplicate(timelineMetric)) {
+        return;
+      }
+      TimelineMetricWrapper metric = this.get(metricName);
+      if (metric == null) {
+        this.put(metricName, new TimelineMetricWrapper(timelineMetric));
+      } else {
+        metric.putMetric(timelineMetric);
+      }
+      // Buffer last ts value
+      endOfBufferTimestamps.put(metricName, timelineMetric.getStartTime());
+    }
+
+    /**
+     * Test whether last buffered timestamp is same as the newly received.
+     * @param timelineMetric @TimelineMetric
+     * @return true/false
+     */
+    private boolean isDuplicate(TimelineMetric timelineMetric) {
+      return endOfBufferTimestamps.containsKey(timelineMetric.getMetricName())
+        && endOfBufferTimestamps.get(timelineMetric.getMetricName()).equals(timelineMetric.getStartTime());
+    }
+  }
+
+  public TimelineMetric getTimelineMetric(String metricName) {
+    if (timelineMetricCache.containsKey(metricName)) {
+      return timelineMetricCache.evict(metricName);
+    }
+
+    return null;
+  }
+
+  /**
+   * Getter method to help testing eviction
+   * @return @int
+   */
+  public int getMaxEvictionTimeInMillis() {
+    return maxEvictionTimeInMillis;
+  }
+
+  public void putTimelineMetric(TimelineMetric timelineMetric) {
+    timelineMetricCache.put(timelineMetric.getMetricName(), timelineMetric);
+  }
+
+  private void transformMetricValuesToDerivative(TimelineMetric timelineMetric) {
+    String metricName = timelineMetric.getMetricName();
+    double firstValue = timelineMetric.getMetricValues().size() > 0
+        ? timelineMetric.getMetricValues().entrySet().iterator().next().getValue() : 0;
+    Double value = counterMetricLastValue.get(metricName);
+    double previousValue = value != null ? value : firstValue;
+    Map<Long, Double> metricValues = timelineMetric.getMetricValues();
+    TreeMap<Long, Double>   newMetricValues = new TreeMap<Long, Double>();
+    for (Map.Entry<Long, Double> entry : metricValues.entrySet()) {
+      newMetricValues.put(entry.getKey(), entry.getValue() - previousValue);
+      previousValue = entry.getValue();
+    }
+    timelineMetric.setMetricValues(newMetricValues);
+    counterMetricLastValue.put(metricName, previousValue);
+  }
+
+  public void putTimelineMetric(TimelineMetric timelineMetric, boolean isCounter) {
+    if (isCounter) {
+      transformMetricValuesToDerivative(timelineMetric);
+    }
+    putTimelineMetric(timelineMetric);
+  }
+}


[03/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar.js
new file mode 100644
index 0000000..e7c1c02
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar", "default", {
+	name: "ar",
+	englishName: "Arabic",
+	nativeName: "العربية",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ر.س.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_Localized: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn-CL.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn-CL.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn-CL.js
new file mode 100644
index 0000000..b898ab3
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn-CL.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture arn-CL
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "arn-CL", "default", {
+	name: "arn-CL",
+	englishName: "Mapudungun (Chile)",
+	nativeName: "Mapudungun (Chile)",
+	language: "arn",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "NeuN",
+		negativeInfinity: "-Infinito",
+		positiveInfinity: "Infinito",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-$ n","$ n"],
+			",": ".",
+			".": ","
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			days: {
+				names: ["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],
+				namesAbbr: ["dom","lun","mar","mié","jue","vie","sáb"],
+				namesShort: ["do","lu","ma","mi","ju","vi","sá"]
+			},
+			months: {
+				names: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],
+				namesAbbr: ["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"d.C.","start":null,"offset":0}],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "dddd, dd' de 'MMMM' de 'yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, dd' de 'MMMM' de 'yyyy H:mm",
+				F: "dddd, dd' de 'MMMM' de 'yyyy H:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM' de 'yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn.js
new file mode 100644
index 0000000..b27f5d5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.arn.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture arn
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "arn", "default", {
+	name: "arn",
+	englishName: "Mapudungun",
+	nativeName: "Mapudungun",
+	language: "arn",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "NeuN",
+		negativeInfinity: "-Infinito",
+		positiveInfinity: "Infinito",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-$ n","$ n"],
+			",": ".",
+			".": ","
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			days: {
+				names: ["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],
+				namesAbbr: ["dom","lun","mar","mié","jue","vie","sáb"],
+				namesShort: ["do","lu","ma","mi","ju","vi","sá"]
+			},
+			months: {
+				names: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],
+				namesAbbr: ["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"d.C.","start":null,"offset":0}],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "dddd, dd' de 'MMMM' de 'yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, dd' de 'MMMM' de 'yyyy H:mm",
+				F: "dddd, dd' de 'MMMM' de 'yyyy H:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM' de 'yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as-IN.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as-IN.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as-IN.js
new file mode 100644
index 0000000..fe97442
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as-IN.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture as-IN
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "as-IN", "default", {
+	name: "as-IN",
+	englishName: "Assamese (India)",
+	nativeName: "অসমীয়া (ভাৰত)",
+	language: "as",
+	numberFormat: {
+		groupSizes: [3,2],
+		"NaN": "nan",
+		negativeInfinity: "-infinity",
+		positiveInfinity: "infinity",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,2]
+		},
+		currency: {
+			pattern: ["$ -n","n$"],
+			groupSizes: [3,2],
+			symbol: "ট"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["সোমবাৰ","মঙ্গলবাৰ","বুধবাৰ","বৃহস্পতিবাৰ","শুক্রবাৰ","শনিবাৰ","ৰবিবাৰ"],
+				namesAbbr: ["সোম.","মঙ্গল.","বুধ.","বৃহ.","শুক্র.","শনি.","ৰবি."],
+				namesShort: ["সো","ম","বু","বৃ","শু","শ","র"]
+			},
+			months: {
+				names: ["জানুৱাৰী","ফেব্রুৱাৰী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টেম্বর","অক্টোবর","নবেম্বর","ডিচেম্বর",""],
+				namesAbbr: ["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টে","অক্টো","নবে","ডিচে",""]
+			},
+			AM: ["ৰাতিপু","ৰাতিপু","ৰাতিপু"],
+			PM: ["আবেলি","আবেলি","আবেলি"],
+			eras: [{"name":"খ্রীষ্টাব্দ","start":null,"offset":0}],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "yyyy,MMMM dd, dddd",
+				t: "tt h:mm",
+				T: "tt h:mm:ss",
+				f: "yyyy,MMMM dd, dddd tt h:mm",
+				F: "yyyy,MMMM dd, dddd tt h:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM,yy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as.js
new file mode 100644
index 0000000..5577f8b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.as.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture as
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "as", "default", {
+	name: "as",
+	englishName: "Assamese",
+	nativeName: "অসমীয়া",
+	language: "as",
+	numberFormat: {
+		groupSizes: [3,2],
+		"NaN": "nan",
+		negativeInfinity: "-infinity",
+		positiveInfinity: "infinity",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,2]
+		},
+		currency: {
+			pattern: ["$ -n","n$"],
+			groupSizes: [3,2],
+			symbol: "ট"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["সোমবাৰ","মঙ্গলবাৰ","বুধবাৰ","বৃহস্পতিবাৰ","শুক্রবাৰ","শনিবাৰ","ৰবিবাৰ"],
+				namesAbbr: ["সোম.","মঙ্গল.","বুধ.","বৃহ.","শুক্র.","শনি.","ৰবি."],
+				namesShort: ["সো","ম","বু","বৃ","শু","শ","র"]
+			},
+			months: {
+				names: ["জানুৱাৰী","ফেব্রুৱাৰী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টেম্বর","অক্টোবর","নবেম্বর","ডিচেম্বর",""],
+				namesAbbr: ["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টে","অক্টো","নবে","ডিচে",""]
+			},
+			AM: ["ৰাতিপু","ৰাতিপু","ৰাতিপু"],
+			PM: ["আবেলি","আবেলি","আবেলি"],
+			eras: [{"name":"খ্রীষ্টাব্দ","start":null,"offset":0}],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "yyyy,MMMM dd, dddd",
+				t: "tt h:mm",
+				T: "tt h:mm:ss",
+				f: "yyyy,MMMM dd, dddd tt h:mm",
+				F: "yyyy,MMMM dd, dddd tt h:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM,yy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl-AZ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl-AZ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl-AZ.js
new file mode 100644
index 0000000..71164b4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl-AZ.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture az-Cyrl-AZ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "az-Cyrl-AZ", "default", {
+	name: "az-Cyrl-AZ",
+	englishName: "Azeri (Cyrillic, Azerbaijan)",
+	nativeName: "Азәрбајҹан (Азәрбајҹан)",
+	language: "az-Cyrl",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "ман."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Базар","Базар ертәси","Чәршәнбә ахшамы","Чәршәнбә","Ҹүмә ахшамы","Ҹүмә","Шәнбә"],
+				namesAbbr: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"],
+				namesShort: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"]
+			},
+			months: {
+				names: ["Јанвар","Феврал","Март","Апрел","Мај","Ијун","Ијул","Август","Сентјабр","Октјабр","Нојабр","Декабр",""],
+				namesAbbr: ["Јан","Фев","Мар","Апр","Мај","Ијун","Ијул","Авг","Сен","Окт","Ноя","Дек",""]
+			},
+			monthsGenitive: {
+				names: ["јанвар","феврал","март","апрел","мај","ијун","ијул","август","сентјабр","октјабр","нојабр","декабр",""],
+				namesAbbr: ["Јан","Фев","Мар","Апр","мая","ијун","ијул","Авг","Сен","Окт","Ноя","Дек",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl.js
new file mode 100644
index 0000000..5928356
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Cyrl.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture az-Cyrl
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "az-Cyrl", "default", {
+	name: "az-Cyrl",
+	englishName: "Azeri (Cyrillic)",
+	nativeName: "Азәрбајҹан дили",
+	language: "az-Cyrl",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "ман."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Базар","Базар ертәси","Чәршәнбә ахшамы","Чәршәнбә","Ҹүмә ахшамы","Ҹүмә","Шәнбә"],
+				namesAbbr: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"],
+				namesShort: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"]
+			},
+			months: {
+				names: ["Јанвар","Феврал","Март","Апрел","Мај","Ијун","Ијул","Август","Сентјабр","Октјабр","Нојабр","Декабр",""],
+				namesAbbr: ["Јан","Фев","Мар","Апр","Мај","Ијун","Ијул","Авг","Сен","Окт","Ноя","Дек",""]
+			},
+			monthsGenitive: {
+				names: ["јанвар","феврал","март","апрел","мај","ијун","ијул","август","сентјабр","октјабр","нојабр","декабр",""],
+				namesAbbr: ["Јан","Фев","Мар","Апр","мая","ијун","ијул","Авг","Сен","Окт","Ноя","Дек",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn-AZ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn-AZ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn-AZ.js
new file mode 100644
index 0000000..200848e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn-AZ.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture az-Latn-AZ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "az-Latn-AZ", "default", {
+	name: "az-Latn-AZ",
+	englishName: "Azeri (Latin, Azerbaijan)",
+	nativeName: "Azərbaycan\xadılı (Azərbaycan)",
+	language: "az-Latn",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "man."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
+				namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
+				namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
+			},
+			months: {
+				names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			monthsGenitive: {
+				names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn.js
new file mode 100644
index 0000000..c4e80c7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az-Latn.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture az-Latn
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "az-Latn", "default", {
+	name: "az-Latn",
+	englishName: "Azeri (Latin)",
+	nativeName: "Azərbaycan\xadılı",
+	language: "az-Latn",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "man."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
+				namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
+				namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
+			},
+			months: {
+				names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			monthsGenitive: {
+				names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az.js
new file mode 100644
index 0000000..7a5e5ec
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.az.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture az
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "az", "default", {
+	name: "az",
+	englishName: "Azeri",
+	nativeName: "Azərbaycan\xadılı",
+	language: "az",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "man."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
+				namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
+				namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
+			},
+			months: {
+				names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			monthsGenitive: {
+				names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
+				namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba-RU.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba-RU.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba-RU.js
new file mode 100644
index 0000000..4b81713
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba-RU.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture ba-RU
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ba-RU", "default", {
+	name: "ba-RU",
+	englishName: "Bashkir (Russia)",
+	nativeName: "Башҡорт (Россия)",
+	language: "ba",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		groupSizes: [3,0],
+		negativeInfinity: "-бесконечность",
+		positiveInfinity: "бесконечность",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,0],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			groupSizes: [3,0],
+			",": " ",
+			".": ",",
+			symbol: "һ."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Йәкшәмбе","Дүшәмбе","Шишәмбе","Шаршамбы","Кесаҙна","Йома","Шәмбе"],
+				namesAbbr: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"],
+				namesShort: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"]
+			},
+			months: {
+				names: ["ғинуар","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь",""],
+				namesAbbr: ["ғин","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yy",
+				D: "d MMMM yyyy 'й'",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy 'й' H:mm",
+				F: "d MMMM yyyy 'й' H:mm:ss",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba.js
new file mode 100644
index 0000000..a665f66
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ba.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture ba
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ba", "default", {
+	name: "ba",
+	englishName: "Bashkir",
+	nativeName: "Башҡорт",
+	language: "ba",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		groupSizes: [3,0],
+		negativeInfinity: "-бесконечность",
+		positiveInfinity: "бесконечность",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,0],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			groupSizes: [3,0],
+			",": " ",
+			".": ",",
+			symbol: "һ."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Йәкшәмбе","Дүшәмбе","Шишәмбе","Шаршамбы","Кесаҙна","Йома","Шәмбе"],
+				namesAbbr: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"],
+				namesShort: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"]
+			},
+			months: {
+				names: ["ғинуар","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь",""],
+				namesAbbr: ["ғин","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yy",
+				D: "d MMMM yyyy 'й'",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy 'й' H:mm",
+				F: "d MMMM yyyy 'й' H:mm:ss",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be-BY.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be-BY.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be-BY.js
new file mode 100644
index 0000000..855695a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be-BY.js
@@ -0,0 +1,80 @@
+/*
+ * Globalize Culture be-BY
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "be-BY", "default", {
+	name: "be-BY",
+	englishName: "Belarusian (Belarus)",
+	nativeName: "Беларускі (Беларусь)",
+	language: "be",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "р."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["нядзеля","панядзелак","аўторак","серада","чацвер","пятніца","субота"],
+				namesAbbr: ["нд","пн","аў","ср","чц","пт","сб"],
+				namesShort: ["нд","пн","аў","ср","чц","пт","сб"]
+			},
+			months: {
+				names: ["Студзень","Люты","Сакавік","Красавік","Май","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань",""],
+				namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
+			},
+			monthsGenitive: {
+				names: ["студзеня","лютага","сакавіка","красавіка","мая","чэрвеня","ліпеня","жніўня","верасня","кастрычніка","лістапада","снежня",""],
+				namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be.js
new file mode 100644
index 0000000..3db61d9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.be.js
@@ -0,0 +1,80 @@
+/*
+ * Globalize Culture be
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "be", "default", {
+	name: "be",
+	englishName: "Belarusian",
+	nativeName: "Беларускі",
+	language: "be",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "р."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["нядзеля","панядзелак","аўторак","серада","чацвер","пятніца","субота"],
+				namesAbbr: ["нд","пн","аў","ср","чц","пт","сб"],
+				namesShort: ["нд","пн","аў","ср","чц","пт","сб"]
+			},
+			months: {
+				names: ["Студзень","Люты","Сакавік","Красавік","Май","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань",""],
+				namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
+			},
+			monthsGenitive: {
+				names: ["студзеня","лютага","сакавіка","красавіка","мая","чэрвеня","ліпеня","жніўня","верасня","кастрычніка","лістапада","снежня",""],
+				namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "d MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d MMMM yyyy H:mm",
+				F: "d MMMM yyyy H:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg-BG.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg-BG.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg-BG.js
new file mode 100644
index 0000000..0de7452
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg-BG.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture bg-BG
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bg-BG", "default", {
+	name: "bg-BG",
+	englishName: "Bulgarian (Bulgaria)",
+	nativeName: "български (България)",
+	language: "bg",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		negativeInfinity: "- безкрайност",
+		positiveInfinity: "+ безкрайност",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "лв."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],
+				namesAbbr: ["нед","пон","вт","ср","четв","пет","съб"],
+				namesShort: ["н","п","в","с","ч","п","с"]
+			},
+			months: {
+				names: ["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември",""],
+				namesAbbr: ["ян","февр","март","апр","май","юни","юли","авг","септ","окт","ноември","дек",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"след новата ера","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy 'г.'",
+				D: "dd MMMM yyyy 'г.'",
+				t: "HH:mm 'ч.'",
+				T: "HH:mm:ss 'ч.'",
+				f: "dd MMMM yyyy 'г.' HH:mm 'ч.'",
+				F: "dd MMMM yyyy 'г.' HH:mm:ss 'ч.'",
+				M: "dd MMMM",
+				Y: "MMMM yyyy 'г.'"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg.js
new file mode 100644
index 0000000..b87a9e5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bg.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture bg
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bg", "default", {
+	name: "bg",
+	englishName: "Bulgarian",
+	nativeName: "български",
+	language: "bg",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		negativeInfinity: "- безкрайност",
+		positiveInfinity: "+ безкрайност",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "лв."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],
+				namesAbbr: ["нед","пон","вт","ср","четв","пет","съб"],
+				namesShort: ["н","п","в","с","ч","п","с"]
+			},
+			months: {
+				names: ["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември",""],
+				namesAbbr: ["ян","февр","март","апр","май","юни","юли","авг","септ","окт","ноември","дек",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"след новата ера","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy 'г.'",
+				D: "dd MMMM yyyy 'г.'",
+				t: "HH:mm 'ч.'",
+				T: "HH:mm:ss 'ч.'",
+				f: "dd MMMM yyyy 'г.' HH:mm 'ч.'",
+				F: "dd MMMM yyyy 'г.' HH:mm:ss 'ч.'",
+				M: "dd MMMM",
+				Y: "MMMM yyyy 'г.'"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-BD.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-BD.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-BD.js
new file mode 100644
index 0000000..cc62709
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-BD.js
@@ -0,0 +1,74 @@
+/*
+ * Globalize Culture bn-BD
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bn-BD", "default", {
+	name: "bn-BD",
+	englishName: "Bengali (Bangladesh)",
+	nativeName: "বাংলা (বাংলাদেশ)",
+	language: "bn",
+	numberFormat: {
+		groupSizes: [3,2],
+		percent: {
+			pattern: ["-%n","%n"],
+			groupSizes: [3,2]
+		},
+		currency: {
+			pattern: ["$ -n","$ n"],
+			groupSizes: [3,2],
+			symbol: "৳"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			":": ".",
+			firstDay: 1,
+			days: {
+				names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
+				namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
+				namesShort: ["র","স","ম","ব","ব","শ","শ"]
+			},
+			months: {
+				names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
+				namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
+			},
+			AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
+			PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
+			patterns: {
+				d: "dd-MM-yy",
+				D: "dd MMMM yyyy",
+				t: "HH.mm",
+				T: "HH.mm.ss",
+				f: "dd MMMM yyyy HH.mm",
+				F: "dd MMMM yyyy HH.mm.ss",
+				M: "dd MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-IN.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-IN.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-IN.js
new file mode 100644
index 0000000..2601291
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn-IN.js
@@ -0,0 +1,74 @@
+/*
+ * Globalize Culture bn-IN
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bn-IN", "default", {
+	name: "bn-IN",
+	englishName: "Bengali (India)",
+	nativeName: "বাংলা (ভারত)",
+	language: "bn",
+	numberFormat: {
+		groupSizes: [3,2],
+		percent: {
+			pattern: ["-%n","%n"],
+			groupSizes: [3,2]
+		},
+		currency: {
+			pattern: ["$ -n","$ n"],
+			groupSizes: [3,2],
+			symbol: "টা"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			":": ".",
+			firstDay: 1,
+			days: {
+				names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
+				namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
+				namesShort: ["র","স","ম","ব","ব","শ","শ"]
+			},
+			months: {
+				names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
+				namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
+			},
+			AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
+			PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
+			patterns: {
+				d: "dd-MM-yy",
+				D: "dd MMMM yyyy",
+				t: "HH.mm",
+				T: "HH.mm.ss",
+				f: "dd MMMM yyyy HH.mm",
+				F: "dd MMMM yyyy HH.mm.ss",
+				M: "dd MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn.js
new file mode 100644
index 0000000..82ce270
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bn.js
@@ -0,0 +1,74 @@
+/*
+ * Globalize Culture bn
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bn", "default", {
+	name: "bn",
+	englishName: "Bengali",
+	nativeName: "বাংলা",
+	language: "bn",
+	numberFormat: {
+		groupSizes: [3,2],
+		percent: {
+			pattern: ["-%n","%n"],
+			groupSizes: [3,2]
+		},
+		currency: {
+			pattern: ["$ -n","$ n"],
+			groupSizes: [3,2],
+			symbol: "টা"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			":": ".",
+			firstDay: 1,
+			days: {
+				names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
+				namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
+				namesShort: ["র","স","ম","ব","ব","শ","শ"]
+			},
+			months: {
+				names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
+				namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
+			},
+			AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
+			PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
+			patterns: {
+				d: "dd-MM-yy",
+				D: "dd MMMM yyyy",
+				t: "HH.mm",
+				T: "HH.mm.ss",
+				f: "dd MMMM yyyy HH.mm",
+				F: "dd MMMM yyyy HH.mm.ss",
+				M: "dd MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo-CN.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo-CN.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo-CN.js
new file mode 100644
index 0000000..b173a24
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo-CN.js
@@ -0,0 +1,77 @@
+/*
+ * Globalize Culture bo-CN
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bo-CN", "default", {
+	name: "bo-CN",
+	englishName: "Tibetan (PRC)",
+	nativeName: "བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)",
+	language: "bo",
+	numberFormat: {
+		groupSizes: [3,0],
+		"NaN": "ཨང་ཀི་མིན་པ།",
+		negativeInfinity: "མོ་གྲངས་ཚད་མེད་ཆུང་བ།",
+		positiveInfinity: "ཕོ་གྲངས་ཚད་མེད་ཆེ་བ།",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,0]
+		},
+		currency: {
+			pattern: ["$-n","$n"],
+			groupSizes: [3,0],
+			symbol: "¥"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["གཟའ་ཉི་མ།","གཟའ་ཟླ་བ།","གཟའ་མིག་དམར།","གཟའ་ལྷག་པ།","གཟའ་ཕུར་བུ།","གཟའ་པ་སངས།","གཟའ་སྤེན་པ།"],
+				namesAbbr: ["ཉི་མ།","ཟླ་བ།","མིག་དམར།","ལྷག་པ།","ཕུར་བུ།","པ་སངས།","སྤེན་པ།"],
+				namesShort: ["༧","༡","༢","༣","༤","༥","༦"]
+			},
+			months: {
+				names: ["སྤྱི་ཟླ་དང་པོ།","སྤྱི་ཟླ་གཉིས་པ།","སྤྱི་ཟླ་གསུམ་པ།","སྤྱི་ཟླ་བཞི་པ།","སྤྱི་ཟླ་ལྔ་པ།","སྤྱི་ཟླ་དྲུག་པ།","སྤྱི་ཟླ་བདུན་པ།","སྤྱི་ཟླ་བརྒྱད་པ།","སྤྱི་ཟླ་དགུ་པ།","སྤྱི་ཟླ་བཅུ་པོ།","སྤྱི་ཟླ་བཅུ་གཅིག་པ།","སྤྱི་ཟླ་བཅུ་གཉིས་པ།",""],
+				namesAbbr: ["ཟླ་ ༡","ཟླ་ ༢","ཟླ་ ༣","ཟླ་ ༤","ཟླ་ ༥","ཟླ་ ༦","ཟླ་ ༧","ཟླ་ ༨","ཟླ་ ༩","ཟླ་ ༡༠","ཟླ་ ༡༡","ཟླ་ ༡༢",""]
+			},
+			AM: ["སྔ་དྲོ","སྔ་དྲོ","སྔ་དྲོ"],
+			PM: ["ཕྱི་དྲོ","ཕྱི་དྲོ","ཕྱི་དྲོ"],
+			eras: [{"name":"སྤྱི་ལོ","start":null,"offset":0}],
+			patterns: {
+				d: "yyyy/M/d",
+				D: "yyyy'ལོའི་ཟླ' M'ཚེས' d",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm",
+				F: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm:ss",
+				M: "'ཟླ་' M'ཚེས'd",
+				Y: "yyyy.M"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo.js
new file mode 100644
index 0000000..96f0caa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bo.js
@@ -0,0 +1,77 @@
+/*
+ * Globalize Culture bo
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bo", "default", {
+	name: "bo",
+	englishName: "Tibetan",
+	nativeName: "བོད་ཡིག",
+	language: "bo",
+	numberFormat: {
+		groupSizes: [3,0],
+		"NaN": "ཨང་ཀི་མིན་པ།",
+		negativeInfinity: "མོ་གྲངས་ཚད་མེད་ཆུང་བ།",
+		positiveInfinity: "ཕོ་གྲངས་ཚད་མེད་ཆེ་བ།",
+		percent: {
+			pattern: ["-n%","n%"],
+			groupSizes: [3,0]
+		},
+		currency: {
+			pattern: ["$-n","$n"],
+			groupSizes: [3,0],
+			symbol: "¥"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["གཟའ་ཉི་མ།","གཟའ་ཟླ་བ།","གཟའ་མིག་དམར།","གཟའ་ལྷག་པ།","གཟའ་ཕུར་བུ།","གཟའ་པ་སངས།","གཟའ་སྤེན་པ།"],
+				namesAbbr: ["ཉི་མ།","ཟླ་བ།","མིག་དམར།","ལྷག་པ།","ཕུར་བུ།","པ་སངས།","སྤེན་པ།"],
+				namesShort: ["༧","༡","༢","༣","༤","༥","༦"]
+			},
+			months: {
+				names: ["སྤྱི་ཟླ་དང་པོ།","སྤྱི་ཟླ་གཉིས་པ།","སྤྱི་ཟླ་གསུམ་པ།","སྤྱི་ཟླ་བཞི་པ།","སྤྱི་ཟླ་ལྔ་པ།","སྤྱི་ཟླ་དྲུག་པ།","སྤྱི་ཟླ་བདུན་པ།","སྤྱི་ཟླ་བརྒྱད་པ།","སྤྱི་ཟླ་དགུ་པ།","སྤྱི་ཟླ་བཅུ་པོ།","སྤྱི་ཟླ་བཅུ་གཅིག་པ།","སྤྱི་ཟླ་བཅུ་གཉིས་པ།",""],
+				namesAbbr: ["ཟླ་ ༡","ཟླ་ ༢","ཟླ་ ༣","ཟླ་ ༤","ཟླ་ ༥","ཟླ་ ༦","ཟླ་ ༧","ཟླ་ ༨","ཟླ་ ༩","ཟླ་ ༡༠","ཟླ་ ༡༡","ཟླ་ ༡༢",""]
+			},
+			AM: ["སྔ་དྲོ","སྔ་དྲོ","སྔ་དྲོ"],
+			PM: ["ཕྱི་དྲོ","ཕྱི་དྲོ","ཕྱི་དྲོ"],
+			eras: [{"name":"སྤྱི་ལོ","start":null,"offset":0}],
+			patterns: {
+				d: "yyyy/M/d",
+				D: "yyyy'ལོའི་ཟླ' M'ཚེས' d",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm",
+				F: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm:ss",
+				M: "'ཟླ་' M'ཚེས'd",
+				Y: "yyyy.M"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br-FR.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br-FR.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br-FR.js
new file mode 100644
index 0000000..37bf505
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br-FR.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture br-FR
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "br-FR", "default", {
+	name: "br-FR",
+	englishName: "Breton (France)",
+	nativeName: "brezhoneg (Frañs)",
+	language: "br",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "NkN",
+		negativeInfinity: "-Anfin",
+		positiveInfinity: "+Anfin",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Sul","Lun","Meurzh","Merc'her","Yaou","Gwener","Sadorn"],
+				namesAbbr: ["Sul","Lun","Meu.","Mer.","Yaou","Gwe.","Sad."],
+				namesShort: ["Su","Lu","Mz","Mc","Ya","Gw","Sa"]
+			},
+			months: {
+				names: ["Genver","C'hwevrer","Meurzh","Ebrel","Mae","Mezheven","Gouere","Eost","Gwengolo","Here","Du","Kerzu",""],
+				namesAbbr: ["Gen.","C'hwe.","Meur.","Ebr.","Mae","Mezh.","Goue.","Eost","Gwen.","Here","Du","Kzu",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"g. J.-K.","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd d MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd d MMMM yyyy HH:mm",
+				F: "dddd d MMMM yyyy HH:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br.js
new file mode 100644
index 0000000..29dd176
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.br.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture br
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "br", "default", {
+	name: "br",
+	englishName: "Breton",
+	nativeName: "brezhoneg",
+	language: "br",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "NkN",
+		negativeInfinity: "-Anfin",
+		positiveInfinity: "+Anfin",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Sul","Lun","Meurzh","Merc'her","Yaou","Gwener","Sadorn"],
+				namesAbbr: ["Sul","Lun","Meu.","Mer.","Yaou","Gwe.","Sad."],
+				namesShort: ["Su","Lu","Mz","Mc","Ya","Gw","Sa"]
+			},
+			months: {
+				names: ["Genver","C'hwevrer","Meurzh","Ebrel","Mae","Mezheven","Gouere","Eost","Gwengolo","Here","Du","Kerzu",""],
+				namesAbbr: ["Gen.","C'hwe.","Meur.","Ebr.","Mae","Mezh.","Goue.","Eost","Gwen.","Here","Du","Kzu",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"g. J.-K.","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd d MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd d MMMM yyyy HH:mm",
+				F: "dddd d MMMM yyyy HH:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));


[06/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LB.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LB.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LB.js
new file mode 100644
index 0000000..6c621f8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LB.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-LB
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-LB", "default", {
+	name: "ar-LB",
+	englishName: "Arabic (Lebanon)",
+	nativeName: "العربية (لبنان)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ل.ل.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 1,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LY.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LY.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LY.js
new file mode 100644
index 0000000..73a4266
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-LY.js
@@ -0,0 +1,462 @@
+/*
+ * Globalize Culture ar-LY
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-LY", "default", {
+	name: "ar-LY",
+	englishName: "Arabic (Libya)",
+	nativeName: "العربية (ليبيا)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$n"],
+			decimals: 3,
+			symbol: "د.ل.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-MA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-MA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-MA.js
new file mode 100644
index 0000000..0b953c4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-MA.js
@@ -0,0 +1,458 @@
+/*
+ * Globalize Culture ar-MA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-MA", "default", {
+	name: "ar-MA",
+	englishName: "Arabic (Morocco)",
+	nativeName: "العربية (المملكة المغربية)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "د.م.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","ماي","يونيو","يوليوز","غشت","شتنبر","أكتوبر","نونبر","دجنبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","ماي","يونيو","يوليوز","غشت","شتنبر","أكتوبر","نونبر","دجنبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "dd MMMM, yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd MMMM, yyyy H:mm",
+				F: "dd MMMM, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MM/yyyy H:mm",
+				F: "dd/MM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MMMM/yyyy H:mm",
+				F: "dd/MMMM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 1,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		}
+	}
+});
+
+}( this ));


[21/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.js
new file mode 100644
index 0000000..e65e8cd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.js
@@ -0,0 +1,1045 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory(require("_"), require("jQuery"), require("Backbone"), require("Backgrid"));
+	else if(typeof define === 'function' && define.amd)
+		define(["underscore", "jquery", "backbone", "backgrid"], factory);
+	else if(typeof exports === 'object')
+		exports["Backgrid.Extension.ColumnManager"] = factory(require("_"), require("jQuery"), require("Backbone"), require("Backgrid"));
+	else
+		root["Backgrid.Extension.ColumnManager"] = factory(root["_"], root["jQuery"], root["Backbone"], root["Backgrid"]);
+})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__) {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ 	// The module cache
+/******/ 	var installedModules = {};
+
+/******/ 	// The require function
+/******/ 	function __webpack_require__(moduleId) {
+
+/******/ 		// Check if module is in cache
+/******/ 		if(installedModules[moduleId])
+/******/ 			return installedModules[moduleId].exports;
+
+/******/ 		// Create a new module (and put it into the cache)
+/******/ 		var module = installedModules[moduleId] = {
+/******/ 			exports: {},
+/******/ 			id: moduleId,
+/******/ 			loaded: false
+/******/ 		};
+
+/******/ 		// Execute the module function
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ 		// Flag the module as loaded
+/******/ 		module.loaded = true;
+
+/******/ 		// Return the exports of the module
+/******/ 		return module.exports;
+/******/ 	}
+
+
+/******/ 	// expose the modules object (__webpack_modules__)
+/******/ 	__webpack_require__.m = modules;
+
+/******/ 	// expose the module cache
+/******/ 	__webpack_require__.c = installedModules;
+
+/******/ 	// __webpack_public_path__
+/******/ 	__webpack_require__.p = "";
+
+/******/ 	// Load entry module and return exports
+/******/ 	return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+	"use strict";
+
+	/**
+	 * A column manager for backgrid
+	 *
+	 * @module Backgrid.ColumnManager
+	 */
+	// Dependencies
+	var _ = __webpack_require__(1);
+	var $ = __webpack_require__(2);
+	var Backbone = __webpack_require__(3);
+	var Backgrid = __webpack_require__(4);
+
+	/**
+	 * Manages visibility of columns.
+	 *
+	 * @class Backgrid.Extension.ColumnManager ColumnManager
+	 * @constructor
+	 * @param {Backgrid.Columns} columns
+	 * @param {Object} [options]
+	 * @param {number} [options.initialColumnCount] Initial amount of columns to show. Default is null (All visible).
+	 * @param {boolean} [options.trackSize]
+	 * @param {boolean} [options.trackOrder]
+	 * @param {boolean} [options.trackVisibility]
+	 * @param {string} [options.stateChecking] can be "strict" or "loose".
+	 * @param {boolean} [options.saveState]
+	 * @param {string} [options.saveStateKey] Storage key. Must be unique for location. Can be left out if this plugin is only used in one place.
+	 * @param {string} [options.saveStateLocation] Can be "localStorage" (default) or "sessionStorage" (be aware, session stored values are lost when window is closed)
+	 * @param {boolean} [options.loadStateOnInit]
+	 * @param {Array} [state]
+	 */
+	Backgrid.Extension.ColumnManager = function (columns, options, state) {
+	  // Bind backbone events
+	  _.extend(this, Backbone.Events);
+
+	  // Save options and merge with defaults
+	  var defaults = {
+	    initialColumnsVisible: null,
+
+	    // State options
+	    trackSize: true,
+	    trackOrder: true,
+	    trackVisibility: true,
+	    stateChecking: "strict",
+	    saveState: false,
+	    saveStateKey: "",
+	    saveStateLocation: "localStorage",
+	    loadStateOnInit: false
+	  };
+	  this.options = _.extend({}, defaults, options);
+	  this.state = [];
+
+	  // Check if columns is instance of Backgrid.Columns
+	  if (columns instanceof Backgrid.Columns) {
+	    // Save columns
+	    this.columns = columns;
+
+	    // Add columnManager to columns (instance)
+	    columns.columnManager = this;
+	    this.addManagerToColumns();
+
+	    // Set state if provided
+	    var storedState = (this.options.loadStateOnInit) ? this.loadState() : false;
+	    if (state && this.checkStateValidity(state)) {
+	      this.setState(state, true);
+	    }
+	    else if (storedState) {
+	      this.setState(storedState, true);
+	    }
+	    else {
+	      // If no initial state is provided, adhere to initial column visibility settings
+	      this.setInitialColumnVisibility();
+
+	      // Set current state
+	      this.setState(this.getStateFromColumns());
+	    }
+
+	    // Listen to column events
+	    if (this.options.trackVisibility || this.options.trackSize || this.options.trackOrder) {
+	      //this.stateUpdateHandler = _.bind(this.stateUpdateHandler, this);
+	      var events = "" +
+	          ((this.options.trackVisibility) ? "change:renderable " : "") +
+	          ((this.options.trackSize) ? "resize " : "") +
+	          ((this.options.trackOrder) ? "ordered" : "");
+	      this.columns.on(events, _.bind(this.stateUpdateHandler, this));
+	    }
+	  }
+	  else {
+	    // Issue warning
+	    console.error("Backgrid.ColumnManager: options.columns is not an instance of Backgrid.Columns");
+	  }
+	};
+
+	/**
+	 * Loops over all columns and sets the visibility according to provided options.
+	 *
+	 * @method setInitialColumnVisibility
+	 */
+	Backgrid.Extension.ColumnManager.prototype.setInitialColumnVisibility = function () {
+	  var self = this;
+
+	  // Loop columns and set renderable property according to settings
+	  var initialColumnsVisible = self.options.initialColumnsVisible;
+
+	  if (initialColumnsVisible) {
+	    self.columns.each(function (col, index) {
+	      col.set("renderable", (col.get("alwaysVisible")) ? true : index < initialColumnsVisible);
+	    });
+	  }
+	};
+
+	/**
+	 * Loops over all columns and adds the columnManager instance to VisibilityHeaderCell columns.
+	 *
+	 * @method addManagerToColumns
+	 */
+	Backgrid.Extension.ColumnManager.prototype.addManagerToColumns = function () {
+	  var self = this;
+
+	  self.columns.each(function (col) {
+	    // Look for header cell
+	    if (col.get("headerCell") === Backgrid.Extension.ColumnManager.ColumnVisibilityHeaderCell) {
+	      col.set("headerCell", col.get("headerCell").extend({
+	        columnManager: self
+	      }));
+	    }
+
+	    if (col.get("headerCell") instanceof Backgrid.Extension.ColumnManager.ColumnVisibilityHeaderCell) {
+	      col.get("headerCell").columnManager = self;
+	    }
+	  });
+	};
+
+	/**
+	 * Convenience function to retrieve a column either directly or by its id.
+	 * Returns false if no column is found.
+	 *
+	 * @method getColumn
+	 * @param {string|number|Backgrid.Column} col
+	 * @return {Backgrid.Column|boolean}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getColumn = function (col) {
+	  // If column is a string or number, try to find a column which has that ID
+	  if (_.isNumber(col) || _.isString(col)) {
+	    col = this.columns.get(col);
+	  }
+	  return (col instanceof Backgrid.Column) ? col : false;
+	};
+
+	/**
+	 * Hides a column
+	 *
+	 * @method hidecolumn
+	 * @param {string|number|Backgrid.Column} col
+	 */
+	Backgrid.Extension.ColumnManager.prototype.hideColumn = function (col) {
+	  // If column is a valid backgrid column, set the renderable property to false
+	  var column = this.getColumn(col);
+	  if (column) {
+	    column.set("renderable", false);
+	  }
+	};
+
+	/**
+	 * Shows a column
+	 *
+	 * @method showColumn
+	 * @param {string|number|Backgrid.Column} col
+	 */
+	Backgrid.Extension.ColumnManager.prototype.showColumn = function (col) {
+	  // If column is a valid backgrid column, set the renderable property to true
+	  var column = this.getColumn(col);
+	  if (column) {
+	    column.set("renderable", true);
+	  }
+	};
+
+	/**
+	 * Toggles a columns' visibility
+	 *
+	 * @method toggleColumnVisibility
+	 * @param {string|number|Backgrid.Column} col
+	 */
+	Backgrid.Extension.ColumnManager.prototype.toggleColumnVisibility = function (col) {
+	  // If column is a valid backgrid column, set the renderable property to true
+	  var column = this.getColumn(col);
+	  if (column) {
+	    if (column.get("renderable")) {
+	      this.hideColumn(column);
+	    }
+	    else {
+	      this.showColumn(column);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns the managed column collection
+	 *
+	 * @method getColumnCollection
+	 * @return {Backgrid.Columns}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getColumnCollection = function () {
+	  return this.columns;
+	};
+
+	/**
+	 *
+	 * @method setState
+	 * @param {Array} state
+	 * @param {boolean} applyState
+	 * @return {boolean}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.setState = function (state, applyState) {
+	  var self = this;
+
+	  // Filter state
+	  _.filter(state, function(columnState) {
+	    if (!_.has(columnState, "name")) {
+	      return false;
+	    }
+
+	    var column = self.columns.findWhere({
+	      name: state.name
+	    });
+
+	    return typeof column !== "undefined";
+	  });
+
+	  // Check if state is valid
+	  if (self.checkStateValidity(state) && state !== self.state) {
+	    // Apply and save state
+	    self.state = state;
+	    self.trigger("state-changed", state);
+
+	    if (applyState) {
+	      return self.applyStateToColumns();
+	    }
+	    else {
+	      return self.saveState();
+	    }
+	  }
+	  return false;
+	};
+
+	/**
+	 * @method getState
+	 * @return {Array}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getState = function () {
+	  return this.state;
+	};
+
+	/**
+	 *
+	 * @method checkStateValidity
+	 * @return {boolean}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.checkStateValidity = function (state) {
+	  // Has to be array
+	  if (!_.isArray(state) && _.isEmpty(state)) {
+	    return false;
+	  }
+
+	  function checkValidityColumnState() {
+	    return _.every(state, function(column) {
+	      var valid = true;
+
+	      // We require a name key
+	      if (!_.has(column, "name")) {
+	        valid = false;
+	      }
+
+	      // If renderable is set, should be boolean
+	      if (_.has(column, "renderable")) {
+	        if (!_.isBoolean(column.renderable)) {
+	          valid = false;
+	        }
+	      }
+
+	      // If displayOrder is set, should be a number
+	      if (_.has(column, "displayOrder")) {
+	        if (!_.isNumber(column.displayOrder)) {
+	          valid = false;
+	        }
+	      }
+
+	      // If width is set, should be a number or a string
+	      if (_.has(column, "width")) {
+	        if (!_.isNumber(column.width) && !_.isString(column.width)) {
+	          valid = false;
+	        }
+	      }
+
+	      return valid;
+	    });
+	  }
+
+	  // Check if state is valid
+	  if (this.options.stateChecking === "loose") {
+	    // At least we require 'name' keys in every objec
+	    return checkValidityColumnState();
+	  }
+	  else {
+	    // Strict check
+	    // Requires same length and valid name keys.
+	    if (state.length !== this.columns.length && !checkValidityColumnState()) {
+	      return false;
+	    }
+
+	    var columnNameKeys = this.columns.map(function (column) {
+	      return column.get("name");
+	    });
+
+	    var newStateNameKeys = _.map(state, function (column) {
+	      return column.name;
+	    });
+
+	    return columnNameKeys.sort().toString() === newStateNameKeys.sort().toString();
+	  }
+	};
+
+
+	/**
+	 *
+	 * @method loadState
+	 * @return {boolean}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.loadState = function () {
+	  // Get state from storage
+	  var state = JSON.parse(this.getStorage().getItem(this.getStorageKey()));
+	  if (this.checkStateValidity(state)) {
+	    return state;
+	  }
+	  return false;
+	};
+
+	/**
+	 *
+	 * @method saveState
+	 * @param {boolean} [force] Override save settings.
+	 * @return {boolean}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.saveState = function (force) {
+	  if (this.options.saveState || force) {
+	    this.getStorage().setItem(this.getStorageKey(), JSON.stringify(this.state));
+	    this.trigger("state-saved");
+	    return true;
+	  }
+	  return false;
+	};
+
+	/**
+	 * @method getStorage
+	 * @return {boolean|Storage}
+	 * @private
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getStorage = function () {
+	  // Check if storage functionality is available
+	  if (typeof Storage !== "undefined") {
+	    return (this.options.saveStateLocation === "sessionStorage") ? sessionStorage : localStorage;
+	  }
+	  else {
+	    console.error("ColMrg: No storage support detected. State won't be saved.");
+	    return false;
+	  }
+	};
+
+	/**
+	 * @method getStorageKey
+	 * @return {string}
+	 * @private
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getStorageKey = function () {
+	  return (this.options.saveStateKey) ? "backgrid-colmgr-" + this.options.saveStateKey : "backgrid-colmgr";
+	};
+
+	/**
+	 * @method stateUpdateHandler
+	 * @return {boolean}
+	 * @private
+	 */
+	Backgrid.Extension.ColumnManager.prototype.stateUpdateHandler = function () {
+	  var state = this.getStateFromColumns();
+	  return this.setState(state);
+	};
+
+	/**
+	 * @method getStateFromColumn
+	 * @return {Array}
+	 */
+	Backgrid.Extension.ColumnManager.prototype.getStateFromColumns = function() {
+	  var self = this;
+
+	  // Map state from columns
+	  return this.columns.map(function(column) {
+	    var columnState = {
+	      name: column.get("name")
+	    };
+
+	    if (self.options.trackVisibility) {
+	      columnState.renderable = column.get("renderable");
+	    }
+	    if (self.options.trackOrder) {
+	      columnState.displayOrder = column.get("displayOrder");
+	    }
+	    if (self.options.trackSize) {
+	      columnState.width = column.get("width");
+	    }
+	    return columnState;
+	  });
+	};
+
+	/**
+	 * @method applyStateToColumns
+	 * @private
+	 */
+	Backgrid.Extension.ColumnManager.prototype.applyStateToColumns = function () {
+	  var self = this;
+
+	  // Loop state
+	  var ordered = false;
+	  _.each(this.state, function(columnState) {
+	    // Find column
+	    var column = self.columns.findWhere({
+	      name: columnState.name
+	    });
+
+	    if (_.has(columnState, "renderable")) {
+	      column.set("renderable", columnState.renderable);
+	    }
+	    if (_.has(columnState, "width")) {
+	      var oldWidth = column.get("width");
+	      column.set("width", columnState.width, {silent: true});
+	      if (oldWidth !== columnState.width) {
+	        column.trigger("resize", column, columnState.width, oldWidth);
+	      }
+	    }
+
+	    if (_.has(columnState, "displayOrder")) {
+	      if (columnState.displayOrder !== column.get("displayOrder")) {
+	        ordered = true;
+	      }
+	      column.set("displayOrder", columnState.displayOrder, {silent: true});
+	    }
+	  });
+
+	  if (ordered) {
+	    self.columns.sort();
+	    self.columns.trigger("ordered");
+	  }
+	};
+
+	//////////////////////////////////////////////
+	/////////////// UI Controls //////////////////
+	//////////////////////////////////////////////
+
+	/**
+	 * A dropdown item view
+	 *
+	 * @class DropDownItemView
+	 * @extends Backbone.View
+	 */
+	var DropDownItemView = Backbone.View.extend({
+	  className: "columnmanager-dropdown-item",
+	  tagName: "li",
+
+	  /**
+	   * @method initialize
+	   * @param {object} opts
+	   * @param {Backgrid.Extension.ColumnManager} opts.columnManager ColumnManager instance.
+	   * @param {Backgrid.Column} opts.column A backgrid column.
+	   */
+	  initialize: function (opts) {
+	    this.columnManager = opts.columnManager;
+	    this.column = opts.column;
+	    this.template = opts.template;
+
+	    _.bindAll(this, "render", "toggleVisibility");
+	    this.column.on("change:renderable", this.render, this);
+	    this.el.addEventListener("click", this.toggleVisibility, true);
+	  },
+
+	  /**
+	   * @method render
+	   * @return {DropDownItemView}
+	   */
+	  render: function () {
+	    this.$el.empty();
+
+	    this.$el.append(this.template({
+	      label: this.column.get("label")
+	    }));
+
+	    if (this.column.get("renderable")) {
+	      this.$el.addClass((this.column.get("renderable")) ? "visible" : null);
+	    }
+	    else {
+	      this.$el.removeClass("visible");
+	    }
+
+	    return this;
+	  },
+
+	  /**
+	   * Toggles visibility of column.
+	   *
+	   * @method toggleVisibility
+	   * @param {object} e
+	   */
+	  toggleVisibility: function (e) {
+	    if (e) {
+	      this.stopPropagation(e);
+	    }
+	    this.columnManager.toggleColumnVisibility(this.column);
+	  },
+
+	  /**
+	   * Convenience function to stop event propagation.
+	   *
+	   * @method stopPropagation
+	   * @param {object} e
+	   * @private
+	   */
+	  stopPropagation: function (e) {
+	    e.stopPropagation();
+	    e.stopImmediatePropagation();
+	    e.preventDefault();
+	  }
+	});
+
+
+	/**
+	 * Dropdown view container.
+	 *
+	 * @class DropDownView
+	 * @extends Backbone.view
+	 */
+	var DropDownView = Backbone.View.extend({
+	  /**
+	   * @property className
+	   * @type String
+	   * @default "columnmanager-dropdown-container"
+	   */
+	  className: "columnmanager-dropdown-container",
+
+	  /**
+	   * @method initialize
+	   * @param {object} opts
+	   * @param {Backgrid.Extension.ColumnManager} opts.columnManager ColumnManager instance.
+	   * @param {Backbone.View} opts.DropdownItemView View to be used for the items.
+	   * @param {Function} opts.dropdownItemTemplate
+	   */
+	  initialize: function (opts) {
+	    this.options = opts;
+	    this.columnManager = opts.columnManager;
+	    this.ItemView = (opts.DropdownItemView instanceof Backbone.View) ? opts.DropdownItemView : DropDownItemView;
+	    this.$dropdownButton = opts.$dropdownButton;
+
+	    this.on("dropdown:opened", this.open, this);
+	    this.on("dropdown:closed", this.close, this);
+	    this.columnManager.columns.on("add remove", this.render, this);
+	  },
+
+	  /**
+	   * @method render
+	   * @return {DropDownView}
+	   */
+	  render: function () {
+	    var view = this;
+	    view.$el.empty();
+
+	    // List all columns
+	    this.columnManager.columns.each(function (col) {
+	      if (!col.get("alwaysVisible")) {
+	        view.$el.append(new view.ItemView({
+	          column: col,
+	          columnManager: view.columnManager,
+	          template: view.options.dropdownItemTemplate
+	        }).render().el);
+	      }
+	    });
+
+	    return this;
+	  },
+
+	  /**
+	   * Opens the dropdown.
+	   *
+	   * @method open
+	   */
+	  open: function () {
+	    this.$el.addClass("open");
+
+	    // Get button
+	    var $button = this.$dropdownButton;
+
+	    // Align
+	    var align;
+	    if (this.options.align === "auto") {
+	      // Determine what alignment fits
+	      var viewPortWidth = document.body.clientWidth || document.body.clientWidth;
+	      align = (($button.offset().left + this.$el.outerWidth()) > viewPortWidth) ? "left" : "right";
+	    }
+	    else {
+	      align = (this.options.align === "left" || this.options.align === "right") ?
+	        (this.options.align === "right" ? "right" : "left") : "right";
+	    }
+
+	    var offset;
+	    if (align === "left") {
+	      // Align right by default
+	      offset = $button.offset().left + $button.outerWidth() - this.$el.outerWidth();
+	      this.$el.css("left", offset + "px");
+	    }
+	    else {
+	      offset = $button.offset().left;
+	      this.$el.css("left", offset + "px");
+	    }
+
+	    // Height position
+	    var offsetHeight = $button.offset().top + $button.outerHeight();
+	    this.$el.css("top", offsetHeight + "px");
+	  },
+
+	  /**
+	   * Closes the dropdown.
+	   *
+	   * @method close
+	   */
+	  close: function () {
+	    this.$el.removeClass("open");
+	  }
+	});
+
+	/**
+	 * UI control which manages visibility of columns.
+	 * Inspired by: https://github.com/kjantzer/backbonejs-dropdown-view.
+	 *
+	 * @class Backgrid.Extension.ColumnManagerVisibilityControl
+	 * @extends Backbone.View
+	 */
+	Backgrid.Extension.ColumnManagerVisibilityControl = Backbone.View.extend({
+	  /**
+	   * @property tagName
+	   * @type String
+	   * @default "div"
+	   */
+	  tagName: "div",
+
+	  /**
+	   * @property className
+	   * @type String
+	   * @default "columnmanager-visibilitycontrol"
+	   */
+	  className: "columnmanager-visibilitycontrol",
+
+	  /**
+	   * @property defaultEvents
+	   * @type Object
+	   */
+	  defaultEvents: {
+	    "click": "stopPropagation"
+	  },
+
+	  /**
+	   * @property defaultOpts
+	   * @type Object
+	   */
+	  defaultOpts: {
+	    width: null,
+	    closeOnEsc: true,
+	    closeOnClick: true,
+	    openOnInit: false,
+	    columnManager: null,
+
+	    // Button
+	    buttonTemplate: _.template("<button class='dropdown-button'>...</button>"),
+
+	    // Container
+	    DropdownView: DropDownView,
+	    dropdownAlign: "auto",
+
+	    // Item view
+	    DropdownItemView: DropDownItemView,
+	    dropdownItemTemplate: _.template("<span class='indicator'></span><span class='column-label'><%= label %></span>")
+	  },
+
+	  /**
+	   * @method initialize
+	   * @param {Object} opts
+	   * @param {Backgrid.Extension.ColumnManager} opts.columnManager ColumnManager instance
+	   */
+	  initialize: function (opts) {
+	    this.options = _.extend({}, this.defaultOpts, opts);
+	    this.events = _.extend({}, this.defaultEvents, this.events || {});
+	    this.columnManager = opts.columnManager;
+
+	    // Option checking
+	    if (!this.columnManager instanceof Backgrid.Extension.ColumnManager) {
+	      console.error("Backgrid.ColumnManager: options.columns is not an instance of Backgrid.Columns");
+	    }
+
+	    // Bind scope to events
+	    _.bindAll(this, "deferClose", "stopDeferClose", "closeOnEsc", "toggle", "render");
+
+	    // UI events
+	    document.body.addEventListener("click", this.deferClose, true);
+	    this.el.addEventListener("click", this.stopDeferClose, true);
+	    if (this.options.closeOnEsc) {
+	      document.body.addEventListener("keyup", this.closeOnEsc, false);
+	    }
+	    this.el.addEventListener("click", this.toggle, false);
+
+	    // Create elements
+	    this.setup();
+
+	    // Listen for dropdown view events indicating to open and/or close
+	    this.view.on("dropdown:close", this.close, this);
+	    this.view.on("dropdown:open", this.open, this);
+	  },
+
+	  /**
+	   * @method delayStart
+	   * @private
+	   */
+	  delayStart: function () {
+	    clearTimeout(this.closeTimeout);
+	    this.delayTimeout = setTimeout(this.open.bind(this), this.options.delay);
+	  },
+
+	  /**
+	   * @method delayEnd
+	   * @private
+	   */
+	  delayEnd: function () {
+	    clearTimeout(this.delayTimeout);
+	    this.closeTimeout = setTimeout(this.close.bind(this), 300);
+	  },
+
+	  /**
+	   * @method setup
+	   * @private
+	   */
+	  setup: function () {
+	    // Override element width
+	    if (this.options.width) {
+	      this.$el.width(this.options.width + "px");
+	    }
+
+	    // Create button element
+	    this.$dropdownButton = $(this.options.buttonTemplate());
+
+	    var viewOptions = {
+	      columnManager: this.columnManager,
+	      DropdownItemView: this.options.DropdownItemView,
+	      dropdownItemTemplate: this.options.dropdownItemTemplate,
+	      align: this.options.dropdownAlign,
+	      $dropdownButton: this.$dropdownButton
+	    };
+
+	    // Check if a different childView has been provided, if not, use default dropdown view
+	    this.view = (this.options.DropdownView instanceof Backbone.View) ?
+	      new this.options.DropdownView(viewOptions) :
+	      new DropDownView(viewOptions);
+	  },
+
+	  /**
+	   * @method setup
+	   */
+	  render: function () {
+	    this.$el.empty();
+
+	    // Render button
+	    this.$el.append(this.$dropdownButton);
+
+	    // Render inner view
+	    this.view.render(); // tell the inner view to render itself
+	    $(document.body).append(this.view.el);
+	    return this;
+	  },
+
+	  /**
+	   * Convenience function to stop event propagation
+	   *
+	   * @method stopPropagation
+	   * @param {object} e
+	   * @private
+	   */
+	  stopPropagation: function (e) {
+	    e.stopPropagation();
+	    e.stopImmediatePropagation();
+	    e.preventDefault();
+	  },
+
+	  /**
+	   * Toggle the dropdown visibility
+	   *
+	   * @method toggle
+	   * @param {object} [e]
+	   */
+	  toggle: function (e) {
+	    if (this.isOpen !== true) {
+	      this.open(e);
+	    }
+	    else {
+	      this.close(e);
+	    }
+	  },
+
+	  /**
+	   * Open the dropdown
+	   *
+	   * @method open
+	   * @param {object} [e]
+	   */
+	  open: function (e) {
+	    clearTimeout(this.closeTimeout);
+	    clearTimeout(this.deferCloseTimeout);
+
+	    if (e) {
+	      if (e.stopPropagation) {
+	        e.stopPropagation();
+	      }
+	      if (e.preventDefault) {
+	        e.preventDefault();
+	      }
+	      e.cancelBubble = true;
+	    }
+
+	    // Don't do anything if already open
+	    if (this.isOpen) {
+	      return;
+	    }
+
+	    this.isOpen = true;
+	    this.$el.addClass("open");
+	    this.trigger("dropdown:opened");
+
+	    // Notify child view
+	    this.view.trigger("dropdown:opened");
+	  },
+
+	  /**
+	   * Close the dropdown
+	   *
+	   * @method close
+	   * @param {object} [e]
+	   */
+	  close: function (e) {
+	    // Don't do anything if already closed
+	    if (!this.isOpen) {
+	      return;
+	    }
+
+	    this.isOpen = false;
+	    this.$el.removeClass("open");
+	    this.trigger("dropdown:closed");
+
+	    // Notify child view
+	    this.view.trigger("dropdown:closed");
+	  },
+
+	  /**
+	   * Close the dropdown on esc
+	   *
+	   * @method closeOnEsc
+	   * @param {object} e
+	   * @private
+	   */
+	  closeOnEsc: function (e) {
+	    if (e.which === 27) {
+	      this.deferClose();
+	    }
+	  },
+
+	  /**
+	   * @method deferClose
+	   * @private
+	   */
+	  deferClose: function () {
+	    this.deferCloseTimeout = setTimeout(this.close.bind(this), 0);
+	  },
+
+	  /**
+	   * @method stopDeferClose
+	   * @private
+	   */
+	  stopDeferClose: function (e) {
+	    clearTimeout(this.deferCloseTimeout);
+	  },
+
+	  /**
+	   * Clean up this control
+	   *
+	   * @method remove
+	   * @chainable
+	   */
+	  remove: function () {
+	    // Remove event listeners
+	    document.body.removeEventListener("click", this.deferClose);
+	    this.el.removeEventListener("click", this.stopDeferClose);
+	    if (this.options.closeOnEsc) {
+	      document.body.removeEventListener("keyup", this.closeOnEsc);
+	    }
+	    this.el.removeEventListener("click", this.toggle);
+
+	    // Remove DOM element
+	    $(this.view.el).remove();
+
+	    // Invoke original backbone methods
+	    return Backbone.View.prototype.remove.apply(this, arguments);
+	  }
+	});
+
+	/**
+	 * Backgrid HeaderCell containing ColumnManagerVisibilityControl
+	 *
+	 * @class Backgrid.Extension.ColumnVisibilityHeaderCell
+	 * @extends Backgrid.HeaderCell
+	 */
+
+	Backgrid.Extension.ColumnManager.ColumnVisibilityHeaderCell = Backgrid.HeaderCell.extend({
+	  initialize: function (options) {
+	    Backgrid.HeaderCell.prototype.initialize.apply(this, arguments);
+
+	    // Add class
+	    this.$el.addClass(this.column.get("name"));
+	  },
+	  render: function () {
+	    this.$el.empty();
+
+	    // Add control
+	    var colVisibilityControl = this.colVisibilityControl = new Backgrid.Extension.ColumnManagerVisibilityControl({
+	      columnManager: this.columnManager
+	    });
+
+	    // Add to header
+	    this.$el.html(colVisibilityControl.render().el);
+
+	    this.delegateEvents();
+	    return this;
+	  },
+
+	  /**
+	   * Clean up this cell.
+	   *
+	   * @method remove
+	   * @chainable
+	   */
+	  remove: function () {
+	    // Remove UI control
+	    this.colVisibilityControl.remove();
+
+	    // Invoke super
+	    /*eslint no-underscore-dangle:0*/
+	    return Backgrid.HeaderCell.__super__.remove.apply(this, arguments);
+	  }
+	});
+
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+	module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+	module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
+
+/***/ },
+/* 3 */
+/***/ function(module, exports, __webpack_require__) {
+
+	module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
+
+/***/ },
+/* 4 */
+/***/ function(module, exports, __webpack_require__) {
+
+	module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
+
+/***/ }
+/******/ ])
+});
+;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.min.js
new file mode 100644
index 0000000..3312282
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.min.js
@@ -0,0 +1 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Backbone"),require("Backgrid"),require("_"),require("jQuery")):"function"==typeof define&&define.amd?define(["Backbone","Backgrid","_","jQuery"],t):"object"==typeof exports?exports["Backgrid.Extension.ColumnManager"]=t(require("Backbone"),require("Backgrid"),require("_"),require("jQuery")):e["Backgrid.Extension.ColumnManager"]=t(e.Backbone,e.Backgrid,e._,e.jQuery)}(this,function(e,t,n,i){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var i=n(3),o=n(4),s=n(1),r=n(2);r.Extension.ColumnManager=function(e,t,n){i.extend(this,s.Events);var o={initialColumnsVisible:null,trackSize:!0,trackOrder:!0,trackVisibility:!0,stateChecking:"strict",saveState:!1,saveStateKey:"",saveStateLocation:"localStorage",loadStateOnInit:!
 1};if(this.options=i.extend({},o,t),this.state=[],e instanceof r.Columns){this.columns=e,e.columnManager=this,this.addManagerToColumns();var a=this.options.loadStateOnInit?this.loadState():!1;if(n&&this.checkStateValidity(n)?this.setState(n,!0):a?this.setState(a,!0):(this.setInitialColumnVisibility(),this.setState(this.getStateFromColumns())),this.options.trackVisibility||this.options.trackSize||this.options.trackOrder){var l=""+(this.options.trackVisibility?"change:renderable ":"")+(this.options.trackSize?"resize ":"")+(this.options.trackOrder?"ordered":"");this.columns.on(l,i.bind(this.stateUpdateHandler,this))}}else console.error("Backgrid.ColumnManager: options.columns is not an instance of Backgrid.Columns")},r.Extension.ColumnManager.prototype.setInitialColumnVisibility=function(){var e=this,t=e.options.initialColumnsVisible;t&&e.columns.each(function(e,n){e.set("renderable",e.get("alwaysVisible")?!0:t>n)})},r.Extension.ColumnManager.prototype.addManagerToColumns=function(){va
 r e=this;e.columns.each(function(t){t.get("headerCell")===r.Extension.ColumnManager.ColumnVisibilityHeaderCell&&t.set("headerCell",t.get("headerCell").extend({columnManager:e})),t.get("headerCell")instanceof r.Extension.ColumnManager.ColumnVisibilityHeaderCell&&(t.get("headerCell").columnManager=e)})},r.Extension.ColumnManager.prototype.getColumn=function(e){return(i.isNumber(e)||i.isString(e))&&(e=this.columns.get(e)),e instanceof r.Column?e:!1},r.Extension.ColumnManager.prototype.hideColumn=function(e){var t=this.getColumn(e);t&&t.set("renderable",!1)},r.Extension.ColumnManager.prototype.showColumn=function(e){var t=this.getColumn(e);t&&t.set("renderable",!0)},r.Extension.ColumnManager.prototype.toggleColumnVisibility=function(e){var t=this.getColumn(e);t&&(t.get("renderable")?this.hideColumn(t):this.showColumn(t))},r.Extension.ColumnManager.prototype.getColumnCollection=function(){return this.columns},r.Extension.ColumnManager.prototype.setState=function(e,t){var n=this;return i.
 filter(e,function(t){if(!i.has(t,"name"))return!1;var o=n.columns.findWhere({name:e.name});return"undefined"!=typeof o}),n.checkStateValidity(e)&&e!==n.state?(n.state=e,n.trigger("state-changed",e),t?n.applyStateToColumns():n.saveState()):!1},r.Extension.ColumnManager.prototype.getState=function(){return this.state},r.Extension.ColumnManager.prototype.checkStateValidity=function(e){function t(){return i.every(e,function(e){var t=!0;return i.has(e,"name")||(t=!1),i.has(e,"renderable")&&(i.isBoolean(e.renderable)||(t=!1)),i.has(e,"displayOrder")&&(i.isNumber(e.displayOrder)||(t=!1)),i.has(e,"width")&&(i.isNumber(e.width)||i.isString(e.width)||(t=!1)),t})}if(!i.isArray(e)&&i.isEmpty(e))return!1;if("loose"===this.options.stateChecking)return t();if(e.length!==this.columns.length&&!t())return!1;var n=this.columns.map(function(e){return e.get("name")}),o=i.map(e,function(e){return e.name});return n.sort().toString()===o.sort().toString()},r.Extension.ColumnManager.prototype.loadState=func
 tion(){var e=JSON.parse(this.getStorage().getItem(this.getStorageKey()));return this.checkStateValidity(e)?e:!1},r.Extension.ColumnManager.prototype.saveState=function(e){return this.options.saveState||e?(this.getStorage().setItem(this.getStorageKey(),JSON.stringify(this.state)),this.trigger("state-saved"),!0):!1},r.Extension.ColumnManager.prototype.getStorage=function(){return"undefined"!=typeof Storage?"sessionStorage"===this.options.saveStateLocation?sessionStorage:localStorage:(console.error("ColMrg: No storage support detected. State won't be saved."),!1)},r.Extension.ColumnManager.prototype.getStorageKey=function(){return this.options.saveStateKey?"backgrid-colmgr-"+this.options.saveStateKey:"backgrid-colmgr"},r.Extension.ColumnManager.prototype.stateUpdateHandler=function(){var e=this.getStateFromColumns();return this.setState(e)},r.Extension.ColumnManager.prototype.getStateFromColumns=function(){var e=this;return this.columns.map(function(t){var n={name:t.get("name")};return
  e.options.trackVisibility&&(n.renderable=t.get("renderable")),e.options.trackOrder&&(n.displayOrder=t.get("displayOrder")),e.options.trackSize&&(n.width=t.get("width")),n})},r.Extension.ColumnManager.prototype.applyStateToColumns=function(){var e=this,t=!1;i.each(this.state,function(n){var o=e.columns.findWhere({name:n.name});if(i.has(n,"renderable")&&o.set("renderable",n.renderable),i.has(n,"width")){var s=o.get("width");o.set("width",n.width,{silent:!0}),s!==n.width&&o.trigger("resize",o,n.width,s)}i.has(n,"displayOrder")&&(n.displayOrder!==o.get("displayOrder")&&(t=!0),o.set("displayOrder",n.displayOrder,{silent:!0}))}),t&&(e.columns.sort(),e.columns.trigger("ordered"))};var a=s.View.extend({className:"columnmanager-dropdown-item",tagName:"li",initialize:function(e){this.columnManager=e.columnManager,this.column=e.column,this.template=e.template,i.bindAll(this,"render","toggleVisibility"),this.column.on("change:renderable",this.render,this),this.el.addEventListener("click",this.
 toggleVisibility,!0)},render:function(){return this.$el.empty(),this.$el.append(this.template({label:this.column.get("label")})),this.column.get("renderable")?this.$el.addClass(this.column.get("renderable")?"visible":null):this.$el.removeClass("visible"),this},toggleVisibility:function(e){e&&this.stopPropagation(e),this.columnManager.toggleColumnVisibility(this.column)},stopPropagation:function(e){e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault()}}),l=s.View.extend({className:"columnmanager-dropdown-container",initialize:function(e){this.options=e,this.columnManager=e.columnManager,this.ItemView=e.DropdownItemView instanceof s.View?e.DropdownItemView:a,this.$dropdownButton=e.$dropdownButton,this.on("dropdown:opened",this.open,this),this.on("dropdown:closed",this.close,this),this.columnManager.columns.on("add remove",this.render,this)},render:function(){var e=this;return e.$el.empty(),this.columnManager.columns.each(function(t){t.get("alwaysVisible")||e.$el.append(n
 ew e.ItemView({column:t,columnManager:e.columnManager,template:e.options.dropdownItemTemplate}).render().el)}),this},open:function(){this.$el.addClass("open");var e,t=this.$dropdownButton;if("auto"===this.options.align){var n=document.body.clientWidth||document.body.clientWidth;e=t.offset().left+this.$el.outerWidth()>n?"left":"right"}else e="left"===this.options.align||"right"===this.options.align?"right"===this.options.align?"right":"left":"right";var i;"left"===e?(i=t.offset().left+t.outerWidth()-this.$el.outerWidth(),this.$el.css("left",i+"px")):(i=t.offset().left,this.$el.css("left",i+"px"));var o=t.offset().top+t.outerHeight();this.$el.css("top",o+"px")},close:function(){this.$el.removeClass("open")}});r.Extension.ColumnManagerVisibilityControl=s.View.extend({tagName:"div",className:"columnmanager-visibilitycontrol",defaultEvents:{click:"stopPropagation"},defaultOpts:{width:null,closeOnEsc:!0,closeOnClick:!0,openOnInit:!1,columnManager:null,buttonTemplate:i.template("<button cl
 ass='dropdown-button'>...</button>"),DropdownView:l,dropdownAlign:"auto",DropdownItemView:a,dropdownItemTemplate:i.template("<span class='indicator'></span><span class='column-label'><%= label %></span>")},initialize:function(e){this.options=i.extend({},this.defaultOpts,e),this.events=i.extend({},this.defaultEvents,this.events||{}),this.columnManager=e.columnManager,!this.columnManager instanceof r.Extension.ColumnManager&&console.error("Backgrid.ColumnManager: options.columns is not an instance of Backgrid.Columns"),i.bindAll(this,"deferClose","stopDeferClose","closeOnEsc","toggle","render"),document.body.addEventListener("click",this.deferClose,!0),this.el.addEventListener("click",this.stopDeferClose,!0),this.options.closeOnEsc&&document.body.addEventListener("keyup",this.closeOnEsc,!1),this.el.addEventListener("click",this.toggle,!1),this.setup(),this.view.on("dropdown:close",this.close,this),this.view.on("dropdown:open",this.open,this)},delayStart:function(){clearTimeout(this.cl
 oseTimeout),this.delayTimeout=setTimeout(this.open.bind(this),this.options.delay)},delayEnd:function(){clearTimeout(this.delayTimeout),this.closeTimeout=setTimeout(this.close.bind(this),300)},setup:function(){this.options.width&&this.$el.width(this.options.width+"px"),this.$dropdownButton=o(this.options.buttonTemplate());var e={columnManager:this.columnManager,DropdownItemView:this.options.DropdownItemView,dropdownItemTemplate:this.options.dropdownItemTemplate,align:this.options.dropdownAlign,$dropdownButton:this.$dropdownButton};this.view=this.options.DropdownView instanceof s.View?new this.options.DropdownView(e):new l(e)},render:function(){return this.$el.empty(),this.$el.append(this.$dropdownButton),this.view.render(),o(document.body).append(this.view.el),this},stopPropagation:function(e){e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault()},toggle:function(e){this.isOpen!==!0?this.open(e):this.close(e)},open:function(e){clearTimeout(this.closeTimeout),clearTimeou
 t(this.deferCloseTimeout),e&&(e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0),this.isOpen||(this.isOpen=!0,this.$el.addClass("open"),this.trigger("dropdown:opened"),this.view.trigger("dropdown:opened"))},close:function(e){this.isOpen&&(this.isOpen=!1,this.$el.removeClass("open"),this.trigger("dropdown:closed"),this.view.trigger("dropdown:closed"))},closeOnEsc:function(e){27===e.which&&this.deferClose()},deferClose:function(){this.deferCloseTimeout=setTimeout(this.close.bind(this),0)},stopDeferClose:function(e){clearTimeout(this.deferCloseTimeout)},remove:function(){return document.body.removeEventListener("click",this.deferClose),this.el.removeEventListener("click",this.stopDeferClose),this.options.closeOnEsc&&document.body.removeEventListener("keyup",this.closeOnEsc),this.el.removeEventListener("click",this.toggle),o(this.view.el).remove(),s.View.prototype.remove.apply(this,arguments)}}),r.Extension.ColumnManager.ColumnVisibilityHeader
 Cell=r.HeaderCell.extend({initialize:function(e){r.HeaderCell.prototype.initialize.apply(this,arguments),this.$el.addClass(this.column.get("name"))},render:function(){this.$el.empty();var e=this.colVisibilityControl=new r.Extension.ColumnManagerVisibilityControl({columnManager:this.columnManager});return this.$el.html(e.render().el),this.delegateEvents(),this},remove:function(){return this.colVisibilityControl.remove(),r.HeaderCell.__super__.remove.apply(this,arguments)}})},function(t,n,i){t.exports=e},function(e,n,i){e.exports=t},function(e,t,i){e.exports=n},function(e,t,n){e.exports=i}])});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/css/backgrid-filter.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/css/backgrid-filter.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/css/backgrid-filter.css
new file mode 100644
index 0000000..4c689d0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/css/backgrid-filter.css
@@ -0,0 +1,193 @@
+/*
+  backgrid-filter
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+
+/*
+  Search Icon CSS derived from:
+
+  PURE CSS GUI ICONS
+  by Nicolas Gallagher
+  - http://nicolasgallagher.com/pure-css-gui-icons/
+
+  http://nicolasgallagher.com
+  http://twitter.com/necolas
+
+  Created: 29 July 2010
+  Version: 1.0.1
+
+  Dual licensed under MIT and GNU GPLv2 (c) Nicolas Gallagher
+*/
+
+.backgrid-filter.form-search {
+  position: relative;
+  width: 248px;
+  height: 30px;
+  margin: 20px;
+}
+
+/*
+  Search Icon
+*/
+
+.backgrid-filter .search {
+  position: absolute;
+  top: 50%;
+  left: 6px;
+  z-index: 1000;
+  width: 10px;
+  height: 20px;
+  margin-top: -10px;
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+}
+
+.backgrid-filter .search:before {
+  position: absolute;
+  top: 50%;
+  left: 0;
+  width: 6px;
+  height: 6px;
+  margin-top: -6px;
+  background: transparent;
+  border: 3px solid gray;
+  -webkit-border-radius: 12px;
+     -moz-border-radius: 12px;
+          border-radius: 12px;
+  content: "";
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+}
+
+.backgrid-filter .search:after {
+  position: absolute;
+  top: 50%;
+  left: 10px;
+  width: 3px;
+  height: 7px;
+  margin-top: 2px;
+  background-color: gray;
+  content: "";
+  -webkit-transform: rotate(-45deg);
+     -moz-transform: rotate(-45deg);
+      -ms-transform: rotate(-45deg);
+       -o-transform: rotate(-45deg);
+          transform: rotate(-45deg);
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+}
+
+/*
+  Clear button
+ */
+
+.backgrid-filter .clear {
+  position: absolute;
+  top: 50%;
+  right: 8px;
+  z-index: 1000;
+  width: 10px;
+  height: 20px;
+  margin-top: -10px;
+  font-family: sans-serif;
+  font-size: 20px;
+  font-weight: bold;
+  line-height: 20px;
+  color: gray;
+  text-decoration: none;
+}
+
+.backgrid-filter input[type="search"] {
+  position: absolute;
+  display: inline-block;
+  width: 206px;
+  height: 20px;
+  padding: 4px 6px;
+  font-weight: normal;
+  color: #555;
+  vertical-align: middle;
+  background-color: #fff;
+  border: 1px solid #ccc;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
+     -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
+       -o-transition: border linear 0.2s, box-shadow linear 0.2s;
+          transition: border linear 0.2s, box-shadow linear 0.2s;
+}
+
+/*
+  Normalize the search input box, with code borrowed from normalize.css.
+
+  https://github.com/necolas/normalize.css/
+
+  Copyright (c) Nicolas Gallagher and Jonathan Neal, MIT @license.
+ */
+
+/*
+ * 1. Correct font family not being inherited in all browsers.
+ * 2. Correct font size not being inherited in all browsers.
+ * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
+ * 4. Address Firefox 4+ setting `line-height` on `input` using `!important` in the UA stylesheet.
+ */
+
+.backgrid-filter input {
+  margin: 0;
+  font-family: inherit;
+  font-size: 100%;
+  line-height: normal;
+}
+
+/*
+ * Re-set default cursor for disabled elements.
+ */
+
+.backgrid-filter input[disabled] {
+  cursor: default;
+}
+
+/*
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
+ *    (include `-moz` to future-proof).
+ */
+
+.backgrid-filter input[type="search"] {
+  outline: none;
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+  -webkit-appearance: none;
+}
+
+/*
+ * Remove the default clear button on IE
+ */
+
+.backgrid-filter input[type="search"]::-ms-clear {
+  display: none;
+}
+
+/*
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+.backgrid-filter input::-moz-focus-inner {
+  padding: 0;
+  border: 0;
+}
+
+.backgrid-filter input[type="search"] {
+  padding-right: 18px;
+  padding-left: 22px;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.js
new file mode 100644
index 0000000..66b1c21
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.js
@@ -0,0 +1,487 @@
+/*
+  backgrid-filter
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+(function (root, factory) {
+
+  // CommonJS
+  if (typeof exports == "object") {
+    (function () {
+      var lunr;
+      try { lunr = require("lunr"); } catch (e) {}
+      module.exports = factory(require("underscore"),
+                               require("backbone"),
+                               require("backgrid"),
+                               lunr);
+    }());
+  }
+  // Browser
+  else {
+    factory(root._, root.Backbone, root.Backgrid, root.lunr);
+  }
+
+}(this, function (_, Backbone, Backgrid, lunr) {
+
+  "use strict";
+
+  /**
+     ServerSideFilter is a search form widget that submits a query to the server
+     for filtering the current collection.
+
+     @class Backgrid.Extension.ServerSideFilter
+  */
+  var ServerSideFilter = Backgrid.Extension.ServerSideFilter = Backbone.View.extend({
+
+    /** @property */
+    tagName: "form",
+
+    /** @property */
+    className: "backgrid-filter form-search",
+
+    /** @property {function(Object, ?Object=): string} template */
+    template: _.template('<span class="search">&nbsp;</span><input type="search" <% if (placeholder) { %> placeholder="<%- placeholder %>" <% } %> name="<%- name %>" /><a class="clear" data-backgrid-action="clear" href="#">&times;</a>', null, {variable: null}),
+
+    /** @property */
+    events: {
+      "keyup input[type=search]": "showClearButtonMaybe",
+      "click a[data-backgrid-action=clear]": "clear",
+      "submit": "search"
+    },
+
+    /** @property {string} [name='q'] Query key */
+    name: "q",
+
+    /**
+       @property {string} [placeholder] The HTML5 placeholder to appear beneath
+       the search box.
+    */
+    placeholder: null,
+
+    /**
+       @param {Object} options
+       @param {Backbone.Collection} options.collection
+       @param {string} [options.name]
+       @param {string} [options.placeholder]
+       @param {function(Object): string} [options.template]
+    */
+    initialize: function (options) {
+      ServerSideFilter.__super__.initialize.apply(this, arguments);
+      this.name = options.name || this.name;
+      this.placeholder = options.placeholder || this.placeholder;
+      this.template = options.template || this.template;
+
+      // Persist the query on pagination
+      var collection = this.collection, self = this;
+      if (Backbone.PageableCollection &&
+          collection instanceof Backbone.PageableCollection &&
+          collection.mode == "server") {
+        collection.queryParams[this.name] = function () {
+          return self.searchBox().val() || null;
+        };
+      }
+    },
+
+    /**
+       Event handler. Show the clear button when the search box has text, hide
+       it otherwise.
+     */
+    showClearButtonMaybe: function () {
+      var $clearButton = this.clearButton();
+      var searchTerms = this.searchBox().val();
+      if (searchTerms) $clearButton.show();
+      else $clearButton.hide();
+    },
+
+    /**
+       Returns the search input box.
+     */
+    searchBox: function () {
+      return this.$el.find("input[type=search]");
+    },
+
+    /**
+       Returns the clear button.
+     */
+    clearButton: function () {
+      return this.$el.find("a[data-backgrid-action=clear]");
+    },
+
+    /**
+       Upon search form submission, this event handler constructs a query
+       parameter object and pass it to Collection#fetch for server-side
+       filtering.
+
+       If the collection is a PageableCollection, searching will go back to the
+       first page.
+    */
+    search: function (e) {
+      if (e) e.preventDefault();
+
+      var data = {};
+      var query = this.searchBox().val();
+      if (query) data[this.name] = query;
+
+      var collection = this.collection;
+
+      // go back to the first page on search
+      if (Backbone.PageableCollection &&
+          collection instanceof Backbone.PageableCollection) {
+        collection.getFirstPage({data: data, reset: true, fetch: true});
+      }
+      else collection.fetch({data: data, reset: true});
+    },
+
+    /**
+       Event handler for the clear button. Clears the search box and refetch the
+       collection.
+
+       If the collection is a PageableCollection, clearing will go back to the
+       first page.
+    */
+    clear: function (e) {
+      if (e) e.preventDefault();
+      this.searchBox().val(null);
+      this.showClearButtonMaybe();
+
+      var collection = this.collection;
+
+      // go back to the first page on clear
+      if (Backbone.PageableCollection &&
+          collection instanceof Backbone.PageableCollection) {
+        collection.getFirstPage({reset: true, fetch: true});
+      }
+      else collection.fetch({reset: true});
+    },
+
+    /**
+       Renders a search form with a text box, optionally with a placeholder and
+       a preset value if supplied during initialization.
+    */
+    render: function () {
+      this.$el.empty().append(this.template({
+        name: this.name,
+        placeholder: this.placeholder,
+        value: this.value
+      }));
+      this.showClearButtonMaybe();
+      this.delegateEvents();
+      return this;
+    }
+
+  });
+
+  /**
+     ClientSideFilter is a search form widget that searches a collection for
+     model matches against a query on the client side. The exact matching
+     algorithm can be overriden by subclasses.
+
+     @class Backgrid.Extension.ClientSideFilter
+     @extends Backgrid.Extension.ServerSideFilter
+  */
+  var ClientSideFilter = Backgrid.Extension.ClientSideFilter = ServerSideFilter.extend({
+
+    /** @property */
+    events: _.extend({}, ServerSideFilter.prototype.events, {
+      "click a[data-backgrid-action=clear]": function (e) {
+        e.preventDefault();
+        this.clear();
+      },
+      "keydown input[type=search]": "search",
+      "submit": function (e) {
+        e.preventDefault();
+        this.search();
+      }
+    }),
+
+    /**
+       @property {?Array.<string>} [fields] A list of model field names to
+       search for matches. If null, all of the fields will be searched.
+    */
+    fields: null,
+
+    /**
+       @property [wait=149] The time in milliseconds to wait since the last
+       change to the search box's value before searching. This value can be
+       adjusted depending on how often the search box is used and how large the
+       search index is.
+    */
+    wait: 149,
+
+    /**
+       Debounces the #search and #clear methods and makes a copy of the given
+       collection for searching.
+
+       @param {Object} options
+       @param {Backbone.Collection} options.collection
+       @param {string} [options.placeholder]
+       @param {string} [options.fields]
+       @param {string} [options.wait=149]
+    */
+    initialize: function (options) {
+      ClientSideFilter.__super__.initialize.apply(this, arguments);
+
+      this.fields = options.fields || this.fields;
+      this.wait = options.wait || this.wait;
+
+      this._debounceMethods(["search", "clear"]);
+
+      var collection = this.collection = this.collection.fullCollection || this.collection;
+      var shadowCollection = this.shadowCollection = collection.clone();
+
+      this.listenTo(collection, "add", function (model, collection, options) {
+        shadowCollection.add(model, options);
+      });
+      this.listenTo(collection, "remove", function (model, collection, options) {
+        shadowCollection.remove(model, options);
+      });
+      this.listenTo(collection, "sort", function (col) {
+        if (!this.searchBox().val()) shadowCollection.reset(col.models);
+      });
+      this.listenTo(collection, "reset", function (col, options) {
+        options = _.extend({reindex: true}, options || {});
+        if (options.reindex && options.from == null && options.to == null) {
+          shadowCollection.reset(col.models);
+        }
+      });
+    },
+
+    _debounceMethods: function (methodNames) {
+      if (_.isString(methodNames)) methodNames = [methodNames];
+
+      this.undelegateEvents();
+
+      for (var i = 0, l = methodNames.length; i < l; i++) {
+        var methodName = methodNames[i];
+        var method = this[methodName];
+        this[methodName] = _.debounce(method, this.wait);
+      }
+
+      this.delegateEvents();
+    },
+
+    /**
+       Constructs a Javascript regular expression object for #makeMatcher.
+
+       This default implementation takes a query string and returns a Javascript
+       RegExp object that matches any of the words contained in the query string
+       case-insensitively. Override this method to return a different regular
+       expression matcher if this behavior is not desired.
+
+       @param {string} query The search query in the search box.
+       @return {RegExp} A RegExp object to match against model #fields.
+     */
+    makeRegExp: function (query) {
+      return new RegExp(query.trim().split(/\s+/).join("|"), "i");
+    },
+
+    /**
+       This default implementation takes a query string and returns a matcher
+       function that looks for matches in the model's #fields or all of its
+       fields if #fields is null, for any of the words in the query
+       case-insensitively using the regular expression object returned from
+       #makeRegExp.
+
+       Most of time, you'd want to override the regular expression used for
+       matching. If so, please refer to the #makeRegExp documentation,
+       otherwise, you can override this method to return a custom matching
+       function.
+
+       Subclasses overriding this method must take care to conform to the
+       signature of the matcher function. The matcher function is a function
+       that takes a model as paramter and returns true if the model matches a
+       search, or false otherwise.
+
+       In addition, when the matcher function is called, its context will be
+       bound to this ClientSideFilter object so it has access to the filter's
+       attributes and methods.
+
+       @param {string} query The search query in the search box.
+       @return {function(Backbone.Model):boolean} A matching function.
+    */
+    makeMatcher: function (query) {
+      var regexp = this.makeRegExp(query);
+      return function (model) {
+        var keys = this.fields || model.keys();
+        for (var i = 0, l = keys.length; i < l; i++) {
+          if (regexp.test(model.get(keys[i]) + "")) return true;
+        }
+        return false;
+      };
+    },
+
+    /**
+       Takes the query from the search box, constructs a matcher with it and
+       loops through collection looking for matches. Reset the given collection
+       when all the matches have been found.
+
+       If the collection is a PageableCollection, searching will go back to the
+       first page.
+    */
+    search: function () {
+      var matcher = _.bind(this.makeMatcher(this.searchBox().val()), this);
+      var col = this.collection;
+      if (col.pageableCollection) col.pageableCollection.getFirstPage({silent: true});
+      col.reset(this.shadowCollection.filter(matcher), {reindex: false});
+    },
+
+    /**
+       Clears the search box and reset the collection to its original.
+
+       If the collection is a PageableCollection, clearing will go back to the
+       first page.
+    */
+    clear: function () {
+      this.searchBox().val(null);
+      this.showClearButtonMaybe();
+      var col = this.collection;
+      if (col.pageableCollection) col.pageableCollection.getFirstPage({silent: true});
+      col.reset(this.shadowCollection.models, {reindex: false});
+    }
+
+  });
+
+  /**
+     LunrFilter is a ClientSideFilter that uses [lunrjs](http://lunrjs.com/) to
+     index the text fields of each model for a collection, and performs
+     full-text searching.
+
+     @class Backgrid.Extension.LunrFilter
+     @extends Backgrid.Extension.ClientSideFilter
+  */
+  var LunrFilter = Backgrid.Extension.LunrFilter = ClientSideFilter.extend({
+
+    /**
+       @property {string} [ref="id"]`lunrjs` document reference attribute name.
+    */
+    ref: "id",
+
+    /**
+       @property {Object} fields A hash of `lunrjs` index field names and boost
+       value. Unlike ClientSideFilter#fields, LunrFilter#fields is _required_ to
+       initialize the index.
+    */
+    fields: null,
+
+    /**
+       Indexes the underlying collection on construction. The index will refresh
+       when the underlying collection is reset. If any model is added, removed
+       or if any indexed fields of any models has changed, the index will be
+       updated.
+
+       @param {Object} options
+       @param {Backbone.Collection} options.collection
+       @param {string} [options.placeholder]
+       @param {string} [options.ref] `lunrjs` document reference attribute name.
+       @param {Object} [options.fields] A hash of `lunrjs` index field names and
+       boost value.
+       @param {number} [options.wait]
+    */
+    initialize: function (options) {
+      LunrFilter.__super__.initialize.apply(this, arguments);
+
+      this.ref = options.ref || this.ref;
+
+      var collection = this.collection = this.collection.fullCollection || this.collection;
+      this.listenTo(collection, "add", this.addToIndex);
+      this.listenTo(collection, "remove", this.removeFromIndex);
+      this.listenTo(collection, "reset", this.resetIndex);
+      this.listenTo(collection, "change", this.updateIndex);
+
+      this.resetIndex(collection);
+    },
+
+    /**
+       Reindex the collection. If `options.reindex` is `false`, this method is a
+       no-op.
+
+       @param {Backbone.Collection} collection
+       @param {Object} [options]
+       @param {boolean} [options.reindex=true]
+    */
+    resetIndex: function (collection, options) {
+      options = _.extend({reindex: true}, options || {});
+
+      if (options.reindex) {
+        var self = this;
+        this.index = lunr(function () {
+          _.each(self.fields, function (boost, fieldName) {
+            this.field(fieldName, boost);
+            this.ref(self.ref);
+          }, this);
+        });
+
+        collection.each(function (model) {
+          this.addToIndex(model);
+        }, this);
+      }
+    },
+
+    /**
+       Adds the given model to the index.
+
+       @param {Backbone.Model} model
+    */
+    addToIndex: function (model) {
+      var index = this.index;
+      var doc = model.toJSON();
+      if (index.documentStore.has(doc[this.ref])) index.update(doc);
+      else index.add(doc);
+    },
+
+    /**
+       Removes the given model from the index.
+
+       @param {Backbone.Model} model
+    */
+    removeFromIndex: function (model) {
+      var index = this.index;
+      var doc = model.toJSON();
+      if (index.documentStore.has(doc[this.ref])) index.remove(doc);
+    },
+
+    /**
+       Updates the index for the given model.
+
+       @param {Backbone.Model} model
+    */
+    updateIndex: function (model) {
+      var changed = model.changedAttributes();
+      if (changed && !_.isEmpty(_.intersection(_.keys(this.fields),
+                                               _.keys(changed)))) {
+        this.index.update(model.toJSON());
+      }
+    },
+
+    /**
+       Takes the query from the search box and performs a full-text search on
+       the client-side. The search result is returned by resetting the
+       underlying collection to the models after interrogating the index for the
+       query answer.
+
+       If the collection is a PageableCollection, searching will go back to the
+       first page.
+    */
+    search: function () {
+      var col = this.collection;
+      if (!this.searchBox().val()) {
+        col.reset(this.shadowCollection.models, {reindex: false});
+        return;
+      }
+
+      var searchResults = this.index.search(this.searchBox().val());
+      var models = [];
+      for (var i = 0; i < searchResults.length; i++) {
+        var result = searchResults[i];
+        models.push(this.shadowCollection.get(result.ref));
+      }
+
+      if (col.pageableCollection) col.pageableCollection.getFirstPage({silent: true});
+      col.reset(models, {reindex: false});
+    }
+
+  });
+
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.min.js
new file mode 100644
index 0000000..3d8edfb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-filter/js/backgrid-filter.min.js
@@ -0,0 +1,8 @@
+/*
+  backgrid-filter
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+!function(a,b){"object"==typeof exports?!function(){var a;try{a=require("lunr")}catch(c){}module.exports=b(require("underscore"),require("backbone"),require("backgrid"),a)}():b(a._,a.Backbone,a.Backgrid,a.lunr)}(this,function(a,b,c,d){"use strict";var e=c.Extension.ServerSideFilter=b.View.extend({tagName:"form",className:"backgrid-filter form-search",template:a.template('<span class="search">&nbsp;</span><input type="search" <% if (placeholder) { %> placeholder="<%- placeholder %>" <% } %> name="<%- name %>" /><a class="clear" data-backgrid-action="clear" href="#">&times;</a>',null,{variable:null}),events:{"keyup input[type=search]":"showClearButtonMaybe","click a[data-backgrid-action=clear]":"clear",submit:"search"},name:"q",placeholder:null,initialize:function(a){e.__super__.initialize.apply(this,arguments),this.name=a.name||this.name,this.placeholder=a.placeholder||this.placeholder,this.template=a.template||this.template;var c=this.collection,d=this;b.PageableCollection&&c instan
 ceof b.PageableCollection&&"server"==c.mode&&(c.queryParams[this.name]=function(){return d.searchBox().val()||null})},showClearButtonMaybe:function(){var a=this.clearButton(),b=this.searchBox().val();b?a.show():a.hide()},searchBox:function(){return this.$el.find("input[type=search]")},clearButton:function(){return this.$el.find("a[data-backgrid-action=clear]")},search:function(a){a&&a.preventDefault();var c={},d=this.searchBox().val();d&&(c[this.name]=d);var e=this.collection;b.PageableCollection&&e instanceof b.PageableCollection?e.getFirstPage({data:c,reset:!0,fetch:!0}):e.fetch({data:c,reset:!0})},clear:function(a){a&&a.preventDefault(),this.searchBox().val(null),this.showClearButtonMaybe();var c=this.collection;b.PageableCollection&&c instanceof b.PageableCollection?c.getFirstPage({reset:!0,fetch:!0}):c.fetch({reset:!0})},render:function(){return this.$el.empty().append(this.template({name:this.name,placeholder:this.placeholder,value:this.value})),this.showClearButtonMaybe(),thi
 s.delegateEvents(),this}}),f=c.Extension.ClientSideFilter=e.extend({events:a.extend({},e.prototype.events,{"click a[data-backgrid-action=clear]":function(a){a.preventDefault(),this.clear()},"keydown input[type=search]":"search",submit:function(a){a.preventDefault(),this.search()}}),fields:null,wait:149,initialize:function(b){f.__super__.initialize.apply(this,arguments),this.fields=b.fields||this.fields,this.wait=b.wait||this.wait,this._debounceMethods(["search","clear"]);var c=this.collection=this.collection.fullCollection||this.collection,d=this.shadowCollection=c.clone();this.listenTo(c,"add",function(a,b,c){d.add(a,c)}),this.listenTo(c,"remove",function(a,b,c){d.remove(a,c)}),this.listenTo(c,"sort",function(a){this.searchBox().val()||d.reset(a.models)}),this.listenTo(c,"reset",function(b,c){c=a.extend({reindex:!0},c||{}),c.reindex&&null==c.from&&null==c.to&&d.reset(b.models)})},_debounceMethods:function(b){a.isString(b)&&(b=[b]),this.undelegateEvents();for(var c=0,d=b.length;d>c;
 c++){var e=b[c],f=this[e];this[e]=a.debounce(f,this.wait)}this.delegateEvents()},makeRegExp:function(a){return new RegExp(a.trim().split(/\s+/).join("|"),"i")},makeMatcher:function(a){var b=this.makeRegExp(a);return function(a){for(var c=this.fields||a.keys(),d=0,e=c.length;e>d;d++)if(b.test(a.get(c[d])+""))return!0;return!1}},search:function(){var b=a.bind(this.makeMatcher(this.searchBox().val()),this),c=this.collection;c.pageableCollection&&c.pageableCollection.getFirstPage({silent:!0}),c.reset(this.shadowCollection.filter(b),{reindex:!1})},clear:function(){this.searchBox().val(null),this.showClearButtonMaybe();var a=this.collection;a.pageableCollection&&a.pageableCollection.getFirstPage({silent:!0}),a.reset(this.shadowCollection.models,{reindex:!1})}}),g=c.Extension.LunrFilter=f.extend({ref:"id",fields:null,initialize:function(a){g.__super__.initialize.apply(this,arguments),this.ref=a.ref||this.ref;var b=this.collection=this.collection.fullCollection||this.collection;this.listenT
 o(b,"add",this.addToIndex),this.listenTo(b,"remove",this.removeFromIndex),this.listenTo(b,"reset",this.resetIndex),this.listenTo(b,"change",this.updateIndex),this.resetIndex(b)},resetIndex:function(b,c){if(c=a.extend({reindex:!0},c||{}),c.reindex){var e=this;this.index=d(function(){a.each(e.fields,function(a,b){this.field(b,a),this.ref(e.ref)},this)}),b.each(function(a){this.addToIndex(a)},this)}},addToIndex:function(a){var b=this.index,c=a.toJSON();b.documentStore.has(c[this.ref])?b.update(c):b.add(c)},removeFromIndex:function(a){var b=this.index,c=a.toJSON();b.documentStore.has(c[this.ref])&&b.remove(c)},updateIndex:function(b){var c=b.changedAttributes();c&&!a.isEmpty(a.intersection(a.keys(this.fields),a.keys(c)))&&this.index.update(b.toJSON())},search:function(){var a=this.collection;if(!this.searchBox().val())return void a.reset(this.shadowCollection.models,{reindex:!1});for(var b=this.index.search(this.searchBox().val()),c=[],d=0;d<b.length;d++){var e=b[d];c.push(this.shadowCo
 llection.get(e.ref))}a.pageableCollection&&a.pageableCollection.getFirstPage({silent:!0}),a.reset(c,{reindex:!1})}})});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/css/backgrid-paginator.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/css/backgrid-paginator.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/css/backgrid-paginator.css
new file mode 100644
index 0000000..20ebbd2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/css/backgrid-paginator.css
@@ -0,0 +1,58 @@
+/*
+  backgrid-paginator
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+.backgrid-paginator {
+  text-align: center;
+  border-top: none;
+  -webkit-border-radius: 0 0 4px 4px;
+     -moz-border-radius: 0 0 4px 4px;
+          border-radius: 0 0 4px 4px;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+.backgrid-paginator ul {
+  display: inline-block;
+  *display: inline;
+  margin: 5px 0;
+  *zoom: 1;
+}
+
+.backgrid-paginator ul > li {
+  display: inline;
+}
+
+.backgrid-paginator ul > li > a,
+.backgrid-paginator ul > li > span {
+  float: left;
+  width: 30px;
+  height: 30px;
+  padding: 0;
+  line-height: 30px;
+  text-decoration: none;
+}
+
+.backgrid-paginator ul > li > a:hover,
+.backgrid-paginator ul > .active > a,
+.backgrid-paginator ul > .active > span {
+  background-color: #f5f5f5;
+}
+
+.backgrid-paginator ul > .active > a,
+.backgrid-paginator ul > .active > span {
+  color: #999999;
+  cursor: default;
+}
+
+.backgrid-paginator ul > .disabled > span,
+.backgrid-paginator ul > .disabled > a,
+.backgrid-paginator ul > .disabled > a:hover {
+  color: #999999;
+  cursor: default;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.js
new file mode 100644
index 0000000..a0b3af9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.js
@@ -0,0 +1,427 @@
+/*
+  backgrid-paginator
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+(function (root, factory) {
+
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(require("underscore"),
+                             require("backbone"),
+                             require("backgrid"),
+                             require("backbone-pageable"));
+  }
+  // Browser
+  else {
+    factory(root._, root.Backbone, root.Backgrid);
+  }
+
+}(this, function (_, Backbone, Backgrid) {
+
+  "use strict";
+
+  /**
+     PageHandle is a class that renders the actual page handles and reacts to
+     click events for pagination.
+
+     This class acts in two modes - control or discrete page handle modes. If
+     one of the `is*` flags is `true`, an instance of this class is under
+     control page handle mode. Setting a `pageIndex` to an instance of this
+     class under control mode has no effect and the correct page index will
+     always be inferred from the `is*` flag. Only one of the `is*` flags should
+     be set to `true` at a time. For example, an instance of this class cannot
+     simultaneously be a rewind control and a fast forward control. A `label`
+     and a `title` template or a string are required to be passed to the
+     constuctor under this mode. If a `title` template is provided, it __MUST__
+     accept a parameter `label`. When the `label` is provided to the `title`
+     template function, its result will be used to render the generated anchor's
+     title attribute.
+
+     If all of the `is*` flags is set to `false`, which is the default, an
+     instance of this class will be in discrete page handle mode. An instance
+     under this mode requires the `pageIndex` to be passed from the constructor
+     as an option and it __MUST__ be a 0-based index of the list of page numbers
+     to render. The constuctor will normalize the base to the same base the
+     underlying PageableCollection collection instance uses. A `label` is not
+     required under this mode, which will default to the equivalent 1-based page
+     index calculated from `pageIndex` and the underlying PageableCollection
+     instance. A provided `label` will still be honored however. The `title`
+     parameter is also not required under this mode, in which case the default
+     `title` template will be used. You are encouraged to provide your own
+     `title` template however if you wish to localize the title strings.
+
+     If this page handle represents the current page, an `active` class will be
+     placed on the root list element.
+
+     If this page handle is at the border of the list of pages, a `disabled`
+     class will be placed on the root list element.
+
+     Only page handles that are neither `active` nor `disabled` will respond to
+     click events and triggers pagination.
+
+     @class Backgrid.Extension.PageHandle
+  */
+  var PageHandle = Backgrid.Extension.PageHandle = Backbone.View.extend({
+
+    /** @property */
+    tagName: "li",
+
+    /** @property */
+    events: {
+      "click a": "changePage"
+    },
+
+    /**
+       @property {string|function(Object.<string, string>): string} title
+       The title to use for the `title` attribute of the generated page handle
+       anchor elements. It can be a string or an Underscore template function
+       that takes a mandatory `label` parameter.
+    */
+    title: _.template('Page <%- label %>', null, {variable: null}),
+
+    /**
+       @property {boolean} isRewind Whether this handle represents a rewind
+       control
+    */
+    isRewind: false,
+
+    /**
+       @property {boolean} isBack Whether this handle represents a back
+       control
+    */
+    isBack: false,
+
+    /**
+       @property {boolean} isForward Whether this handle represents a forward
+       control
+    */
+    isForward: false,
+
+    /**
+       @property {boolean} isFastForward Whether this handle represents a fast
+       forward control
+    */
+    isFastForward: false,
+
+    /**
+       Initializer.
+
+       @param {Object} options
+       @param {Backbone.Collection} options.collection
+       @param {number} pageIndex 0-based index of the page number this handle
+       handles. This parameter will be normalized to the base the underlying
+       PageableCollection uses.
+       @param {string} [options.label] If provided it is used to render the
+       anchor text, otherwise the normalized pageIndex will be used
+       instead. Required if any of the `is*` flags is set to `true`.
+       @param {string} [options.title]
+       @param {boolean} [options.isRewind=false]
+       @param {boolean} [options.isBack=false]
+       @param {boolean} [options.isForward=false]
+       @param {boolean} [options.isFastForward=false]
+    */
+    initialize: function (options) {
+      var collection = this.collection;
+      var state = collection.state;
+      var currentPage = state.currentPage;
+      var firstPage = state.firstPage;
+      var lastPage = state.lastPage;
+
+      _.extend(this, _.pick(options,
+                            ["isRewind", "isBack", "isForward", "isFastForward"]));
+
+      var pageIndex;
+      if (this.isRewind) pageIndex = firstPage;
+      else if (this.isBack) pageIndex = Math.max(firstPage, currentPage - 1);
+      else if (this.isForward) pageIndex = Math.min(lastPage, currentPage + 1);
+      else if (this.isFastForward) pageIndex = lastPage;
+      else {
+        pageIndex = +options.pageIndex;
+        pageIndex = (firstPage ? pageIndex + 1 : pageIndex);
+      }
+      this.pageIndex = pageIndex;
+
+      this.label = (options.label || (firstPage ? pageIndex : pageIndex + 1)) + '';
+      var title = options.title || this.title;
+      this.title = _.isFunction(title) ? title({label: this.label}) : title;
+    },
+
+    /**
+       Renders a clickable anchor element under a list item.
+    */
+    render: function () {
+      this.$el.empty();
+      var anchor = document.createElement("a");
+      anchor.href = '#';
+      if (this.title) anchor.title = this.title;
+      anchor.innerHTML = this.label;
+      this.el.appendChild(anchor);
+
+      var collection = this.collection;
+      var state = collection.state;
+      var currentPage = state.currentPage;
+      var pageIndex = this.pageIndex;
+
+      if (this.isRewind && currentPage == state.firstPage ||
+         this.isBack && !collection.hasPrevious() ||
+         this.isForward && !collection.hasNext() ||
+         this.isFastForward && (currentPage == state.lastPage || state.totalPages < 1)) {
+        this.$el.addClass("disabled");
+      }
+      else if (!(this.isRewind ||
+                 this.isBack ||
+                 this.isForward ||
+                 this.isFastForward) &&
+               state.currentPage == pageIndex) {
+        this.$el.addClass("active");
+      }
+
+      this.delegateEvents();
+      return this;
+    },
+
+    /**
+       jQuery click event handler. Goes to the page this PageHandle instance
+       represents. No-op if this page handle is currently active or disabled.
+    */
+    changePage: function (e) {
+      e.preventDefault();
+      var $el = this.$el, col = this.collection;
+      if (!$el.hasClass("active") && !$el.hasClass("disabled")) {
+        if (this.isRewind) col.getFirstPage();
+        else if (this.isBack) col.getPreviousPage();
+        else if (this.isForward) col.getNextPage();
+        else if (this.isFastForward) col.getLastPage();
+        else col.getPage(this.pageIndex, {reset: true});
+      }
+      return this;
+    }
+
+  });
+
+  /**
+     Paginator is a Backgrid extension that renders a series of configurable
+     pagination handles. This extension is best used for splitting a large data
+     set across multiple pages. If the number of pages is larger then a
+     threshold, which is set to 10 by default, the page handles are rendered
+     within a sliding window, plus the rewind, back, forward and fast forward
+     control handles. The individual control handles can be turned off.
+
+     @class Backgrid.Extension.Paginator
+  */
+  var Paginator = Backgrid.Extension.Paginator = Backbone.View.extend({
+
+    /** @property */
+    className: "backgrid-paginator",
+
+    /** @property */
+    windowSize: 10,
+
+    /**
+       @property {number} slideScale the number used by #slideHowMuch to scale
+       `windowSize` to yield the number of pages to slide. For example, the
+       default windowSize(10) * slideScale(0.5) yields 5, which means the window
+       will slide forward 5 pages as soon as you've reached page 6. The smaller
+       the scale factor the less pages to slide, and vice versa.
+
+       Also See:
+
+       - #slideMaybe
+       - #slideHowMuch
+    */
+    slideScale: 0.5,
+
+    /**
+       @property {Object.<string, Object.<string, string>>} controls You can
+       disable specific control handles by setting the keys in question to
+       null. The defaults will be merged with your controls object, with your
+       changes taking precedent.
+    */
+    controls: {
+      rewind: {
+        label: "《",
+        title: "First"
+      },
+      back: {
+        label: "〈",
+        title: "Previous"
+      },
+      forward: {
+        label: "〉",
+        title: "Next"
+      },
+      fastForward: {
+        label: "》",
+        title: "Last"
+      }
+    },
+
+    /** @property */
+    renderIndexedPageHandles: true,
+
+    /**
+       @property {Backgrid.Extension.PageHandle} pageHandle. The PageHandle
+       class to use for rendering individual handles
+    */
+    pageHandle: PageHandle,
+
+    /** @property */
+    goBackFirstOnSort: true,
+
+    /**
+       Initializer.
+
+       @param {Object} options
+       @param {Backbone.Collection} options.collection
+       @param {boolean} [options.controls]
+       @param {boolean} [options.pageHandle=Backgrid.Extension.PageHandle]
+       @param {boolean} [options.goBackFirstOnSort=true]
+    */
+    initialize: function (options) {
+      var self = this;
+      self.controls = _.defaults(options.controls || {}, self.controls,
+                                 Paginator.prototype.controls);
+
+      _.extend(self, _.pick(options || {}, "windowSize", "pageHandle",
+                            "slideScale", "goBackFirstOnSort",
+                            "renderIndexedPageHandles"));
+
+      var col = self.collection;
+      self.listenTo(col, "add", self.render);
+      self.listenTo(col, "remove", self.render);
+      self.listenTo(col, "reset", self.render);
+      self.listenTo(col, "backgrid:sorted", function () {
+        if (self.goBackFirstOnSort) col.getFirstPage({reset: true});
+      });
+    },
+
+    /**
+      Decides whether the window should slide. This method should return 1 if
+      sliding should occur and 0 otherwise. The default is sliding should occur
+      if half of the pages in a window has been reached.
+
+      __Note__: All the parameters have been normalized to be 0-based.
+
+      @param {number} firstPage
+      @param {number} lastPage
+      @param {number} currentPage
+      @param {number} windowSize
+      @param {number} slideScale
+
+      @return {0|1}
+     */
+    slideMaybe: function (firstPage, lastPage, currentPage, windowSize, slideScale) {
+      return Math.round(currentPage % windowSize / windowSize);
+    },
+
+    /**
+      Decides how many pages to slide when sliding should occur. The default
+      simply scales the `windowSize` to arrive at a fraction of the `windowSize`
+      to increment.
+
+      __Note__: All the parameters have been normalized to be 0-based.
+
+      @param {number} firstPage
+      @param {number} lastPage
+      @param {number} currentPage
+      @param {number} windowSize
+      @param {number} slideScale
+
+      @return {number}
+     */
+    slideThisMuch: function (firstPage, lastPage, currentPage, windowSize, slideScale) {
+      return ~~(windowSize * slideScale);
+    },
+
+    _calculateWindow: function () {
+      var collection = this.collection;
+      var state = collection.state;
+
+      // convert all indices to 0-based here
+      var firstPage = state.firstPage;
+      var lastPage = +state.lastPage;
+      lastPage = Math.max(0, firstPage ? lastPage - 1 : lastPage);
+      var currentPage = Math.max(state.currentPage, state.firstPage);
+      currentPage = firstPage ? currentPage - 1 : currentPage;
+      var windowSize = this.windowSize;
+      var slideScale = this.slideScale;
+      var windowStart = Math.floor(currentPage / windowSize) * windowSize;
+      if (currentPage <= lastPage - this.slideThisMuch()) {
+        windowStart += (this.slideMaybe(firstPage, lastPage, currentPage, windowSize, slideScale) *
+                        this.slideThisMuch(firstPage, lastPage, currentPage, windowSize, slideScale));
+      }
+      var windowEnd = Math.min(lastPage + 1, windowStart + windowSize);
+      return [windowStart, windowEnd];
+    },
+
+    /**
+       Creates a list of page handle objects for rendering.
+
+       @return {Array.<Object>} an array of page handle objects hashes
+    */
+    makeHandles: function () {
+
+      var handles = [];
+      var collection = this.collection;
+
+      var window = this._calculateWindow();
+      var winStart = window[0], winEnd = window[1];
+
+      if (this.renderIndexedPageHandles) {
+        for (var i = winStart; i < winEnd; i++) {
+          handles.push(new this.pageHandle({
+            collection: collection,
+            pageIndex: i
+          }));
+        }
+      }
+
+      var controls = this.controls;
+      _.each(["back", "rewind", "forward", "fastForward"], function (key) {
+        var value = controls[key];
+        if (value) {
+          var handleCtorOpts = {
+            collection: collection,
+            title: value.title,
+            label: value.label
+          };
+          handleCtorOpts["is" + key.slice(0, 1).toUpperCase() + key.slice(1)] = true;
+          var handle = new this.pageHandle(handleCtorOpts);
+          if (key == "rewind" || key == "back") handles.unshift(handle);
+          else handles.push(handle);
+        }
+      }, this);
+
+      return handles;
+    },
+
+    /**
+       Render the paginator handles inside an unordered list.
+    */
+    render: function () {
+      this.$el.empty();
+
+      if (this.handles) {
+        for (var i = 0, l = this.handles.length; i < l; i++) {
+          this.handles[i].remove();
+        }
+      }
+
+      var handles = this.handles = this.makeHandles();
+
+      var ul = document.createElement("ul");
+      for (var i = 0; i < handles.length; i++) {
+        ul.appendChild(handles[i].render().el);
+      }
+
+      this.el.appendChild(ul);
+
+      return this;
+    }
+
+  });
+
+}));


[08/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-BH.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-BH.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-BH.js
new file mode 100644
index 0000000..62e60f2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-BH.js
@@ -0,0 +1,462 @@
+/*
+ * Globalize Culture ar-BH
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-BH", "default", {
+	name: "ar-BH",
+	englishName: "Arabic (Bahrain)",
+	nativeName: "العربية (البحرين)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$ n"],
+			decimals: 3,
+			symbol: "د.ب.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-DZ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-DZ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-DZ.js
new file mode 100644
index 0000000..5e8225a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-DZ.js
@@ -0,0 +1,458 @@
+/*
+ * Globalize Culture ar-DZ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-DZ", "default", {
+	name: "ar-DZ",
+	englishName: "Arabic (Algeria)",
+	nativeName: "العربية (الجزائر)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "د.ج.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "dd MMMM, yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd MMMM, yyyy H:mm",
+				F: "dd MMMM, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MM/yyyy H:mm",
+				F: "dd/MM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MMMM/yyyy H:mm",
+				F: "dd/MMMM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-EG.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-EG.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-EG.js
new file mode 100644
index 0000000..35313e5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-EG.js
@@ -0,0 +1,484 @@
+/*
+ * Globalize Culture ar-EG
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-EG", "default", {
+	name: "ar-EG",
+	englishName: "Arabic (Egypt)",
+	nativeName: "العربية (مصر)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ج.م.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));


[36/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java
new file mode 100644
index 0000000..765c639
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/LogsMgr.java
@@ -0,0 +1,1977 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.manager;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.dao.ServiceLogsSolrDao;
+import org.apache.ambari.logsearch.graph.GraphDataGnerator;
+import org.apache.ambari.logsearch.query.QueryGeneration;
+import org.apache.ambari.logsearch.util.BizUtil;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.DateUtil;
+import org.apache.ambari.logsearch.util.FileUtil;
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.ambari.logsearch.view.VBarDataList;
+import org.apache.ambari.logsearch.view.VBarGraphData;
+import org.apache.ambari.logsearch.view.VCount;
+import org.apache.ambari.logsearch.view.VCountList;
+import org.apache.ambari.logsearch.view.VGraphData;
+import org.apache.ambari.logsearch.view.VGraphInfo;
+import org.apache.ambari.logsearch.view.VGroupList;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.view.VNode;
+import org.apache.ambari.logsearch.view.VNodeList;
+import org.apache.ambari.logsearch.view.VSolrLogList;
+import org.apache.ambari.logsearch.view.VSummary;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.FacetField;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.PivotField;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.RangeFacet;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.common.collect.Lists;
+
+@Component
+public class LogsMgr extends MgrBase {
+  private static Logger logger = Logger.getLogger(LogsMgr.class);
+
+  public static List<String> cancelByDate = new CopyOnWriteArrayList<String>();
+
+  public static Map<String, String> mapUniqueId = new ConcurrentHashMap<String, String>();
+
+  @Autowired
+  ServiceLogsSolrDao serviceLogsSolrDao;
+
+  @Autowired
+  BizUtil bizUtil;
+
+  @Autowired
+  QueryGeneration queryGenerator;
+
+  @Autowired
+  FileUtil fileUtil;
+
+  @Autowired
+  DateUtil dateUtil;
+
+
+  @Autowired
+  GraphDataGnerator graphDataGnerator;
+
+
+  public String searchLogs(SearchCriteria searchCriteria) {
+    String keyword = (String) searchCriteria.getParamValue("keyword");
+    if (!stringUtil.isEmpty(keyword))
+      try {
+        return getPageByKeyword(searchCriteria);
+      } catch (SolrException | SolrServerException e) {
+        logger.error("Error while getting keyword=" + keyword, e);
+      }
+    String logId = (String) searchCriteria.getParamValue("sourceLogId");
+    if (!stringUtil.isEmpty(logId))
+      try {
+        return getPageByLogId(searchCriteria);
+      } catch (SolrException e) {
+        logger.error("Error while getting keyword=" + keyword, e);
+      }
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+
+    solrQuery.setParam("event", "/solr/logs_search");
+    try {
+      VSolrLogList collection = getLogAsPaginationProvided(solrQuery, serviceLogsSolrDao);
+      return convertObjToString(collection);
+    } catch (SolrException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getHosts(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetField(solrQuery, LogSearchConstants.SOLR_HOST);
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      FacetField hostFacetField = response
+        .getFacetField(LogSearchConstants.SOLR_HOST);
+      if (hostFacetField == null)
+        return convertObjToString(new SolrDocumentList());
+      List<Count> hostList = hostFacetField.getValues();
+      if (hostList == null)
+        return convertObjToString(new SolrDocumentList());
+      SolrDocumentList docList = response.getResults();
+      String hostName = "";
+      for (Count host : hostList) {
+        SolrDocument solrDoc = new SolrDocument();
+        hostName = host.getName();
+        solrDoc.put(LogSearchConstants.SOLR_HOST, hostName);
+        docList.add(solrDoc);
+      }
+
+      VGroupList collection = new VGroupList(docList);
+      collection.setStartIndex((int) docList.getStart());
+      collection.setTotalCount(docList.getNumFound());
+      return convertObjToString(collection);
+    } catch (IOException | SolrServerException | SolrException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public VGroupList getComponentList(SearchCriteria searchCriteria) {
+    SolrQuery query = new SolrQuery();
+    query.setParam("event", "/audit/getLiveLogsCount");
+    queryGenerator.setMainQuery(query, null);
+
+    queryGenerator.setGroupField(query, LogSearchConstants.SOLR_COMPONENT,
+      searchCriteria.getMaxRows());
+
+    searchCriteria.setSortBy(LogSearchConstants.SOLR_COMPONENT);
+    queryGenerator.setSortOrderDefaultServiceLog(query, searchCriteria);
+    try {
+      return this.getSolrGroupList(query);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + query, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getComponents(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetField(solrQuery,
+      LogSearchConstants.SOLR_COMPONENT);
+    queryGenerator.setFacetSort(solrQuery, LogSearchConstants.FACET_INDEX);
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      FacetField hostFacetField = response
+        .getFacetField(LogSearchConstants.SOLR_COMPONENT);
+      if (hostFacetField == null)
+        return convertObjToString(new SolrDocumentList());
+      List<Count> componenttList = hostFacetField.getValues();
+      if (componenttList == null)
+        return convertObjToString(new SolrDocumentList());
+      SolrDocumentList docList = response.getResults();
+      String hostName = "";
+      for (Count component : componenttList) {
+        SolrDocument solrDoc = new SolrDocument();
+        hostName = component.getName();
+        solrDoc.put(LogSearchConstants.SOLR_COMPONENT, hostName);
+        docList.add(solrDoc);
+      }
+
+      VGroupList collection = new VGroupList(docList);
+      collection.setStartIndex((int) docList.getStart());
+      collection.setTotalCount(docList.getNumFound());
+      return convertObjToString(collection);
+    } catch (IOException | SolrServerException | SolrException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getAggregatedInfo(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    String hierarchy = "host,type,level";
+    try {
+      queryGenerator.setMainQuery(solrQuery, null);
+      queryGenerator.setFacetPivot(solrQuery, 1, hierarchy);
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+
+      List<List<PivotField>> hirarchicalPivotField = new ArrayList<List<PivotField>>();
+      List<VGraphData> dataList = new ArrayList<VGraphData>();
+      NamedList<List<PivotField>> namedList = response.getFacetPivot();
+      if (namedList != null) {
+        hirarchicalPivotField = namedList.getAll(hierarchy);
+      }
+      if (!hirarchicalPivotField.isEmpty())
+        dataList = buidGraphData(hirarchicalPivotField.get(0));
+      VGraphInfo graphInfo = new VGraphInfo();
+      graphInfo.setGraphData(dataList);
+      return convertObjToString(graphInfo);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public List<VGraphData> buidGraphData(List<PivotField> pivotFields) {
+    List<VGraphData> logList = new ArrayList<VGraphData>();
+    if (pivotFields != null) {
+      for (PivotField pivotField : pivotFields) {
+        VGraphData logLevel = new VGraphData();
+        logLevel.setName("" + pivotField.getValue());
+        logLevel.setCount(Long.valueOf(pivotField.getCount()));
+        if (pivotField.getPivot() != null)
+          logLevel.setDataList(buidGraphData(pivotField.getPivot()));
+        logList.add(logLevel);
+      }
+    }
+    return logList;
+  }
+
+  public VCountList getLogLevelCount(SearchCriteria searchCriteria) {
+    VCountList collection = new VCountList();
+    List<VCount> vCounts = new ArrayList<VCount>();
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetField(solrQuery, LogSearchConstants.SOLR_LEVEL);
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      FacetField hostFacetField = response
+        .getFacetField(LogSearchConstants.SOLR_LEVEL);
+      if (hostFacetField == null)
+        return collection;
+      List<Count> levelList = hostFacetField.getValues();
+
+      for (Count level : levelList) {
+        VCount vCount = new VCount();
+        vCount.setName(level.getName());
+        vCount.setCount(level.getCount());
+        vCounts.add(vCount);
+      }
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+    collection.setCounts(vCounts);
+    return collection;
+  }
+
+  public VCountList getComponenetsCount(SearchCriteria searchCriteria) {
+    VCountList collection = new VCountList();
+    List<VCount> vCounts = new ArrayList<VCount>();
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetField(solrQuery,
+      LogSearchConstants.SOLR_COMPONENT);
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      FacetField hostFacetField = response
+        .getFacetField(LogSearchConstants.SOLR_COMPONENT);
+      if (hostFacetField == null)
+        return collection;
+      List<Count> componentList = hostFacetField.getValues();
+
+      for (Count component : componentList) {
+        VCount vCount = new VCount();
+        vCount.setName(component.getName());
+        vCount.setCount(component.getCount());
+        vCounts.add(vCount);
+      }
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+    collection.setCounts(vCounts);
+    return collection;
+  }
+
+  public VCountList getHostsCount(SearchCriteria searchCriteria) {
+    VCountList collection = new VCountList();
+    List<VCount> vCounts = new ArrayList<VCount>();
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.setFacetField(solrQuery, LogSearchConstants.SOLR_HOST);
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      FacetField hostFacetField = response
+        .getFacetField(LogSearchConstants.SOLR_HOST);
+      if (hostFacetField == null)
+        return collection;
+      List<Count> hostList = hostFacetField.getValues();
+
+      for (Count host : hostList) {
+        VCount vCount = new VCount();
+        vCount.setName(host.getName());
+        vCount.setCount(host.getCount());
+        vCounts.add(vCount);
+      }
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+    collection.setCounts(vCounts);
+    return collection;
+  }
+
+  public List<VNode> buidTreeData(List<PivotField> pivotFields,
+                                  List<PivotField> pivotFieldHost, SolrQuery query,
+                                  String firstPriority, String secondPriority) {
+    List<VNode> extensionTree = new ArrayList<VNode>();
+    String hostQuery = null;
+    if (pivotFields != null) {
+      // For Host
+      for (PivotField pivotHost : pivotFields) {
+        VNode hostNode = new VNode();
+        hostNode.setName("" + pivotHost.getValue());
+        hostNode.setValue("" + pivotHost.getCount());
+        hostNode.setType(firstPriority);
+        hostNode.setParent(true);
+        hostNode.setRoot(true);
+        PivotField hostPivot = null;
+        for (PivotField searchHost : pivotFieldHost) {
+          if (hostNode.getName().equals(searchHost.getValue())) {
+            hostPivot = searchHost;
+            break;
+          }
+        }
+        List<PivotField> pivotLevelHost = hostPivot.getPivot();
+        if (pivotLevelHost != null) {
+          Collection<VNameValue> logLevelCount = new ArrayList<VNameValue>();
+          for (PivotField pivotLevel : pivotLevelHost) {
+            VNameValue vnameValue = new VNameValue();
+            vnameValue.setName(((String) pivotLevel.getValue())
+              .toUpperCase());
+
+            vnameValue.setValue("" + pivotLevel.getCount());
+            logLevelCount.add(vnameValue);
+
+          }
+          hostNode.setLogLevelCount(logLevelCount);
+        }
+
+        query.addFilterQuery(hostQuery);
+        List<PivotField> pivotComponents = pivotHost.getPivot();
+        // For Components
+        if (pivotComponents != null) {
+          Collection<VNode> componentNodes = new ArrayList<VNode>();
+          for (PivotField pivotComp : pivotComponents) {
+            VNode compNode = new VNode();
+            compNode.setName("" + pivotComp.getValue());
+            compNode.setType(secondPriority);
+            compNode.setValue("" + pivotComp.getCount());
+            compNode.setParent(false);
+            compNode.setRoot(false);
+            List<PivotField> pivotLevels = pivotComp.getPivot();
+            if (pivotLevels != null) {
+              Collection<VNameValue> logLevelCount = new ArrayList<VNameValue>();
+              for (PivotField pivotLevel : pivotLevels) {
+                VNameValue vnameValue = new VNameValue();
+                vnameValue.setName(((String) pivotLevel
+                  .getValue()).toUpperCase());
+
+                vnameValue.setValue("" + pivotLevel.getCount());
+                logLevelCount.add(vnameValue);
+
+              }
+              compNode.setLogLevelCount(logLevelCount);
+            }
+            componentNodes.add(compNode);
+          }
+          hostNode.setChilds(componentNodes);
+        }
+        extensionTree.add(hostNode);
+      }
+    }
+
+    return extensionTree;
+  }
+
+  public VNodeList getTreeExtension(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    solrQuery.setParam("event", "/getTreeExtension");
+
+    if (searchCriteria.getSortBy() == null) {
+      searchCriteria.setSortBy(LogSearchConstants.SOLR_HOST);
+      searchCriteria.setSortType(SolrQuery.ORDER.asc.toString());
+    }
+    queryGenerator.setFilterFacetSort(solrQuery, searchCriteria);
+    String hostName = ""
+      + ((searchCriteria.getParamValue("hostName") == null) ? ""
+      : searchCriteria.getParamValue("hostName"));
+    if (!"".equals(hostName))
+      solrQuery.addFilterQuery(LogSearchConstants.SOLR_HOST + ":*"
+        + hostName + "*");
+    String firstHirarchy = "host,type,level";
+    String secondHirarchy = "host,level";
+    VNodeList list = new VNodeList();
+    try {
+
+      queryGenerator.setFacetPivot(solrQuery, 1, firstHirarchy,
+        secondHirarchy);
+
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      List<List<PivotField>> listFirstHirarchicalPivotFields = new ArrayList<List<PivotField>>();
+      NamedList<List<PivotField>> firstNamedList = response
+        .getFacetPivot();
+      if (firstNamedList != null) {
+        listFirstHirarchicalPivotFields = firstNamedList
+          .getAll(firstHirarchy);
+      }
+      List<List<PivotField>> listSecondHirarchicalPivotFields = new ArrayList<List<PivotField>>();
+      NamedList<List<PivotField>> secondNamedList = response
+        .getFacetPivot();
+      if (secondNamedList != null) {
+        listSecondHirarchicalPivotFields = secondNamedList
+          .getAll(secondHirarchy);
+      }
+      List<PivotField> firstHirarchicalPivotFields = new ArrayList<PivotField>();
+      List<PivotField> secondHirarchicalPivotFields = new ArrayList<PivotField>();
+      if (!listFirstHirarchicalPivotFields.isEmpty()) {
+        firstHirarchicalPivotFields = listFirstHirarchicalPivotFields
+          .get(0);
+      }
+      if (!listSecondHirarchicalPivotFields.isEmpty()) {
+        secondHirarchicalPivotFields = listSecondHirarchicalPivotFields
+          .get(0);
+      }
+      List<VNode> dataList = buidTreeData(firstHirarchicalPivotFields,
+        secondHirarchicalPivotFields, solrQuery,
+        LogSearchConstants.HOST, LogSearchConstants.COMPONENT);
+
+      list.setvNodeList(dataList);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+    }
+
+    return list;
+  }
+
+  public String getHostListByComponent(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    solrQuery.setParam("event", "/getHostListByComponent");
+
+    if (searchCriteria.getSortBy() == null) {
+      searchCriteria.setSortBy(LogSearchConstants.SOLR_HOST);
+      searchCriteria.setSortType(SolrQuery.ORDER.asc.toString());
+    }
+    queryGenerator.setFilterFacetSort(solrQuery, searchCriteria);
+    String componentName = ""
+      + ((searchCriteria.getParamValue("componentName") == null) ? ""
+      : searchCriteria.getParamValue("componentName"));
+    if (!"".equals(componentName))
+      solrQuery.addFilterQuery(LogSearchConstants.SOLR_COMPONENT + ":"
+        + componentName);
+    else
+      try {
+        return convertObjToString(new VNodeList());
+      } catch (IOException e1) {
+        logger.error(e1);
+      }
+    String firstHirarchy = "type,host,level";
+    String secondHirarchy = "type,level";
+    VNodeList list = new VNodeList();
+    try {
+      queryGenerator.setFacetPivot(solrQuery, 1, firstHirarchy,
+        secondHirarchy);
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      List<List<PivotField>> firstHirarchicalPivotFields = null;
+      List<List<PivotField>> secondHirarchicalPivotFields = null;
+      NamedList<List<PivotField>> firstNamedList = response
+        .getFacetPivot();
+      if (firstNamedList != null) {
+        firstHirarchicalPivotFields = firstNamedList
+          .getAll(firstHirarchy);
+        secondHirarchicalPivotFields = firstNamedList
+          .getAll(secondHirarchy);
+      }
+
+      if (firstHirarchicalPivotFields == null
+        || secondHirarchicalPivotFields == null) {
+        return convertObjToString(new ArrayList<VNode>());
+      }
+
+      List<VNode> dataList = buidTreeData(
+        firstHirarchicalPivotFields.get(0),
+        secondHirarchicalPivotFields.get(0), solrQuery,
+        LogSearchConstants.COMPONENT, LogSearchConstants.HOST);
+
+      list.setvNodeList(dataList);
+      return convertObjToString(list);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public VNameValueList getLogsLevelCount(SearchCriteria sc) {
+    VNameValueList nameValueList = new VNameValueList();
+    SolrQuery query = queryGenerator.commonFilterQuery(sc);
+    query.setParam("event", "/getLogLevelCounts");
+    List<VNameValue> logsCounts = getLogLevelFacets(query);
+    nameValueList.setVNameValues(logsCounts);
+
+    return nameValueList;
+  }
+
+  public List<VNameValue> getLogLevelFacets(SolrQuery query) {
+    HashMap<String, String> map = new HashMap<String, String>();
+    List<VNameValue> logsCounts = new ArrayList<VNameValue>();
+    try {
+
+      queryGenerator.setFacetField(query, LogSearchConstants.SOLR_LEVEL);
+
+      List<Count> logLevelCounts = getFacetCounts(query,
+        LogSearchConstants.SOLR_LEVEL);
+      for (Count count : logLevelCounts) {
+        map.put(count.getName().toUpperCase(), "" + count.getCount());
+      }
+      String level = LogSearchConstants.FATAL;
+      VNameValue nameValue = null;
+
+      String value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+      level = LogSearchConstants.ERROR;
+
+      value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+      level = LogSearchConstants.WARN;
+
+      value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+      level = LogSearchConstants.INFO;
+
+      value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+      level = LogSearchConstants.DEBUG;
+
+      value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+      level = LogSearchConstants.TRACE;
+
+      value = map.get(level);
+      if (value == null || value.equals(""))
+        value = "0";
+      nameValue = new VNameValue();
+      nameValue.setName(level);
+      nameValue.setValue(value);
+      logsCounts.add(nameValue);
+
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + query, e);
+    }
+    return logsCounts;
+  }
+
+  // Get Facet Count According to FacetFeild
+  public List<Count> getFacetCounts(SolrQuery solrQuery, String facetField)
+    throws SolrServerException, IOException, SolrException {
+
+    QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+
+    FacetField field = response.getFacetField(facetField);
+    if (field == null) {
+      return new ArrayList<FacetField.Count>();
+    }
+    return field.getValues();
+  }
+
+  public String getPageByKeyword(SearchCriteria searchCriteria)
+    throws SolrServerException {
+
+    String keyword = solrUtil.makeSolrSearchString((String) searchCriteria
+      .getParamValue("keyword"));
+
+    String keyType = (String) searchCriteria.getParamValue("keywordType");
+
+    if (!(boolean) "0".equals(keyType)) {
+      try {
+        int currentPageNumber = searchCriteria.getPage();
+        int maxRows = searchCriteria.getMaxRows();
+        String nextPageLogID = "";
+
+        int lastLogIndexNumber = ((currentPageNumber + 1)
+          * maxRows);
+        String nextPageLogTime = "";
+
+
+        // Next Page Start Time Calculation
+        SolrQuery nextPageLogTimeQuery = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        nextPageLogTimeQuery.remove("start");
+        nextPageLogTimeQuery.remove("rows");
+        nextPageLogTimeQuery.setStart(lastLogIndexNumber);
+        nextPageLogTimeQuery.setRows(1);
+
+        SolrDocumentList docList = serviceLogsSolrDao.process(
+          nextPageLogTimeQuery).getResults();
+        SolrDocument solrDoc = docList.get(0);
+
+        Date logDate = (Date) solrDoc.get(LogSearchConstants.LOGTIME);
+        nextPageLogTime = dateUtil
+          .convertDateWithMillisecondsToSolrDate(logDate);
+        nextPageLogID = ""
+          + solrDoc.get(LogSearchConstants.ID);
+
+        if (stringUtil.isEmpty(nextPageLogID))
+          nextPageLogID = "0";
+
+        String filterQueryListIds = "";
+        // Remove the same Time Ids
+        SolrQuery listRemoveIds = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        listRemoveIds.remove("start");
+        listRemoveIds.remove("rows");
+        queryGenerator.setSingleIncludeFilter(listRemoveIds,
+          LogSearchConstants.LOGTIME, "\"" + nextPageLogTime + "\"");
+        queryGenerator.setSingleExcludeFilter(listRemoveIds,
+          LogSearchConstants.ID, nextPageLogID);
+        listRemoveIds.set("fl", LogSearchConstants.ID);
+        SolrDocumentList docListIds = serviceLogsSolrDao.process(
+          listRemoveIds).getResults();
+        boolean isFirst = true;
+        for (SolrDocument solrDocId : docListIds) {
+          String id = "" + solrDocId.get(LogSearchConstants.ID);
+          if (isFirst) {
+            filterQueryListIds += "-" + LogSearchConstants.ID + ":" + id;
+            isFirst = false;
+          } else {
+            filterQueryListIds += " AND " + "-" + LogSearchConstants.ID + ":" + id;
+          }
+        }
+
+        // Keyword Sequence Number Calculation
+        String endTime = (String) searchCriteria.getParamValue("to");
+        String startTime = (String) searchCriteria
+          .getParamValue("from");
+        SolrQuery logTimeThroughRangeQuery = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        logTimeThroughRangeQuery.remove("start");
+        logTimeThroughRangeQuery.remove("rows");
+        logTimeThroughRangeQuery.setRows(1);
+        if (!stringUtil.isEmpty(filterQueryListIds))
+          logTimeThroughRangeQuery.setFilterQueries(filterQueryListIds);
+
+
+        String sortByType = searchCriteria.getSortType();
+
+        if (!stringUtil.isEmpty(sortByType) && sortByType
+          .equalsIgnoreCase(LogSearchConstants.ASCENDING_ORDER)) {
+          
+          /*sequenceNumber =""+( Integer.parseInt(sequenceNumber) - 1);*/
+          /*queryGenerator.setSingleRangeFilter(
+              logTimeThroughRangeQuery,
+              LogSearchConstants.SEQUNCE_ID, "*",sequenceNumber);*/
+          queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
+            LogSearchConstants.LOGTIME, nextPageLogTime,
+            endTime);
+          logTimeThroughRangeQuery.set("sort",
+            LogSearchConstants.LOGTIME + " "
+              + LogSearchConstants.ASCENDING_ORDER);
+
+        } else {
+          /*sequenceNumber =""+( Integer.parseInt(sequenceNumber) + 1);*/
+          /*queryGenerator.setSingleRangeFilter(
+              logTimeThroughRangeQuery,
+              LogSearchConstants.SEQUNCE_ID, sequenceNumber, "*");*/
+          queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
+            LogSearchConstants.LOGTIME, startTime,
+            nextPageLogTime);
+          logTimeThroughRangeQuery.set("sort",
+            LogSearchConstants.LOGTIME + " "
+              + LogSearchConstants.DESCENDING_ORDER);
+        }
+        queryGenerator.setSingleIncludeFilter(logTimeThroughRangeQuery,
+          LogSearchConstants.SOLR_LOG_MESSAGE, keyword);
+
+
+        SolrDocumentList documentList = serviceLogsSolrDao.process(
+          logTimeThroughRangeQuery).getResults();
+
+        SolrDocument solrDocument = new SolrDocument();
+        if (!documentList.isEmpty())
+          solrDocument = documentList.get(0);
+        /*String keywordLogSequenceNumber = ""+ solrDocument.get(LogSearchConstants.SEQUNCE_ID);*/
+        Date keywordLogDate = (Date) solrDocument.get(LogSearchConstants.LOGTIME);
+        String originalKeywordDate = dateUtil
+          .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+        String keywordId = "" + solrDocument.get(LogSearchConstants.ID);
+
+        // Getting Range Count from StartTime To Keyword Log Time
+        SolrQuery rangeLogQuery = nextPageLogTimeQuery.getCopy();
+        rangeLogQuery.remove("start");
+        rangeLogQuery.remove("rows");
+
+        if (!stringUtil.isEmpty(sortByType) && sortByType
+          .equalsIgnoreCase(LogSearchConstants.ASCENDING_ORDER)) {
+          keywordLogDate = dateUtil.addMilliSecondsToDate(keywordLogDate, 1);
+          String keywordDateTime = dateUtil
+            .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+          queryGenerator.setSingleRangeFilter(rangeLogQuery,
+            LogSearchConstants.LOGTIME, startTime,
+            keywordDateTime);
+          /*queryGenerator
+          .setSingleRangeFilter(rangeLogQuery,
+              LogSearchConstants.SEQUNCE_ID,"*", keywordLogSequenceNumber);*/
+
+
+        } else {
+          /*queryGenerator
+          .setSingleRangeFilter(rangeLogQuery,
+              LogSearchConstants.SEQUNCE_ID, keywordLogSequenceNumber,
+              "*"); */
+          keywordLogDate = dateUtil.addMilliSecondsToDate(keywordLogDate, -1);
+          String keywordDateTime = dateUtil
+            .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+          queryGenerator.setSingleRangeFilter(rangeLogQuery,
+            LogSearchConstants.LOGTIME, keywordDateTime,
+            endTime);
+        }
+
+
+        long countNumberLogs = countQuery(rangeLogQuery) - 1;
+        
+        /*// Delete Duplicate entries
+        SolrQuery duplicatesLogQuery = nextPageLogTimeQuery.getCopy();
+        duplicatesLogQuery.remove("start");
+        duplicatesLogQuery.remove("rows");
+        queryGenerator.setSingleIncludeFilter(duplicatesLogQuery,
+            LogSearchConstants.LOGTIME, "\"" + keywordLogTime
+                + "\"");
+
+        countNumberLogs = countNumberLogs
+            - countQuery(duplicatesLogQuery);*/
+
+        //Adding numbers on 
+
+
+        try {
+          SolrQuery sameIdQuery = queryGenerator
+            .commonFilterQuery(searchCriteria);
+          queryGenerator.setSingleIncludeFilter(sameIdQuery,
+            LogSearchConstants.LOGTIME, "\"" + originalKeywordDate + "\"");
+          sameIdQuery.set("fl", LogSearchConstants.ID);
+          SolrDocumentList sameQueryDocList = serviceLogsSolrDao.process(sameIdQuery)
+            .getResults();
+          for (SolrDocument solrDocumenent : sameQueryDocList) {
+            String id = (String) solrDocumenent
+              .getFieldValue(LogSearchConstants.ID);
+            countNumberLogs++;
+            if (id.equals(keywordId))
+              break;
+          }
+        } catch (SolrException | SolrServerException | IOException e) {
+          logger.error(e);
+        }
+
+        int start = (int) ((countNumberLogs / maxRows) * maxRows);
+        SolrQuery logIdQuery = nextPageLogTimeQuery.getCopy();
+        rangeLogQuery.remove("start");
+        rangeLogQuery.remove("rows");
+        logIdQuery.setStart(start);
+        logIdQuery.setRows(searchCriteria.getMaxRows());
+        VSolrLogList vSolrLogList = getLogAsPaginationProvided(logIdQuery, serviceLogsSolrDao);
+        return convertObjToString(vSolrLogList);
+
+      } catch (Exception e) {
+        //do nothing
+      }
+
+    } else {
+      try {
+        int currentPageNumber = searchCriteria.getPage();
+        int maxRows = searchCriteria.getMaxRows();
+        String sequenceNumber = "";
+
+        if (currentPageNumber == 0) {
+          throw restErrorUtil.createRESTException("This is first Page Not",
+            MessageEnums.ERROR_SYSTEM);
+        }
+
+        int firstLogCurrentPage = (currentPageNumber * maxRows);
+        String lastLogsLogTime = "";
+
+        // Next Page Start Time Calculation
+        SolrQuery lastLogTime = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        lastLogTime.remove("start");
+        lastLogTime.remove("rows");
+
+        lastLogTime.setStart(firstLogCurrentPage);
+        lastLogTime.setRows(1);
+
+        SolrDocumentList docList = serviceLogsSolrDao.process(
+          lastLogTime).getResults();
+        SolrDocument solrDoc = docList.get(0);
+
+        Date logDate = (Date) solrDoc.get(LogSearchConstants.LOGTIME);
+        String sortByType = searchCriteria.getSortType();
+        lastLogsLogTime = dateUtil
+          .convertDateWithMillisecondsToSolrDate(logDate);
+        String lastLogsLogId = ""
+          + solrDoc.get(LogSearchConstants.SEQUNCE_ID);
+        if (stringUtil.isEmpty(sequenceNumber))
+          sequenceNumber = "0";
+
+
+        String filterQueryListIds = "";
+        // Remove the same Time Ids
+        SolrQuery listRemoveIds = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        listRemoveIds.remove("start");
+        listRemoveIds.remove("rows");
+        queryGenerator.setSingleIncludeFilter(listRemoveIds,
+          LogSearchConstants.LOGTIME, "\"" + lastLogsLogTime + "\"");
+        queryGenerator.setSingleExcludeFilter(listRemoveIds,
+          LogSearchConstants.ID, lastLogsLogId);
+        listRemoveIds.set("fl", LogSearchConstants.ID);
+        SolrDocumentList docListIds = serviceLogsSolrDao.process(
+          listRemoveIds).getResults();
+        boolean isFirst = true;
+        for (SolrDocument solrDocId : docListIds) {
+          String id = "" + solrDocId.get(LogSearchConstants.ID);
+          if (isFirst) {
+            filterQueryListIds += "-" + LogSearchConstants.ID + ":" + id;
+            isFirst = false;
+          } else {
+            filterQueryListIds += " AND " + "-" + LogSearchConstants.ID + ":" + id;
+          }
+        }
+
+
+        // Keyword LogTime Calculation
+        String endTime = (String) searchCriteria.getParamValue("to");
+        String startTime = (String) searchCriteria
+          .getParamValue("from");
+        SolrQuery logTimeThroughRangeQuery = queryGenerator
+          .commonFilterQuery(searchCriteria);
+        logTimeThroughRangeQuery.remove("start");
+        logTimeThroughRangeQuery.remove("rows");
+        logTimeThroughRangeQuery.setRows(1);
+        queryGenerator.setSingleExcludeFilter(logTimeThroughRangeQuery,
+          LogSearchConstants.ID, lastLogsLogId);
+        if (!stringUtil.isEmpty(filterQueryListIds))
+          logTimeThroughRangeQuery.setFilterQueries(filterQueryListIds);
+
+        if (!stringUtil.isEmpty(sortByType) && sortByType
+          .equalsIgnoreCase(LogSearchConstants.ASCENDING_ORDER)) {
+
+          sequenceNumber = ""
+            + (Integer.parseInt(sequenceNumber) - 1);
+          logTimeThroughRangeQuery.remove("sort");
+          logTimeThroughRangeQuery.set("sort",
+            LogSearchConstants.LOGTIME + " "
+              + LogSearchConstants.DESCENDING_ORDER);
+          
+          /*queryGenerator.setSingleRangeFilter(
+              logTimeThroughRangeQuery,
+              LogSearchConstants.SEQUNCE_ID,"*", sequenceNumber);*/
+          queryGenerator.setSingleRangeFilter(
+            logTimeThroughRangeQuery,
+            LogSearchConstants.LOGTIME, startTime,
+            lastLogsLogTime);
+
+        } else {
+          sequenceNumber = "" + (Integer.parseInt(sequenceNumber) + 1);
+
+          logTimeThroughRangeQuery.remove("sort");
+          logTimeThroughRangeQuery.set("sort",
+            LogSearchConstants.LOGTIME + " "
+              + LogSearchConstants.ASCENDING_ORDER);
+          
+          /*queryGenerator.setSingleRangeFilter(
+              logTimeThroughRangeQuery,
+              LogSearchConstants.SEQUNCE_ID, sequenceNumber,"*");*/
+          queryGenerator.setSingleRangeFilter(logTimeThroughRangeQuery,
+            LogSearchConstants.LOGTIME, lastLogsLogTime, endTime);
+        }
+        queryGenerator.setSingleIncludeFilter(logTimeThroughRangeQuery,
+          LogSearchConstants.SOLR_LOG_MESSAGE, keyword);
+
+
+        SolrDocumentList documentList = serviceLogsSolrDao.process(
+          logTimeThroughRangeQuery).getResults();
+        SolrDocument solrDocument = new SolrDocument();
+        if (!documentList.isEmpty())
+          solrDocument = documentList.get(0);
+
+        
+        /*String keywordLogSequenceNumber = ""+ solrDocument.get(LogSearchConstants.SEQUNCE_ID);*/
+        Date keywordLogDate = (Date) solrDocument.get(LogSearchConstants.LOGTIME);
+        String originalKeywordDate = dateUtil
+          .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+        String keywordId = "" + solrDocument.get(LogSearchConstants.ID);
+
+        // Getting Range Count from StartTime To Keyword Log Time
+        SolrQuery rangeLogQuery = lastLogTime.getCopy();
+        rangeLogQuery.remove("start");
+        rangeLogQuery.remove("rows");
+
+        if (!stringUtil.isEmpty(sortByType) && sortByType
+          .equalsIgnoreCase(LogSearchConstants.ASCENDING_ORDER)) {
+          keywordLogDate = dateUtil.addMilliSecondsToDate(keywordLogDate, 1);
+          String keywordDateTime = dateUtil
+            .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+          queryGenerator.setSingleRangeFilter(rangeLogQuery,
+            LogSearchConstants.LOGTIME, startTime,
+            keywordDateTime);
+          /*queryGenerator
+          .setSingleRangeFilter(rangeLogQuery,
+              LogSearchConstants.SEQUNCE_ID,"*", keywordLogSequenceNumber);*/
+
+
+        } else {
+          /*queryGenerator
+          .setSingleRangeFilter(rangeLogQuery,
+              LogSearchConstants.SEQUNCE_ID, keywordLogSequenceNumber,
+              "*"); */
+          keywordLogDate = dateUtil.addMilliSecondsToDate(keywordLogDate, -1);
+          String keywordDateTime = dateUtil
+            .convertDateWithMillisecondsToSolrDate(keywordLogDate);
+          queryGenerator.setSingleRangeFilter(rangeLogQuery,
+            LogSearchConstants.LOGTIME, keywordDateTime,
+            endTime);
+        }
+
+
+        long countNumberLogs = countQuery(rangeLogQuery) - 1;
+        
+        /*// Delete Duplicate entries
+        SolrQuery duplicatesLogQuery = nextPageLogTimeQuery.getCopy();
+        duplicatesLogQuery.remove("start");
+        duplicatesLogQuery.remove("rows");
+        queryGenerator.setSingleIncludeFilter(duplicatesLogQuery,
+            LogSearchConstants.LOGTIME, "\"" + keywordLogTime
+                + "\"");
+
+        countNumberLogs = countNumberLogs
+            - countQuery(duplicatesLogQuery);*/
+
+        //Adding numbers on 
+
+
+        try {
+          SolrQuery sameIdQuery = queryGenerator
+            .commonFilterQuery(searchCriteria);
+          queryGenerator.setSingleIncludeFilter(sameIdQuery,
+            LogSearchConstants.LOGTIME, "\"" + originalKeywordDate + "\"");
+          sameIdQuery.set("fl", LogSearchConstants.ID);
+          SolrDocumentList sameQueryDocList = serviceLogsSolrDao.process(sameIdQuery)
+            .getResults();
+          for (SolrDocument solrDocumenent : sameQueryDocList) {
+            String id = (String) solrDocumenent
+              .getFieldValue(LogSearchConstants.ID);
+            countNumberLogs++;
+            if (id.equals(keywordId))
+              break;
+          }
+        } catch (SolrException | SolrServerException | IOException e) {
+          logger.error(e);
+        }
+        int start = (int) ((countNumberLogs / maxRows) * maxRows);
+
+        SolrQuery logIdQuery = lastLogTime.getCopy();
+        rangeLogQuery.remove("start");
+        rangeLogQuery.remove("rows");
+        logIdQuery.setStart(start);
+        logIdQuery.setRows(searchCriteria.getMaxRows());
+        VSolrLogList vSolrLogList = getLogAsPaginationProvided(logIdQuery, serviceLogsSolrDao);
+        return convertObjToString(vSolrLogList);
+      } catch (Exception e) {
+        //do nothing
+      }
+
+    }
+    throw restErrorUtil.createRESTException("keyword not found",
+      MessageEnums.ERROR_SYSTEM);
+  }
+
+  public String getPageByKeyword1(SearchCriteria searchCriteria)
+    throws SolrServerException {
+
+    SolrQuery query = queryGenerator.commonFilterQuery(searchCriteria);
+    String keyword = solrUtil.makeSearcableString((String) searchCriteria
+      .getParamValue("keyword"));
+    String uniqueId = (String) searchCriteria.getParamValue("token");
+    if (uniqueId != null && !uniqueId.equals(""))
+      cancelByDate.add(uniqueId);
+    Long numberPages = 0l;
+    int currentPageNumber = searchCriteria.getPage();
+    try {
+      numberPages = countQuery(query) / searchCriteria.getMaxRows();
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+    }
+    if ((boolean) searchCriteria.getParamValue("keywordType").equals("0")) {
+      for (int i = currentPageNumber - 1; i >= 0
+        && !cancelRequest(uniqueId); i--) {
+        mapUniqueId.put(uniqueId, "" + i);
+        query.remove("rows");
+        query.remove("start");
+        query.setStart(i * searchCriteria.getMaxRows());
+        query.setRows(searchCriteria.getMaxRows());
+        VSolrLogList vSolrLogList = getLogAsPaginationProvided(query, serviceLogsSolrDao);
+        SolrDocumentList documentList = vSolrLogList.getList();
+        for (SolrDocument solrDoc : documentList) {
+          String log_message = solrUtil
+            .makeSearcableString((String) solrDoc
+              .getFieldValue(LogSearchConstants.SOLR_LOG_MESSAGE));
+          if (log_message != null
+            && log_message
+            .toLowerCase(Locale.ENGLISH)
+            .contains(
+              keyword.toLowerCase(Locale.ENGLISH))) {
+            cancelByDate.remove(uniqueId);
+            try {
+              return convertObjToString(vSolrLogList);
+            } catch (IOException e) {
+              logger.error(e);
+            }
+          }
+        }
+      }
+
+    } else {
+      for (int i = currentPageNumber + 1; i <= numberPages
+        && !cancelRequest(uniqueId); i++) {
+        mapUniqueId.put(uniqueId, "" + i);
+        query.remove("rows");
+        query.remove("start");
+        query.setStart(i * searchCriteria.getMaxRows());
+        query.setRows(searchCriteria.getMaxRows());
+        VSolrLogList vSolrLogList = getLogAsPaginationProvided(query, serviceLogsSolrDao);
+        SolrDocumentList solrDocumentList = vSolrLogList.getList();
+        for (SolrDocument solrDocument : solrDocumentList) {
+          String logMessage = solrUtil
+            .makeSearcableString((String) solrDocument
+              .getFieldValue(LogSearchConstants.SOLR_LOG_MESSAGE));
+          if (logMessage != null
+            && logMessage.toLowerCase(Locale.ENGLISH).contains(
+            keyword.toLowerCase(Locale.ENGLISH))) {
+            cancelByDate.remove(uniqueId);
+            try {
+              return convertObjToString(vSolrLogList);
+            } catch (SolrException | IOException e) {
+              logger.error(e);
+            }
+          }
+        }
+      }
+    }
+    throw restErrorUtil.createRESTException("keyword not found",
+      MessageEnums.ERROR_SYSTEM);
+  }
+
+  private String getPageByLogId(SearchCriteria searchCriteria) {
+    String endLogTime = (String) searchCriteria.getParamValue("to");
+    long startIndex = 0l;
+
+    String logId = (String) searchCriteria.getParamValue("sourceLogId");
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+
+    String endTimeMinusOneMilli = "";
+    String logTime = "";
+    try {
+
+      SolrQuery logTimeByIdQuery = new SolrQuery();
+      queryGenerator.setMainQuery(logTimeByIdQuery, null);
+      queryGenerator.setSingleIncludeFilter(logTimeByIdQuery,
+        LogSearchConstants.ID, logId);
+      queryGenerator.setRowCount(solrQuery, 1);
+
+      SolrDocumentList docList = serviceLogsSolrDao.process(
+        logTimeByIdQuery).getResults();
+      Date dateOfLogId = (Date) docList.get(0).get(
+        LogSearchConstants.LOGTIME);
+
+      logTime = dateUtil
+        .convertDateWithMillisecondsToSolrDate(dateOfLogId);
+      Date endDate = dateUtil.addMilliSecondsToDate(dateOfLogId, 1);
+      endTimeMinusOneMilli = (String) dateUtil
+        .convertDateWithMillisecondsToSolrDate(endDate);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+    }
+
+    try {
+      solrQuery.remove(LogSearchConstants.ID);
+      solrQuery.remove(LogSearchConstants.LOGTIME);
+      queryGenerator.setSingleRangeFilter(solrQuery,
+        LogSearchConstants.LOGTIME, endTimeMinusOneMilli,
+        endLogTime);
+      queryGenerator.setRowCount(solrQuery, 0);
+      startIndex = countQuery(solrQuery);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+    }
+
+    try {
+      SolrQuery sameIdQuery = queryGenerator
+        .commonFilterQuery(searchCriteria);
+      queryGenerator.setSingleIncludeFilter(sameIdQuery,
+        LogSearchConstants.LOGTIME, "\"" + logTime + "\"");
+      sameIdQuery.set("fl", LogSearchConstants.ID);
+      SolrDocumentList docList = serviceLogsSolrDao.process(sameIdQuery)
+        .getResults();
+      for (SolrDocument solrDocumenent : docList) {
+        String id = (String) solrDocumenent
+          .getFieldValue(LogSearchConstants.ID);
+        startIndex++;
+        if (id.equals(logId))
+          break;
+      }
+
+      SolrQuery logIdQuery = queryGenerator
+        .commonFilterQuery(searchCriteria);
+      logIdQuery.remove("rows");
+      logIdQuery.remove("start");
+      int start = (int) ((startIndex / searchCriteria.getMaxRows()) * searchCriteria
+        .getMaxRows());
+      logIdQuery.setStart(start);
+      logIdQuery.setRows(searchCriteria.getMaxRows());
+      VSolrLogList vSolrLogList = getLogAsPaginationProvided(logIdQuery, serviceLogsSolrDao);
+      return convertObjToString(vSolrLogList);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+    }
+
+    throw restErrorUtil.createRESTException("LogId not Found",
+      MessageEnums.ERROR_SYSTEM);
+  }
+
+  @SuppressWarnings("unchecked")
+  public List<VNameValue> getHistogramCounts(SolrQuery solrQuery,
+                                             String from, String to, String unit) {
+    List<VNameValue> logsCounts = new ArrayList<VNameValue>();
+    try {
+
+      queryGenerator.setFacetRange(solrQuery, LogSearchConstants.LOGTIME,
+        from, to, unit);
+
+      List<RangeFacet.Count> logLevelCounts;
+
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      @SuppressWarnings("rawtypes")
+      List<RangeFacet> rangeFacet = response.getFacetRanges();
+
+      if (rangeFacet == null) {
+        return new ArrayList<VNameValue>();
+
+      }
+      logLevelCounts = rangeFacet.get(0).getCounts();
+      for (RangeFacet.Count logCount : logLevelCounts) {
+        VNameValue nameValue = new VNameValue();
+        nameValue.setName(logCount.getValue());
+        nameValue.setValue("" + logCount.getCount());
+        logsCounts.add(nameValue);
+      }
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+    }
+    return logsCounts;
+  }
+
+  public List<Count> getFacetCountsByDate(SolrQuery solrQuery,
+                                          String facetField) throws SolrServerException, IOException,
+    SolrException {
+
+    QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+
+    FacetField field = response.getFacetDate(facetField);
+    return field.getValues();
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getHistogramData(SearchCriteria searchCriteria) {
+    VBarDataList dataList = new VBarDataList();
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    solrQuery.set("event", "/getHistogramData");
+    String from = (String) searchCriteria.getParamValue("from");
+    String to = (String) searchCriteria.getParamValue("to");
+    String unit = (String) searchCriteria.getParamValue("unit");
+
+    List<VBarGraphData> histogramData = new ArrayList<VBarGraphData>();
+    List<String> logLevels = ConfigUtil.logLevels;
+
+    String jsonHistogramQuery = queryGenerator
+      .buildJSONFacetTermTimeRangeQuery(
+        LogSearchConstants.SOLR_LEVEL,
+        LogSearchConstants.LOGTIME, from, to, unit).replace(
+        "\\", "");
+
+    try {
+      queryGenerator.setJSONFacet(solrQuery, jsonHistogramQuery);
+      queryGenerator.setRowCount(solrQuery, 0);
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      if (response == null)
+        response = new QueryResponse();
+
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) response
+        .getResponse().get("facets");
+
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.toString().equals("{count=0}"))
+        return convertObjToString(dataList);
+
+      extractValuesFromBuckets(jsonFacetResponse, "x", "y", histogramData);
+
+      Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+      List<VBarGraphData> graphDatas = new ArrayList<VBarGraphData>();
+      for (String level : logLevels) {
+        boolean isLevelPresent = false;
+        VBarGraphData vData1 = null;
+        for (VBarGraphData vData2 : histogramData) {
+          String name = vData2.getName();
+          if (level.contains(name)) {
+            isLevelPresent = true;
+            vData1 = vData2;
+            break;
+          }
+          if (vNameValues.isEmpty()) {
+            Collection<VNameValue> vNameValues2 = vData2
+              .getDataCount();
+            for (VNameValue value : vNameValues2) {
+              VNameValue value2 = new VNameValue();
+              value2.setValue("0");
+              value2.setName(value.getName());
+              vNameValues.add(value2);
+            }
+          }
+        }
+        if (!isLevelPresent) {
+          VBarGraphData vBarGraphData = new VBarGraphData();
+          vBarGraphData.setName(level);
+          vBarGraphData.setDataCounts(vNameValues);
+          graphDatas.add(vBarGraphData);
+        } else {
+          graphDatas.add(vData1);
+        }
+      }
+
+      dataList.setGraphData(graphDatas);
+      return convertObjToString(dataList);
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+
+    }
+  }
+
+  public void arrangeLevel(String level,
+                           List<VBarGraphData> histogramDataLocal,
+                           List<VBarGraphData> histogramData) {
+    for (VBarGraphData histData : histogramData) {
+      if (histData != null && level.equals(histData.getName())) {
+        histogramDataLocal.add(histData);
+      }
+    }
+  }
+
+  public String cancelFindRequestByDate(HttpServletRequest request) {
+    String uniqueId = null;
+
+    uniqueId = (String) request.getParameter("token");
+    if (stringUtil.isEmpty(uniqueId)) {
+      logger.error("Unique id is Empty");
+      throw restErrorUtil.createRESTException("Unique id is Empty",
+        MessageEnums.DATA_NOT_FOUND);
+    }
+
+    if (cancelByDate.remove(uniqueId)) {
+      mapUniqueId.remove(uniqueId);
+      return "Cancel Request Successfully Procssed ";
+    }
+    return "Cancel Request Unable to Process";
+  }
+
+  public boolean cancelRequest(String uniqueId) {
+    for (String date : cancelByDate) {
+      if (uniqueId.equalsIgnoreCase(date))
+        return false;
+    }
+    return true;
+  }
+
+  public Response exportToTextFile(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    String from = (String) searchCriteria.getParamValue("from");
+    from = from.replace("T", " ");
+    from = from.replace(".", ",");
+    String to = (String) searchCriteria.getParamValue("to");
+    to = to.replace("T", " ");
+    to = to.replace(".", ",");
+
+    String utcOffset = (String) searchCriteria.getParamValue("utcOffset");
+    to = dateUtil.addOffsetToDate(to, Long.parseLong(utcOffset),
+      "yyyy-MM-dd HH:mm:ss,SSS");
+    from = dateUtil.addOffsetToDate(from, Long.parseLong(utcOffset),
+      "yyyy-MM-dd HH:mm:ss,SSS");
+
+    String fileName = dateUtil.getCurrentDateInString();
+    if (searchCriteria.getParamValue("hostLogFile") != null
+      && searchCriteria.getParamValue("compLogFile") != null) {
+      fileName = searchCriteria.getParamValue("hostLogFile") + "_"
+        + searchCriteria.getParamValue("compLogFile");
+    }
+    String format = (String) searchCriteria.getParamValue("format");
+    format = "text".equalsIgnoreCase(format) && format != null ? ".txt"
+      : ".json";
+    String textToSave = "";
+    try {
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      SolrDocumentList docList = response.getResults();
+      VSummary vsummary = bizUtil.buildSummaryForLogFile(docList);
+      vsummary.setFormat(format);
+      vsummary.setFrom(from);
+      vsummary.setTo(to);
+
+      try {
+        String include[] = ((String) searchCriteria
+          .getParamValue("iMessage"))
+          .split(LogSearchConstants.I_E_SEPRATOR);
+        String includeString = "";
+        for (String inc : include) {
+          includeString = includeString + ",\"" + inc + "\"";
+        }
+        includeString = includeString.replaceFirst(",", "");
+        if (!stringUtil.isEmpty(includeString)) {
+          vsummary.setIncludeString(includeString);
+        }
+      } catch (Exception e) {
+        // do nothing
+      }
+
+      String excludeString = "";
+      boolean isNormalExcluded = false;
+      try {
+        String exclude[] = ((String) searchCriteria
+          .getParamValue("eMessage"))
+          .split(LogSearchConstants.I_E_SEPRATOR);
+        for (String exc : exclude) {
+          excludeString = excludeString + ",\"" + exc + "\"";
+        }
+        excludeString = excludeString.replaceFirst(",", "");
+        if (!stringUtil.isEmpty(excludeString)) {
+          vsummary.setExcludeString(excludeString);
+          isNormalExcluded = true;
+        }
+      } catch (Exception ne) {
+        // do nothing
+      }
+      try {
+
+        String globalExclude[] = ((String) searchCriteria
+          .getParamValue("gEMessage"))
+          .split(LogSearchConstants.I_E_SEPRATOR);
+
+        for (String exc : globalExclude) {
+          excludeString = excludeString + ",\"" + exc + "\"";
+        }
+
+        if (!stringUtil.isEmpty(excludeString)) {
+          if (!isNormalExcluded)
+            excludeString = excludeString.replaceFirst(",", "");
+          vsummary.setExcludeString(excludeString);
+        }
+      } catch (Exception ne) {
+        // do nothing
+      }
+
+      for (SolrDocument solrDoc : docList) {
+
+        Date logTimeDateObj = (Date) solrDoc
+          .get(LogSearchConstants.LOGTIME);
+
+        String logTime = dateUtil.convertSolrDateToNormalDateFormat(
+          logTimeDateObj.getTime(), Long.parseLong(utcOffset));
+        solrDoc.remove(LogSearchConstants.LOGTIME);
+        solrDoc.addField(LogSearchConstants.LOGTIME, logTime);
+      }
+
+      if (format.toLowerCase(Locale.ENGLISH).equals(".txt")) {
+        textToSave = bizUtil.convertObjectToNormalText(docList);
+      } else if (format.toLowerCase(Locale.ENGLISH).equals(".json")) {
+        textToSave = convertObjToString(docList);
+      } else {
+        throw restErrorUtil.createRESTException(
+          "unsoported format either should be json or text",
+          MessageEnums.ERROR_SYSTEM);
+      }
+      return fileUtil.saveToFile(textToSave, fileName, vsummary);
+
+    } catch (SolrException | SolrServerException | IOException
+      | ParseException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getComponentListWithLevelCounts(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    solrQuery.setParam("event", "/getComponentListWithLevelCounts");
+
+    if (searchCriteria.getSortBy() == null) {
+      searchCriteria.setSortBy(LogSearchConstants.SOLR_COMPONENT);
+      searchCriteria.setSortType(SolrQuery.ORDER.asc.toString());
+    }
+    queryGenerator.setFilterFacetSort(solrQuery, searchCriteria);
+    String componentLevelHirachy = "type,level";
+    VNodeList list = new VNodeList();
+    try {
+
+      queryGenerator.setFacetPivot(solrQuery, 1, componentLevelHirachy);
+
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+
+      List<List<PivotField>> listPivotField = new ArrayList<List<PivotField>>();
+      NamedList<List<PivotField>> namedList = response.getFacetPivot();
+      if (namedList != null) {
+        listPivotField = namedList.getAll(componentLevelHirachy);
+      }
+      List<PivotField> secondHirarchicalPivotFields = null;
+      if (listPivotField == null || listPivotField.isEmpty()) {
+        return convertObjToString(list);
+      } else {
+        secondHirarchicalPivotFields = listPivotField.get(0);
+      }
+      List<VNode> datatList = new ArrayList<VNode>();
+      for (PivotField singlePivotField : secondHirarchicalPivotFields) {
+        VNode comp = new VNode();
+        comp.setName("" + singlePivotField.getValue());
+        List<PivotField> levelList = singlePivotField.getPivot();
+        List<VNameValue> levelCountList = new ArrayList<VNameValue>();
+        comp.setLogLevelCount(levelCountList);
+        for (PivotField levelPivot : levelList) {
+          VNameValue level = new VNameValue();
+          level.setName(("" + levelPivot.getValue()).toUpperCase());
+          level.setValue("" + levelPivot.getCount());
+          levelCountList.add(level);
+        }
+        datatList.add(comp);
+      }
+      list.setvNodeList(datatList);
+      return convertObjToString(list);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getExtremeDatesForBundelId(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = new SolrQuery();
+    try {
+      String bundelId = (String) searchCriteria
+        .getParamValue(LogSearchConstants.BUNDLE_ID);
+
+      queryGenerator.setSingleIncludeFilter(solrQuery,
+        LogSearchConstants.BUNDLE_ID, bundelId);
+
+      queryGenerator.setMainQuery(solrQuery, null);
+      solrQuery.setSort(LogSearchConstants.LOGTIME, SolrQuery.ORDER.asc);
+      queryGenerator.setRowCount(solrQuery, 1);
+      VNameValueList nameValueList = new VNameValueList();
+      List<VNameValue> vNameValues = new ArrayList<VNameValue>();
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+
+      SolrDocumentList solrDocList = response.getResults();
+      for (SolrDocument solrDoc : solrDocList) {
+
+        Date logTimeAsc = (Date) solrDoc
+          .getFieldValue(LogSearchConstants.LOGTIME);
+        if (logTimeAsc != null) {
+          VNameValue nameValue = new VNameValue();
+          nameValue.setName("From");
+          nameValue.setValue("" + logTimeAsc.getTime());
+          vNameValues.add(nameValue);
+        }
+      }
+
+      solrQuery.clear();
+      queryGenerator.setMainQuery(solrQuery, null);
+      queryGenerator.setSingleIncludeFilter(solrQuery,
+        LogSearchConstants.BUNDLE_ID, bundelId);
+      solrQuery.setSort(LogSearchConstants.LOGTIME, SolrQuery.ORDER.desc);
+      queryGenerator.setRowCount(solrQuery, 1);
+
+      solrDocList.clear();
+      response = serviceLogsSolrDao.process(solrQuery);
+
+      solrDocList = response.getResults();
+      for (SolrDocument solrDoc : solrDocList) {
+        Date logTimeDesc = (Date) solrDoc
+          .getFieldValue(LogSearchConstants.LOGTIME);
+
+        if (logTimeDesc != null) {
+          VNameValue nameValue = new VNameValue();
+          nameValue.setName("To");
+          nameValue.setValue("" + logTimeDesc.getTime());
+          vNameValues.add(nameValue);
+        }
+      }
+      nameValueList.setVNameValues(vNameValues);
+      return convertObjToString(nameValueList);
+
+    } catch (SolrServerException | SolrException | IOException e) {
+      logger.error(e);
+      try {
+        return convertObjToString(new VNameValueList());
+      } catch (IOException e1) {
+        throw restErrorUtil.createRESTException(e1.getMessage(),
+          MessageEnums.DATA_NOT_FOUND);
+      }
+    }
+  }
+
+  protected VGroupList getSolrGroupList(SolrQuery query)
+    throws SolrServerException, IOException, SolrException {
+    QueryResponse response = serviceLogsSolrDao.process(query);
+    SolrDocumentList docList = response.getResults();
+    VGroupList collection = new VGroupList(docList);
+    collection.setStartIndex((int) docList.getStart());
+    collection.setTotalCount(docList.getNumFound());
+    return collection;
+  }
+
+  public Long countQuery(SolrQuery query) throws SolrException,
+    SolrServerException, IOException {
+    query.setRows(0);
+    QueryResponse response = serviceLogsSolrDao.process(query);
+    SolrDocumentList docList = response.getResults();
+    return docList.getNumFound();
+  }
+
+  public String getServiceLogsFieldsName() {
+    String fieldsNameStrArry[] = PropertiesUtil
+      .getPropertyStringList("solr.servicelogs.fields");
+    if (fieldsNameStrArry.length > 0) {
+      try {
+        List<String> uiFieldNames = new ArrayList<String>();
+        String temp = null;
+        for (String field : fieldsNameStrArry) {
+          temp = ConfigUtil.serviceLogsColumnMapping.get(field
+            + LogSearchConstants.SOLR_SUFFIX);
+          if (temp == null)
+            uiFieldNames.add(field);
+          else
+            uiFieldNames.add(temp);
+        }
+        return convertObjToString(uiFieldNames);
+      } catch (IOException e) {
+        logger.error("converting object to json failed", e);
+      }
+    }
+    throw restErrorUtil.createRESTException(
+      "No field name found in property file",
+      MessageEnums.DATA_NOT_FOUND);
+
+  }
+
+  public String getServiceLogsSchemaFieldsName() {
+
+    List<String> fieldNames = new ArrayList<String>();
+    String suffix = PropertiesUtil.getProperty("solr.core.logs");
+    String excludeArray[] = PropertiesUtil
+      .getPropertyStringList("servicelogs.exclude.columnlist");
+
+    HashMap<String, String> uiFieldColumnMapping = new LinkedHashMap<String, String>();
+    ConfigUtil.getSchemaFieldsName(suffix, excludeArray, fieldNames);
+
+    for (String fieldName : fieldNames) {
+      String uiField = ConfigUtil.serviceLogsColumnMapping.get(fieldName
+        + LogSearchConstants.SOLR_SUFFIX);
+      if (uiField != null) {
+        uiFieldColumnMapping.put(fieldName, uiField);
+      } else {
+        uiFieldColumnMapping.put(fieldName, fieldName);
+      }
+    }
+
+    try {
+      HashMap<String, String> uiFieldColumnMappingSorted = new LinkedHashMap<String, String>();
+      uiFieldColumnMappingSorted.put(LogSearchConstants.SOLR_LOG_MESSAGE,
+        "");
+
+      Iterator<Entry<String, String>> it = bizUtil
+        .sortHashMapByValuesD(uiFieldColumnMapping).entrySet()
+        .iterator();
+      while (it.hasNext()) {
+        @SuppressWarnings("rawtypes")
+        Map.Entry pair = (Map.Entry) it.next();
+        uiFieldColumnMappingSorted.put("" + pair.getKey(),
+          "" + pair.getValue());
+        it.remove();
+      }
+
+      return convertObjToString(uiFieldColumnMappingSorted);
+    } catch (IOException e) {
+      logger.error(e);
+    }
+    throw restErrorUtil.createRESTException(
+      "Cache is Empty for FieldsName", MessageEnums.DATA_NOT_FOUND);
+  }
+
+  @SuppressWarnings("unchecked")
+  public void extractValuesFromBuckets(
+    SimpleOrderedMap<Object> jsonFacetResponse, String outerField,
+    String innerField, List<VBarGraphData> histogramData) {
+    NamedList<Object> stack = (NamedList<Object>) jsonFacetResponse
+      .get(outerField);
+    ArrayList<Object> stackBuckets = (ArrayList<Object>) stack
+      .get("buckets");
+    for (Object temp : stackBuckets) {
+      VBarGraphData vBarGraphData = new VBarGraphData();
+
+      SimpleOrderedMap<Object> level = (SimpleOrderedMap<Object>) temp;
+      String name = ((String) level.getVal(0)).toUpperCase();
+      vBarGraphData.setName(name);
+
+      Collection<VNameValue> vNameValues = new ArrayList<VNameValue>();
+      vBarGraphData.setDataCounts(vNameValues);
+      ArrayList<Object> levelBuckets = (ArrayList<Object>) ((NamedList<Object>) level
+        .get(innerField)).get("buckets");
+      for (Object temp1 : levelBuckets) {
+        SimpleOrderedMap<Object> countValue = (SimpleOrderedMap<Object>) temp1;
+        String value = dateUtil
+          .convertDateWithMillisecondsToSolrDate((Date) countValue
+            .getVal(0));
+
+        String count = "" + countValue.getVal(1);
+        VNameValue vNameValue = new VNameValue();
+        vNameValue.setName(value);
+        vNameValue.setValue(count);
+        vNameValues.add(vNameValue);
+      }
+      histogramData.add(vBarGraphData);
+    }
+  }
+
+  public String getCurrentPageOfKeywordSearch(String requestDate) {
+    if (stringUtil.isEmpty(requestDate)) {
+      logger.error("Unique id is Empty");
+      throw restErrorUtil.createRESTException("Unique id is Empty",
+        MessageEnums.DATA_NOT_FOUND);
+    }
+    String pageNumber = mapUniqueId.get(requestDate);
+    if (stringUtil.isEmpty(pageNumber)) {
+      logger.error("Not able to find Page Number");
+      throw restErrorUtil.createRESTException("Page Number not found",
+        MessageEnums.DATA_NOT_FOUND);
+    }
+    return pageNumber;
+  }
+
+  public String getAnyGraphData(SearchCriteria searchCriteria) {
+    searchCriteria.addParam("feildTime", LogSearchConstants.LOGTIME);
+    String suffix = PropertiesUtil.getProperty("solr.core.logs");
+    searchCriteria.addParam("suffix", suffix);
+    SolrQuery solrQuery = queryGenerator.commonFilterQuery(searchCriteria);
+    String result = graphDataGnerator.getAnyGraphData(searchCriteria,
+      serviceLogsSolrDao, solrQuery);
+    if (result != null)
+      return result;
+    try {
+      return convertObjToString(new VBarDataList());
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  public String getAfterBeforeLogs(SearchCriteria searchCriteria) {
+    SolrDocumentList docList = null;
+    String id = (String) searchCriteria
+      .getParamValue(LogSearchConstants.ID);
+    if (stringUtil.isEmpty(id)) {
+      try {
+        return convertObjToString(new VSolrLogList());
+      } catch (IOException e) {
+        throw restErrorUtil.createRESTException(e.getMessage(),
+          MessageEnums.ERROR_SYSTEM);
+      }
+    }
+    String maxRows = "";
+
+    maxRows = (String) searchCriteria.getParamValue("numberRows");
+    if (stringUtil.isEmpty(maxRows))
+      maxRows = "10";
+    String scrollType = (String) searchCriteria.getParamValue("scrollType");
+    String logTime = null;
+    String sequenceId = null;
+    try {
+      SolrQuery solrQuery = new SolrQuery();
+      queryGenerator.setMainQuery(solrQuery,
+        queryGenerator.buildFilterQuery(LogSearchConstants.ID, id));
+      queryGenerator.setRowCount(solrQuery, 1);
+      QueryResponse response = serviceLogsSolrDao.process(solrQuery);
+      docList = response.getResults();
+      if (docList != null && !docList.isEmpty()) {
+        Date date = (Date) docList.get(0).getFieldValue(
+          LogSearchConstants.LOGTIME);
+        logTime = dateUtil.convertDateWithMillisecondsToSolrDate(date);
+        sequenceId = ""
+          + docList.get(0).getFieldValue(
+          LogSearchConstants.SEQUNCE_ID);
+      }
+      if (stringUtil.isEmpty(logTime)) {
+        return convertObjToString(new VSolrLogList());
+      }
+    } catch (SolrServerException | SolrException | IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.DATA_NOT_FOUND);
+    }
+    if (LogSearchConstants.SCROLL_TYPE_BEFORE.equals(scrollType)) {
+      VSolrLogList vSolrLogList = whenScrollUp(searchCriteria, logTime,
+        sequenceId, maxRows);
+
+      SolrDocumentList solrDocList = new SolrDocumentList();
+      for (SolrDocument solrDoc : vSolrLogList.getList()) {
+        solrDocList.add(solrDoc);
+      }
+      vSolrLogList.setSolrDocuments(solrDocList);
+      try {
+        return convertObjToString(vSolrLogList);
+      } catch (IOException e) {
+        // do nothing
+      }
+    } else if (LogSearchConstants.SCROLL_TYPE_AFTER.equals(scrollType)) {
+      SolrDocumentList solrDocList = new SolrDocumentList();
+      VSolrLogList vSolrLogList = new VSolrLogList();
+      for (SolrDocument solrDoc : whenScrollDown(searchCriteria, logTime,
+        sequenceId, maxRows).getList()) {
+        solrDocList.add(solrDoc);
+      }
+      vSolrLogList.setSolrDocuments(solrDocList);
+      try {
+        return convertObjToString(vSolrLogList);
+      } catch (IOException e) {
+        // do nothing
+      }
+
+    } else {
+      VSolrLogList vSolrLogList = new VSolrLogList();
+      SolrDocumentList initial = new SolrDocumentList();
+      SolrDocumentList before = whenScrollUp(searchCriteria, logTime,
+        sequenceId, maxRows).getList();
+      SolrDocumentList after = whenScrollDown(searchCriteria, logTime,
+        sequenceId, maxRows).getList();
+      if (before == null || before.isEmpty())
+        before = new SolrDocumentList();
+      for (SolrDocument solrDoc : Lists.reverse(before)) {
+        initial.add(solrDoc);
+      }
+      initial.add(docList.get(0));
+      if (after == null || after.isEmpty())
+        after = new SolrDocumentList();
+      for (SolrDocument solrDoc : after) {
+        initial.add(solrDoc);
+      }
+      vSolrLogList.setSolrDocuments(initial);
+      try {
+        return convertObjToString(vSolrLogList);
+      } catch (IOException e) {
+        // do nothing
+      }
+    }
+    try {
+      return convertObjToString(new VSolrLogList());
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.DATA_NOT_FOUND);
+    }
+  }
+
+  private VSolrLogList whenScrollUp(SearchCriteria searchCriteria,
+                                    String logTime, String sequenceId, String maxRows) {
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    /*queryGenerator.setSingleExcludeFilter(solrQuery,
+        LogSearchConstants.SEQUNCE_ID, sequenceId);*/
+    try {
+      int seq_num = Integer.parseInt(sequenceId) - 1;
+      sequenceId = "" + seq_num;
+    } catch (Exception e) {
+
+    }
+    queryGenerator.setSingleRangeFilter(
+      solrQuery,
+      LogSearchConstants.SEQUNCE_ID, "*", sequenceId);
+
+    queryGenerator.applyLogFileFilter(solrQuery, searchCriteria);
+
+    queryGenerator.setSingleRangeFilter(solrQuery,
+      LogSearchConstants.LOGTIME, "*", logTime);
+    queryGenerator.setRowCount(solrQuery, Integer.parseInt(maxRows));
+    String order1 = LogSearchConstants.LOGTIME + " "
+      + LogSearchConstants.DESCENDING_ORDER;
+    String order2 = LogSearchConstants.SEQUNCE_ID + " "
+      + LogSearchConstants.ASCENDING_ORDER;
+    List<String> sortOrder = new ArrayList<String>();
+    sortOrder.add(order1);
+    sortOrder.add(order2);
+    searchCriteria.addParam("sort", sortOrder);
+    queryGenerator.setMultipleSortOrder(solrQuery, searchCriteria);
+
+    return getLogAsPaginationProvided(solrQuery, serviceLogsSolrDao);
+  }
+
+  private VSolrLogList whenScrollDown(SearchCriteria searchCriteria,
+                                      String logTime, String sequenceId, String maxRows) {
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    queryGenerator.applyLogFileFilter(solrQuery, searchCriteria);
+
+    /*queryGenerator.setSingleExcludeFilter(solrQuery,
+        LogSearchConstants.SEQUNCE_ID, sequenceId);*/
+    try {
+      int seq_num = Integer.parseInt(sequenceId) + 1;
+      sequenceId = "" + seq_num;
+    } catch (Exception e) {
+
+    }
+    queryGenerator.setSingleRangeFilter(
+      solrQuery,
+      LogSearchConstants.SEQUNCE_ID, sequenceId, "*");
+    queryGenerator.setSingleRangeFilter(solrQuery,
+      LogSearchConstants.LOGTIME, logTime, "*");
+    queryGenerator.setRowCount(solrQuery, Integer.parseInt(maxRows));
+
+    String order1 = LogSearchConstants.LOGTIME + " "
+      + LogSearchConstants.ASCENDING_ORDER;
+    String order2 = LogSearchConstants.SEQUNCE_ID + " "
+      + LogSearchConstants.ASCENDING_ORDER;
+    List<String> sortOrder = new ArrayList<String>();
+    sortOrder.add(order1);
+    sortOrder.add(order2);
+    searchCriteria.addParam("sort", sortOrder);
+    queryGenerator.setMultipleSortOrder(solrQuery, searchCriteria);
+
+    return getLogAsPaginationProvided(solrQuery, serviceLogsSolrDao);
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getSuggestions(SearchCriteria searchCriteria) {
+    SolrQuery solrQuery = new SolrQuery();
+    queryGenerator.setMainQuery(solrQuery, null);
+    String field = "" + searchCriteria.getParamValue("fieldName");
+    String originalFieldName = ConfigUtil.serviceLogsColumnMapping
+      .get(field + LogSearchConstants.UI_SUFFIX);
+    if (originalFieldName == null)
+      originalFieldName = field;
+    originalFieldName = LogSearchConstants.NGRAM_SUFFIX + originalFieldName;
+    String value = "" + searchCriteria.getParamValue("valueToSuggest");
+    String jsonQuery = queryGenerator
+      .buidlJSONFacetRangeQueryForSuggestion(originalFieldName, value);
+    try {
+      List<String> valueList = new ArrayList<String>();
+      queryGenerator.setJSONFacet(solrQuery, jsonQuery);
+      QueryResponse queryResponse = serviceLogsSolrDao.process(solrQuery);
+      if (queryResponse == null)
+        return convertObjToString(valueList);
+      SimpleOrderedMap<Object> jsonFacetResponse = (SimpleOrderedMap<Object>) queryResponse
+        .getResponse().get("facets");
+      if (jsonFacetResponse == null
+        || jsonFacetResponse.equals("{count=0}"))
+        return convertObjToString(valueList);
+      SimpleOrderedMap<Object> stack = (SimpleOrderedMap<Object>) jsonFacetResponse
+        .get("y");
+      if (stack == null || stack.equals("{count=0}"))
+        return convertObjToString(valueList);
+      SimpleOrderedMap<Object> buckets = (SimpleOrderedMap<Object>) stack
+        .get("x");
+      if (buckets == null || buckets.equals("{count=0}"))
+        return convertObjToString(valueList);
+      ArrayList<Object> bucketList = (ArrayList<Object>) buckets
+        .get("buckets");
+      for (Object object : bucketList) {
+        SimpleOrderedMap<Object> simpleOrderdMap = (SimpleOrderedMap<Object>) object;
+        String val = "" + simpleOrderdMap.getVal(0);
+        valueList.add(val);
+      }
+      return convertObjToString(valueList);
+    } catch (SolrException | SolrServerException | IOException e) {
+      try {
+        return convertObjToString(new ArrayList<String>());
+      } catch (IOException e1) {
+        throw restErrorUtil.createRESTException(e.getMessage(),
+          MessageEnums.ERROR_SYSTEM);
+      }
+    }
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/MgrBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/MgrBase.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/MgrBase.java
new file mode 100644
index 0000000..cf50a87
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/MgrBase.java
@@ -0,0 +1,167 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.manager;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Scanner;
+
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.dao.SolrDaoBase;
+import org.apache.ambari.logsearch.query.QueryGeneration;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.view.VSolrLogList;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
+
+public class MgrBase {
+  static private Logger logger = Logger.getLogger(MgrBase.class);
+
+  @Autowired
+  SolrUtil solrUtil;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  @Autowired
+  QueryGeneration queryGenrator;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  JsonSerializer<Date> jsonDateSerialiazer = null;
+  JsonDeserializer<Date> jsonDateDeserialiazer = null;
+
+  public MgrBase() {
+    jsonDateSerialiazer = new JsonSerializer<Date>() {
+
+      @Override
+      public JsonElement serialize(Date paramT,
+                                   java.lang.reflect.Type paramType,
+                                   JsonSerializationContext paramJsonSerializationContext) {
+
+        return paramT == null ? null : new JsonPrimitive(paramT.getTime());
+      }
+    };
+
+    jsonDateDeserialiazer = new JsonDeserializer<Date>() {
+
+      @Override
+      public Date deserialize(JsonElement json,
+                              java.lang.reflect.Type typeOfT,
+                              JsonDeserializationContext context) throws JsonParseException {
+        return json == null ? null : new Date(json.getAsLong());
+      }
+
+    };
+  }
+
+  public String convertObjToString(Object obj) throws IOException {
+    if (obj == null) {
+      return "";
+    }
+    /*ObjectMapper mapper = new ObjectMapper();
+    ObjectWriter w = mapper.writerWithDefaultPrettyPrinter();
+    return mapper.writeValueAsString(obj);*/
+
+    Gson gson = new GsonBuilder()
+      .registerTypeAdapter(Date.class, jsonDateSerialiazer)
+      .registerTypeAdapter(Date.class, jsonDateDeserialiazer).create();
+
+    return gson.toJson(obj);
+  }
+
+
+  public String getHadoopServiceConfigJSON() {
+    StringBuilder result = new StringBuilder("");
+
+    // Get file from resources folder
+    ClassLoader classLoader = getClass().getClassLoader();
+    File file = new File(classLoader
+      .getResource("HadoopServiceConfig.json").getFile());
+
+    try (Scanner scanner = new Scanner(file)) {
+
+      while (scanner.hasNextLine()) {
+        String line = scanner.nextLine();
+        result.append(line).append("\n");
+      }
+
+      scanner.close();
+
+    } catch (IOException e) {
+      logger.error("Unable to read HadoopServiceConfig.json", e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+    String hadoopServiceConfig = result.toString();
+    if (jsonUtil.isJSONValid(hadoopServiceConfig))
+      return hadoopServiceConfig;
+    throw restErrorUtil.createRESTException("Improper JSON",
+      MessageEnums.ERROR_SYSTEM);
+
+  }
+
+  public VSolrLogList getLogAsPaginationProvided(SolrQuery solrQuery, SolrDaoBase solrDaoBase) {
+    try {
+      QueryResponse response = solrDaoBase.process(solrQuery);
+      SolrDocumentList docList = response.getResults();
+      VSolrLogList collection = new VSolrLogList(docList);
+      collection.setStartIndex((int) docList.getStart());
+      collection.setTotalCount(docList.getNumFound());
+      Integer rowNumber = solrQuery.getRows();
+      if (rowNumber == null) {
+        logger.error("No RowNumber was set in solrQuery");
+        return new VSolrLogList();
+      }
+      collection.setPageSize(rowNumber);
+      return collection;
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error("Error during solrQuery=" + solrQuery, e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicMgr.java
new file mode 100644
index 0000000..0a4328b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/PublicMgr.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.manager;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.view.VNameValue;
+import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.web.security.LogsearchSimpleAuthenticationProvider;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PublicMgr extends MgrBase {
+  private static Logger logger = Logger.getLogger(PublicMgr.class);
+
+  @Autowired
+  LogsearchSimpleAuthenticationProvider simpleAuthenticationProvider;
+
+  public String getGeneralConfig() {
+    VNameValueList nameValueList = new VNameValueList();
+    List<VNameValue> nameValues = new ArrayList<VNameValue>();
+    VNameValue nameValue = new VNameValue();
+    nameValue.setName("simpleAuth");
+    nameValue.setValue("" + simpleAuthenticationProvider.isEnable());
+    nameValues.add(nameValue);
+    nameValueList.setVNameValues(nameValues);
+    try {
+      return convertObjToString(nameValueList);
+    } catch (IOException e) {
+      throw restErrorUtil.createRESTException(e.getMessage(), MessageEnums.ERROR_SYSTEM);
+    }
+  }
+}


[05/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-OM.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-OM.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-OM.js
new file mode 100644
index 0000000..6a9bca4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-OM.js
@@ -0,0 +1,458 @@
+/*
+ * Globalize Culture ar-OM
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-OM", "default", {
+	name: "ar-OM",
+	englishName: "Arabic (Oman)",
+	nativeName: "العربية (عمان)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			decimals: 3,
+			symbol: "ر.ع.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-QA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-QA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-QA.js
new file mode 100644
index 0000000..dfa405e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-QA.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-QA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-QA", "default", {
+	name: "ar-QA",
+	englishName: "Arabic (Qatar)",
+	nativeName: "العربية (قطر)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ر.ق.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SA.js
new file mode 100644
index 0000000..cba34f6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SA.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-SA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-SA", "default", {
+	name: "ar-SA",
+	englishName: "Arabic (Saudi Arabia)",
+	nativeName: "العربية (المملكة العربية السعودية)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ر.س.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_Localized: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));


[59/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
AMBARI-15679. Stack definition for Logsearch (oleewre)


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

Branch: refs/heads/branch-dev-logsearch
Commit: cb6a7b9bc145a5b01d51418c2fe335321a21d718
Parents: f729469
Author: oleewere <ol...@gmail.com>
Authored: Sat Apr 9 11:59:06 2016 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Sat Apr 9 11:59:06 2016 +0200

----------------------------------------------------------------------
 .../libraries/functions/package_conditions.py   |    4 +
 .../common-services/LOGSEARCH/0.5.0/alerts.json |   63 +
 .../0.5.0/configuration/logfeeder-env.xml       |  118 ++
 .../0.5.0/configuration/logfeeder-log4j.xml     |   80 +
 .../0.5.0/configuration/logfeeder-site.xml      |   87 +
 .../logsearch-audit_logs-solrconfig.xml         | 1929 ++++++++++++++++++
 .../0.5.0/configuration/logsearch-env.xml       |  143 ++
 .../0.5.0/configuration/logsearch-log4j.xml     |  110 +
 .../logsearch-service_logs-solrconfig.xml       | 1928 +++++++++++++++++
 .../0.5.0/configuration/logsearch-site.xml      |   80 +
 .../0.5.0/configuration/logsearch-solr-env.xml  |  193 ++
 .../configuration/logsearch-solr-log4j.xml      |   57 +
 .../0.5.0/configuration/logsearch-solr-xml.xml  |   41 +
 .../LOGSEARCH/0.5.0/kerberos.json               |   17 +
 .../LOGSEARCH/0.5.0/metainfo.xml                |  119 ++
 .../0.5.0/package/scripts/logfeeder.py          |   67 +
 .../0.5.0/package/scripts/logsearch.py          |   65 +
 .../LOGSEARCH/0.5.0/package/scripts/params.py   |  231 +++
 .../0.5.0/package/scripts/setup_logfeeder.py    |   67 +
 .../0.5.0/package/scripts/setup_logsearch.py    |   93 +
 .../0.5.0/package/scripts/setup_solr.py         |   67 +
 .../LOGSEARCH/0.5.0/package/scripts/solr.py     |   66 +
 .../0.5.0/package/scripts/status_params.py      |   36 +
 .../package/templates/global.config.json.j2     |   28 +
 .../0.5.0/package/templates/grok-patterns.j2    |  144 ++
 .../templates/input.config-accumulo.json.j2     |  105 +
 .../templates/input.config-ambari.json.j2       |   93 +
 .../package/templates/input.config-ams.json.j2  |   92 +
 .../templates/input.config-atlas.json.j2        |   55 +
 .../templates/input.config-falcon.json.j2       |   55 +
 .../templates/input.config-hbase.json.j2        |   62 +
 .../package/templates/input.config-hdfs.json.j2 |  246 +++
 .../package/templates/input.config-hive.json.j2 |   62 +
 .../templates/input.config-kafka.json.j2        |  105 +
 .../package/templates/input.config-knox.json.j2 |   68 +
 .../templates/input.config-logsearch.json.j2    |   68 +
 .../templates/input.config-oozie.json.j2        |   56 +
 .../templates/input.config-ranger.json.j2       |  122 ++
 .../templates/input.config-storm.json.j2        |   86 +
 .../package/templates/input.config-yarn.json.j2 |   86 +
 .../templates/input.config-zookeeper.json.j2    |   56 +
 .../package/templates/logfeeder.properties.j2   |   18 +
 .../package/templates/logsearch.properties.j2   |   40 +
 .../package/templates/output.config.json.j2     |   97 +
 .../0.5.0/package/templates/zoo.cfg.j2          |   31 +
 .../LOGSEARCH/0.5.0/quicklinks/quicklinks.json  |   28 +
 .../stacks/HDP/2.2/upgrades/upgrade-2.3.xml     |    3 +
 .../stacks/HDP/2.2/upgrades/upgrade-2.4.xml     |    3 +
 .../stacks/HDP/2.3/role_command_order.json      |    5 +-
 .../HDP/2.3/services/LOGSEARCH/metainfo.xml     |   26 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.3.xml     |    3 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml     |    3 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.4.xml     |    3 +
 .../stacks/2.4/LOGSEARCH/test_logfeeder.py      |  152 ++
 .../stacks/2.4/LOGSEARCH/test_logsearch.py      |  159 ++
 .../python/stacks/2.4/LOGSEARCH/test_solr.py    |  155 ++
 .../test/python/stacks/2.4/configs/default.json |  398 ++++
 .../src/test/python/stacks/utils/RMFTestCase.py |   14 +-
 .../HDP/2.2.0/upgrades/upgrade_test_checks.xml  |    1 +
 .../app/mappers/service_metrics_mapper.js       |    3 +-
 ambari-web/app/models/quick_links.js            |   13 +
 .../app/views/common/quick_view_link_view.js    |    6 +-
 .../test/views/common/quick_link_view_test.js   |    5 +
 63 files changed, 8412 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
index df46ce0..e164f56 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
@@ -46,6 +46,10 @@ def should_install_ams_grafana():
   config = Script.get_config()
   return 'role' in config and config['role'] == "METRICS_GRAFANA"
 
+def should_install_logsearch_solr():
+  config = Script.get_config()
+  return 'role' in config and config['role'] != "LOGSEARCH_LOGFEEDER"
+
 def should_install_mysql():
   config = Script.get_config()
   hive_database = config['configurations']['hive-env']['hive_database']

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
new file mode 100644
index 0000000..32bbf67
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/alerts.json
@@ -0,0 +1,63 @@
+{
+  "LOGSEARCH": {
+    "LOGSEARCH_SERVER": [
+      {
+        "name": "logsearch_ui",
+        "label": "LogSearch Web UI",
+        "description": "This host-level alert is triggered if the LogSearch UI is unreachable.",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "WEB",
+          "uri": {
+            "http": "{{logsearch-site/logsearch.ui.port}}",
+            "https": "{{logsearch-site/logsearch.ui.port}}",
+            "connection_timeout": 5.0,
+            "default_port": 61888
+          },
+          "reporting": {
+            "ok": {
+              "text": "HTTP {0} response in {2:.3f}s"
+            },
+            "warning":{
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
+            },
+            "critical": {
+              "text": "Connection failed to {1} ({3})"
+            }
+          }
+        }
+      }
+    ],
+    "LOGSEARCH_SOLR": [
+      {
+        "name": "logsearch_solr",
+        "label": "Solr Web UI",
+        "description": "This host-level alert is triggered if the Solr Cloud Instance is unreachable.",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "WEB",
+          "uri": {
+            "http": "{{logsearch-solr-env/logsearch_solr_port}}",
+            "https": "{{logsearch-solr-env/logsearch_solr_port}}",
+            "connection_timeout": 5.0,
+            "default_port": 8886
+          },
+          "reporting": {
+            "ok": {
+              "text": "HTTP {0} response in {2:.3f}s"
+            },
+            "warning":{
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
+            },
+            "critical": {
+              "text": "Connection failed to {1} ({3})"
+            }
+          }
+        }
+      }
+    ]
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
new file mode 100644
index 0000000..2722be8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logfeeder_pid_dir</name>
+    <value>/var/run/ambari-logsearch-logfeeder</value>
+    <description>logfeeder Process ID Directory</description>
+    <display-name>Logfeeder pid dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_log_dir</name>
+    <value>/var/log/ambari-logsearch-logfeeder</value>
+    <description>Log dir for logfeeder</description>
+    <display-name>Logfeeder log dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_checkpoint_folder</name>
+    <value>/etc/ambari-logsearch-logfeeder/conf/checkpoints</value>
+    <description>Checkpoint folder for logfeeder</description>
+    <display-name>Logfeeder checkpoint dir</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_config_files</name>
+    <value>{{logfeeder_config_files}}</value>
+    <description>Comma separated config files in grok format</description>
+    <display-name>Logfeeder config files</display-name>
+  </property>
+  
+  <property>
+    <name>logfeeder_user</name>
+    <value>logfeeder</value>
+    <property-type>USER</property-type>
+    <description>logfeeder user</description>
+    <display-name>Logsfeeder User</display-name>
+  </property>
+
+  <property>
+    <name>logfeeder_group</name>
+    <value>logfeeder</value>
+    <property-type>GROUP</property-type>
+    <description>logfeeder group</description>
+    <display-name>Logsfeeder Group</display-name>
+  </property> 
+
+  <property>
+    <name>logfeeder_max_mem</name>
+    <value>512m</value>
+    <description>Max memory for LogFeeder</description>
+    <display-name>Logsfeeder max memory</display-name>
+  </property>
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for config.json file</description>
+    <value>#!/bin/bash
+# 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.
+
+set -e
+
+export LOGFEEDER_PATH={{logfeeder_dir}}
+
+export LOGFEEDER_CONF_DIR={{logsearch_logfeeder_conf}}
+
+#Logfile e.g. /var/log/logfeeder.log
+export LOGFILE={{logfeeder_log}}
+
+#pid file e.g. /var/run/logfeeder.pid
+export PID_FILE={{logfeeder_pid_file}}
+
+export JAVA_HOME={{java64_home}}
+
+if [ "$LOGFEEDER_JAVA_MEM" = "" ]; then
+  export LOGFEEDER_JAVA_MEM=-Xmx{{logfeeder_max_mem}}
+fi
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
new file mode 100644
index 0000000..5a3331e
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-log4j.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+  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.
+--&gt;
+&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
+&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
+  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
+    &lt;param name="Target" value="System.out" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="rolling_file" class="org.apache.log4j.RollingFileAppender"&gt; 
+    &lt;param name="file" value="{{logfeeder_log_dir}}/logfeeder.log" /&gt;
+    &lt;param name="append" value="true" /&gt; 
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt; 
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt; 
+    &lt;/layout&gt; 
+  &lt;/appender&gt; 
+
+  &lt;category name="org.apache.ambari.logfeeder" additivity="false"&gt;
+    &lt;priority value="info" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/category&gt;
+
+  &lt;root&gt;
+    &lt;priority value="warn" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/root&gt;
+&lt;/log4j:configuration&gt;  
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
new file mode 100644
index 0000000..40ee374
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-site.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>logfeeder.solr.service.logs.enable</name>
+    <value>true</value>
+    <display-name>Service Logs enabled</display-name>
+    <description>Enable service logs to Solr</description>
+  </property>
+
+  <property>
+    <name>logfeeder.solr.audit.logs.enable</name>
+    <value>true</value>
+    <display-name>Audit Logs enabled</display-name>
+    <description>Enable audit logs to Solr</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.service.logs.enable</name>
+    <value>false</value>
+    <display-name>Kafka Service Logs enabled</display-name>
+    <description>Enable service logs to Kafka</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.topic.service.logs</name>
+    <value>service_logs</value>
+    <display-name>Kafka Service Logs topic</display-name>
+    <description>Kafka topic for service logs</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.audit.logs.enable</name>
+    <value>false</value>
+    <display-name>Audit Logs enabled</display-name>
+    <description>Enable audit logs to Kafka</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.topic.audit.logs</name>
+    <value>audit_logs</value>
+    <display-name>Kafka Audit Logs topic</display-name>
+    <description>Kafka topic for audit logs</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.broker.list</name>
+    <value>NONE</value>
+    <display-name>Kafka broker list</display-name>
+    <description>List of brokers. e.g. broker1_host:port,broker2_host:port</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.security.protocol</name>
+    <value>NONE</value>
+    <display-name>Kafka security protocol</display-name>
+    <description>If security is enabled, then set this value. E.g. SASL_PLAINTEXT</description>
+  </property>
+
+  <property>
+    <name>logfeeder.kafka.kerberos.service.name</name>
+    <value>NONE</value>
+    <display-name>Kafka Kerberos service name</display-name>
+    <description>If security is enabled, then set this value. E.g. kafka</description>
+  </property>
+
+</configuration>


[48/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
new file mode 100644
index 0000000..9b2a717
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
@@ -0,0 +1,351 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.filter;
+
+import java.io.BufferedInputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import oi.thekraken.grok.api.Grok;
+import oi.thekraken.grok.api.exception.GrokException;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.MetricCount;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import com.google.gson.reflect.TypeToken;
+
+public class FilterGrok extends Filter {
+  static private Logger logger = Logger.getLogger(FilterGrok.class);
+
+  private static final String GROK_PATTERN_FILE = "grok-patterns";
+
+  String messagePattern = null;
+  String multilinePattern = null;
+
+  Grok grokMultiline = null;
+  Grok grokMessage = null;
+
+  StringBuilder strBuff = null;
+  String currMultilineJsonStr = null;
+
+  InputMarker firstInputMarker = null;
+  InputMarker savedInputMarker = null;
+
+  String sourceField = null;
+  boolean removeSourceField = true;
+
+  Set<String> namedParamList = new HashSet<String>();
+  Set<String> multiLineamedParamList = new HashSet<String>();
+
+  Type jsonType = new TypeToken<Map<String, String>>() {
+  }.getType();
+
+  public MetricCount grokErrorMetric = new MetricCount();
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+
+    try {
+      grokErrorMetric.metricsName = "filter.error.grok";
+      // Get the Grok file patterns
+      messagePattern = escapePattern(getStringValue("message_pattern"));
+      multilinePattern = escapePattern(getStringValue("multiline_pattern"));
+      sourceField = getStringValue("source_field");
+      removeSourceField = getBooleanValue("remove_source_field",
+        removeSourceField);
+
+      logger.info("init() done. grokPattern=" + messagePattern
+        + ", multilinePattern=" + multilinePattern + ", "
+        + getShortDescription());
+      if (StringUtils.isEmpty(messagePattern)) {
+        logger.error("message_pattern is not set for filter.");
+        return;
+      }
+      extractNamedParams(messagePattern, namedParamList);
+
+      grokMessage = new Grok();
+      // grokMessage.addPatternFromReader(r);
+      loadPatterns(grokMessage);
+      grokMessage.compile(messagePattern);
+      if (!StringUtils.isEmpty(multilinePattern)) {
+        extractNamedParams(multilinePattern, multiLineamedParamList);
+
+        grokMultiline = new Grok();
+        loadPatterns(grokMultiline);
+        grokMultiline.compile(multilinePattern);
+      }
+    } catch (Throwable t) {
+      logger.fatal(
+        "Caught exception while initializing Grok. multilinePattern="
+          + multilinePattern + ", messagePattern="
+          + messagePattern, t);
+      grokMessage = null;
+      grokMultiline = null;
+    }
+
+  }
+
+  /**
+   * @param stringValue
+   * @return
+   */
+  private String escapePattern(String inPattern) {
+    String inStr = inPattern;
+    if (inStr != null) {
+      if (inStr.contains("(?m)") && !inStr.contains("(?s)")) {
+        inStr = inStr.replaceFirst("(?m)", "(?s)");
+      }
+      // inStr = inStr.replaceAll("\\[", "\\\\[");
+      // inStr = inStr.replaceAll("\\]", "\\\\]");
+      // inStr = inStr.replaceAll("\\(", "\\\\(");
+      // inStr = inStr.replaceAll("\\)", "\\\\)");
+    }
+    return inStr;
+  }
+
+  private void extractNamedParams(String patternStr, Set<String> paramList) {
+    String grokRegEx = "%\\{" + "(?<name>" + "(?<pattern>[A-z0-9]+)"
+      + "(?::(?<subname>[A-z0-9_:]+))?" + ")" + "(?:=(?<definition>"
+      + "(?:" + "(?:[^{}]+|\\.+)+" + ")+" + ")" + ")?" + "\\}";
+
+    Pattern pattern = Pattern.compile(grokRegEx);
+    java.util.regex.Matcher matcher = pattern.matcher(patternStr);
+    while (matcher.find()) {
+      String subname = matcher.group(3);
+      if (subname != null) {
+        paramList.add(subname);
+      }
+    }
+  }
+
+  private boolean loadPatterns(Grok grok) {
+    InputStreamReader grokPatternsReader = null;
+    logger.info("Loading pattern file " + GROK_PATTERN_FILE);
+    try {
+      BufferedInputStream fileInputStream = (BufferedInputStream) this
+        .getClass().getClassLoader()
+        .getResourceAsStream(GROK_PATTERN_FILE);
+      if (fileInputStream == null) {
+        logger.fatal("Couldn't load grok-patterns file "
+          + GROK_PATTERN_FILE + ". Things will not work");
+        return false;
+      }
+      grokPatternsReader = new InputStreamReader(fileInputStream);
+    } catch (Throwable t) {
+      logger.fatal("Error reading grok-patterns file " + GROK_PATTERN_FILE
+        + " from classpath. Grok filtering will not work.", t);
+      return false;
+    }
+    try {
+      grok.addPatternFromReader(grokPatternsReader);
+    } catch (GrokException e) {
+      logger.fatal(
+        "Error loading patterns from grok-patterns reader for file "
+          + GROK_PATTERN_FILE, e);
+      return false;
+    }
+
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.filter.Filter#apply(java.lang.String)
+   */
+  @Override
+  public void apply(String inputStr, InputMarker inputMarker) {
+    if (grokMessage == null) {
+      return;
+    }
+
+    if (grokMultiline != null) {
+      // Check if new line
+      String jsonStr = grokMultiline.capture(inputStr);
+      if (!"{}".equals(jsonStr)) {
+        // New line
+        if (strBuff != null) {
+          savedInputMarker.beginLineNumber = firstInputMarker.lineNumber;
+          // Construct JSON object and add only the interested named
+          // parameters
+          Map<String, Object> jsonObj = Collections
+            .synchronizedMap(new HashMap<String, Object>());
+          try {
+            // Handle message parsing
+            applyMessage(strBuff.toString(), jsonObj,
+              currMultilineJsonStr);
+          } finally {
+            strBuff = null;
+            savedInputMarker = null;
+            firstInputMarker = null;
+          }
+        }
+        currMultilineJsonStr = jsonStr;
+      }
+
+      if (strBuff == null) {
+        strBuff = new StringBuilder();
+        firstInputMarker = inputMarker;
+      } else {
+        // strBuff.append(System.lineSeparator());
+        strBuff.append('\r');
+        strBuff.append('\n');
+      }
+      strBuff.append(inputStr);
+      savedInputMarker = inputMarker;
+    } else {
+      savedInputMarker = inputMarker;
+      Map<String, Object> jsonObj = Collections
+        .synchronizedMap(new HashMap<String, Object>());
+      applyMessage(inputStr, jsonObj, null);
+    }
+  }
+
+  @Override
+  public void apply(Map<String, Object> jsonObj, InputMarker inputMarker) {
+    if (sourceField != null) {
+      savedInputMarker = inputMarker;
+      applyMessage((String) jsonObj.get(sourceField), jsonObj, null);
+      if (removeSourceField) {
+        jsonObj.remove(sourceField);
+      }
+    }
+  }
+
+  /**
+   * @param inputStr
+   * @param jsonObj
+   */
+  private void applyMessage(String inputStr, Map<String, Object> jsonObj,
+                            String multilineJsonStr) {
+    String jsonStr = grokParse(inputStr);
+
+    boolean parseError = false;
+    if ("{}".equals(jsonStr)) {
+      parseError = true;
+      // Error parsing string.
+      logParseError(inputStr);
+
+      if (multilineJsonStr == null) {
+        // TODO: Should we just add this as raw message in solr?
+        return;
+      }
+    }
+
+    if (parseError) {
+      jsonStr = multilineJsonStr;
+    }
+    Map<String, String> jsonSrc = LogFeederUtil.getGson().fromJson(jsonStr,
+      jsonType);
+    for (String namedParam : namedParamList) {
+      if (jsonSrc.get(namedParam) != null) {
+        jsonObj.put(namedParam, jsonSrc.get(namedParam));
+      }
+    }
+    if (parseError) {
+      // Add error tags
+      @SuppressWarnings("unchecked")
+      List<String> tagsList = (List<String>) jsonObj.get("tags");
+      if (tagsList == null) {
+        tagsList = new ArrayList<String>();
+        jsonObj.put("tags", tagsList);
+      }
+      tagsList.add("error_grok_parsing");
+      if (sourceField == null) {
+        // For now let's put the raw message in log_message, so it is
+        // will be searchable
+        jsonObj.put("log_message", inputStr);
+      }
+    }
+
+    super.apply(jsonObj, savedInputMarker);
+    statMetric.count++;
+  }
+
+  public String grokParse(String inputStr) {
+    String jsonStr = grokMessage.capture(inputStr);
+    return jsonStr;
+  }
+
+  private void logParseError(String inputStr) {
+    grokErrorMetric.count++;
+    final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+      + "_PARSEERROR";
+    int inputStrLength = inputStr != null ? inputStr.length() : 0;
+    LogFeederUtil.logErrorMessageByInterval(
+      LOG_MESSAGE_KEY,
+      "Error parsing string. length=" + inputStrLength
+        + ", input=" + input.getShortDescription()
+        + ". First upto 100 characters="
+        + LogFeederUtil.subString(inputStr, 100), null, logger,
+      Level.WARN);
+  }
+
+  @Override
+  public void flush() {
+    if (strBuff != null) {
+      // Handle message parsing
+      Map<String, Object> jsonObj = Collections
+        .synchronizedMap(new HashMap<String, Object>());
+      applyMessage(strBuff.toString(), jsonObj, currMultilineJsonStr);
+      strBuff = null;
+      savedInputMarker = null;
+    }
+    super.flush();
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.ConfigBlock#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "filter:filter=grok,regex=" + messagePattern;
+  }
+
+  @Override
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    super.addMetricsContainers(metricsList);
+    metricsList.add(grokErrorMetric);
+  }
+
+  @Override
+  public void logStat() {
+    super.logStat();
+    // Printing stat for grokErrors
+    logStatForMetric(grokErrorMetric, "Stat: Grok Errors");
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
new file mode 100644
index 0000000..c4da3cb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
@@ -0,0 +1,132 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.filter;
+
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.MetricCount;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+public class FilterKeyValue extends Filter {
+  static private Logger logger = Logger.getLogger(FilterKeyValue.class);
+
+  String sourceField = null;
+  String valueSplit = "=";
+  String fieldSplit = "\t";
+
+  public MetricCount errorMetric = new MetricCount();
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+    errorMetric.metricsName = "filter.error.keyvalue";
+
+    sourceField = getStringValue("source_field");
+    valueSplit = getStringValue("value_split", valueSplit);
+    fieldSplit = getStringValue("field_split", fieldSplit);
+
+    logger.info("init() done. source_field=" + sourceField
+      + ", value_split=" + valueSplit + ", " + ", field_split="
+      + fieldSplit + ", " + getShortDescription());
+    if (StringUtils.isEmpty(sourceField)) {
+      logger.fatal("source_field is not set for filter. This filter will not be applied");
+      return;
+    }
+
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.filter.Filter#apply(java.lang.String)
+   */
+  @Override
+  public void apply(String inputStr, InputMarker inputMarker) {
+    apply(LogFeederUtil.toJSONObject(inputStr), inputMarker);
+  }
+
+  @Override
+  public void apply(Map<String, Object> jsonObj, InputMarker inputMarker) {
+    if (sourceField == null) {
+      return;
+    }
+    Object valueObj = jsonObj.get(sourceField);
+    if (valueObj != null) {
+      StringTokenizer fieldTokenizer = new StringTokenizer(
+        valueObj.toString(), fieldSplit);
+      while (fieldTokenizer.hasMoreTokens()) {
+        String nv = fieldTokenizer.nextToken();
+        StringTokenizer nvTokenizer = new StringTokenizer(nv,
+          valueSplit);
+        while (nvTokenizer.hasMoreTokens()) {
+          String name = nvTokenizer.nextToken();
+          if (nvTokenizer.hasMoreTokens()) {
+            String value = nvTokenizer.nextToken();
+            jsonObj.put(name, value);
+          } else {
+            // Unbalanced name value pairs
+            logParseError("name=" + name + ", pair=" + nv
+              + ", field=" + sourceField + ", field_value="
+              + valueObj);
+          }
+        }
+      }
+    }
+    super.apply(jsonObj, inputMarker);
+    statMetric.count++;
+  }
+
+  private void logParseError(String inputStr) {
+    errorMetric.count++;
+    final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+      + "_PARSEERROR";
+    LogFeederUtil
+      .logErrorMessageByInterval(
+        LOG_MESSAGE_KEY,
+        "Error parsing string. length=" + inputStr.length()
+          + ", input=" + input.getShortDescription()
+          + ". First upto 100 characters="
+          + LogFeederUtil.subString(inputStr, 100), null, logger,
+        Level.ERROR);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.ConfigBlock#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "filter:filter=keyvalue,regex=" + sourceField;
+  }
+
+  @Override
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    super.addMetricsContainers(metricsList);
+    metricsList.add(errorMetric);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/JSONFilterCode.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/JSONFilterCode.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/JSONFilterCode.java
new file mode 100644
index 0000000..5c4d30e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/JSONFilterCode.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.filter;
+
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.log4j.Logger;
+
+
+public class JSONFilterCode extends Filter {
+  private static Logger logger = Logger.getLogger(JSONFilterCode.class);
+
+  @Override
+  public void apply(String inputStr, InputMarker inputMarker) {
+    Map<String, Object> jsonMap = LogFeederUtil.toJSONObject(inputStr);
+    // linenumber
+    Double lineNumberD = (Double) jsonMap.get("line_number");
+    if (lineNumberD != null) {
+      long lineNumber = lineNumberD.longValue();
+      jsonMap.put("line_number", lineNumber);
+    }
+    // logtime
+    String timeStampStr = (String) jsonMap.get("logtime");
+    if (timeStampStr != null && !timeStampStr.isEmpty()) {
+      String logtime = LogFeederUtil.getDate(timeStampStr);
+      jsonMap.put("logtime", logtime);
+    }
+    super.apply(jsonMap, inputMarker);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
new file mode 100644
index 0000000..ec75f2d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
@@ -0,0 +1,321 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.input;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.ConfigBlock;
+import org.apache.ambari.logfeeder.InputMgr;
+import org.apache.ambari.logfeeder.MetricCount;
+import org.apache.ambari.logfeeder.OutputMgr;
+import org.apache.ambari.logfeeder.filter.Filter;
+import org.apache.ambari.logfeeder.output.Output;
+import org.apache.log4j.Logger;
+
+public abstract class Input extends ConfigBlock implements Runnable {
+  static private Logger logger = Logger.getLogger(Input.class);
+
+  OutputMgr outputMgr;
+  InputMgr inputMgr;
+
+  List<Output> outputList = new ArrayList<Output>();
+
+  Filter firstFilter = null;
+  Thread thread;
+  private boolean isClosed = false;
+  String filePath = null;
+  String type = null;
+
+  boolean tail = true;
+  boolean useEventMD5 = false;
+  boolean genEventMD5 = true;
+
+  public MetricCount readBytesMetric = new MetricCount();
+
+  /**
+   * This method will be called from the thread spawned for the output. This
+   * method should only exit after all data are read from the source or the
+   * process is exiting
+   *
+   * @throws Exception
+   */
+  abstract void start() throws Exception;
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+    tail = getBooleanValue("tail", tail);
+    useEventMD5 = getBooleanValue("use_event_md5_as_id", useEventMD5);
+    genEventMD5 = getBooleanValue("gen_event_md5", genEventMD5);
+
+    if (firstFilter != null) {
+      firstFilter.init();
+    }
+  }
+
+  @Override
+  public String getNameForThread() {
+    if (filePath != null) {
+      try {
+        return (type + "=" + (new File(filePath)).getName());
+      } catch (Throwable ex) {
+        logger.warn("Couldn't get basename for filePath=" + filePath,
+          ex);
+      }
+    }
+    return super.getNameForThread() + ":" + type;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see java.lang.Runnable#run()
+   */
+  @Override
+  public void run() {
+    try {
+      logger.info("Started to monitor. " + getShortDescription());
+      start();
+    } catch (Exception e) {
+      logger.error("Error writing to output.", e);
+    }
+    logger.info("Exiting thread. " + getShortDescription());
+  }
+
+  public void outputLine(String line, InputMarker marker) {
+    statMetric.count++;
+    readBytesMetric.count += (line.length());
+
+    if (firstFilter != null) {
+      firstFilter.apply(line, marker);
+    } else {
+      // TODO: For now, let's make filter mandatory, so that no one
+      // accidently forgets to write filter
+      // outputMgr.write(line, this);
+    }
+  }
+
+  /**
+   *
+   */
+  public void flush() {
+    if (firstFilter != null) {
+      firstFilter.flush();
+    }
+  }
+
+  public boolean monitor() {
+    if (isReady()) {
+      logger.info("Starting thread. " + getShortDescription());
+      thread = new Thread(this, getNameForThread());
+      thread.start();
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  public void checkIn(InputMarker inputMarker) {
+    // Default implementation is to ignore.
+  }
+
+  /**
+   * This is generally used by final checkin
+   */
+  public void checkIn() {
+
+  }
+
+  /**
+   * @return
+   */
+  public boolean isReady() {
+    return true;
+  }
+
+  public boolean isTail() {
+    return tail;
+  }
+
+  public void setTail(boolean tail) {
+    this.tail = tail;
+  }
+
+  public boolean isUseEventMD5() {
+    return useEventMD5;
+  }
+
+  public void setUseEventMD5(boolean useEventMD5) {
+    this.useEventMD5 = useEventMD5;
+  }
+
+  public boolean isGenEventMD5() {
+    return genEventMD5;
+  }
+
+  public void setGenEventMD5(boolean genEventMD5) {
+    this.genEventMD5 = genEventMD5;
+  }
+
+  @Override
+  public void setDrain(boolean drain) {
+    logger.info("Request to drain. " + getShortDescription());
+    super.setDrain(drain);
+    ;
+    try {
+      thread.interrupt();
+    } catch (Throwable t) {
+      // ignore
+    }
+  }
+
+  public Filter getFirstFilter() {
+    return firstFilter;
+  }
+
+  public void setFirstFilter(Filter filter) {
+    firstFilter = filter;
+  }
+
+  public void setInputMgr(InputMgr inputMgr) {
+    this.inputMgr = inputMgr;
+  }
+
+  public void setOutputMgr(OutputMgr outputMgr) {
+    this.outputMgr = outputMgr;
+  }
+
+  public String getFilePath() {
+    return filePath;
+  }
+
+  public void setFilePath(String filePath) {
+    this.filePath = filePath;
+  }
+
+  public void close() {
+    logger.info("Close called. " + getShortDescription());
+
+    try {
+      if (firstFilter != null) {
+        firstFilter.close();
+      } else {
+        outputMgr.close();
+      }
+    } catch (Throwable t) {
+      // Ignore
+    }
+    isClosed = true;
+  }
+
+  public void setClosed(boolean isClosed) {
+    this.isClosed = isClosed;
+  }
+
+  public boolean isClosed() {
+    return isClosed;
+  }
+
+  @Override
+  public void loadConfig(Map<String, Object> map) {
+    super.loadConfig(map);
+    String typeValue = getStringValue("type");
+    if (typeValue != null) {
+      // Explicitly add type and value to field list
+      contextFields.put("type", typeValue);
+      @SuppressWarnings("unchecked")
+      Map<String, Object> addFields = (Map<String, Object>) map
+        .get("add_fields");
+      if (addFields == null) {
+        addFields = new HashMap<String, Object>();
+        map.put("add_fields", addFields);
+      }
+      addFields.put("type", typeValue);
+    }
+  }
+
+  @Override
+  public String getShortDescription() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public void logStat() {
+    super.logStat();
+    logStatForMetric(readBytesMetric, "Stat: Bytes Read");
+
+    if (firstFilter != null) {
+      firstFilter.logStat();
+    }
+  }
+
+  @Override
+  public String toString() {
+    return getShortDescription();
+  }
+
+  /**
+   *
+   */
+  public void rollOver() {
+    // Only some inputs support it. E.g. InputFile
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public void setType(String type) {
+    this.type = type;
+  }
+
+  public Date getEventTime() {
+    return null;
+  }
+
+  public List<Output> getOutputList() {
+    return outputList;
+  }
+
+  /**
+   * @param output
+   */
+  public void addOutput(Output output) {
+    outputList.add(output);
+  }
+
+  /**
+   * @param metricsList
+   */
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    super.addMetricsContainers(metricsList);
+    if (firstFilter != null) {
+      firstFilter.addMetricsContainers(metricsList);
+    }
+    metricsList.add(readBytesMetric);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
new file mode 100644
index 0000000..420610a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
@@ -0,0 +1,562 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.input;
+
+import java.io.BufferedReader;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.input.reader.LogsearchReaderFactory;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.solr.common.util.Base64;
+
+public class InputFile extends Input {
+  static private Logger logger = Logger.getLogger(InputFile.class);
+
+  // String startPosition = "beginning";
+  String logPath = null;
+  boolean isStartFromBegining = true;
+
+  boolean isReady = false;
+  File[] logPathFiles = null;
+  Object fileKey = null;
+  String base64FileKey = null;
+
+  private boolean isRolledOver = false;
+  boolean addWildCard = false;
+
+  long lastCheckPointTimeMS = 0;
+  int checkPointIntervalMS = 5 * 1000; // 5 seconds
+  RandomAccessFile checkPointWriter = null;
+  Map<String, Object> jsonCheckPoint = null;
+
+  File checkPointFile = null;
+
+  private InputMarker lastCheckPointInputMarker = null;
+
+  private String checkPointExtension = ".cp";
+
+  @Override
+  public void init() throws Exception {
+    logger.info("init() called");
+    statMetric.metricsName = "input.files.read_lines";
+    readBytesMetric.metricsName = "input.files.read_bytes";
+    checkPointExtension = LogFeederUtil.getStringProperty(
+      "logfeeder.checkpoint.extension", checkPointExtension);
+
+    // Let's close the file and set it to true after we start monitoring it
+    setClosed(true);
+    logPath = getStringValue("path");
+    tail = getBooleanValue("tail", tail);
+    addWildCard = getBooleanValue("add_wild_card", addWildCard);
+    checkPointIntervalMS = getIntValue("checkpoint.interval.ms",
+      checkPointIntervalMS);
+
+    if (logPath == null || logPath.isEmpty()) {
+      logger.error("path is empty for file input. "
+        + getShortDescription());
+      return;
+    }
+
+    String startPosition = getStringValue("start_position");
+    if (StringUtils.isEmpty(startPosition)
+      || startPosition.equalsIgnoreCase("beginning")
+      || startPosition.equalsIgnoreCase("begining")) {
+      isStartFromBegining = true;
+    }
+
+    if (!tail) {
+      // start position end doesn't apply if we are not tailing
+      isStartFromBegining = true;
+    }
+
+    setFilePath(logPath);
+    boolean isFileReady = isReady();
+
+    logger.info("File to monitor " + logPath + ", tail=" + tail
+      + ", addWildCard=" + addWildCard + ", isReady=" + isFileReady);
+
+    super.init();
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.input.Input#isReady()
+   */
+  @Override
+  public boolean isReady() {
+    if (!isReady) {
+      // Let's try to check whether the file is available
+      logPathFiles = getActualFiles(logPath);
+      if (logPathFiles != null && logPathFiles.length > 0
+        && logPathFiles[0].isFile()) {
+
+        if (isTail() && logPathFiles.length > 1) {
+          logger.warn("Found multiple files (" + logPathFiles.length
+            + ") for the file filter " + filePath
+            + ". Will use only the first one. Using "
+            + logPathFiles[0].getAbsolutePath());
+        }
+        logger.info("File filter " + filePath + " expanded to "
+          + logPathFiles[0].getAbsolutePath());
+        isReady = true;
+      } else {
+        logger.debug(logPath + " file doesn't exist. Ignoring for now");
+      }
+    }
+    return isReady;
+  }
+
+  private File[] getActualFiles(String searchPath) {
+    if (addWildCard) {
+      if (!searchPath.endsWith("*")) {
+        searchPath = searchPath + "*";
+      }
+    }
+    File checkFile = new File(searchPath);
+    if (checkFile.isFile()) {
+      return new File[]{checkFile};
+    }
+    // Let's do wild card search
+    // First check current folder
+    File checkFiles[] = findFileForWildCard(searchPath, new File("."));
+    if (checkFiles == null || checkFiles.length == 0) {
+      // Let's check from the parent folder
+      File parentDir = (new File(searchPath)).getParentFile();
+      if (parentDir != null) {
+        String wildCard = (new File(searchPath)).getName();
+        checkFiles = findFileForWildCard(wildCard, parentDir);
+      }
+    }
+    return checkFiles;
+  }
+
+  private File[] findFileForWildCard(String searchPath, File dir) {
+    logger.debug("findFileForWildCard(). filePath=" + searchPath + ", dir="
+      + dir + ", dir.fullpath=" + dir.getAbsolutePath());
+    FileFilter fileFilter = new WildcardFileFilter(searchPath);
+    return dir.listFiles(fileFilter);
+  }
+
+  @Override
+  synchronized public void checkIn(InputMarker inputMarker) {
+    super.checkIn(inputMarker);
+    if (checkPointWriter != null) {
+      try {
+        int lineNumber = LogFeederUtil.objectToInt(
+          jsonCheckPoint.get("line_number"), 0, "line_number");
+        if (lineNumber > inputMarker.lineNumber) {
+          // Already wrote higher line number for this input
+          return;
+        }
+        // If interval is greater than last checkPoint time, then write
+        long currMS = System.currentTimeMillis();
+        if (!isClosed()
+          && (currMS - lastCheckPointTimeMS) < checkPointIntervalMS) {
+          // Let's save this one so we can update the check point file
+          // on flush
+          lastCheckPointInputMarker = inputMarker;
+          return;
+        }
+        lastCheckPointTimeMS = currMS;
+
+        jsonCheckPoint.put("line_number", ""
+          + new Integer(inputMarker.lineNumber));
+        jsonCheckPoint.put("last_write_time_ms", "" + new Long(currMS));
+        jsonCheckPoint.put("last_write_time_date", new Date());
+
+        String jsonStr = LogFeederUtil.getGson().toJson(jsonCheckPoint);
+
+        // Let's rewind
+        checkPointWriter.seek(0);
+        checkPointWriter.writeInt(jsonStr.length());
+        checkPointWriter.write(jsonStr.getBytes());
+
+        if (isClosed()) {
+          final String LOG_MESSAGE_KEY = this.getClass()
+            .getSimpleName() + "_FINAL_CHECKIN";
+          LogFeederUtil.logErrorMessageByInterval(
+            LOG_MESSAGE_KEY,
+            "Wrote final checkPoint, input="
+              + getShortDescription()
+              + ", checkPointFile="
+              + checkPointFile.getAbsolutePath()
+              + ", checkPoint=" + jsonStr, null, logger,
+            Level.INFO);
+        }
+      } catch (Throwable t) {
+        final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+          + "_CHECKIN_EXCEPTION";
+        LogFeederUtil
+          .logErrorMessageByInterval(LOG_MESSAGE_KEY,
+            "Caught exception checkIn. , input="
+              + getShortDescription(), t, logger,
+            Level.ERROR);
+      }
+    }
+
+  }
+
+  @Override
+  public void checkIn() {
+    super.checkIn();
+    if (lastCheckPointInputMarker != null) {
+      checkIn(lastCheckPointInputMarker);
+    }
+  }
+
+  @Override
+  public void rollOver() {
+    logger.info("Marking this input file for rollover. "
+      + getShortDescription());
+    isRolledOver = true;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.input.Input#monitor()
+   */
+  @Override
+  void start() throws Exception {
+    if (logPathFiles == null || logPathFiles.length == 0) {
+      return;
+    }
+
+    if (isTail()) {
+      // Just process the first file
+      processFile(logPathFiles[0]);
+    } else {
+      for (File file : logPathFiles) {
+        try {
+          processFile(file);
+          if (isClosed() || isDrain()) {
+            logger.info("isClosed or isDrain. Now breaking loop.");
+            break;
+          }
+        } catch (Throwable t) {
+          logger.error(
+            "Error processing file=" + file.getAbsolutePath(),
+            t);
+        }
+      }
+    }
+    // Call the close for the input. Which should flush to the filters and
+    // output
+    close();
+  }
+
+  @Override
+  public void close() {
+    super.close();
+    logger.info("close() calling checkPoint checkIn(). "
+      + getShortDescription());
+    checkIn();
+  }
+
+  private void processFile(File logPathFile) throws FileNotFoundException,
+    IOException {
+    logger.info("Monitoring logPath=" + logPath + ", logPathFile="
+      + logPathFile);
+    BufferedReader br = null;
+    checkPointFile = null;
+    checkPointWriter = null;
+    jsonCheckPoint = null;
+    int resumeFromLineNumber = 0;
+
+    int lineCount = 0;
+    try {
+      setFilePath(logPathFile.getAbsolutePath());
+//      br = new BufferedReader(new FileReader(logPathFile));
+      br = new BufferedReader(LogsearchReaderFactory.INSTANCE.getReader(logPathFile));
+
+      // Whether to send to output from the beginning.
+      boolean resume = isStartFromBegining;
+
+      // Seems FileWatch is not reliable, so let's only use file key
+      // comparison
+      // inputMgr.monitorSystemFileChanges(this);
+      fileKey = getFileKey(logPathFile);
+      base64FileKey = Base64.byteArrayToBase64(fileKey.toString()
+        .getBytes());
+      logger.info("fileKey=" + fileKey + ", base64=" + base64FileKey
+        + ". " + getShortDescription());
+
+      if (isTail()) {
+        try {
+          // Let's see if there is a checkpoint for this file
+          logger.info("Checking existing checkpoint file. "
+            + getShortDescription());
+
+          String fileBase64 = Base64.byteArrayToBase64(fileKey
+            .toString().getBytes());
+          String checkPointFileName = fileBase64
+            + checkPointExtension;
+          File checkPointFolder = inputMgr.getCheckPointFolderFile();
+          checkPointFile = new File(checkPointFolder,
+            checkPointFileName);
+          checkPointWriter = new RandomAccessFile(checkPointFile,
+            "rw");
+
+          try {
+            int contentSize = checkPointWriter.readInt();
+            byte b[] = new byte[contentSize];
+            int readSize = checkPointWriter.read(b, 0, contentSize);
+            if (readSize != contentSize) {
+              logger.error("Couldn't read expected number of bytes from checkpoint file. expected="
+                + contentSize
+                + ", read="
+                + readSize
+                + ", checkPointFile="
+                + checkPointFile
+                + ", input=" + getShortDescription());
+            } else {
+              // Create JSON string
+              String jsonCheckPointStr = new String(b, 0,
+                readSize);
+              jsonCheckPoint = LogFeederUtil
+                .toJSONObject(jsonCheckPointStr);
+
+              resumeFromLineNumber = LogFeederUtil.objectToInt(
+                jsonCheckPoint.get("line_number"), 0,
+                "line_number");
+
+              if (resumeFromLineNumber > 0) {
+                // Let's read from last line read
+                resume = false;
+              }
+              logger.info("CheckPoint. checkPointFile="
+                + checkPointFile + ", json="
+                + jsonCheckPointStr
+                + ", resumeFromLineNumber="
+                + resumeFromLineNumber + ", resume="
+                + resume);
+            }
+          } catch (EOFException eofEx) {
+            logger.info("EOFException. Will reset checkpoint file "
+              + checkPointFile.getAbsolutePath() + " for "
+              + getShortDescription());
+          }
+          if (jsonCheckPoint == null) {
+            // This seems to be first time, so creating the initial
+            // checkPoint object
+            jsonCheckPoint = new HashMap<String, Object>();
+            jsonCheckPoint.put("file_path", filePath);
+            jsonCheckPoint.put("file_key", fileBase64);
+          }
+
+        } catch (Throwable t) {
+          logger.error(
+            "Error while configuring checkpoint file. Will reset file. checkPointFile="
+              + checkPointFile, t);
+        }
+      }
+
+      setClosed(false);
+      int sleepStep = 2;
+      int sleepIteration = 0;
+      while (true) {
+        try {
+          if (isDrain()) {
+            break;
+          }
+
+          String line = br.readLine();
+          if (line == null) {
+            if (!resume) {
+              resume = true;
+            }
+            sleepIteration++;
+            try {
+              // Since FileWatch service is not reliable, we will
+              // check
+              // file inode every n seconds after no write
+              if (sleepIteration > 4) {
+                Object newFileKey = getFileKey(logPathFile);
+                if (newFileKey != null) {
+                  if (fileKey == null
+                    || !newFileKey.equals(fileKey)) {
+                    logger.info("File key is different. Calling rollover. oldKey="
+                      + fileKey
+                      + ", newKey="
+                      + newFileKey
+                      + ". "
+                      + getShortDescription());
+                    // File has rotated.
+                    rollOver();
+                  }
+                }
+              }
+              // Flush on the second iteration
+              if (!tail && sleepIteration >= 2) {
+                logger.info("End of file. Done with filePath="
+                  + logPathFile.getAbsolutePath()
+                  + ", lineCount=" + lineCount);
+                flush();
+                break;
+              } else if (sleepIteration == 2) {
+                flush();
+              } else if (sleepIteration >= 2) {
+                if (isRolledOver) {
+                  isRolledOver = false;
+                  // Close existing file
+                  try {
+                    logger.info("File is rolled over. Closing current open file."
+                      + getShortDescription()
+                      + ", lineCount=" + lineCount);
+                    br.close();
+                  } catch (Exception ex) {
+                    logger.error("Error closing file"
+                      + getShortDescription());
+                    break;
+                  }
+                  try {
+                    // Open new file
+                    logger.info("Opening new rolled over file."
+                      + getShortDescription());
+//                    br = new BufferedReader(new FileReader(
+//                            logPathFile));
+                    br = new BufferedReader(LogsearchReaderFactory.
+                      INSTANCE.getReader(logPathFile));
+                    lineCount = 0;
+                    fileKey = getFileKey(logPathFile);
+                    base64FileKey = Base64
+                      .byteArrayToBase64(fileKey
+                        .toString().getBytes());
+                    logger.info("fileKey=" + fileKey
+                      + ", base64=" + base64FileKey
+                      + ", " + getShortDescription());
+                  } catch (Exception ex) {
+                    logger.error("Error opening rolled over file. "
+                      + getShortDescription());
+                    // Let's add this to monitoring and exit
+                    // this
+                    // thread
+                    logger.info("Added input to not ready list."
+                      + getShortDescription());
+                    isReady = false;
+                    inputMgr.addToNotReady(this);
+                    break;
+                  }
+                  logger.info("File is successfully rolled over. "
+                    + getShortDescription());
+                  continue;
+                }
+              }
+              Thread.sleep(sleepStep * 1000);
+              sleepStep = (sleepStep * 2);
+              sleepStep = sleepStep > 10 ? 10 : sleepStep;
+            } catch (InterruptedException e) {
+              logger.info("Thread interrupted."
+                + getShortDescription());
+            }
+          } else {
+            lineCount++;
+            sleepStep = 1;
+            sleepIteration = 0;
+
+            if (!resume && lineCount > resumeFromLineNumber) {
+              logger.info("Resuming to read from last line. lineCount="
+                + lineCount
+                + ", input="
+                + getShortDescription());
+              resume = true;
+            }
+            if (resume) {
+              InputMarker marker = new InputMarker();
+              marker.fileKey = fileKey;
+              marker.base64FileKey = base64FileKey;
+              marker.filePath = filePath;
+              marker.input = this;
+              marker.lineNumber = lineCount;
+              outputLine(line, marker);
+            }
+          }
+        } catch (Throwable t) {
+          final String LOG_MESSAGE_KEY = this.getClass()
+            .getSimpleName() + "_READ_LOOP_EXCEPTION";
+          LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+            "Caught exception in read loop. lineNumber="
+              + lineCount + ", input="
+              + getShortDescription(), t, logger,
+            Level.ERROR);
+
+        }
+      }
+    } finally {
+      if (br != null) {
+        logger.info("Closing reader." + getShortDescription()
+          + ", lineCount=" + lineCount);
+        try {
+          br.close();
+        } catch (Throwable t) {
+          // ignore
+        }
+      }
+    }
+  }
+
+  /**
+   * @param logPathFile2
+   * @return
+   */
+  static public Object getFileKey(File file) {
+    try {
+      Path fileFullPath = Paths.get(file.getAbsolutePath());
+      if (fileFullPath != null) {
+        BasicFileAttributes basicAttr = Files.readAttributes(
+          fileFullPath, BasicFileAttributes.class);
+        return basicAttr.fileKey();
+      }
+    } catch (Throwable ex) {
+      logger.error("Error getting file attributes for file=" + file, ex);
+    }
+    return file.toString();
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.ambari.logfeeder.input.Input#getShortDescription()
+   */
+  @Override
+  public String getShortDescription() {
+    return "input:source="
+      + getStringValue("source")
+      + ", path="
+      + (logPathFiles != null && logPathFiles.length > 0 ? logPathFiles[0]
+      .getAbsolutePath() : getStringValue("path"));
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputMarker.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputMarker.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputMarker.java
new file mode 100644
index 0000000..6196068
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputMarker.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.input;
+
+/**
+ * This file contains the file inode, line number of the log currently been read
+ */
+public class InputMarker {
+  public int lineNumber = 0;
+  public int beginLineNumber = 0;
+  public Input input;
+  public String filePath;
+  public Object fileKey = null;
+  public String base64FileKey = null;
+
+  @Override
+  public String toString() {
+    return "InputMarker [lineNumber=" + lineNumber + ", input="
+      + input.getShortDescription() + "]";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
new file mode 100644
index 0000000..9c46c4e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.input.reader;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.zip.GZIPInputStream;
+
+import org.apache.log4j.Logger;
+
+public class GZIPReader extends InputStreamReader {
+
+  private static Logger logger = Logger.getLogger(GZIPReader.class);
+
+  public GZIPReader(String fileName) throws FileNotFoundException {
+    super(getStream(fileName));
+    logger.info("Created GZIPReader for file : " + fileName);
+  }
+
+  public GZIPReader(File file) throws FileNotFoundException {
+    super(getStream(file.getName()));
+  }
+
+  private static InputStream getStream(String fileName) {
+    InputStream gzipStream = null;
+    InputStream fileStream = null;
+    try {
+      fileStream = new FileInputStream(fileName);
+      gzipStream = new GZIPInputStream(fileStream);
+    } catch (Exception e) {
+      logger.error(e, e.getCause());
+    }
+    return gzipStream;
+  }
+
+  /**
+   * validating file based on magic number
+   *
+   * @param fileName
+   * @return
+   */
+  public static boolean isValidFile(String fileName) {
+    // TODO make it generic and put in factory itself
+    InputStream is = null;
+    try {
+      is = new FileInputStream(fileName);
+      byte[] signature = new byte[2];
+      int nread = is.read(signature); // read the gzip signature
+      return nread == 2 && signature[0] == (byte) 0x1f && signature[1] == (byte) 0x8b;
+    } catch (IOException e) {
+      return false;
+    } finally {
+      if (is != null) {
+        try {
+          is.close();
+        } catch (IOException e) {
+        }
+      }
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/LogsearchReaderFactory.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/LogsearchReaderFactory.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/LogsearchReaderFactory.java
new file mode 100644
index 0000000..a231807
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/LogsearchReaderFactory.java
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.input.reader;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.Reader;
+
+import org.apache.log4j.Logger;
+
+public enum LogsearchReaderFactory {
+  INSTANCE;
+  private static Logger logger = Logger
+    .getLogger(LogsearchReaderFactory.class);
+
+  /**
+   * @param fileName
+   * @return
+   * @throws FileNotFoundException
+   */
+  public Reader getReader(File file) throws FileNotFoundException {
+    logger.debug("Inside reader factory for file:" + file);
+    if (GZIPReader.isValidFile(file.getAbsolutePath())) {
+      logger.info("Reading file " + file + " as gzip file");
+      return new GZIPReader(file.getAbsolutePath());
+    } else {
+      return new FileReader(file);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
new file mode 100644
index 0000000..fc12458
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.logconfig;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.util.SolrUtil;
+import org.apache.ambari.logfeeder.view.VLogfeederFilter;
+import org.apache.ambari.logfeeder.view.VLogfeederFilterWrapper;
+import org.apache.log4j.Logger;
+
+public class FetchConfigFromSolr extends Thread {
+  private static Logger logger = Logger.getLogger(FetchConfigFromSolr.class);
+  private static VLogfeederFilterWrapper logfeederFilterWrapper = null;
+  private static int solrConfigInterval = 5;// 5 sec;
+  private static long delay;
+  private static String endTimeDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";//2016-04-05T04:30:00.000Z
+  private static String sysTimeZone = "GMT";
+
+  public FetchConfigFromSolr() {
+    this.setName(this.getClass().getSimpleName());
+  }
+
+  @Override
+  public void run() {
+    solrConfigInterval = LogFeederUtil.getIntProperty("logfeeder.solr.config.internal", solrConfigInterval);
+    delay = 1000 * solrConfigInterval;
+    do {
+      logger.debug("Updating config from solr after every " + solrConfigInterval + " sec.");
+      pullConfigFromSolr();
+      try {
+        Thread.sleep(delay);
+      } catch (InterruptedException e) {
+        logger.error(e.getLocalizedMessage(), e.getCause());
+      }
+    } while (true);
+  }
+
+  private synchronized void pullConfigFromSolr() {
+    HashMap<String, Object> configDocMap = SolrUtil.getInstance().getConfigDoc();
+    if (configDocMap != null) {
+      String configJson = (String) configDocMap.get(LogFeederConstants.VALUES);
+      if (configJson != null) {
+        logfeederFilterWrapper = LogFeederUtil.getGson().fromJson(configJson, VLogfeederFilterWrapper.class);
+      }
+    }
+  }
+
+  public static boolean isFilterExpired(VLogfeederFilter logfeederFilter) {
+    boolean isFilterExpired = false;// default is false
+    if (logfeederFilter != null) {
+      Date filterEndDate = parseFilterExpireDate(logfeederFilter);
+      if (filterEndDate != null) {
+        Date currentDate = getCurrentDate();
+        if (currentDate.compareTo(filterEndDate) >= 0) {
+          logger.debug("Filter for  Component :" + logfeederFilter.getLabel() + " and Hosts :"
+            + listToStr(logfeederFilter.getHosts()) + "Filter is expired because of filter endTime : "
+            + dateToStr(filterEndDate) + " is older than currentTime :" + dateToStr(currentDate));
+          isFilterExpired = true;
+        }
+      }
+    }
+    return isFilterExpired;
+  }
+
+  public static String dateToStr(Date date) {
+    if (date == null) {
+      return "";
+    }
+    SimpleDateFormat formatter = new SimpleDateFormat(endTimeDateFormat);
+    TimeZone timeZone = TimeZone.getTimeZone(sysTimeZone);
+    formatter.setTimeZone(timeZone);
+    return formatter.format(date);
+  }
+
+  public static Date parseFilterExpireDate(VLogfeederFilter vLogfeederFilter) {
+    String expiryTime = vLogfeederFilter.getExpiryTime();
+    if (expiryTime != null && !expiryTime.isEmpty()) {
+      SimpleDateFormat formatter = new SimpleDateFormat(endTimeDateFormat);
+      TimeZone timeZone = TimeZone.getTimeZone(sysTimeZone);
+      formatter.setTimeZone(timeZone);
+      try {
+        return formatter.parse(expiryTime);
+      } catch (ParseException e) {
+        logger.error("Filter have invalid ExpiryTime : " + expiryTime + " for component :" + vLogfeederFilter.getLabel()
+          + " and hosts :" + listToStr(vLogfeederFilter.getHosts()));
+      }
+    }
+    return null;
+  }
+
+  public static List<String> getAllowedLevels(String hostName, VLogfeederFilter componentFilter) {
+    String componentName = componentFilter.getLabel();
+    List<String> hosts = componentFilter.getHosts();
+    List<String> defaultLevels = componentFilter.getDefaultLevels();
+    List<String> overrideLevels = componentFilter.getOverrideLevels();
+    if (LogFeederUtil.isListContains(hosts, hostName, false)) {
+      if (isFilterExpired(componentFilter)) {
+        // pick default
+        logger.debug("Filter for component " + componentName + " and host :" + hostName + " is expired at "
+          + componentFilter.getExpiryTime());
+        return defaultLevels;
+      } else {
+        // return tmp filter levels
+        return overrideLevels;
+      }
+    } else {
+      return defaultLevels;
+    }
+  }
+
+  public static VLogfeederFilter findComponentFilter(String componentName) {
+    if (logfeederFilterWrapper != null) {
+      HashMap<String, VLogfeederFilter> filter = logfeederFilterWrapper.getFilter();
+      if (filter != null) {
+        VLogfeederFilter componentFilter = filter.get(componentName);
+        if (componentFilter != null) {
+          return componentFilter;
+        }
+      }
+    }
+    logger.trace("Filter is not there for component :" + componentName);
+    return null;
+  }
+
+
+  public static Date getCurrentDate() {
+    TimeZone.setDefault(TimeZone.getTimeZone(sysTimeZone));
+    Date date = new Date();
+    return date;
+  }
+
+  public static String listToStr(List<String> strList) {
+    StringBuilder out = new StringBuilder("[");
+    if (strList != null) {
+      int counter = 0;
+      for (Object o : strList) {
+        if (counter > 0) {
+          out.append(",");
+        }
+        out.append(o.toString());
+        counter++;
+      }
+    }
+    out.append("]");
+    return out.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogFeederConstants.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogFeederConstants.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogFeederConstants.java
new file mode 100644
index 0000000..f61dc1b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogFeederConstants.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.logconfig;
+
+public class LogFeederConstants {
+
+  public static final String ALL = "all";
+  public static final String NAME = "log_feeder_config";
+  // solr fields
+  public static final String SOLR_LEVEL = "level";
+  public static final String SOLR_COMPONENT = "type";
+  public static final String SOLR_HOST = "host";
+
+  //
+  // UserConfig Constants History
+  public static final String ID = "id";
+  public static final String USER_NAME = "username";
+  public static final String VALUES = "jsons";
+  public static final String FILTER_NAME = "filtername";
+  public static final String ROW_TYPE = "rowtype";
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogfeederScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogfeederScheduler.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogfeederScheduler.java
new file mode 100644
index 0000000..7525dff
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/LogfeederScheduler.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.logconfig;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.log4j.Logger;
+
+public enum LogfeederScheduler {
+
+  INSTANCE;
+
+  private Logger logger = Logger.getLogger(LogfeederScheduler.class);
+
+  private static boolean running = false;
+
+  public synchronized void start() {
+    boolean filterEnable = LogFeederUtil.getBooleanProperty("logfeeder.log.filter.enable", false);
+    if (!filterEnable) {
+      logger.info("Logfeeder  filter Scheduler is disabled.");
+      return;
+    }
+    if (!running) {
+      for (Thread thread : getThreadList()) {
+        thread.start();
+      }
+      running = true;
+      logger.info("Logfeeder Scheduler started!");
+    } else {
+      logger.warn("Logfeeder Scheduler is already running.");
+    }
+  }
+
+  private List<Thread> getThreadList() {
+    List<Thread> tasks = new ArrayList<Thread>();
+    tasks.add(new FetchConfigFromSolr());
+    return tasks;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
new file mode 100644
index 0000000..3748445
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.logconfig.filter;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.logconfig.FetchConfigFromSolr;
+import org.apache.ambari.logfeeder.logconfig.LogFeederConstants;
+import org.apache.ambari.logfeeder.view.VLogfeederFilter;
+import org.apache.log4j.Logger;
+
+public class ApplyLogFilter extends DefaultDataFilter {
+
+  private static Logger logger = Logger.getLogger(ApplyLogFilter.class);
+
+  @Override
+  public boolean applyFilter(Map<String, Object> jsonObj, boolean defaultValue) {
+    if (isEmpty(jsonObj)) {
+      logger.warn("Output jsonobj is empty");
+      return defaultValue;
+    }
+    String hostName = (String) jsonObj.get(LogFeederConstants.SOLR_HOST);
+    if (isNotEmpty(hostName)) {
+      String componentName = (String) jsonObj.get(LogFeederConstants.SOLR_COMPONENT);
+      if (isNotEmpty(componentName)) {
+        String level = (String) jsonObj.get(LogFeederConstants.SOLR_LEVEL);
+        if (isNotEmpty(level)) {
+          // find component filter
+          VLogfeederFilter componentFilter = FetchConfigFromSolr.findComponentFilter(componentName);
+          if (componentFilter == null) {
+            //return default value if there is no filter found for particular component
+            return defaultValue;
+          }
+          List<String> allowedLevels = FetchConfigFromSolr.getAllowedLevels(hostName, componentFilter);
+          return LogFeederUtil.isListContains(allowedLevels, level, false);
+        }
+      }
+    }
+    return defaultValue;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
new file mode 100644
index 0000000..9e98c6a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder.logconfig.filter;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Default filter to allow everything
+ */
+public class DefaultDataFilter {
+  private static Logger logger = Logger.getLogger(DefaultDataFilter.class);
+
+  protected static final boolean CASE_SENSITIVE = false;
+
+  public boolean applyFilter(Map<String, Object> outputJsonObj, boolean defaultValue) {
+    return defaultValue;
+  }
+
+  public boolean isEmpty(Map<String, Object> map) {
+    if (map == null || map.isEmpty()) {
+      return true;
+    }
+    return false;
+  }
+
+  public boolean isEmpty(String str) {
+    if (str == null || str.trim().isEmpty()) {
+      return true;
+    }
+    return false;
+  }
+
+  public boolean isNotEmpty(String str) {
+    return !isEmpty(str);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/FilterLogData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/FilterLogData.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/FilterLogData.java
new file mode 100644
index 0000000..643df98
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/FilterLogData.java
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.logconfig.filter;
+
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.logconfig.filter.ApplyLogFilter;
+import org.apache.log4j.Logger;
+
+/**
+ * Read configuration from solr and filter the log
+ */
+public enum FilterLogData {
+  INSTANCE;
+  private ApplyLogFilter applyLogFilter = new ApplyLogFilter();
+  private static Logger logger = Logger.getLogger(FilterLogData.class);
+  // by default allow every log
+  boolean defaultValue = true;
+
+  public boolean isAllowed(String jsonBlock) {
+    if (jsonBlock == null || jsonBlock.isEmpty()) {
+      return defaultValue;
+    }
+    Map<String, Object> jsonObj = LogFeederUtil.toJSONObject(jsonBlock);
+    return applyLogFilter.applyFilter(jsonObj, defaultValue);
+  }
+
+  public boolean isAllowed(Map<String, Object> jsonObj) {
+    boolean isAllowed = applyLogFilter.applyFilter(jsonObj, defaultValue);
+    if (!isAllowed) {
+      logger.trace("Filter block the content :" + LogFeederUtil.getGson().toJson(jsonObj));
+    }
+    return isAllowed;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
new file mode 100644
index 0000000..5b89d4b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.mapper;
+
+import java.util.Map;
+
+public abstract class Mapper {
+  String inputDesc;
+  String fieldName;
+  String mapClassCode;
+
+  @SuppressWarnings("hiding")
+  public boolean init(String inputDesc, String fieldName,
+                      String mapClassCode, Object mapConfigs) {
+    this.inputDesc = inputDesc;
+    this.fieldName = fieldName;
+    this.mapClassCode = mapClassCode;
+    return true;
+  }
+
+  /**
+   * @param value
+   * @return
+   */
+  public Object apply(Map<String, Object> jsonObj, Object value) {
+    return value;
+  }
+
+  @Override
+  public String toString() {
+    return "mapClass=" + mapClassCode + ", input=" + inputDesc
+      + ", fieldName=" + fieldName;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
new file mode 100644
index 0000000..107e7e4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.mapper;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+public class MapperDate extends Mapper {
+  Logger logger = Logger.getLogger(MapperDate.class);
+
+  String dateFormat = null;
+  SimpleDateFormat dateFormatter = null;
+  boolean isEpoch = false;
+
+  @SuppressWarnings("hiding")
+  @Override
+  public boolean init(String inputDesc, String fieldName,
+                      String mapClassCode, Object mapConfigs) {
+    super.init(inputDesc, fieldName, mapClassCode, mapConfigs);
+    if (!(mapConfigs instanceof Map)) {
+      logger.fatal("Can't initialize object. mapConfigs class is not of type Map. "
+        + mapConfigs.getClass().getName()
+        + ", map="
+        + this.toString());
+      return false;
+    }
+    @SuppressWarnings("unchecked")
+    Map<String, Object> mapObjects = (Map<String, Object>) mapConfigs;
+    dateFormat = (String) mapObjects.get("date_pattern");
+    if (StringUtils.isEmpty(dateFormat)) {
+      logger.fatal("Date format for map is empty. " + this.toString());
+    } else {
+      logger.info("Date mapper format is " + dateFormat);
+
+      if (dateFormat.equalsIgnoreCase("epoch")) {
+        isEpoch = true;
+        return true;
+      } else {
+        try {
+          dateFormatter = new SimpleDateFormat(dateFormat);
+          return true;
+        } catch (Throwable ex) {
+          logger.fatal("Error creating date format. format="
+            + dateFormat + ". " + this.toString());
+        }
+      }
+    }
+    return false;
+  }
+
+  @Override
+  public Object apply(Map<String, Object> jsonObj, Object value) {
+    if (value != null) {
+      try {
+        if (isEpoch) {
+          // First convert to long
+          long ms = Long.parseLong(value.toString()) * 1000;
+          value = new Date(ms);
+        } else if (dateFormatter != null) {
+          value = dateFormatter.parse(value.toString());
+        } else {
+          return value;
+        }
+        jsonObj.put(fieldName, value);
+      } catch (Throwable t) {
+        LogFeederUtil.logErrorMessageByInterval(this.getClass()
+            .getSimpleName() + ":apply",
+          "Error applying date transformation. isEpoch="
+            + isEpoch + ", dateFormat=" + dateFormat
+            + ", value=" + value + ". " + this.toString(),
+          t, logger, Level.ERROR);
+      }
+    }
+    return value;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
new file mode 100644
index 0000000..99c33ed
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
@@ -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.
+ */
+
+package org.apache.ambari.logfeeder.mapper;
+
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * Overrides the value for the field
+ */
+public class MapperFieldName extends Mapper {
+  Logger logger = Logger.getLogger(MapperFieldName.class);
+  String newValue = null;
+
+  @SuppressWarnings("hiding")
+  @Override
+  public boolean init(String inputDesc, String fieldName,
+      String mapClassCode, Object mapConfigs) {
+    super.init(inputDesc, fieldName, mapClassCode, mapConfigs);
+    if (!(mapConfigs instanceof Map)) {
+      logger.fatal("Can't initialize object. mapConfigs class is not of type Map. "
+          + mapConfigs.getClass().getName());
+      return false;
+    }
+    @SuppressWarnings("unchecked")
+    Map<String, Object> mapObjects = (Map<String, Object>) mapConfigs;
+    newValue = (String) mapObjects.get("new_fieldname");
+    if (StringUtils.isEmpty(newValue)) {
+      logger.fatal("Map field value is empty.");
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public Object apply(Map<String, Object> jsonObj, Object value) {
+    if (newValue != null) {
+      // Remove the old one
+      jsonObj.remove(fieldName);
+      // Add with new key name
+      jsonObj.put(newValue, value);
+    } else {
+      LogFeederUtil.logErrorMessageByInterval(this.getClass()
+          .getSimpleName() + ":apply",
+          "New fieldName is null, so transformation is not applied. "
+              + this.toString(), null, logger, Level.ERROR);
+    }
+    return value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
new file mode 100644
index 0000000..9810ceb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.mapper;
+
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * Overrides the value for the field
+ */
+public class MapperFieldValue extends Mapper {
+  Logger logger = Logger.getLogger(MapperFieldValue.class);
+  String prevValue = null;
+  String newValue = null;
+
+  @SuppressWarnings("hiding")
+  @Override
+  public boolean init(String inputDesc, String fieldName,
+      String mapClassCode, Object mapConfigs) {
+    super.init(inputDesc, fieldName, mapClassCode, mapConfigs);
+    if (!(mapConfigs instanceof Map)) {
+      logger.fatal("Can't initialize object. mapConfigs class is not of type Map. "
+          + mapConfigs.getClass().getName());
+      return false;
+    }
+    @SuppressWarnings("unchecked")
+    Map<String, Object> mapObjects = (Map<String, Object>) mapConfigs;
+    prevValue = (String) mapObjects.get("pre_value");
+    newValue = (String) mapObjects.get("post_value");
+    if (StringUtils.isEmpty(newValue)) {
+      logger.fatal("Map field value is empty.");
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public Object apply(Map<String, Object> jsonObj, Object value) {
+    if (newValue != null) {
+      if (prevValue != null) {
+        if (prevValue.equalsIgnoreCase(value.toString())) {
+          value = newValue;
+          jsonObj.put(fieldName, value);
+        }
+      }
+    } else {
+      LogFeederUtil.logErrorMessageByInterval(
+          this.getClass().getSimpleName() + ":apply",
+          "New value is null, so transformation is not applied. "
+              + this.toString(), null, logger, Level.ERROR);
+    }
+    return value;
+  }
+
+}


[28/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone.js
new file mode 100644
index 0000000..24a550a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone.js
@@ -0,0 +1,1608 @@
+//     Backbone.js 1.1.2
+
+//     (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Backbone may be freely distributed under the MIT license.
+//     For all details and documentation:
+//     http://backbonejs.org
+
+(function(root, factory) {
+
+  // Set up Backbone appropriately for the environment. Start with AMD.
+  if (typeof define === 'function' && define.amd) {
+    define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
+      // Export global even in AMD case in case this script is loaded with
+      // others that may still expect a global Backbone.
+      root.Backbone = factory(root, exports, _, $);
+    });
+
+  // Next for Node.js or CommonJS. jQuery may not be needed as a module.
+  } else if (typeof exports !== 'undefined') {
+    var _ = require('underscore');
+    factory(root, exports, _);
+
+  // Finally, as a browser global.
+  } else {
+    root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
+  }
+
+}(this, function(root, Backbone, _, $) {
+
+  // Initial Setup
+  // -------------
+
+  // Save the previous value of the `Backbone` variable, so that it can be
+  // restored later on, if `noConflict` is used.
+  var previousBackbone = root.Backbone;
+
+  // Create local references to array methods we'll want to use later.
+  var array = [];
+  var push = array.push;
+  var slice = array.slice;
+  var splice = array.splice;
+
+  // Current version of the library. Keep in sync with `package.json`.
+  Backbone.VERSION = '1.1.2';
+
+  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
+  // the `$` variable.
+  Backbone.$ = $;
+
+  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
+  // to its previous owner. Returns a reference to this Backbone object.
+  Backbone.noConflict = function() {
+    root.Backbone = previousBackbone;
+    return this;
+  };
+
+  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
+  // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
+  // set a `X-Http-Method-Override` header.
+  Backbone.emulateHTTP = false;
+
+  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
+  // `application/json` requests ... will encode the body as
+  // `application/x-www-form-urlencoded` instead and will send the model in a
+  // form param named `model`.
+  Backbone.emulateJSON = false;
+
+  // Backbone.Events
+  // ---------------
+
+  // A module that can be mixed in to *any object* in order to provide it with
+  // custom events. You may bind with `on` or remove with `off` callback
+  // functions to an event; `trigger`-ing an event fires all callbacks in
+  // succession.
+  //
+  //     var object = {};
+  //     _.extend(object, Backbone.Events);
+  //     object.on('expand', function(){ alert('expanded'); });
+  //     object.trigger('expand');
+  //
+  var Events = Backbone.Events = {
+
+    // Bind an event to a `callback` function. Passing `"all"` will bind
+    // the callback to all events fired.
+    on: function(name, callback, context) {
+      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
+      this._events || (this._events = {});
+      var events = this._events[name] || (this._events[name] = []);
+      events.push({callback: callback, context: context, ctx: context || this});
+      return this;
+    },
+
+    // Bind an event to only be triggered a single time. After the first time
+    // the callback is invoked, it will be removed.
+    once: function(name, callback, context) {
+      if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
+      var self = this;
+      var once = _.once(function() {
+        self.off(name, once);
+        callback.apply(this, arguments);
+      });
+      once._callback = callback;
+      return this.on(name, once, context);
+    },
+
+    // Remove one or many callbacks. If `context` is null, removes all
+    // callbacks with that function. If `callback` is null, removes all
+    // callbacks for the event. If `name` is null, removes all bound
+    // callbacks for all events.
+    off: function(name, callback, context) {
+      var retain, ev, events, names, i, l, j, k;
+      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
+      if (!name && !callback && !context) {
+        this._events = void 0;
+        return this;
+      }
+      names = name ? [name] : _.keys(this._events);
+      for (i = 0, l = names.length; i < l; i++) {
+        name = names[i];
+        if (events = this._events[name]) {
+          this._events[name] = retain = [];
+          if (callback || context) {
+            for (j = 0, k = events.length; j < k; j++) {
+              ev = events[j];
+              if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
+                  (context && context !== ev.context)) {
+                retain.push(ev);
+              }
+            }
+          }
+          if (!retain.length) delete this._events[name];
+        }
+      }
+
+      return this;
+    },
+
+    // Trigger one or many events, firing all bound callbacks. Callbacks are
+    // passed the same arguments as `trigger` is, apart from the event name
+    // (unless you're listening on `"all"`, which will cause your callback to
+    // receive the true name of the event as the first argument).
+    trigger: function(name) {
+      if (!this._events) return this;
+      var args = slice.call(arguments, 1);
+      if (!eventsApi(this, 'trigger', name, args)) return this;
+      var events = this._events[name];
+      var allEvents = this._events.all;
+      if (events) triggerEvents(events, args);
+      if (allEvents) triggerEvents(allEvents, arguments);
+      return this;
+    },
+
+    // Tell this object to stop listening to either specific events ... or
+    // to every object it's currently listening to.
+    stopListening: function(obj, name, callback) {
+      var listeningTo = this._listeningTo;
+      if (!listeningTo) return this;
+      var remove = !name && !callback;
+      if (!callback && typeof name === 'object') callback = this;
+      if (obj) (listeningTo = {})[obj._listenId] = obj;
+      for (var id in listeningTo) {
+        obj = listeningTo[id];
+        obj.off(name, callback, this);
+        if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
+      }
+      return this;
+    }
+
+  };
+
+  // Regular expression used to split event strings.
+  var eventSplitter = /\s+/;
+
+  // Implement fancy features of the Events API such as multiple event
+  // names `"change blur"` and jQuery-style event maps `{change: action}`
+  // in terms of the existing API.
+  var eventsApi = function(obj, action, name, rest) {
+    if (!name) return true;
+
+    // Handle event maps.
+    if (typeof name === 'object') {
+      for (var key in name) {
+        obj[action].apply(obj, [key, name[key]].concat(rest));
+      }
+      return false;
+    }
+
+    // Handle space separated event names.
+    if (eventSplitter.test(name)) {
+      var names = name.split(eventSplitter);
+      for (var i = 0, l = names.length; i < l; i++) {
+        obj[action].apply(obj, [names[i]].concat(rest));
+      }
+      return false;
+    }
+
+    return true;
+  };
+
+  // A difficult-to-believe, but optimized internal dispatch function for
+  // triggering events. Tries to keep the usual cases speedy (most internal
+  // Backbone events have 3 arguments).
+  var triggerEvents = function(events, args) {
+    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
+    switch (args.length) {
+      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
+      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
+      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
+      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
+      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
+    }
+  };
+
+  var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
+
+  // Inversion-of-control versions of `on` and `once`. Tell *this* object to
+  // listen to an event in another object ... keeping track of what it's
+  // listening to.
+  _.each(listenMethods, function(implementation, method) {
+    Events[method] = function(obj, name, callback) {
+      var listeningTo = this._listeningTo || (this._listeningTo = {});
+      var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
+      listeningTo[id] = obj;
+      if (!callback && typeof name === 'object') callback = this;
+      obj[implementation](name, callback, this);
+      return this;
+    };
+  });
+
+  // Aliases for backwards compatibility.
+  Events.bind   = Events.on;
+  Events.unbind = Events.off;
+
+  // Allow the `Backbone` object to serve as a global event bus, for folks who
+  // want global "pubsub" in a convenient place.
+  _.extend(Backbone, Events);
+
+  // Backbone.Model
+  // --------------
+
+  // Backbone **Models** are the basic data object in the framework --
+  // frequently representing a row in a table in a database on your server.
+  // A discrete chunk of data and a bunch of useful, related methods for
+  // performing computations and transformations on that data.
+
+  // Create a new model with the specified attributes. A client id (`cid`)
+  // is automatically generated and assigned for you.
+  var Model = Backbone.Model = function(attributes, options) {
+    var attrs = attributes || {};
+    options || (options = {});
+    this.cid = _.uniqueId('c');
+    this.attributes = {};
+    if (options.collection) this.collection = options.collection;
+    if (options.parse) attrs = this.parse(attrs, options) || {};
+    attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
+    this.set(attrs, options);
+    this.changed = {};
+    this.initialize.apply(this, arguments);
+  };
+
+  // Attach all inheritable methods to the Model prototype.
+  _.extend(Model.prototype, Events, {
+
+    // A hash of attributes whose current and previous value differ.
+    changed: null,
+
+    // The value returned during the last failed validation.
+    validationError: null,
+
+    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
+    // CouchDB users may want to set this to `"_id"`.
+    idAttribute: 'id',
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Return a copy of the model's `attributes` object.
+    toJSON: function(options) {
+      return _.clone(this.attributes);
+    },
+
+    // Proxy `Backbone.sync` by default -- but override this if you need
+    // custom syncing semantics for *this* particular model.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Get the value of an attribute.
+    get: function(attr) {
+      return this.attributes[attr];
+    },
+
+    // Get the HTML-escaped value of an attribute.
+    escape: function(attr) {
+      return _.escape(this.get(attr));
+    },
+
+    // Returns `true` if the attribute contains a value that is not null
+    // or undefined.
+    has: function(attr) {
+      return this.get(attr) != null;
+    },
+
+    // Set a hash of model attributes on the object, firing `"change"`. This is
+    // the core primitive operation of a model, updating the data and notifying
+    // anyone who needs to know about the change in state. The heart of the beast.
+    set: function(key, val, options) {
+      var attr, attrs, unset, changes, silent, changing, prev, current;
+      if (key == null) return this;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      options || (options = {});
+
+      // Run validation.
+      if (!this._validate(attrs, options)) return false;
+
+      // Extract attributes and options.
+      unset           = options.unset;
+      silent          = options.silent;
+      changes         = [];
+      changing        = this._changing;
+      this._changing  = true;
+
+      if (!changing) {
+        this._previousAttributes = _.clone(this.attributes);
+        this.changed = {};
+      }
+      current = this.attributes, prev = this._previousAttributes;
+
+      // Check for changes of `id`.
+      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
+
+      // For each `set` attribute, update or delete the current value.
+      for (attr in attrs) {
+        val = attrs[attr];
+        if (!_.isEqual(current[attr], val)) changes.push(attr);
+        if (!_.isEqual(prev[attr], val)) {
+          this.changed[attr] = val;
+        } else {
+          delete this.changed[attr];
+        }
+        unset ? delete current[attr] : current[attr] = val;
+      }
+
+      // Trigger all relevant attribute changes.
+      if (!silent) {
+        if (changes.length) this._pending = options;
+        for (var i = 0, l = changes.length; i < l; i++) {
+          this.trigger('change:' + changes[i], this, current[changes[i]], options);
+        }
+      }
+
+      // You might be wondering why there's a `while` loop here. Changes can
+      // be recursively nested within `"change"` events.
+      if (changing) return this;
+      if (!silent) {
+        while (this._pending) {
+          options = this._pending;
+          this._pending = false;
+          this.trigger('change', this, options);
+        }
+      }
+      this._pending = false;
+      this._changing = false;
+      return this;
+    },
+
+    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
+    // if the attribute doesn't exist.
+    unset: function(attr, options) {
+      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
+    },
+
+    // Clear all attributes on the model, firing `"change"`.
+    clear: function(options) {
+      var attrs = {};
+      for (var key in this.attributes) attrs[key] = void 0;
+      return this.set(attrs, _.extend({}, options, {unset: true}));
+    },
+
+    // Determine if the model has changed since the last `"change"` event.
+    // If you specify an attribute name, determine if that attribute has changed.
+    hasChanged: function(attr) {
+      if (attr == null) return !_.isEmpty(this.changed);
+      return _.has(this.changed, attr);
+    },
+
+    // Return an object containing all the attributes that have changed, or
+    // false if there are no changed attributes. Useful for determining what
+    // parts of a view need to be updated and/or what attributes need to be
+    // persisted to the server. Unset attributes will be set to undefined.
+    // You can also pass an attributes object to diff against the model,
+    // determining if there *would be* a change.
+    changedAttributes: function(diff) {
+      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
+      var val, changed = false;
+      var old = this._changing ? this._previousAttributes : this.attributes;
+      for (var attr in diff) {
+        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
+        (changed || (changed = {}))[attr] = val;
+      }
+      return changed;
+    },
+
+    // Get the previous value of an attribute, recorded at the time the last
+    // `"change"` event was fired.
+    previous: function(attr) {
+      if (attr == null || !this._previousAttributes) return null;
+      return this._previousAttributes[attr];
+    },
+
+    // Get all of the attributes of the model at the time of the previous
+    // `"change"` event.
+    previousAttributes: function() {
+      return _.clone(this._previousAttributes);
+    },
+
+    // Fetch the model from the server. If the server's representation of the
+    // model differs from its current attributes, they will be overridden,
+    // triggering a `"change"` event.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        if (!model.set(model.parse(resp, options), options)) return false;
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Set a hash of model attributes, and sync the model to the server.
+    // If the server returns an attributes hash that differs, the model's
+    // state will be `set` again.
+    save: function(key, val, options) {
+      var attrs, method, xhr, attributes = this.attributes;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (key == null || typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      options = _.extend({validate: true}, options);
+
+      // If we're not waiting and attributes exist, save acts as
+      // `set(attr).save(null, opts)` with validation. Otherwise, check if
+      // the model will be valid when the attributes, if any, are set.
+      if (attrs && !options.wait) {
+        if (!this.set(attrs, options)) return false;
+      } else {
+        if (!this._validate(attrs, options)) return false;
+      }
+
+      // Set temporary attributes if `{wait: true}`.
+      if (attrs && options.wait) {
+        this.attributes = _.extend({}, attributes, attrs);
+      }
+
+      // After a successful server-side save, the client is (optionally)
+      // updated with the server-side state.
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        // Ensure attributes are restored during synchronous saves.
+        model.attributes = attributes;
+        var serverAttrs = model.parse(resp, options);
+        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
+        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
+          return false;
+        }
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+
+      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
+      if (method === 'patch') options.attrs = attrs;
+      xhr = this.sync(method, this, options);
+
+      // Restore attributes.
+      if (attrs && options.wait) this.attributes = attributes;
+
+      return xhr;
+    },
+
+    // Destroy this model on the server if it was already persisted.
+    // Optimistically removes the model from its collection, if it has one.
+    // If `wait: true` is passed, waits for the server to respond before removal.
+    destroy: function(options) {
+      options = options ? _.clone(options) : {};
+      var model = this;
+      var success = options.success;
+
+      var destroy = function() {
+        model.trigger('destroy', model, model.collection, options);
+      };
+
+      options.success = function(resp) {
+        if (options.wait || model.isNew()) destroy();
+        if (success) success(model, resp, options);
+        if (!model.isNew()) model.trigger('sync', model, resp, options);
+      };
+
+      if (this.isNew()) {
+        options.success();
+        return false;
+      }
+      wrapError(this, options);
+
+      var xhr = this.sync('delete', this, options);
+      if (!options.wait) destroy();
+      return xhr;
+    },
+
+    // Default URL for the model's representation on the server -- if you're
+    // using Backbone's restful methods, override this to change the endpoint
+    // that will be called.
+    url: function() {
+      var base =
+        _.result(this, 'urlRoot') ||
+        _.result(this.collection, 'url') ||
+        urlError();
+      if (this.isNew()) return base;
+      return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id);
+    },
+
+    // **parse** converts a response into the hash of attributes to be `set` on
+    // the model. The default implementation is just to pass the response along.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new model with identical attributes to this one.
+    clone: function() {
+      return new this.constructor(this.attributes);
+    },
+
+    // A model is new if it has never been saved to the server, and lacks an id.
+    isNew: function() {
+      return !this.has(this.idAttribute);
+    },
+
+    // Check if the model is currently in a valid state.
+    isValid: function(options) {
+      return this._validate({}, _.extend(options || {}, { validate: true }));
+    },
+
+    // Run validation against the next complete set of model attributes,
+    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
+    _validate: function(attrs, options) {
+      if (!options.validate || !this.validate) return true;
+      attrs = _.extend({}, this.attributes, attrs);
+      var error = this.validationError = this.validate(attrs, options) || null;
+      if (!error) return true;
+      this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
+      return false;
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Model.
+  var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
+
+  // Mix in each Underscore method as a proxy to `Model#attributes`.
+  _.each(modelMethods, function(method) {
+    Model.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.attributes);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Backbone.Collection
+  // -------------------
+
+  // If models tend to represent a single row of data, a Backbone Collection is
+  // more analagous to a table full of data ... or a small slice or page of that
+  // table, or a collection of rows that belong together for a particular reason
+  // -- all of the messages in this particular folder, all of the documents
+  // belonging to this particular author, and so on. Collections maintain
+  // indexes of their models, both in order, and for lookup by `id`.
+
+  // Create a new **Collection**, perhaps to contain a specific type of `model`.
+  // If a `comparator` is specified, the Collection will maintain
+  // its models in sort order, as they're added and removed.
+  var Collection = Backbone.Collection = function(models, options) {
+    options || (options = {});
+    if (options.model) this.model = options.model;
+    if (options.comparator !== void 0) this.comparator = options.comparator;
+    this._reset();
+    this.initialize.apply(this, arguments);
+    if (models) this.reset(models, _.extend({silent: true}, options));
+  };
+
+  // Default options for `Collection#set`.
+  var setOptions = {add: true, remove: true, merge: true};
+  var addOptions = {add: true, remove: false};
+
+  // Define the Collection's inheritable methods.
+  _.extend(Collection.prototype, Events, {
+
+    // The default model for a collection is just a **Backbone.Model**.
+    // This should be overridden in most cases.
+    model: Model,
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // The JSON representation of a Collection is an array of the
+    // models' attributes.
+    toJSON: function(options) {
+      return this.map(function(model){ return model.toJSON(options); });
+    },
+
+    // Proxy `Backbone.sync` by default.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Add a model, or list of models to the set.
+    add: function(models, options) {
+      return this.set(models, _.extend({merge: false}, options, addOptions));
+    },
+
+    // Remove a model, or a list of models from the set.
+    remove: function(models, options) {
+      var singular = !_.isArray(models);
+      models = singular ? [models] : _.clone(models);
+      options || (options = {});
+      var i, l, index, model;
+      for (i = 0, l = models.length; i < l; i++) {
+        model = models[i] = this.get(models[i]);
+        if (!model) continue;
+        delete this._byId[model.id];
+        delete this._byId[model.cid];
+        index = this.indexOf(model);
+        this.models.splice(index, 1);
+        this.length--;
+        if (!options.silent) {
+          options.index = index;
+          model.trigger('remove', model, this, options);
+        }
+        this._removeReference(model, options);
+      }
+      return singular ? models[0] : models;
+    },
+
+    // Update a collection by `set`-ing a new list of models, adding new ones,
+    // removing models that are no longer present, and merging models that
+    // already exist in the collection, as necessary. Similar to **Model#set**,
+    // the core operation for updating the data contained by the collection.
+    set: function(models, options) {
+      options = _.defaults({}, options, setOptions);
+      if (options.parse) models = this.parse(models, options);
+      var singular = !_.isArray(models);
+      models = singular ? (models ? [models] : []) : _.clone(models);
+      var i, l, id, model, attrs, existing, sort;
+      var at = options.at;
+      var targetModel = this.model;
+      var sortable = this.comparator && (at == null) && options.sort !== false;
+      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
+      var toAdd = [], toRemove = [], modelMap = {};
+      var add = options.add, merge = options.merge, remove = options.remove;
+      var order = !sortable && add && remove ? [] : false;
+
+      // Turn bare objects into model references, and prevent invalid models
+      // from being added.
+      for (i = 0, l = models.length; i < l; i++) {
+        attrs = models[i] || {};
+        if (attrs instanceof Model) {
+          id = model = attrs;
+        } else {
+          id = attrs[targetModel.prototype.idAttribute || 'id'];
+        }
+
+        // If a duplicate is found, prevent it from being added and
+        // optionally merge it into the existing model.
+        if (existing = this.get(id)) {
+          if (remove) modelMap[existing.cid] = true;
+          if (merge) {
+            attrs = attrs === model ? model.attributes : attrs;
+            if (options.parse) attrs = existing.parse(attrs, options);
+            existing.set(attrs, options);
+            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
+          }
+          models[i] = existing;
+
+        // If this is a new, valid model, push it to the `toAdd` list.
+        } else if (add) {
+          model = models[i] = this._prepareModel(attrs, options);
+          if (!model) continue;
+          toAdd.push(model);
+          this._addReference(model, options);
+        }
+
+        // Do not add multiple models with the same `id`.
+        model = existing || model;
+        if (order && (model.isNew() || !modelMap[model.id])) order.push(model);
+        modelMap[model.id] = true;
+      }
+
+      // Remove nonexistent models if appropriate.
+      if (remove) {
+        for (i = 0, l = this.length; i < l; ++i) {
+          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
+        }
+        if (toRemove.length) this.remove(toRemove, options);
+      }
+
+      // See if sorting is needed, update `length` and splice in new models.
+      if (toAdd.length || (order && order.length)) {
+        if (sortable) sort = true;
+        this.length += toAdd.length;
+        if (at != null) {
+          for (i = 0, l = toAdd.length; i < l; i++) {
+            this.models.splice(at + i, 0, toAdd[i]);
+          }
+        } else {
+          if (order) this.models.length = 0;
+          var orderedModels = order || toAdd;
+          for (i = 0, l = orderedModels.length; i < l; i++) {
+            this.models.push(orderedModels[i]);
+          }
+        }
+      }
+
+      // Silently sort the collection if appropriate.
+      if (sort) this.sort({silent: true});
+
+      // Unless silenced, it's time to fire all appropriate add/sort events.
+      if (!options.silent) {
+        for (i = 0, l = toAdd.length; i < l; i++) {
+          (model = toAdd[i]).trigger('add', model, this, options);
+        }
+        if (sort || (order && order.length)) this.trigger('sort', this, options);
+      }
+
+      // Return the added (or merged) model (or models).
+      return singular ? models[0] : models;
+    },
+
+    // When you have more items than you want to add or remove individually,
+    // you can reset the entire set with a new list of models, without firing
+    // any granular `add` or `remove` events. Fires `reset` when finished.
+    // Useful for bulk operations and optimizations.
+    reset: function(models, options) {
+      options || (options = {});
+      for (var i = 0, l = this.models.length; i < l; i++) {
+        this._removeReference(this.models[i], options);
+      }
+      options.previousModels = this.models;
+      this._reset();
+      models = this.add(models, _.extend({silent: true}, options));
+      if (!options.silent) this.trigger('reset', this, options);
+      return models;
+    },
+
+    // Add a model to the end of the collection.
+    push: function(model, options) {
+      return this.add(model, _.extend({at: this.length}, options));
+    },
+
+    // Remove a model from the end of the collection.
+    pop: function(options) {
+      var model = this.at(this.length - 1);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Add a model to the beginning of the collection.
+    unshift: function(model, options) {
+      return this.add(model, _.extend({at: 0}, options));
+    },
+
+    // Remove a model from the beginning of the collection.
+    shift: function(options) {
+      var model = this.at(0);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Slice out a sub-array of models from the collection.
+    slice: function() {
+      return slice.apply(this.models, arguments);
+    },
+
+    // Get a model from the set by id.
+    get: function(obj) {
+      if (obj == null) return void 0;
+      return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid];
+    },
+
+    // Get the model at the given index.
+    at: function(index) {
+      return this.models[index];
+    },
+
+    // Return models with matching attributes. Useful for simple cases of
+    // `filter`.
+    where: function(attrs, first) {
+      if (_.isEmpty(attrs)) return first ? void 0 : [];
+      return this[first ? 'find' : 'filter'](function(model) {
+        for (var key in attrs) {
+          if (attrs[key] !== model.get(key)) return false;
+        }
+        return true;
+      });
+    },
+
+    // Return the first model with matching attributes. Useful for simple cases
+    // of `find`.
+    findWhere: function(attrs) {
+      return this.where(attrs, true);
+    },
+
+    // Force the collection to re-sort itself. You don't need to call this under
+    // normal circumstances, as the set will maintain sort order as each item
+    // is added.
+    sort: function(options) {
+      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
+      options || (options = {});
+
+      // Run sort based on type of `comparator`.
+      if (_.isString(this.comparator) || this.comparator.length === 1) {
+        this.models = this.sortBy(this.comparator, this);
+      } else {
+        this.models.sort(_.bind(this.comparator, this));
+      }
+
+      if (!options.silent) this.trigger('sort', this, options);
+      return this;
+    },
+
+    // Pluck an attribute from each model in the collection.
+    pluck: function(attr) {
+      return _.invoke(this.models, 'get', attr);
+    },
+
+    // Fetch the default set of models for this collection, resetting the
+    // collection when they arrive. If `reset: true` is passed, the response
+    // data will be passed through the `reset` method instead of `set`.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var success = options.success;
+      var collection = this;
+      options.success = function(resp) {
+        var method = options.reset ? 'reset' : 'set';
+        collection[method](resp, options);
+        if (success) success(collection, resp, options);
+        collection.trigger('sync', collection, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Create a new instance of a model in this collection. Add the model to the
+    // collection immediately, unless `wait: true` is passed, in which case we
+    // wait for the server to agree.
+    create: function(model, options) {
+      options = options ? _.clone(options) : {};
+      if (!(model = this._prepareModel(model, options))) return false;
+      if (!options.wait) this.add(model, options);
+      var collection = this;
+      var success = options.success;
+      options.success = function(model, resp) {
+        if (options.wait) collection.add(model, options);
+        if (success) success(model, resp, options);
+      };
+      model.save(null, options);
+      return model;
+    },
+
+    // **parse** converts a response into a list of models to be added to the
+    // collection. The default implementation is just to pass it through.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new collection with an identical list of models as this one.
+    clone: function() {
+      return new this.constructor(this.models);
+    },
+
+    // Private method to reset all internal state. Called when the collection
+    // is first initialized or reset.
+    _reset: function() {
+      this.length = 0;
+      this.models = [];
+      this._byId  = {};
+    },
+
+    // Prepare a hash of attributes (or other model) to be added to this
+    // collection.
+    _prepareModel: function(attrs, options) {
+      if (attrs instanceof Model) return attrs;
+      options = options ? _.clone(options) : {};
+      options.collection = this;
+      var model = new this.model(attrs, options);
+      if (!model.validationError) return model;
+      this.trigger('invalid', this, model.validationError, options);
+      return false;
+    },
+
+    // Internal method to create a model's ties to a collection.
+    _addReference: function(model, options) {
+      this._byId[model.cid] = model;
+      if (model.id != null) this._byId[model.id] = model;
+      if (!model.collection) model.collection = this;
+      model.on('all', this._onModelEvent, this);
+    },
+
+    // Internal method to sever a model's ties to a collection.
+    _removeReference: function(model, options) {
+      if (this === model.collection) delete model.collection;
+      model.off('all', this._onModelEvent, this);
+    },
+
+    // Internal method called every time a model in the set fires an event.
+    // Sets need to update their indexes when models change ids. All other
+    // events simply proxy through. "add" and "remove" events that originate
+    // in other collections are ignored.
+    _onModelEvent: function(event, model, collection, options) {
+      if ((event === 'add' || event === 'remove') && collection !== this) return;
+      if (event === 'destroy') this.remove(model, options);
+      if (model && event === 'change:' + model.idAttribute) {
+        delete this._byId[model.previous(model.idAttribute)];
+        if (model.id != null) this._byId[model.id] = model;
+      }
+      this.trigger.apply(this, arguments);
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Collection.
+  // 90% of the core usefulness of Backbone Collections is actually implemented
+  // right here:
+  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
+    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
+    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
+    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
+    'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',
+    'lastIndexOf', 'isEmpty', 'chain', 'sample'];
+
+  // Mix in each Underscore method as a proxy to `Collection#models`.
+  _.each(methods, function(method) {
+    Collection.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.models);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Underscore methods that take a property name as an argument.
+  var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy'];
+
+  // Use attributes instead of properties.
+  _.each(attributeMethods, function(method) {
+    Collection.prototype[method] = function(value, context) {
+      var iterator = _.isFunction(value) ? value : function(model) {
+        return model.get(value);
+      };
+      return _[method](this.models, iterator, context);
+    };
+  });
+
+  // Backbone.View
+  // -------------
+
+  // Backbone Views are almost more convention than they are actual code. A View
+  // is simply a JavaScript object that represents a logical chunk of UI in the
+  // DOM. This might be a single item, an entire list, a sidebar or panel, or
+  // even the surrounding frame which wraps your whole app. Defining a chunk of
+  // UI as a **View** allows you to define your DOM events declaratively, without
+  // having to worry about render order ... and makes it easy for the view to
+  // react to specific changes in the state of your models.
+
+  // Creating a Backbone.View creates its initial element outside of the DOM,
+  // if an existing element is not provided...
+  var View = Backbone.View = function(options) {
+    this.cid = _.uniqueId('view');
+    options || (options = {});
+    _.extend(this, _.pick(options, viewOptions));
+    this._ensureElement();
+    this.initialize.apply(this, arguments);
+    this.delegateEvents();
+  };
+
+  // Cached regex to split keys for `delegate`.
+  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
+
+  // List of view options to be merged as properties.
+  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
+
+  // Set up all inheritable **Backbone.View** properties and methods.
+  _.extend(View.prototype, Events, {
+
+    // The default `tagName` of a View's element is `"div"`.
+    tagName: 'div',
+
+    // jQuery delegate for element lookup, scoped to DOM elements within the
+    // current view. This should be preferred to global lookups where possible.
+    $: function(selector) {
+      return this.$el.find(selector);
+    },
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // **render** is the core function that your view should override, in order
+    // to populate its element (`this.el`), with the appropriate HTML. The
+    // convention is for **render** to always return `this`.
+    render: function() {
+      return this;
+    },
+
+    // Remove this view by taking the element out of the DOM, and removing any
+    // applicable Backbone.Events listeners.
+    remove: function() {
+      this.$el.remove();
+      this.stopListening();
+      return this;
+    },
+
+    // Change the view's element (`this.el` property), including event
+    // re-delegation.
+    setElement: function(element, delegate) {
+      if (this.$el) this.undelegateEvents();
+      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
+      this.el = this.$el[0];
+      if (delegate !== false) this.delegateEvents();
+      return this;
+    },
+
+    // Set callbacks, where `this.events` is a hash of
+    //
+    // *{"event selector": "callback"}*
+    //
+    //     {
+    //       'mousedown .title':  'edit',
+    //       'click .button':     'save',
+    //       'click .open':       function(e) { ... }
+    //     }
+    //
+    // pairs. Callbacks will be bound to the view, with `this` set properly.
+    // Uses event delegation for efficiency.
+    // Omitting the selector binds the event to `this.el`.
+    // This only works for delegate-able events: not `focus`, `blur`, and
+    // not `change`, `submit`, and `reset` in Internet Explorer.
+    delegateEvents: function(events) {
+      if (!(events || (events = _.result(this, 'events')))) return this;
+      this.undelegateEvents();
+      for (var key in events) {
+        var method = events[key];
+        if (!_.isFunction(method)) method = this[events[key]];
+        if (!method) continue;
+
+        var match = key.match(delegateEventSplitter);
+        var eventName = match[1], selector = match[2];
+        method = _.bind(method, this);
+        eventName += '.delegateEvents' + this.cid;
+        if (selector === '') {
+          this.$el.on(eventName, method);
+        } else {
+          this.$el.on(eventName, selector, method);
+        }
+      }
+      return this;
+    },
+
+    // Clears all callbacks previously bound to the view with `delegateEvents`.
+    // You usually don't need to use this, but may wish to if you have multiple
+    // Backbone views attached to the same DOM element.
+    undelegateEvents: function() {
+      this.$el.off('.delegateEvents' + this.cid);
+      return this;
+    },
+
+    // Ensure that the View has a DOM element to render into.
+    // If `this.el` is a string, pass it through `$()`, take the first
+    // matching element, and re-assign it to `el`. Otherwise, create
+    // an element from the `id`, `className` and `tagName` properties.
+    _ensureElement: function() {
+      if (!this.el) {
+        var attrs = _.extend({}, _.result(this, 'attributes'));
+        if (this.id) attrs.id = _.result(this, 'id');
+        if (this.className) attrs['class'] = _.result(this, 'className');
+        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
+        this.setElement($el, false);
+      } else {
+        this.setElement(_.result(this, 'el'), false);
+      }
+    }
+
+  });
+
+  // Backbone.sync
+  // -------------
+
+  // Override this function to change the manner in which Backbone persists
+  // models to the server. You will be passed the type of request, and the
+  // model in question. By default, makes a RESTful Ajax request
+  // to the model's `url()`. Some possible customizations could be:
+  //
+  // * Use `setTimeout` to batch rapid-fire updates into a single request.
+  // * Send up the models as XML instead of JSON.
+  // * Persist models via WebSockets instead of Ajax.
+  //
+  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
+  // as `POST`, with a `_method` parameter containing the true HTTP method,
+  // as well as all requests with the body as `application/x-www-form-urlencoded`
+  // instead of `application/json` with the model in a param named `model`.
+  // Useful when interfacing with server-side languages like **PHP** that make
+  // it difficult to read the body of `PUT` requests.
+  Backbone.sync = function(method, model, options) {
+    var type = methodMap[method];
+
+    // Default options, unless specified.
+    _.defaults(options || (options = {}), {
+      emulateHTTP: Backbone.emulateHTTP,
+      emulateJSON: Backbone.emulateJSON
+    });
+
+    // Default JSON-request options.
+    var params = {type: type, dataType: 'json'};
+
+    // Ensure that we have a URL.
+    if (!options.url) {
+      params.url = _.result(model, 'url') || urlError();
+    }
+
+    // Ensure that we have the appropriate request data.
+    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
+      params.contentType = 'application/json';
+      params.data = JSON.stringify(options.attrs || model.toJSON(options));
+    }
+
+    // For older servers, emulate JSON by encoding the request into an HTML-form.
+    if (options.emulateJSON) {
+      params.contentType = 'application/x-www-form-urlencoded';
+      params.data = params.data ? {model: params.data} : {};
+    }
+
+    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
+    // And an `X-HTTP-Method-Override` header.
+    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
+      params.type = 'POST';
+      if (options.emulateJSON) params.data._method = type;
+      var beforeSend = options.beforeSend;
+      options.beforeSend = function(xhr) {
+        xhr.setRequestHeader('X-HTTP-Method-Override', type);
+        if (beforeSend) return beforeSend.apply(this, arguments);
+      };
+    }
+
+    // Don't process data on a non-GET request.
+    if (params.type !== 'GET' && !options.emulateJSON) {
+      params.processData = false;
+    }
+
+    // If we're sending a `PATCH` request, and we're in an old Internet Explorer
+    // that still has ActiveX enabled by default, override jQuery to use that
+    // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
+    if (params.type === 'PATCH' && noXhrPatch) {
+      params.xhr = function() {
+        return new ActiveXObject("Microsoft.XMLHTTP");
+      };
+    }
+
+    // Make the request, allowing the user to override any Ajax options.
+    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
+    model.trigger('request', model, xhr, options);
+    return xhr;
+  };
+
+  var noXhrPatch =
+    typeof window !== 'undefined' && !!window.ActiveXObject &&
+      !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);
+
+  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
+  var methodMap = {
+    'create': 'POST',
+    'update': 'PUT',
+    'patch':  'PATCH',
+    'delete': 'DELETE',
+    'read':   'GET'
+  };
+
+  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
+  // Override this if you'd like to use a different library.
+  Backbone.ajax = function() {
+    return Backbone.$.ajax.apply(Backbone.$, arguments);
+  };
+
+  // Backbone.Router
+  // ---------------
+
+  // Routers map faux-URLs to actions, and fire events when routes are
+  // matched. Creating a new one sets its `routes` hash, if not set statically.
+  var Router = Backbone.Router = function(options) {
+    options || (options = {});
+    if (options.routes) this.routes = options.routes;
+    this._bindRoutes();
+    this.initialize.apply(this, arguments);
+  };
+
+  // Cached regular expressions for matching named param parts and splatted
+  // parts of route strings.
+  var optionalParam = /\((.*?)\)/g;
+  var namedParam    = /(\(\?)?:\w+/g;
+  var splatParam    = /\*\w+/g;
+  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
+
+  // Set up all inheritable **Backbone.Router** properties and methods.
+  _.extend(Router.prototype, Events, {
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Manually bind a single named route to a callback. For example:
+    //
+    //     this.route('search/:query/p:num', 'search', function(query, num) {
+    //       ...
+    //     });
+    //
+    route: function(route, name, callback) {
+      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
+      if (_.isFunction(name)) {
+        callback = name;
+        name = '';
+      }
+      if (!callback) callback = this[name];
+      var router = this;
+      Backbone.history.route(route, function(fragment) {
+        var args = router._extractParameters(route, fragment);
+        router.execute(callback, args);
+        router.trigger.apply(router, ['route:' + name].concat(args));
+        router.trigger('route', name, args);
+        Backbone.history.trigger('route', router, name, args);
+      });
+      return this;
+    },
+
+    // Execute a route handler with the provided parameters.  This is an
+    // excellent place to do pre-route setup or post-route cleanup.
+    execute: function(callback, args) {
+      if (callback) callback.apply(this, args);
+    },
+
+    // Simple proxy to `Backbone.history` to save a fragment into the history.
+    navigate: function(fragment, options) {
+      Backbone.history.navigate(fragment, options);
+      return this;
+    },
+
+    // Bind all defined routes to `Backbone.history`. We have to reverse the
+    // order of the routes here to support behavior where the most general
+    // routes can be defined at the bottom of the route map.
+    _bindRoutes: function() {
+      if (!this.routes) return;
+      this.routes = _.result(this, 'routes');
+      var route, routes = _.keys(this.routes);
+      while ((route = routes.pop()) != null) {
+        this.route(route, this.routes[route]);
+      }
+    },
+
+    // Convert a route string into a regular expression, suitable for matching
+    // against the current location hash.
+    _routeToRegExp: function(route) {
+      route = route.replace(escapeRegExp, '\\$&')
+                   .replace(optionalParam, '(?:$1)?')
+                   .replace(namedParam, function(match, optional) {
+                     return optional ? match : '([^/?]+)';
+                   })
+                   .replace(splatParam, '([^?]*?)');
+      return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
+    },
+
+    // Given a route, and a URL fragment that it matches, return the array of
+    // extracted decoded parameters. Empty or unmatched parameters will be
+    // treated as `null` to normalize cross-browser behavior.
+    _extractParameters: function(route, fragment) {
+      var params = route.exec(fragment).slice(1);
+      return _.map(params, function(param, i) {
+        // Don't decode the search params.
+        if (i === params.length - 1) return param || null;
+        return param ? decodeURIComponent(param) : null;
+      });
+    }
+
+  });
+
+  // Backbone.History
+  // ----------------
+
+  // Handles cross-browser history management, based on either
+  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
+  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
+  // and URL fragments. If the browser supports neither (old IE, natch),
+  // falls back to polling.
+  var History = Backbone.History = function() {
+    this.handlers = [];
+    _.bindAll(this, 'checkUrl');
+
+    // Ensure that `History` can be used outside of the browser.
+    if (typeof window !== 'undefined') {
+      this.location = window.location;
+      this.history = window.history;
+    }
+  };
+
+  // Cached regex for stripping a leading hash/slash and trailing space.
+  var routeStripper = /^[#\/]|\s+$/g;
+
+  // Cached regex for stripping leading and trailing slashes.
+  var rootStripper = /^\/+|\/+$/g;
+
+  // Cached regex for detecting MSIE.
+  var isExplorer = /msie [\w.]+/;
+
+  // Cached regex for removing a trailing slash.
+  var trailingSlash = /\/$/;
+
+  // Cached regex for stripping urls of hash.
+  var pathStripper = /#.*$/;
+
+  // Has the history handling already been started?
+  History.started = false;
+
+  // Set up all inheritable **Backbone.History** properties and methods.
+  _.extend(History.prototype, Events, {
+
+    // The default interval to poll for hash changes, if necessary, is
+    // twenty times a second.
+    interval: 50,
+
+    // Are we at the app root?
+    atRoot: function() {
+      return this.location.pathname.replace(/[^\/]$/, '$&/') === this.root;
+    },
+
+    // Gets the true hash value. Cannot use location.hash directly due to bug
+    // in Firefox where location.hash will always be decoded.
+    getHash: function(window) {
+      var match = (window || this).location.href.match(/#(.*)$/);
+      return match ? match[1] : '';
+    },
+
+    // Get the cross-browser normalized URL fragment, either from the URL,
+    // the hash, or the override.
+    getFragment: function(fragment, forcePushState) {
+      if (fragment == null) {
+        if (this._hasPushState || !this._wantsHashChange || forcePushState) {
+          fragment = decodeURI(this.location.pathname + this.location.search);
+          var root = this.root.replace(trailingSlash, '');
+          if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);
+        } else {
+          fragment = this.getHash();
+        }
+      }
+      return fragment.replace(routeStripper, '');
+    },
+
+    // Start the hash change handling, returning `true` if the current URL matches
+    // an existing route, and `false` otherwise.
+    start: function(options) {
+      if (History.started) throw new Error("Backbone.history has already been started");
+      History.started = true;
+
+      // Figure out the initial configuration. Do we need an iframe?
+      // Is pushState desired ... is it available?
+      this.options          = _.extend({root: '/'}, this.options, options);
+      this.root             = this.options.root;
+      this._wantsHashChange = this.options.hashChange !== false;
+      this._wantsPushState  = !!this.options.pushState;
+      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);
+      var fragment          = this.getFragment();
+      var docMode           = document.documentMode;
+      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
+
+      // Normalize root to always include a leading and trailing slash.
+      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
+
+      if (oldIE && this._wantsHashChange) {
+        var frame = Backbone.$('<iframe src="javascript:0" tabindex="-1">');
+        this.iframe = frame.hide().appendTo('body')[0].contentWindow;
+        this.navigate(fragment);
+      }
+
+      // Depending on whether we're using pushState or hashes, and whether
+      // 'onhashchange' is supported, determine how we check the URL state.
+      if (this._hasPushState) {
+        Backbone.$(window).on('popstate', this.checkUrl);
+      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
+        Backbone.$(window).on('hashchange', this.checkUrl);
+      } else if (this._wantsHashChange) {
+        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
+      }
+
+      // Determine if we need to change the base url, for a pushState link
+      // opened by a non-pushState browser.
+      this.fragment = fragment;
+      var loc = this.location;
+
+      // Transition from hashChange to pushState or vice versa if both are
+      // requested.
+      if (this._wantsHashChange && this._wantsPushState) {
+
+        // If we've started off with a route from a `pushState`-enabled
+        // browser, but we're currently in a browser that doesn't support it...
+        if (!this._hasPushState && !this.atRoot()) {
+          this.fragment = this.getFragment(null, true);
+          this.location.replace(this.root + '#' + this.fragment);
+          // Return immediately as browser will do redirect to new url
+          return true;
+
+        // Or if we've started out with a hash-based route, but we're currently
+        // in a browser where it could be `pushState`-based instead...
+        } else if (this._hasPushState && this.atRoot() && loc.hash) {
+          this.fragment = this.getHash().replace(routeStripper, '');
+          this.history.replaceState({}, document.title, this.root + this.fragment);
+        }
+
+      }
+
+      if (!this.options.silent) return this.loadUrl();
+    },
+
+    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
+    // but possibly useful for unit testing Routers.
+    stop: function() {
+      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
+      if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
+      History.started = false;
+    },
+
+    // Add a route to be tested when the fragment changes. Routes added later
+    // may override previous routes.
+    route: function(route, callback) {
+      this.handlers.unshift({route: route, callback: callback});
+    },
+
+    // Checks the current URL to see if it has changed, and if it has,
+    // calls `loadUrl`, normalizing across the hidden iframe.
+    checkUrl: function(e) {
+      var current = this.getFragment();
+      if (current === this.fragment && this.iframe) {
+        current = this.getFragment(this.getHash(this.iframe));
+      }
+      if (current === this.fragment) return false;
+      if (this.iframe) this.navigate(current);
+      this.loadUrl();
+    },
+
+    // Attempt to load the current URL fragment. If a route succeeds with a
+    // match, returns `true`. If no defined routes matches the fragment,
+    // returns `false`.
+    loadUrl: function(fragment) {
+      fragment = this.fragment = this.getFragment(fragment);
+      return _.any(this.handlers, function(handler) {
+        if (handler.route.test(fragment)) {
+          handler.callback(fragment);
+          return true;
+        }
+      });
+    },
+
+    // Save a fragment into the hash history, or replace the URL state if the
+    // 'replace' option is passed. You are responsible for properly URL-encoding
+    // the fragment in advance.
+    //
+    // The options object can contain `trigger: true` if you wish to have the
+    // route callback be fired (not usually desirable), or `replace: true`, if
+    // you wish to modify the current URL without adding an entry to the history.
+    navigate: function(fragment, options) {
+      if (!History.started) return false;
+      if (!options || options === true) options = {trigger: !!options};
+
+      var url = this.root + (fragment = this.getFragment(fragment || ''));
+
+      // Strip the hash for matching.
+      fragment = fragment.replace(pathStripper, '');
+
+      if (this.fragment === fragment) return;
+      this.fragment = fragment;
+
+      // Don't include a trailing slash on the root.
+      if (fragment === '' && url !== '/') url = url.slice(0, -1);
+
+      // If pushState is available, we use it to set the fragment as a real URL.
+      if (this._hasPushState) {
+        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
+
+      // If hash changes haven't been explicitly disabled, update the hash
+      // fragment to store history.
+      } else if (this._wantsHashChange) {
+        this._updateHash(this.location, fragment, options.replace);
+        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
+          // Opening and closing the iframe tricks IE7 and earlier to push a
+          // history entry on hash-tag change.  When replace is true, we don't
+          // want this.
+          if(!options.replace) this.iframe.document.open().close();
+          this._updateHash(this.iframe.location, fragment, options.replace);
+        }
+
+      // If you've told us that you explicitly don't want fallback hashchange-
+      // based history, then `navigate` becomes a page refresh.
+      } else {
+        return this.location.assign(url);
+      }
+      if (options.trigger) return this.loadUrl(fragment);
+    },
+
+    // Update the hash location, either replacing the current entry, or adding
+    // a new one to the browser history.
+    _updateHash: function(location, fragment, replace) {
+      if (replace) {
+        var href = location.href.replace(/(javascript:|#).*$/, '');
+        location.replace(href + '#' + fragment);
+      } else {
+        // Some browsers require that `hash` contains a leading #.
+        location.hash = '#' + fragment;
+      }
+    }
+
+  });
+
+  // Create the default Backbone.history.
+  Backbone.history = new History;
+
+  // Helpers
+  // -------
+
+  // Helper function to correctly set up the prototype chain, for subclasses.
+  // Similar to `goog.inherits`, but uses a hash of prototype properties and
+  // class properties to be extended.
+  var extend = function(protoProps, staticProps) {
+    var parent = this;
+    var child;
+
+    // The constructor function for the new subclass is either defined by you
+    // (the "constructor" property in your `extend` definition), or defaulted
+    // by us to simply call the parent's constructor.
+    if (protoProps && _.has(protoProps, 'constructor')) {
+      child = protoProps.constructor;
+    } else {
+      child = function(){ return parent.apply(this, arguments); };
+    }
+
+    // Add static properties to the constructor function, if supplied.
+    _.extend(child, parent, staticProps);
+
+    // Set the prototype chain to inherit from `parent`, without calling
+    // `parent`'s constructor function.
+    var Surrogate = function(){ this.constructor = child; };
+    Surrogate.prototype = parent.prototype;
+    child.prototype = new Surrogate;
+
+    // Add prototype properties (instance properties) to the subclass,
+    // if supplied.
+    if (protoProps) _.extend(child.prototype, protoProps);
+
+    // Set a convenience property in case the parent's prototype is needed
+    // later.
+    child.__super__ = parent.prototype;
+
+    return child;
+  };
+
+  // Set up inheritance for the model, collection, router, view and history.
+  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
+
+  // Throw an error when a URL is needed, and none is supplied.
+  var urlError = function() {
+    throw new Error('A "url" property or function must be specified');
+  };
+
+  // Wrap an optional error callback with a fallback error event.
+  var wrapError = function(model, options) {
+    var error = options.error;
+    options.error = function(resp) {
+      if (error) error(model, resp, options);
+      model.trigger('error', model, resp, options);
+    };
+  };
+
+  return Backbone;
+
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/css/bootstrap.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/css/bootstrap.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/css/bootstrap.css
new file mode 100644
index 0000000..667c6f4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/css/bootstrap.css
@@ -0,0 +1,43 @@
+/* Date */
+.bbf-date .bbf-date {
+  width: 4em
+}
+
+.bbf-date .bbf-month {
+  width: 9em;
+}
+
+.bbf-date .bbf-year {
+  width: 5em;
+}
+
+
+/* DateTime */
+.bbf-datetime select {
+  width: 4em;
+}
+
+
+/* List */
+.bbf-list .bbf-add {
+  margin-top: -10px
+}
+
+.bbf-list li {
+  margin-bottom: 5px
+}
+
+.bbf-list .bbf-del {
+  margin-left: 4px
+}
+
+
+/* List.Modal */
+.bbf-list-modal {
+  cursor: pointer;
+  border: 1px solid #ccc;
+  width: 208px;
+  border-radius: 3px;
+  padding: 4px;
+  color: #555;
+}


[25/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.min.js
new file mode 100644
index 0000000..78f32fd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.min.js
@@ -0,0 +1,8 @@
+/*
+  backbone-pageable 1.3.2
+  http://github.com/wyuenho/backbone-pageable
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong
+  Licensed under the MIT @license.
+*/
+!function(a){if("object"==typeof exports)module.exports=a(require("underscore"),require("backbone"));else if("function"==typeof define&&define.amd)define(["underscore","backbone"],a);else if("undefined"!=typeof _&&"undefined"!=typeof Backbone){var b=Backbone.PageableCollection,c=a(_,Backbone);Backbone.PageableCollection.noConflict=function(){return Backbone.PageableCollection=b,c}}}(function(a,b){"use strict";function c(b,c){if(!a.isNumber(b)||a.isNaN(b)||!a.isFinite(b)||~~b!==b)throw new TypeError("`"+c+"` must be a finite integer");return b}function d(a){for(var b,c,d,e,f={},g=decodeURIComponent,h=a.split("&"),i=0,j=h.length;j>i;i++){var k=h[i];b=k.split("="),c=b[0],d=b[1]||!0,c=g(c),e=f[c],n(e)?e.push(d):f[c]=e?[e,d]:d}return f}var e=a.extend,f=a.omit,g=a.clone,h=a.each,i=a.pick,j=a.contains,k=a.isEmpty,l=a.pairs,m=a.invert,n=a.isArray,o=a.isFunction,p=a.isObject,q=a.keys,r=a.isUndefined,s=a.result,t=Math.ceil,u=Math.floor,v=Math.max,w=b.Collection.prototype,x=/[\s'"]/g,y=/[<>\s'
 "]/g,z=b.PageableCollection=b.Collection.extend({state:{firstPage:1,lastPage:null,currentPage:null,pageSize:25,totalPages:null,totalRecords:null,sortKey:null,order:-1},mode:"server",queryParams:{currentPage:"page",pageSize:"per_page",totalPages:"total_pages",totalRecords:"total_entries",sortKey:"sort_by",order:"order",directions:{"-1":"asc",1:"desc"}},constructor:function(a,c){b.Collection.apply(this,arguments),c=c||{};var d=this.mode=c.mode||this.mode||A.mode,f=e({},A.queryParams,this.queryParams,c.queryParams||{});f.directions=e({},A.queryParams.directions,this.queryParams.directions,f.directions||{}),this.queryParams=f;var h=this.state=e({},A.state,this.state,c.state||{});h.currentPage=null==h.currentPage?h.firstPage:h.currentPage,n(a)||(a=a?[a]:[]),"server"==d||null!=h.totalRecords||k(a)||(h.totalRecords=a.length),this.switchMode(d,e({fetch:!1,resetState:!1,models:a},c));var i=c.comparator;if(h.sortKey&&!i&&this.setSorting(h.sortKey,h.order,c),"server"!=d){var j=this.fullCollect
 ion;i&&c.full&&(delete this.comparator,j.comparator=i),c.full&&j.sort(),a&&!k(a)&&(this.getPage(h.currentPage),a.splice.apply(a,[0,a.length].concat(this.models)))}this._initState=g(this.state)},_makeFullCollection:function(a,c){var d,e,f,g=["url","model","sync","comparator"],h=this.constructor.prototype,i={};for(d=0,e=g.length;e>d;d++)f=g[d],r(h[f])||(i[f]=h[f]);var j=new(b.Collection.extend(i))(a,c);for(d=0,e=g.length;e>d;d++)f=g[d],this[f]!==h[f]&&(j[f]=this[f]);return j},_makeCollectionEventHandler:function(a,b){return function(c,d,f,i){var j=a._handlers;h(q(j),function(c){var d=j[c];a.off(c,d),b.off(c,d)});var k=g(a.state),l=k.firstPage,m=0===l?k.currentPage:k.currentPage-1,n=k.pageSize,o=m*n,p=o+n;if("add"==c){var s,u,v,w,i=i||{};if(f==b)u=b.indexOf(d),u>=o&&p>u&&(w=a,s=v=u-o);else{s=a.indexOf(d),u=o+s,w=b;var v=r(i.at)?u:i.at+o}if(++k.totalRecords,a.state=a._checkState(k),w){w.add(d,e({},i||{},{at:v}));var x=s>=n?d:!r(i.at)&&p>v&&a.length>n?a.at(n):null;if(x){var y=f._events.a
 dd||[],z={onAdd:!0};if(y.length){var A=y[y.length-1],B=A.callback;A.callback=function(){try{B.apply(this,arguments),a.remove(x,z)}finally{A.callback=B}}}else a.remove(x,z)}}}if("remove"==c)if(i.onAdd)delete i.onAdd;else{if(--k.totalRecords){var C=k.totalPages=t(k.totalRecords/n);k.lastPage=0===l?C-1:C,k.currentPage>C&&(k.currentPage=k.lastPage)}else k.totalRecords=null,k.totalPages=null;a.state=a._checkState(k);var D,E=i.index;f==a?((D=b.at(p))&&a.push(D),b.remove(d)):E>=o&&p>E&&(a.remove(d),D=b.at(m*(n+E)),D&&a.push(D))}if("reset"==c)if(i=f,f=d,f===a&&null==i.from&&null==i.to){var F=b.models.slice(0,o),G=b.models.slice(o+a.models.length);b.reset(F.concat(a.models).concat(G),i)}else f===b&&((k.totalRecords=b.models.length)||(k.totalRecords=null,k.totalPages=null),"client"==a.mode&&(k.lastPage=k.currentPage=k.firstPage),a.state=a._checkState(k),a.reset(b.models.slice(o,p),e({},i,{parse:!1})));"sort"==c&&(i=f,f=d,f===b&&a.reset(b.models.slice(o,p),e({},i,{parse:!1}))),h(q(j),function(
 c){var d=j[c];h([a,b],function(a){a.on(c,d);var b=a._events[c]||[];b.unshift(b.pop())})})}},_checkState:function(a){var b=this.mode,d=this.links,e=a.totalRecords,f=a.pageSize,g=a.currentPage,h=a.firstPage,i=a.totalPages;if(null!=e&&null!=f&&null!=g&&null!=h&&("infinite"==b?d:!0)){if(e=c(e,"totalRecords"),f=c(f,"pageSize"),g=c(g,"currentPage"),h=c(h,"firstPage"),1>f)throw new RangeError("`pageSize` must be >= 1");if(i=a.totalPages=t(e/f),0>h||h>1)throw new RangeError("`firstPage must be 0 or 1`");if(a.lastPage=0===h?v(0,i-1):i,"infinite"==b){if(!d[g+""])throw new RangeError("No link found for page "+g)}else if(h>g||i>0&&(h?g>i:g>=i))throw new RangeError("`currentPage` must be firstPage <= currentPage "+(h?">":">=")+" totalPages if "+h+"-based. Got "+g+".")}return a},setPageSize:function(a,b){a=c(a,"pageSize"),b=b||{first:!1};var d=this.state,g=t(d.totalRecords/a),h=g?v(d.firstPage,u(g*(d.firstPage?d.currentPage:d.currentPage+1)/d.totalPages)):d.firstPage;return d=this.state=this._che
 ckState(e({},d,{pageSize:a,currentPage:b.first?d.firstPage:h,totalPages:g})),this.getPage(d.currentPage,f(b,["first"]))},switchMode:function(b,c){if(!j(["server","client","infinite"],b))throw new TypeError('`mode` must be one of "server", "client" or "infinite"');c=c||{fetch:!0,resetState:!0};var d=this.state=c.resetState?g(this._initState):this._checkState(e({},this.state));this.mode=b;var i,k=this,l=this.fullCollection,m=this._handlers=this._handlers||{};if("server"==b||l)"server"==b&&l&&(h(q(m),function(a){i=m[a],k.off(a,i),l.off(a,i)}),delete this._handlers,this._fullComparator=l.comparator,delete this.fullCollection);else{l=this._makeFullCollection(c.models||[]),l.pageableCollection=this,this.fullCollection=l;var n=this._makeCollectionEventHandler(this,l);h(["add","remove","reset","sort"],function(b){m[b]=i=a.bind(n,{},b),k.on(b,i),l.on(b,i)}),l.comparator=this._fullComparator}if("infinite"==b)for(var o=this.links={},p=d.firstPage,r=t(d.totalRecords/d.pageSize),s=0===p?v(0,r-1)
 :r||p,u=d.firstPage;s>=u;u++)o[u]=this.url;else this.links&&delete this.links;return c.fetch?this.fetch(f(c,"fetch","resetState")):this},hasPrevious:function(){var a=this.state,b=a.currentPage;return"infinite"!=this.mode?b>a.firstPage:!!this.links[b-1]},hasNext:function(){var a=this.state,b=this.state.currentPage;return"infinite"!=this.mode?b<a.lastPage:!!this.links[b+1]},getFirstPage:function(a){return this.getPage("first",a)},getPreviousPage:function(a){return this.getPage("prev",a)},getNextPage:function(a){return this.getPage("next",a)},getLastPage:function(a){return this.getPage("last",a)},getPage:function(a,b){var d=this.mode,g=this.fullCollection;b=b||{fetch:!1};var h=this.state,i=h.firstPage,j=h.currentPage,l=h.lastPage,m=h.pageSize,n=a;switch(a){case"first":n=i;break;case"prev":n=j-1;break;case"next":n=j+1;break;case"last":n=l;break;default:n=c(a,"index")}this.state=this._checkState(e({},h,{currentPage:n})),b.from=j,b.to=n;var o=(0===i?n:n-1)*m,p=g&&g.length?g.models.slice(o
 ,o+m):[];return"client"!=d&&("infinite"!=d||k(p))||b.fetch?("infinite"==d&&(b.url=this.links[n]),this.fetch(f(b,"fetch"))):this.reset(p,f(b,"fetch"))},getPageByOffset:function(a,b){if(0>a)throw new RangeError("`offset must be > 0`");a=c(a);var d=u(a/this.state.pageSize);return 0!==this.state.firstPage&&d++,d>this.state.lastPage&&(d=this.state.lastPage),this.getPage(d,b)},sync:function(a,c,d){var f=this;if("infinite"==f.mode){var g=d.success,h=f.state.currentPage;d.success=function(a,b,c){var i=f.links,j=f.parseLinks(a,e({xhr:c},d));j.first&&(i[f.state.firstPage]=j.first),j.prev&&(i[h-1]=j.prev),j.next&&(i[h+1]=j.next),g&&g(a,b,c)}}return(w.sync||b.sync).call(f,a,c,d)},parseLinks:function(a,b){var c={},e=b.xhr.getResponseHeader("Link");if(e){var f=["first","prev","previous","next","last"];h(e.split(","),function(a){var b=a.split(";"),d=b[0].replace(y,""),e=b.slice(1);h(e,function(a){var b=a.split("="),e=b[0].replace(x,""),g=b[1].replace(x,"");"rel"==e&&j(f,g)&&("previous"==g?c.prev=d
 :c[g]=d)})});var i,k,l=c.last||"";if(k=(i=l.indexOf("?"))?l.slice(i+1):""){var m=d(k),n=g(this.state),o=this.queryParams,p=n.pageSize,q=1*m[o.totalRecords],r=1*m[o.currentPage],s=m[o.totalPages];q||(r?q=(0===n.firstPage?r+1:r)*p:s&&(q=s*p)),q&&(n.totalRecords=q),this.state=this._checkState(n)}}return delete c.last,c},parse:function(a,b){var c=this.parseState(a,g(this.queryParams),g(this.state),b);return c&&(this.state=this._checkState(e({},this.state,c))),this.parseRecords(a,b)},parseState:function(b,c,d){if(b&&2===b.length&&p(b[0])&&n(b[1])){var e=g(d),i=b[0];return h(l(f(c,"directions")),function(b){var c=b[0],d=b[1],f=i[d];r(f)||a.isNull(f)||(e[c]=i[d])}),i.order&&(e.order=1*m(c.directions)[i.order]),e}},parseRecords:function(a){return a&&2===a.length&&p(a[0])&&n(a[1])?a[1]:a},fetch:function(a){a=a||{};var b=this._checkState(this.state),c=this.mode;"infinite"!=c||a.url||(a.url=this.links[b.currentPage]);var h=a.data||{},j=s(a,"url")||s(this,"url")||"",k=j.indexOf("?");-1!=k&&(e(h
 ,d(j.slice(k+1))),j=j.slice(0,k)),a.url=j,a.data=h;var m,n,p,t,u="client"==this.mode?i(this.queryParams,"sortKey","order"):f(i(this.queryParams,q(A.queryParams)),"directions"),v=l(u),x=g(this);for(m=0;m<v.length;m++)n=v[m],p=n[0],t=n[1],t=o(t)?t.call(x):t,null!=b[p]&&null!=t&&(h[t]=b[p]);b.sortKey&&b.order?h[u.order]=this.queryParams.directions[b.order+""]:b.sortKey||delete h[u.order];var y=l(f(this.queryParams,q(A.queryParams)));for(m=0;m<y.length;m++)n=y[m],t=n[1],t=o(t)?t.call(x):t,null!=t&&(h[n[0]]=t);if("server"!=c){var z=this,B=this.fullCollection,C=a.success;return a.success=function(b,d,f){f=f||{},r(a.silent)?delete f.silent:f.silent=a.silent;var g=b.models;"client"==c?B.reset(g,f):B.add(g,e({at:B.length},f)),C&&C(b,d,f)},w.fetch.call(z,e({},a,{silent:!0}))}return w.fetch.call(this,a)},_makeComparator:function(a,b,c){var d=this.state;return a=a||d.sortKey,b=b||d.order,a&&b?(c||(c=function(a,b){return a.get(b)}),function(d,e){var f,g=c(d,a),h=c(e,a);return 1===b&&(f=g,g=h,h=f
 ),g===h?0:h>g?-1:1}):void 0},setSorting:function(a,b,c){var d=this.state;d.sortKey=a,d.order=b=b||d.order;var f=this.fullCollection,g=!1,h=!1;a||(g=h=!0);var i=this.mode;c=e({side:"client"==i?i:"server",full:!0},c);var j=this._makeComparator(a,b,c.sortValue),k=c.full,l=c.side;return"client"==l?k?(f&&(f.comparator=j),g=!0):(this.comparator=j,h=!0):"server"!=l||k||(this.comparator=j),g&&delete this.comparator,h&&f&&delete f.comparator,this}}),A=z.prototype;return z});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.js
new file mode 100644
index 0000000..a182eda
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.js
@@ -0,0 +1,178 @@
+// Backbone.BabySitter
+// -------------------
+// v0.0.6
+//
+// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://github.com/babysitterjs/backbone.babysitter
+
+(function (root, factory) {
+  if (typeof exports === 'object') {
+
+    var underscore = require('underscore');
+    var backbone = require('backbone');
+
+    module.exports = factory(underscore, backbone);
+
+  } else if (typeof define === 'function' && define.amd) {
+
+    define(['underscore', 'backbone'], factory);
+
+  } 
+}(this, function (_, Backbone) {
+  "option strict";
+
+  // Backbone.ChildViewContainer
+// ---------------------------
+//
+// Provide a container to store, retrieve and
+// shut down child views.
+
+Backbone.ChildViewContainer = (function(Backbone, _){
+  
+  // Container Constructor
+  // ---------------------
+
+  var Container = function(views){
+    this._views = {};
+    this._indexByModel = {};
+    this._indexByCustom = {};
+    this._updateLength();
+
+    _.each(views, this.add, this);
+  };
+
+  // Container Methods
+  // -----------------
+
+  _.extend(Container.prototype, {
+
+    // Add a view to this container. Stores the view
+    // by `cid` and makes it searchable by the model
+    // cid (and model itself). Optionally specify
+    // a custom key to store an retrieve the view.
+    add: function(view, customIndex){
+      var viewCid = view.cid;
+
+      // store the view
+      this._views[viewCid] = view;
+
+      // index it by model
+      if (view.model){
+        this._indexByModel[view.model.cid] = viewCid;
+      }
+
+      // index by custom
+      if (customIndex){
+        this._indexByCustom[customIndex] = viewCid;
+      }
+
+      this._updateLength();
+    },
+
+    // Find a view by the model that was attached to
+    // it. Uses the model's `cid` to find it.
+    findByModel: function(model){
+      return this.findByModelCid(model.cid);
+    },
+
+    // Find a view by the `cid` of the model that was attached to
+    // it. Uses the model's `cid` to find the view `cid` and
+    // retrieve the view using it.
+    findByModelCid: function(modelCid){
+      var viewCid = this._indexByModel[modelCid];
+      return this.findByCid(viewCid);
+    },
+
+    // Find a view by a custom indexer.
+    findByCustom: function(index){
+      var viewCid = this._indexByCustom[index];
+      return this.findByCid(viewCid);
+    },
+
+    // Find by index. This is not guaranteed to be a
+    // stable index.
+    findByIndex: function(index){
+      return _.values(this._views)[index];
+    },
+
+    // retrieve a view by it's `cid` directly
+    findByCid: function(cid){
+      return this._views[cid];
+    },
+
+    // Remove a view
+    remove: function(view){
+      var viewCid = view.cid;
+
+      // delete model index
+      if (view.model){
+        delete this._indexByModel[view.model.cid];
+      }
+
+      // delete custom index
+      _.any(this._indexByCustom, function(cid, key) {
+        if (cid === viewCid) {
+          delete this._indexByCustom[key];
+          return true;
+        }
+      }, this);
+
+      // remove the view from the container
+      delete this._views[viewCid];
+
+      // update the length
+      this._updateLength();
+    },
+
+    // Call a method on every view in the container,
+    // passing parameters to the call method one at a
+    // time, like `function.call`.
+    call: function(method){
+      this.apply(method, _.tail(arguments));
+    },
+
+    // Apply a method on every view in the container,
+    // passing parameters to the call method one at a
+    // time, like `function.apply`.
+    apply: function(method, args){
+      _.each(this._views, function(view){
+        if (_.isFunction(view[method])){
+          view[method].apply(view, args || []);
+        }
+      });
+    },
+
+    // Update the `.length` attribute on this container
+    _updateLength: function(){
+      this.length = _.size(this._views);
+    }
+  });
+
+  // Borrowing this code from Backbone.Collection:
+  // http://backbonejs.org/docs/backbone.html#section-106
+  //
+  // Mix in methods from Underscore, for iteration, and other
+  // collection related features.
+  var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter', 
+    'select', 'reject', 'every', 'all', 'some', 'any', 'include', 
+    'contains', 'invoke', 'toArray', 'first', 'initial', 'rest', 
+    'last', 'without', 'isEmpty', 'pluck'];
+
+  _.each(methods, function(method) {
+    Container.prototype[method] = function() {
+      var views = _.values(this._views);
+      var args = [views].concat(_.toArray(arguments));
+      return _[method].apply(_, args);
+    };
+  });
+
+  // return the public API
+  return Container;
+})(Backbone, _);
+
+  return Backbone.ChildViewContainer; 
+
+}));
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.min.js
new file mode 100644
index 0000000..78355c8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.babysitter/js/backbone.babysitter.min.js
@@ -0,0 +1,10 @@
+// Backbone.BabySitter
+// -------------------
+// v0.0.6
+//
+// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://github.com/babysitterjs/backbone.babysitter
+
+(function(i,e){if("object"==typeof exports){var t=require("underscore"),n=require("backbone");module.exports=e(t,n)}else"function"==typeof define&&define.amd&&define(["underscore","backbone"],e)})(this,function(i,e){"option strict";return e.ChildViewContainer=function(i,e){var t=function(i){this._views={},this._indexByModel={},this._indexByCustom={},this._updateLength(),e.each(i,this.add,this)};e.extend(t.prototype,{add:function(i,e){var t=i.cid;this._views[t]=i,i.model&&(this._indexByModel[i.model.cid]=t),e&&(this._indexByCustom[e]=t),this._updateLength()},findByModel:function(i){return this.findByModelCid(i.cid)},findByModelCid:function(i){var e=this._indexByModel[i];return this.findByCid(e)},findByCustom:function(i){var e=this._indexByCustom[i];return this.findByCid(e)},findByIndex:function(i){return e.values(this._views)[i]},findByCid:function(i){return this._views[i]},remove:function(i){var t=i.cid;i.model&&delete this._indexByModel[i.model.cid],e.any(this._indexByCustom,functi
 on(i,e){return i===t?(delete this._indexByCustom[e],!0):void 0},this),delete this._views[t],this._updateLength()},call:function(i){this.apply(i,e.tail(arguments))},apply:function(i,t){e.each(this._views,function(n){e.isFunction(n[i])&&n[i].apply(n,t||[])})},_updateLength:function(){this.length=e.size(this._views)}});var n=["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];return e.each(n,function(i){t.prototype[i]=function(){var t=e.values(this._views),n=[t].concat(e.toArray(arguments));return e[i].apply(e,n)}}),t}(e,i),e.ChildViewContainer});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal.js
new file mode 100644
index 0000000..6cd05b0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal.js
@@ -0,0 +1,275 @@
+/**
+ * Bootstrap Modal wrapper for use with Backbone.
+ * 
+ * Takes care of instantiation, manages multiple modals,
+ * adds several options and removes the element from the DOM when closed
+ *
+ * @author Charles Davison <ch...@powmedia.co.uk>
+ *
+ * Events:
+ * shown: Fired when the modal has finished animating in
+ * hidden: Fired when the modal has finished animating out
+ * cancel: The user dismissed the modal
+ * ok: The user clicked OK
+ */
+(function($, _, Backbone) {
+
+  //Set custom template settings
+  var _interpolateBackup = _.templateSettings;
+  _.templateSettings = {
+    interpolate: /\{\{(.+?)\}\}/g,
+    evaluate: /<%([\s\S]+?)%>/g
+  }
+
+  var template = _.template('\
+    <% if (title) { %>\
+      <div class="modal-header">\
+        <% if (allowCancel) { %>\
+          <a class="close">×</a>\
+        <% } %>\
+        <h3>{{title}}</h3>\
+      </div>\
+    <% } %>\
+    <div class="modal-body">{{content}}</div>\
+    <div class="modal-footer">\
+      <% if (allowCancel) { %>\
+        <% if (cancelText) { %>\
+          <a href="#" class="btn cancel">{{cancelText}}</a>\
+        <% } %>\
+      <% } %>\
+      <a href="#" class="btn ok btn-primary">{{okText}}</a>\
+    </div>\
+  ');
+
+  //Reset to users' template settings
+  _.templateSettings = _interpolateBackup;
+  
+
+  var Modal = Backbone.View.extend({
+
+    className: 'modal',
+
+    events: {
+      'click .close': function(event) {
+        event.preventDefault();
+
+        this.trigger('cancel');
+
+        if (this.options.content && this.options.content.trigger) {
+          this.options.content.trigger('cancel', this);
+        }
+      },
+      'click .cancel': function(event) {
+        event.preventDefault();
+
+        this.trigger('cancel');
+
+        if (this.options.content && this.options.content.trigger) {
+          this.options.content.trigger('cancel', this);
+        }
+      },
+      'click .ok': function(event) {
+        event.preventDefault();
+
+        this.trigger('ok');
+
+        if (this.options.content && this.options.content.trigger) {
+          this.options.content.trigger('ok', this);
+        }
+
+        if (this.options.okCloses) {
+          this.close();
+        }
+      }
+    },
+
+    /**
+     * Creates an instance of a Bootstrap Modal
+     *
+     * @see http://twitter.github.com/bootstrap/javascript.html#modals
+     *
+     * @param {Object} options
+     * @param {String|View} [options.content] Modal content. Default: none
+     * @param {String} [options.title]        Title. Default: none
+     * @param {String} [options.okText]       Text for the OK button. Default: 'OK'
+     * @param {String} [options.cancelText]   Text for the cancel button. Default: 'Cancel'. If passed a falsey value, the button will be removed
+     * @param {Boolean} [options.allowCancel  Whether the modal can be closed, other than by pressing OK. Default: true
+     * @param {Boolean} [options.escape]      Whether the 'esc' key can dismiss the modal. Default: true, but false if options.cancellable is true
+     * @param {Boolean} [options.animate]     Whether to animate in/out. Default: false
+     * @param {Function} [options.template]   Compiled underscore template to override the default one
+     */
+    initialize: function(options) {
+      this.options = _.extend({
+        title: null,
+        okText: 'OK',
+        focusOk: true,
+        okCloses: true,
+        cancelText: 'Cancel',
+        allowCancel: true,
+        escape: true,
+        animate: false,
+        template: template
+      }, options);
+    },
+
+    /**
+     * Creates the DOM element
+     * 
+     * @api private
+     */
+    render: function() {
+      var $el = this.$el,
+          options = this.options,
+          content = options.content;
+
+      //Create the modal container
+      $el.html(options.template(options));
+
+      var $content = this.$content = $el.find('.modal-body')
+
+      //Insert the main content if it's a view
+      if (content.$el) {
+        content.render();
+        $el.find('.modal-body').html(content.$el);
+      }
+
+      if (options.animate) $el.addClass('fade');
+
+      this.isRendered = true;
+
+      return this;
+    },
+
+    /**
+     * Renders and shows the modal
+     *
+     * @param {Function} [cb]     Optional callback that runs only when OK is pressed.
+     */
+    open: function(cb) {
+      if (!this.isRendered) this.render();
+
+      var self = this,
+          $el = this.$el;
+
+      //Create it
+      $el.modal(_.extend({
+        keyboard: this.options.allowCancel,
+        backdrop: this.options.allowCancel ? true : 'static'
+      }, this.options.modalOptions));
+
+      //Focus OK button
+      $el.one('shown', function() {
+        if (self.options.focusOk) {
+          $el.find('.btn.ok').focus();
+        }
+
+        if (self.options.content && self.options.content.trigger) {
+          self.options.content.trigger('shown', self);
+        }
+
+        self.trigger('shown');
+      });
+
+      //Adjust the modal and backdrop z-index; for dealing with multiple modals
+      var numModals = Modal.count,
+          $backdrop = $('.modal-backdrop:eq('+numModals+')'),
+          backdropIndex = parseInt($backdrop.css('z-index'),10),
+          elIndex = parseInt($backdrop.css('z-index'), 10);
+
+      $backdrop.css('z-index', backdropIndex + numModals);
+      this.$el.css('z-index', elIndex + numModals);
+
+      if (this.options.allowCancel) {
+        $backdrop.one('click', function() {
+          if (self.options.content && self.options.content.trigger) {
+            self.options.content.trigger('cancel', self);
+          }
+
+          self.trigger('cancel');
+        });
+        
+        $(document).one('keyup.dismiss.modal', function (e) {
+          e.which == 27 && self.trigger('cancel');
+
+          if (self.options.content && self.options.content.trigger) {
+            e.which == 27 && self.options.content.trigger('shown', self);
+          }
+        });
+      }
+
+      this.on('cancel', function() {
+        self.close();
+      });
+
+      Modal.count++;
+
+      //Run callback on OK if provided
+      if (cb) {
+        self.on('ok', cb);
+      }
+      
+      return this;
+    },
+
+    /**
+     * Closes the modal
+     */
+    close: function() {
+      var self = this,
+          $el = this.$el;
+
+      //Check if the modal should stay open
+      if (this._preventClose) {
+        this._preventClose = false;
+        return;
+      }
+
+      $el.one('hidden', function() {
+        self.remove();
+
+        if (self.options.content && self.options.content.trigger) {
+          self.options.content.trigger('hidden', self);
+        }
+
+        self.trigger('hidden');
+      });
+
+      $el.modal('hide');
+
+      Modal.count--;
+    },
+
+    /**
+     * Stop the modal from closing.
+     * Can be called from within a 'close' or 'ok' event listener.
+     */
+    preventClose: function() {
+      this._preventClose = true;
+    }
+  }, {
+    //STATICS
+
+    //The number of modals on display
+    count: 0
+  });
+
+
+  //EXPORTS
+  //CommonJS
+  if (typeof require == 'function' && typeof module !== 'undefined' && exports) {
+    module.exports = Modal;
+  }
+
+  //AMD / RequireJS
+  if (typeof define === 'function' && define.amd) {
+    return define(function() {
+      Backbone.BootstrapModal = Modal;
+    })
+  }
+
+  //Regular; add to Backbone.Bootstrap.Modal
+  else {
+    Backbone.BootstrapModal = Modal;
+  }
+
+})(jQuery, _, Backbone);

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.localstorage/backbone.localStorage.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.localstorage/backbone.localStorage.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.localstorage/backbone.localStorage.js
new file mode 100644
index 0000000..4446d4a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.localstorage/backbone.localStorage.js
@@ -0,0 +1,222 @@
+/**
+ * Backbone localStorage Adapter
+ * Version 1.1.7
+ *
+ * https://github.com/jeromegn/Backbone.localStorage
+ */
+(function (root, factory) {
+   if (typeof exports === 'object' && typeof require === 'function') {
+     module.exports = factory(require("underscore"), require("backbone"));
+   } else if (typeof define === "function" && define.amd) {
+      // AMD. Register as an anonymous module.
+      define(["underscore","backbone"], function(_, Backbone) {
+        // Use global variables if the locals are undefined.
+        return factory(_ || root._, Backbone || root.Backbone);
+      });
+   } else {
+      // RequireJS isn't being used. Assume underscore and backbone are loaded in <script> tags
+      factory(_, Backbone);
+   }
+}(this, function(_, Backbone) {
+// A simple module to replace `Backbone.sync` with *localStorage*-based
+// persistence. Models are given GUIDS, and saved into a JSON object. Simple
+// as that.
+
+// Hold reference to Underscore.js and Backbone.js in the closure in order
+// to make things work even if they are removed from the global namespace
+
+// Generate four random hex digits.
+function S4() {
+   return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
+};
+
+// Generate a pseudo-GUID by concatenating random hexadecimal.
+function guid() {
+   return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
+};
+
+// Our Store is represented by a single JS object in *localStorage*. Create it
+// with a meaningful name, like the name you'd give a table.
+// window.Store is deprectated, use Backbone.LocalStorage instead
+Backbone.LocalStorage = window.Store = function(name) {
+  if( !this.localStorage ) {
+    throw "Backbone.localStorage: Environment does not support localStorage."
+  }
+  this.name = name;
+  var store = this.localStorage().getItem(this.name);
+  this.records = (store && store.split(",")) || [];
+};
+
+_.extend(Backbone.LocalStorage.prototype, {
+
+  // Save the current state of the **Store** to *localStorage*.
+  save: function() {
+    this.localStorage().setItem(this.name, this.records.join(","));
+  },
+
+  // Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
+  // have an id of it's own.
+  create: function(model) {
+    if (!model.id) {
+      model.id = guid();
+      model.set(model.idAttribute, model.id);
+    }
+    this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
+    this.records.push(model.id.toString());
+    this.save();
+    return this.find(model);
+  },
+
+  // Update a model by replacing its copy in `this.data`.
+  update: function(model) {
+    this.localStorage().setItem(this.name+"-"+model.id, JSON.stringify(model));
+    if (!_.include(this.records, model.id.toString()))
+      this.records.push(model.id.toString()); this.save();
+    return this.find(model);
+  },
+
+  // Retrieve a model from `this.data` by id.
+  find: function(model) {
+    return this.jsonData(this.localStorage().getItem(this.name+"-"+model.id));
+  },
+
+  // Return the array of all models currently in storage.
+  findAll: function() {
+    // Lodash removed _#chain in v1.0.0-rc.1
+    return (_.chain || _)(this.records)
+      .map(function(id){
+        return this.jsonData(this.localStorage().getItem(this.name+"-"+id));
+      }, this)
+      .compact()
+      .value();
+  },
+
+  // Delete a model from `this.data`, returning it.
+  destroy: function(model) {
+    if (model.isNew())
+      return false
+    this.localStorage().removeItem(this.name+"-"+model.id);
+    this.records = _.reject(this.records, function(id){
+      return id === model.id.toString();
+    });
+    this.save();
+    return model;
+  },
+
+  localStorage: function() {
+    return localStorage;
+  },
+
+  // fix for "illegal access" error on Android when JSON.parse is passed null
+  jsonData: function (data) {
+      return data && JSON.parse(data);
+  },
+
+  // Clear localStorage for specific collection.
+  _clear: function() {
+    var local = this.localStorage(),
+      itemRe = new RegExp("^" + this.name + "-");
+
+    // Remove id-tracking item (e.g., "foo").
+    local.removeItem(this.name);
+
+    // Lodash removed _#chain in v1.0.0-rc.1
+    // Match all data items (e.g., "foo-ID") and remove.
+    (_.chain || _)(local).keys()
+      .filter(function (k) { return itemRe.test(k); })
+      .each(function (k) { local.removeItem(k); });
+
+    this.records.length = 0;
+  },
+
+  // Size of localStorage.
+  _storageSize: function() {
+    return this.localStorage().length;
+  }
+
+});
+
+// localSync delegate to the model or collection's
+// *localStorage* property, which should be an instance of `Store`.
+// window.Store.sync and Backbone.localSync is deprecated, use Backbone.LocalStorage.sync instead
+Backbone.LocalStorage.sync = window.Store.sync = Backbone.localSync = function(method, model, options) {
+  var store = model.localStorage || model.collection.localStorage;
+
+  var resp, errorMessage, syncDfd = Backbone.$.Deferred && Backbone.$.Deferred(); //If $ is having Deferred - use it.
+
+  try {
+
+    switch (method) {
+      case "read":
+        resp = model.id != undefined ? store.find(model) : store.findAll();
+        break;
+      case "create":
+        resp = store.create(model);
+        break;
+      case "update":
+        resp = store.update(model);
+        break;
+      case "delete":
+        resp = store.destroy(model);
+        break;
+    }
+
+  } catch(error) {
+    if (error.code === 22 && store._storageSize() === 0)
+      errorMessage = "Private browsing is unsupported";
+    else
+      errorMessage = error.message;
+  }
+
+  if (resp) {
+    if (options && options.success) {
+      if (Backbone.VERSION === "0.9.10") {
+        options.success(model, resp, options);
+      } else {
+        options.success(resp);
+      }
+    }
+    if (syncDfd) {
+      syncDfd.resolve(resp);
+    }
+
+  } else {
+    errorMessage = errorMessage ? errorMessage
+                                : "Record Not Found";
+
+    if (options && options.error)
+      if (Backbone.VERSION === "0.9.10") {
+        options.error(model, errorMessage, options);
+      } else {
+        options.error(errorMessage);
+      }
+
+    if (syncDfd)
+      syncDfd.reject(errorMessage);
+  }
+
+  // add compatibility with $.ajax
+  // always execute callback for success and error
+  if (options && options.complete) options.complete(resp);
+
+  return syncDfd && syncDfd.promise();
+};
+
+Backbone.ajaxSync = Backbone.sync;
+
+Backbone.getSyncMethod = function(model) {
+  if(model.localStorage || (model.collection && model.collection.localStorage)) {
+    return Backbone.localSync;
+  }
+
+  return Backbone.ajaxSync;
+};
+
+// Override 'Backbone.sync' to default to localSync,
+// the original 'Backbone.sync' is still available in 'Backbone.ajaxSync'
+Backbone.sync = function(method, model, options) {
+  return Backbone.getSyncMethod(model).apply(this, [method, model, options]);
+};
+
+return Backbone.LocalStorage;
+}));


[23/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.min.js
new file mode 100644
index 0000000..447d646
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.min.js
@@ -0,0 +1,20 @@
+// MarionetteJS (Backbone.Marionette)
+// ----------------------------------
+// v1.8.8
+//
+// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://marionettejs.com
+
+
+/*!
+ * Includes BabySitter
+ * https://github.com/marionettejs/backbone.babysitter/
+ *
+ * Includes Wreqr
+ * https://github.com/marionettejs/backbone.wreqr/
+ */
+
+
+!function(a,b){if("object"==typeof exports){var c=require("underscore"),d=require("backbone"),e=require("backbone.wreqr"),f=require("backbone.babysitter");module.exports=b(c,d,e,f)}else"function"==typeof define&&define.amd&&define(["underscore","backbone","backbone.wreqr","backbone.babysitter"],b)}(this,function(a,b){!function(a,b,c){"use strict";function d(a,b){var c=new Error(a);throw c.name=b||"Error",c}var e={};b.Marionette=e,e.$=b.$;var f=Array.prototype.slice;return e.extend=b.Model.extend,e.getOption=function(a,b){if(a&&b){var c;return c=a.options&&b in a.options&&void 0!==a.options[b]?a.options[b]:a[b]}},e.normalizeMethods=function(a){var b,d={};return c.each(a,function(a,e){b=a,c.isFunction(b)||(b=this[b]),b&&(d[e]=b)},this),d},e.normalizeUIKeys=function(a,b){return"undefined"!=typeof a?(c.each(c.keys(a),function(c){var d=/@ui.[a-zA-Z_$0-9]*/g;c.match(d)&&(a[c.replace(d,function(a){return b[a.slice(4)]})]=a[c],delete a[c])}),a):void 0},e.actAsCollection=function(a,b){var d=
 ["forEach","each","map","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","toArray","first","initial","rest","last","without","isEmpty","pluck"];c.each(d,function(d){a[d]=function(){var a=c.values(c.result(this,b)),e=[a].concat(c.toArray(arguments));return c[d].apply(c,e)}})},e.triggerMethod=function(){function a(a,b,c){return c.toUpperCase()}var b=/(^|:)(\w)/gi,d=function(d){var e="on"+d.replace(b,a),f=this[e];return c.isFunction(this.trigger)&&this.trigger.apply(this,arguments),c.isFunction(f)?f.apply(this,c.tail(arguments)):void 0};return d}(),e.MonitorDOMRefresh=function(a){function b(a){a._isShown=!0,e(a)}function d(a){a._isRendered=!0,e(a)}function e(a){a._isShown&&a._isRendered&&f(a)&&c.isFunction(a.triggerMethod)&&a.triggerMethod("dom:refresh")}function f(b){return a.contains(b.el)}return function(a){a.listenTo(a,"show",function(){b(a)}),a.listenTo(a,"render",function(){d(a)})}}(document.documentElement),function(a){function 
 b(a,b,e,f){var g=f.split(/\s+/);c.each(g,function(c){var f=a[c];f||d("Method '"+c+"' was configured as an event handler, but does not exist."),a.listenTo(b,e,f)})}function e(a,b,c,d){a.listenTo(b,c,d)}function f(a,b,d,e){var f=e.split(/\s+/);c.each(f,function(c){var e=a[c];a.stopListening(b,d,e)})}function g(a,b,c,d){a.stopListening(b,c,d)}function h(a,b,d,e,f){b&&d&&(c.isFunction(d)&&(d=d.call(a)),c.each(d,function(d,g){c.isFunction(d)?e(a,b,g,d):f(a,b,g,d)}))}a.bindEntityEvents=function(a,c,d){h(a,c,d,e,b)},a.unbindEntityEvents=function(a,b,c){h(a,b,c,g,f)}}(e),e.Callbacks=function(){this._deferred=e.$.Deferred(),this._callbacks=[]},c.extend(e.Callbacks.prototype,{add:function(a,b){this._callbacks.push({cb:a,ctx:b}),this._deferred.done(function(c,d){b&&(c=b),a.call(c,d)})},run:function(a,b){this._deferred.resolve(b,a)},reset:function(){var a=this._callbacks;this._deferred=e.$.Deferred(),this._callbacks=[],c.each(a,function(a){this.add(a.cb,a.ctx)},this)}}),e.Controller=function(a)
 {this.triggerMethod=e.triggerMethod,this.options=a||{},c.isFunction(this.initialize)&&this.initialize(this.options)},e.Controller.extend=e.extend,c.extend(e.Controller.prototype,b.Events,{close:function(){this.stopListening();var a=Array.prototype.slice.call(arguments);this.triggerMethod.apply(this,["close"].concat(a)),this.off()}}),e.Region=function(a){if(this.options=a||{},this.el=e.getOption(this,"el"),this.el||d("An 'el' must be specified for a region.","NoElError"),this.initialize){var b=Array.prototype.slice.apply(arguments);this.initialize.apply(this,b)}},c.extend(e.Region,{buildRegion:function(a,b){var e=c.isString(a),f=c.isString(a.selector),g=c.isUndefined(a.regionType),h=c.isFunction(a);h||e||f||d("Region must be specified as a Region type, a selector string or an object with selector property");var i,j;e&&(i=a),a.selector&&(i=a.selector,delete a.selector),h&&(j=a),!h&&g&&(j=b),a.regionType&&(j=a.regionType,delete a.regionType),(e||h)&&(a={}),a.el=i;var k=new j(a);return 
 a.parentEl&&(k.getEl=function(b){var d=a.parentEl;return c.isFunction(d)&&(d=d()),d.find(b)}),k}}),c.extend(e.Region.prototype,b.Events,{show:function(a,b){this.ensureEl();var d=b||{},f=a.isClosed||c.isUndefined(a.$el),g=a!==this.currentView,h=!!d.preventClose,i=!h&&g;return i&&this.close(),a.render(),e.triggerMethod.call(this,"before:show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("before:show"):e.triggerMethod.call(a,"before:show"),(g||f)&&this.open(a),this.currentView=a,e.triggerMethod.call(this,"show",a),c.isFunction(a.triggerMethod)?a.triggerMethod("show"):e.triggerMethod.call(a,"show"),this},ensureEl:function(){this.$el&&0!==this.$el.length||(this.$el=this.getEl(this.el))},getEl:function(a){return e.$(a)},open:function(a){this.$el.empty().append(a.el)},close:function(){var a=this.currentView;a&&!a.isClosed&&(a.close?a.close():a.remove&&a.remove(),e.triggerMethod.call(this,"close",a),delete this.currentView)},attachView:function(a){this.currentView=a},reset:function(){th
 is.close(),delete this.$el}}),e.Region.extend=e.extend,e.RegionManager=function(a){var b=a.Controller.extend({constructor:function(b){this._regions={},a.Controller.prototype.constructor.call(this,b)},addRegions:function(a,b){var d={};return c.each(a,function(a,e){c.isString(a)&&(a={selector:a}),a.selector&&(a=c.defaults({},a,b));var f=this.addRegion(e,a);d[e]=f},this),d},addRegion:function(b,d){var e,f=c.isObject(d),g=c.isString(d),h=!!d.selector;return e=g||f&&h?a.Region.buildRegion(d,a.Region):c.isFunction(d)?a.Region.buildRegion(d,a.Region):d,this._store(b,e),this.triggerMethod("region:add",b,e),e},get:function(a){return this._regions[a]},removeRegion:function(a){var b=this._regions[a];this._remove(a,b)},removeRegions:function(){c.each(this._regions,function(a,b){this._remove(b,a)},this)},closeRegions:function(){c.each(this._regions,function(a){a.close()},this)},close:function(){this.removeRegions(),a.Controller.prototype.close.apply(this,arguments)},_store:function(a,b){this._re
 gions[a]=b,this._setLength()},_remove:function(a,b){b.close(),b.stopListening(),delete this._regions[a],this._setLength(),this.triggerMethod("region:remove",a,b)},_setLength:function(){this.length=c.size(this._regions)}});return a.actAsCollection(b.prototype,"_regions"),b}(e),e.TemplateCache=function(a){this.templateId=a},c.extend(e.TemplateCache,{templateCaches:{},get:function(a){var b=this.templateCaches[a];return b||(b=new e.TemplateCache(a),this.templateCaches[a]=b),b.load()},clear:function(){var a,b=f.call(arguments),c=b.length;if(c>0)for(a=0;c>a;a++)delete this.templateCaches[b[a]];else this.templateCaches={}}}),c.extend(e.TemplateCache.prototype,{load:function(){if(this.compiledTemplate)return this.compiledTemplate;var a=this.loadTemplate(this.templateId);return this.compiledTemplate=this.compileTemplate(a),this.compiledTemplate},loadTemplate:function(a){var b=e.$(a).html();return b&&0!==b.length||d("Could not find template: '"+a+"'","NoTemplateError"),b},compileTemplate:func
 tion(a){return c.template(a)}}),e.Renderer={render:function(a,b){a||d("Cannot render the template since it's false, null or undefined.","TemplateNotFoundError");var c;return(c="function"==typeof a?a:e.TemplateCache.get(a))(b)}},e.View=b.View.extend({constructor:function(a){c.bindAll(this,"render"),this.options=c.extend({},c.result(this,"options"),c.isFunction(a)?a.call(this):a),this.events=this.normalizeUIKeys(c.result(this,"events")),c.isObject(this.behaviors)&&new e.Behaviors(this),b.View.prototype.constructor.apply(this,arguments),e.MonitorDOMRefresh(this),this.listenTo(this,"show",this.onShowCalled)},triggerMethod:e.triggerMethod,normalizeMethods:e.normalizeMethods,getTemplate:function(){return e.getOption(this,"template")},mixinTemplateHelpers:function(a){a=a||{};var b=e.getOption(this,"templateHelpers");return c.isFunction(b)&&(b=b.call(this)),c.extend(a,b)},normalizeUIKeys:function(a){var b=c.result(this,"ui");return e.normalizeUIKeys(a,b)},configureTriggers:function(){if(thi
 s.triggers){var a={},b=this.normalizeUIKeys(c.result(this,"triggers"));return c.each(b,function(b,d){var e=c.isObject(b),f=e?b.event:b;a[d]=function(a){if(a){var c=a.preventDefault,d=a.stopPropagation,g=e?b.preventDefault:c,h=e?b.stopPropagation:d;g&&c&&c.apply(a),h&&d&&d.apply(a)}var i={view:this,model:this.model,collection:this.collection};this.triggerMethod(f,i)}},this),a}},delegateEvents:function(a){this._delegateDOMEvents(a),e.bindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.bindEntityEvents(this,this.collection,e.getOption(this,"collectionEvents"))},_delegateDOMEvents:function(a){a=a||this.events,c.isFunction(a)&&(a=a.call(this));var d={},e=c.result(this,"behaviorEvents")||{},f=this.configureTriggers();c.extend(d,e,a,f),b.View.prototype.delegateEvents.call(this,d)},undelegateEvents:function(){var a=Array.prototype.slice.call(arguments);b.View.prototype.undelegateEvents.apply(this,a),e.unbindEntityEvents(this,this.model,e.getOption(this,"modelEvents")),e.unbi
 ndEntityEvents(this,this.collection,e.getOption(this,"collectionEvents"))},onShowCalled:function(){},close:function(){if(!this.isClosed){var a=Array.prototype.slice.call(arguments),b=this.triggerMethod.apply(this,["before:close"].concat(a));b!==!1&&(this.isClosed=!0,this.triggerMethod.apply(this,["close"].concat(a)),this.unbindUIElements(),this.remove())}},bindUIElements:function(){if(this.ui){this._uiBindings||(this._uiBindings=this.ui);var a=c.result(this,"_uiBindings");this.ui={},c.each(c.keys(a),function(b){var c=a[b];this.ui[b]=this.$(c)},this)}},unbindUIElements:function(){this.ui&&this._uiBindings&&(c.each(this.ui,function(a,b){delete this.ui[b]},this),this.ui=this._uiBindings,delete this._uiBindings)}}),e.ItemView=e.View.extend({constructor:function(){e.View.prototype.constructor.apply(this,arguments)},serializeData:function(){var a={};return this.model?a=this.model.toJSON():this.collection&&(a={items:this.collection.toJSON()}),a},render:function(){this.isClosed=!1,this.trig
 gerMethod("before:render",this),this.triggerMethod("item:before:render",this);var a=this.serializeData();a=this.mixinTemplateHelpers(a);var b=this.getTemplate(),c=e.Renderer.render(b,a);return this.$el.html(c),this.bindUIElements(),this.triggerMethod("render",this),this.triggerMethod("item:rendered",this),this},close:function(){this.isClosed||(this.triggerMethod("item:before:close"),e.View.prototype.close.apply(this,arguments),this.triggerMethod("item:closed"))}}),e.CollectionView=e.View.extend({itemViewEventPrefix:"itemview",constructor:function(){this._initChildViewStorage(),e.View.prototype.constructor.apply(this,arguments),this._initialEvents(),this.initRenderBuffer()},initRenderBuffer:function(){this.elBuffer=document.createDocumentFragment(),this._bufferedChildren=[]},startBuffering:function(){this.initRenderBuffer(),this.isBuffering=!0},endBuffering:function(){this.isBuffering=!1,this.appendBuffer(this,this.elBuffer),this._triggerShowBufferedChildren(),this.initRenderBuffer()
 },_triggerShowBufferedChildren:function(){this._isShown&&(c.each(this._bufferedChildren,function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):e.triggerMethod.call(a,"show")}),this._bufferedChildren=[])},_initialEvents:function(){this.collection&&(this.listenTo(this.collection,"add",this.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this.render))},addChildView:function(a){this.closeEmptyView();var b=this.getItemView(a),c=this.collection.indexOf(a);this.addItemView(a,b,c)},onShowCalled:function(){this.children.each(function(a){c.isFunction(a.triggerMethod)?a.triggerMethod("show"):e.triggerMethod.call(a,"show")})},triggerBeforeRender:function(){this.triggerMethod("before:render",this),this.triggerMethod("collection:before:render",this)},triggerRendered:function(){this.triggerMethod("render",this),this.triggerMethod("collection:rendered",this)},render:function(){return this.isClosed=!1,this.triggerBeforeRender
 (),this._renderChildren(),this.triggerRendered(),this},_renderChildren:function(){this.startBuffering(),this.closeEmptyView(),this.closeChildren(),this.isEmpty(this.collection)?this.showEmptyView():this.showCollection(),this.endBuffering()},showCollection:function(){var a;this.collection.each(function(b,c){a=this.getItemView(b),this.addItemView(b,a,c)},this)},showEmptyView:function(){var a=this.getEmptyView();if(a&&!this._showingEmptyView){this._showingEmptyView=!0;var c=new b.Model;this.addItemView(c,a,0)}},closeEmptyView:function(){this._showingEmptyView&&(this.closeChildren(),delete this._showingEmptyView)},getEmptyView:function(){return e.getOption(this,"emptyView")},getItemView:function(){var a=e.getOption(this,"itemView");return a||d("An `itemView` must be specified","NoItemViewError"),a},addItemView:function(a,b,d){var f=e.getOption(this,"itemViewOptions");c.isFunction(f)&&(f=f.call(this,a,d));var g=this.buildItemView(a,b,f);return this.addChildViewEventForwarding(g),this.tri
 ggerMethod("before:item:added",g),this.children.add(g),this.renderItemView(g,d),this._isShown&&!this.isBuffering&&(c.isFunction(g.triggerMethod)?g.triggerMethod("show"):e.triggerMethod.call(g,"show")),this.triggerMethod("after:item:added",g),g},addChildViewEventForwarding:function(a){var b=e.getOption(this,"itemViewEventPrefix");this.listenTo(a,"all",function(){var d=f.call(arguments),g=d[0],h=this.normalizeMethods(this.getItemEvents());d[0]=b+":"+g,d.splice(1,0,a),"undefined"!=typeof h&&c.isFunction(h[g])&&h[g].apply(this,d),e.triggerMethod.apply(this,d)},this)},getItemEvents:function(){return c.isFunction(this.itemEvents)?this.itemEvents.call(this):this.itemEvents},renderItemView:function(a,b){a.render(),this.appendHtml(this,a,b)},buildItemView:function(a,b,d){var e=c.extend({model:a},d);return new b(e)},removeItemView:function(a){var b=this.children.findByModel(a);this.removeChildView(b),this.checkEmpty()},removeChildView:function(a){a&&(a.close?a.close():a.remove&&a.remove(),thi
 s.stopListening(a),this.children.remove(a)),this.triggerMethod("item:removed",a)},isEmpty:function(){return!this.collection||0===this.collection.length},checkEmpty:function(){this.isEmpty(this.collection)&&this.showEmptyView()},appendBuffer:function(a,b){a.$el.append(b)},appendHtml:function(a,b){a.isBuffering?(a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b)):a.$el.append(b.el)},_initChildViewStorage:function(){this.children=new b.ChildViewContainer},close:function(){this.isClosed||(this.triggerMethod("collection:before:close"),this.closeChildren(),this.triggerMethod("collection:closed"),e.View.prototype.close.apply(this,arguments))},closeChildren:function(){this.children.each(function(a){this.removeChildView(a)},this),this.checkEmpty()}}),e.CompositeView=e.CollectionView.extend({constructor:function(){e.CollectionView.prototype.constructor.apply(this,arguments)},_initialEvents:function(){this.once("render",function(){this.collection&&(this.listenTo(this.collection,"add",thi
 s.addChildView),this.listenTo(this.collection,"remove",this.removeItemView),this.listenTo(this.collection,"reset",this._renderChildren))})},getItemView:function(){var a=e.getOption(this,"itemView")||this.constructor;return a||d("An `itemView` must be specified","NoItemViewError"),a},serializeData:function(){var a={};return this.model&&(a=this.model.toJSON()),a},render:function(){this.isRendered=!0,this.isClosed=!1,this.resetItemViewContainer(),this.triggerBeforeRender();var a=this.renderModel();return this.$el.html(a),this.bindUIElements(),this.triggerMethod("composite:model:rendered"),this._renderChildren(),this.triggerMethod("composite:rendered"),this.triggerRendered(),this},_renderChildren:function(){this.isRendered&&(this.triggerMethod("composite:collection:before:render"),e.CollectionView.prototype._renderChildren.call(this),this.triggerMethod("composite:collection:rendered"))},renderModel:function(){var a={};a=this.serializeData(),a=this.mixinTemplateHelpers(a);var b=this.getT
 emplate();return e.Renderer.render(b,a)},appendBuffer:function(a,b){var c=this.getItemViewContainer(a);c.append(b)},appendHtml:function(a,b){if(a.isBuffering)a.elBuffer.appendChild(b.el),a._bufferedChildren.push(b);else{var c=this.getItemViewContainer(a);c.append(b.el)}},getItemViewContainer:function(a){if("$itemViewContainer"in a)return a.$itemViewContainer;var b,f=e.getOption(a,"itemViewContainer");if(f){var g=c.isFunction(f)?f.call(a):f;b="@"===g.charAt(0)&&a.ui?a.ui[g.substr(4)]:a.$(g),b.length<=0&&d("The specified `itemViewContainer` was not found: "+a.itemViewContainer,"ItemViewContainerMissingError")}else b=a.$el;return a.$itemViewContainer=b,b},resetItemViewContainer:function(){this.$itemViewContainer&&delete this.$itemViewContainer}}),e.Layout=e.ItemView.extend({regionType:e.Region,constructor:function(a){a=a||{},this._firstRender=!0,this._initializeRegions(a),e.ItemView.prototype.constructor.call(this,a)},render:function(){return this.isClosed&&this._initializeRegions(),th
 is._firstRender?this._firstRender=!1:this.isClosed||this._reInitializeRegions(),e.ItemView.prototype.render.apply(this,arguments)},close:function(){this.isClosed||(this.regionManager.close(),e.ItemView.prototype.close.apply(this,arguments))},addRegion:function(a,b){var c={};return c[a]=b,this._buildRegions(c)[a]},addRegions:function(a){return this.regions=c.extend({},this.regions,a),this._buildRegions(a)},removeRegion:function(a){return delete this.regions[a],this.regionManager.removeRegion(a)},getRegion:function(a){return this.regionManager.get(a)},_buildRegions:function(a){var b=this,c={regionType:e.getOption(this,"regionType"),parentEl:function(){return b.$el}};return this.regionManager.addRegions(a,c)},_initializeRegions:function(a){var b;this._initRegionManager(),b=c.isFunction(this.regions)?this.regions(a):this.regions||{},this.addRegions(b)},_reInitializeRegions:function(){this.regionManager.closeRegions(),this.regionManager.each(function(a){a.reset()})},_initRegionManager:fu
 nction(){this.regionManager=new e.RegionManager,this.listenTo(this.regionManager,"region:add",function(a,b){this[a]=b,this.trigger("region:add",a,b)}),this.listenTo(this.regionManager,"region:remove",function(a,b){delete this[a],this.trigger("region:remove",a,b)})}}),e.Behavior=function(a,b){function c(b,c){this.view=c,this.defaults=a.result(this,"defaults")||{},this.options=a.extend({},this.defaults,b),this.$=function(){return this.view.$.apply(this.view,arguments)},this.initialize.apply(this,arguments)}return a.extend(c.prototype,b.Events,{initialize:function(){},close:function(){this.stopListening()},triggerMethod:e.triggerMethod}),c.extend=e.extend,c}(c,b),e.Behaviors=function(a,b){function c(a){this.behaviors=c.parseBehaviors(a,b.result(a,"behaviors")),c.wrap(a,this.behaviors,["bindUIElements","unbindUIElements","delegateEvents","undelegateEvents","behaviorEvents","triggerMethod","setElement","close"])}var d={setElement:function(a,c){a.apply(this,b.tail(arguments,2)),b.each(c,f
 unction(a){a.$el=this.$el},this)},close:function(a,c){var d=b.tail(arguments,2);a.apply(this,d),b.invoke(c,"close",d)},bindUIElements:function(a,c){a.apply(this),b.invoke(c,a)},unbindUIElements:function(a,c){a.apply(this),b.invoke(c,a)},triggerMethod:function(a,c){var d=b.tail(arguments,2);a.apply(this,d),b.each(c,function(b){a.apply(b,d)})},delegateEvents:function(c,d){var e=b.tail(arguments,2);c.apply(this,e),b.each(d,function(b){a.bindEntityEvents(b,this.model,a.getOption(b,"modelEvents")),a.bindEntityEvents(b,this.collection,a.getOption(b,"collectionEvents"))},this)},undelegateEvents:function(c,d){var e=b.tail(arguments,2);c.apply(this,e),b.each(d,function(b){a.unbindEntityEvents(b,this.model,a.getOption(b,"modelEvents")),a.unbindEntityEvents(b,this.collection,a.getOption(b,"collectionEvents"))},this)},behaviorEvents:function(c,d){var e={},f=b.result(this,"ui");return b.each(d,function(c,d){var g={},h=b.clone(b.result(c,"events"))||{},i=b.result(c,"ui"),j=b.extend({},f,i);h=a.no
 rmalizeUIKeys(h,j),b.each(b.keys(h),function(a){var e=new Array(d+2).join(" "),f=a+e,i=b.isFunction(h[a])?h[a]:c[h[a]];g[f]=b.bind(i,c)}),e=b.extend(e,g)}),e}};return b.extend(c,{behaviorsLookup:function(){throw new Error("You must define where your behaviors are stored. See https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.behaviors.md#behaviorslookup")},getBehaviorClass:function(a,d){return a.behaviorClass?a.behaviorClass:b.isFunction(c.behaviorsLookup)?c.behaviorsLookup.apply(this,arguments)[d]:c.behaviorsLookup[d]},parseBehaviors:function(a,d){return b.map(d,function(b,d){var e=c.getBehaviorClass(b,d);return new e(b,a)})},wrap:function(a,c,e){b.each(e,function(e){a[e]=b.partial(d[e],a[e],c)})}}),c}(e,c),e.AppRouter=b.Router.extend({constructor:function(a){b.Router.prototype.constructor.apply(this,arguments),this.options=a||{};var c=e.getOption(this,"appRoutes"),d=this._getController();this.processAppRoutes(d,c),this.on("route",this._processOnRoute,t
 his)},appRoute:function(a,b){var c=this._getController();this._addAppRoute(c,a,b)},_processOnRoute:function(a,b){var d=c.invert(this.appRoutes)[a];c.isFunction(this.onRoute)&&this.onRoute(a,d,b)},processAppRoutes:function(a,b){if(b){var d=c.keys(b).reverse();c.each(d,function(c){this._addAppRoute(a,c,b[c])},this)}},_getController:function(){return e.getOption(this,"controller")},_addAppRoute:function(a,b,e){var f=a[e];f||d("Method '"+e+"' was not found on the controller"),this.route(b,e,c.bind(f,a))}}),e.Application=function(a){this._initRegionManager(),this._initCallbacks=new e.Callbacks,this.vent=new b.Wreqr.EventAggregator,this.commands=new b.Wreqr.Commands,this.reqres=new b.Wreqr.RequestResponse,this.submodules={},c.extend(this,a),this.triggerMethod=e.triggerMethod},c.extend(e.Application.prototype,b.Events,{execute:function(){this.commands.execute.apply(this.commands,arguments)},request:function(){return this.reqres.request.apply(this.reqres,arguments)},addInitializer:function(
 a){this._initCallbacks.add(a)},start:function(a){this.triggerMethod("initialize:before",a),this._initCallbacks.run(a,this),this.triggerMethod("initialize:after",a),this.triggerMethod("start",a)},addRegions:function(a){return this._regionManager.addRegions(a)},closeRegions:function(){this._regionManager.closeRegions()},removeRegion:function(a){this._regionManager.removeRegion(a)},getRegion:function(a){return this._regionManager.get(a)},module:function(a,b){var c=e.Module.getClass(b),d=f.call(arguments);return d.unshift(this),c.create.apply(c,d)},_initRegionManager:function(){this._regionManager=new e.RegionManager,this.listenTo(this._regionManager,"region:add",function(a,b){this[a]=b}),this.listenTo(this._regionManager,"region:remove",function(a){delete this[a]})}}),e.Application.extend=e.extend,e.Module=function(a,b,d){this.moduleName=a,this.options=c.extend({},this.options,d),this.initialize=d.initialize||this.initialize,this.submodules={},this._setupInitializersAndFinalizers(),thi
 s.app=b,this.startWithParent=!0,this.triggerMethod=e.triggerMethod,c.isFunction(this.initialize)&&this.initialize(this.options,a,b)},e.Module.extend=e.extend,c.extend(e.Module.prototype,b.Events,{initialize:function(){},addInitializer:function(a){this._initializerCallbacks.add(a)},addFinalizer:function(a){this._finalizerCallbacks.add(a)},start:function(a){this._isInitialized||(c.each(this.submodules,function(b){b.startWithParent&&b.start(a)}),this.triggerMethod("before:start",a),this._initializerCallbacks.run(a,this),this._isInitialized=!0,this.triggerMethod("start",a))},stop:function(){this._isInitialized&&(this._isInitialized=!1,e.triggerMethod.call(this,"before:stop"),c.each(this.submodules,function(a){a.stop()}),this._finalizerCallbacks.run(void 0,this),this._initializerCallbacks.reset(),this._finalizerCallbacks.reset(),e.triggerMethod.call(this,"stop"))},addDefinition:function(a,b){this._runModuleDefinition(a,b)},_runModuleDefinition:function(a,d){if(a){var f=c.flatten([this,th
 is.app,b,e,e.$,c,d]);a.apply(this,f)}},_setupInitializersAndFinalizers:function(){this._initializerCallbacks=new e.Callbacks,this._finalizerCallbacks=new e.Callbacks}}),c.extend(e.Module,{create:function(a,b,d){var e=a,g=f.call(arguments);g.splice(0,3),b=b.split(".");var h=b.length,i=[];return i[h-1]=d,c.each(b,function(b,c){var f=e;e=this._getModule(f,b,a,d),this._addModuleDefinition(f,e,i[c],g)},this),e},_getModule:function(a,b,d,e){var f=c.extend({},e),g=this.getClass(e),h=a[b];return h||(h=new g(b,d,f),a[b]=h,a.submodules[b]=h),h},getClass:function(a){var b=e.Module;return a?a.prototype instanceof b?a:a.moduleClass||b:b},_addModuleDefinition:function(a,b,c,d){var e=this._getDefine(c),f=this._getStartWithParent(c,b);e&&b.addDefinition(e,d),this._addStartWithParent(a,b,f)},_getStartWithParent:function(a,b){var d;return c.isFunction(a)&&a.prototype instanceof e.Module?(d=b.constructor.prototype.startWithParent,c.isUndefined(d)?!0:d):c.isObject(a)?(d=a.startWithParent,c.isUndefined(
 d)?!0:d):!0},_getDefine:function(a){return!c.isFunction(a)||a.prototype instanceof e.Module?c.isObject(a)?a.define:null:a},_addStartWithParent:function(a,b,c){b.startWithParent=b.startWithParent&&c,b.startWithParent&&!b.startWithParentIsConfigured&&(b.startWithParentIsConfigured=!0,a.addInitializer(function(a){b.startWithParent&&b.start(a)}))}}),e}(this,b,a);return b.Marionette});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.js
new file mode 100644
index 0000000..b3e784a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.js
@@ -0,0 +1,277 @@
+(function (root, factory) {
+  if (typeof exports === 'object') {
+
+    var underscore = require('underscore');
+    var backbone = require('backbone');
+
+    module.exports = factory(underscore, backbone);
+
+  } else if (typeof define === 'function' && define.amd) {
+
+    define(['underscore', 'backbone'], factory);
+
+  } 
+}(this, function (_, Backbone) {
+  "use strict";
+
+  Backbone.Wreqr = (function(Backbone, Marionette, _){
+  "use strict";
+  var Wreqr = {};
+
+  // Handlers
+// --------
+// A registry of functions to call, given a name
+
+Wreqr.Handlers = (function(Backbone, _){
+  "use strict";
+  
+  // Constructor
+  // -----------
+
+  var Handlers = function(options){
+    this.options = options;
+    this._wreqrHandlers = {};
+    
+    if (_.isFunction(this.initialize)){
+      this.initialize(options);
+    }
+  };
+
+  Handlers.extend = Backbone.Model.extend;
+
+  // Instance Members
+  // ----------------
+
+  _.extend(Handlers.prototype, Backbone.Events, {
+
+    // Add multiple handlers using an object literal configuration
+    setHandlers: function(handlers){
+      _.each(handlers, function(handler, name){
+        var context = null;
+
+        if (_.isObject(handler) && !_.isFunction(handler)){
+          context = handler.context;
+          handler = handler.callback;
+        }
+
+        this.setHandler(name, handler, context);
+      }, this);
+    },
+
+    // Add a handler for the given name, with an
+    // optional context to run the handler within
+    setHandler: function(name, handler, context){
+      var config = {
+        callback: handler,
+        context: context
+      };
+
+      this._wreqrHandlers[name] = config;
+
+      this.trigger("handler:add", name, handler, context);
+    },
+
+    // Determine whether or not a handler is registered
+    hasHandler: function(name){
+      return !! this._wreqrHandlers[name];
+    },
+
+    // Get the currently registered handler for
+    // the specified name. Throws an exception if
+    // no handler is found.
+    getHandler: function(name){
+      var config = this._wreqrHandlers[name];
+
+      if (!config){
+        throw new Error("Handler not found for '" + name + "'");
+      }
+
+      return function(){
+        var args = Array.prototype.slice.apply(arguments);
+        return config.callback.apply(config.context, args);
+      };
+    },
+
+    // Remove a handler for the specified name
+    removeHandler: function(name){
+      delete this._wreqrHandlers[name];
+    },
+
+    // Remove all handlers from this registry
+    removeAllHandlers: function(){
+      this._wreqrHandlers = {};
+    }
+  });
+
+  return Handlers;
+})(Backbone, _);
+
+  // Wreqr.CommandStorage
+// --------------------
+//
+// Store and retrieve commands for execution.
+Wreqr.CommandStorage = (function(){
+  "use strict";
+
+  // Constructor function
+  var CommandStorage = function(options){
+    this.options = options;
+    this._commands = {};
+
+    if (_.isFunction(this.initialize)){
+      this.initialize(options);
+    }
+  };
+
+  // Instance methods
+  _.extend(CommandStorage.prototype, Backbone.Events, {
+
+    // Get an object literal by command name, that contains
+    // the `commandName` and the `instances` of all commands
+    // represented as an array of arguments to process
+    getCommands: function(commandName){
+      var commands = this._commands[commandName];
+
+      // we don't have it, so add it
+      if (!commands){
+
+        // build the configuration
+        commands = {
+          command: commandName, 
+          instances: []
+        };
+
+        // store it
+        this._commands[commandName] = commands;
+      }
+
+      return commands;
+    },
+
+    // Add a command by name, to the storage and store the
+    // args for the command
+    addCommand: function(commandName, args){
+      var command = this.getCommands(commandName);
+      command.instances.push(args);
+    },
+
+    // Clear all commands for the given `commandName`
+    clearCommands: function(commandName){
+      var command = this.getCommands(commandName);
+      command.instances = [];
+    }
+  });
+
+  return CommandStorage;
+})();
+
+  // Wreqr.Commands
+// --------------
+//
+// A simple command pattern implementation. Register a command
+// handler and execute it.
+Wreqr.Commands = (function(Wreqr){
+  "use strict";
+
+  return Wreqr.Handlers.extend({
+    // default storage type
+    storageType: Wreqr.CommandStorage,
+
+    constructor: function(options){
+      this.options = options || {};
+
+      this._initializeStorage(this.options);
+      this.on("handler:add", this._executeCommands, this);
+
+      var args = Array.prototype.slice.call(arguments);
+      Wreqr.Handlers.prototype.constructor.apply(this, args);
+    },
+
+    // Execute a named command with the supplied args
+    execute: function(name, args){
+      name = arguments[0];
+      args = Array.prototype.slice.call(arguments, 1);
+
+      if (this.hasHandler(name)){
+        this.getHandler(name).apply(this, args);
+      } else {
+        this.storage.addCommand(name, args);
+      }
+
+    },
+
+    // Internal method to handle bulk execution of stored commands
+    _executeCommands: function(name, handler, context){
+      var command = this.storage.getCommands(name);
+
+      // loop through and execute all the stored command instances
+      _.each(command.instances, function(args){
+        handler.apply(context, args);
+      });
+
+      this.storage.clearCommands(name);
+    },
+
+    // Internal method to initialize storage either from the type's
+    // `storageType` or the instance `options.storageType`.
+    _initializeStorage: function(options){
+      var storage;
+
+      var StorageType = options.storageType || this.storageType;
+      if (_.isFunction(StorageType)){
+        storage = new StorageType();
+      } else {
+        storage = StorageType;
+      }
+
+      this.storage = storage;
+    }
+  });
+
+})(Wreqr);
+
+  // Wreqr.RequestResponse
+// ---------------------
+//
+// A simple request/response implementation. Register a
+// request handler, and return a response from it
+Wreqr.RequestResponse = (function(Wreqr){
+  "use strict";
+
+  return Wreqr.Handlers.extend({
+    request: function(){
+      var name = arguments[0];
+      var args = Array.prototype.slice.call(arguments, 1);
+
+      return this.getHandler(name).apply(this, args);
+    }
+  });
+
+})(Wreqr);
+
+  // Event Aggregator
+// ----------------
+// A pub-sub object that can be used to decouple various parts
+// of an application through event-driven architecture.
+
+Wreqr.EventAggregator = (function(Backbone, _){
+  "use strict";
+  var EA = function(){};
+
+  // Copy the `extend` function used by Backbone's classes
+  EA.extend = Backbone.Model.extend;
+
+  // Copy the basic Backbone.Events on to the event aggregator
+  _.extend(EA.prototype, Backbone.Events);
+
+  return EA;
+})(Backbone, _);
+
+
+  return Wreqr;
+})(Backbone, Backbone.Marionette, _);
+
+  return Backbone.Wreqr; 
+
+}));
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.min.js
new file mode 100644
index 0000000..6514150
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.wreqr/js/backbone.wreqr.min.js
@@ -0,0 +1,11 @@
+// Backbone.Wreqr (Backbone.Marionette)
+// ----------------------------------
+// v0.2.0
+//
+// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://github.com/marionettejs/backbone.wreqr
+
+
+(function(t,e){if("object"==typeof exports){var n=require("underscore"),r=require("backbone");module.exports=e(n,r)}else"function"==typeof define&&define.amd&&define(["underscore","backbone"],e)})(this,function(t,e){"use strict";return e.Wreqr=function(t,e,n){var r={};return r.Handlers=function(t,e){var n=function(t){this.options=t,this._wreqrHandlers={},e.isFunction(this.initialize)&&this.initialize(t)};return n.extend=t.Model.extend,e.extend(n.prototype,t.Events,{setHandlers:function(t){e.each(t,function(t,n){var r=null;e.isObject(t)&&!e.isFunction(t)&&(r=t.context,t=t.callback),this.setHandler(n,t,r)},this)},setHandler:function(t,e,n){var r={callback:e,context:n};this._wreqrHandlers[t]=r,this.trigger("handler:add",t,e,n)},hasHandler:function(t){return!!this._wreqrHandlers[t]},getHandler:function(t){var e=this._wreqrHandlers[t];if(!e)throw Error("Handler not found for '"+t+"'");return function(){var t=Array.prototype.slice.apply(arguments);return e.callback.apply(e.context,t)}},re
 moveHandler:function(t){delete this._wreqrHandlers[t]},removeAllHandlers:function(){this._wreqrHandlers={}}}),n}(t,n),r.CommandStorage=function(){var e=function(t){this.options=t,this._commands={},n.isFunction(this.initialize)&&this.initialize(t)};return n.extend(e.prototype,t.Events,{getCommands:function(t){var e=this._commands[t];return e||(e={command:t,instances:[]},this._commands[t]=e),e},addCommand:function(t,e){var n=this.getCommands(t);n.instances.push(e)},clearCommands:function(t){var e=this.getCommands(t);e.instances=[]}}),e}(),r.Commands=function(t){return t.Handlers.extend({storageType:t.CommandStorage,constructor:function(e){this.options=e||{},this._initializeStorage(this.options),this.on("handler:add",this._executeCommands,this);var n=Array.prototype.slice.call(arguments);t.Handlers.prototype.constructor.apply(this,n)},execute:function(t,e){t=arguments[0],e=Array.prototype.slice.call(arguments,1),this.hasHandler(t)?this.getHandler(t).apply(this,e):this.storage.addComman
 d(t,e)},_executeCommands:function(t,e,r){var i=this.storage.getCommands(t);n.each(i.instances,function(t){e.apply(r,t)}),this.storage.clearCommands(t)},_initializeStorage:function(t){var e,r=t.storageType||this.storageType;e=n.isFunction(r)?new r:r,this.storage=e}})}(r),r.RequestResponse=function(t){return t.Handlers.extend({request:function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);return this.getHandler(t).apply(this,e)}})}(r),r.EventAggregator=function(t,e){var n=function(){};return n.extend=t.Model.extend,e.extend(n.prototype,t.Events),n}(t,n),r}(e,e.Marionette,t),e.Wreqr});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone-min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone-min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone-min.js
new file mode 100644
index 0000000..7243e5f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone-min.js
@@ -0,0 +1,4 @@
+(function(){var root=this;var previousBackbone=root.Backbone;var array=[];var push=array.push;var slice=array.slice;var splice=array.splice;var Backbone;if(typeof exports!=="undefined"){Backbone=exports}else{Backbone=root.Backbone={}}Backbone.VERSION="1.0.0";var _=root._;if(!_&&typeof require!=="undefined")_=require("underscore");Backbone.$=root.jQuery||root.Zepto||root.ender||root.$;Backbone.noConflict=function(){root.Backbone=previousBackbone;return this};Backbone.emulateHTTP=false;Backbone.emulateJSON=false;var Events=Backbone.Events={on:function(name,callback,context){if(!eventsApi(this,"on",name,[callback,context])||!callback)return this;this._events||(this._events={});var events=this._events[name]||(this._events[name]=[]);events.push({callback:callback,context:context,ctx:context||this});return this},once:function(name,callback,context){if(!eventsApi(this,"once",name,[callback,context])||!callback)return this;var self=this;var once=_.once(function(){self.off(name,once);callbac
 k.apply(this,arguments)});once._callback=callback;return this.on(name,once,context)},off:function(name,callback,context){var retain,ev,events,names,i,l,j,k;if(!this._events||!eventsApi(this,"off",name,[callback,context]))return this;if(!name&&!callback&&!context){this._events={};return this}names=name?[name]:_.keys(this._events);for(i=0,l=names.length;i<l;i++){name=names[i];if(events=this._events[name]){this._events[name]=retain=[];if(callback||context){for(j=0,k=events.length;j<k;j++){ev=events[j];if(callback&&callback!==ev.callback&&callback!==ev.callback._callback||context&&context!==ev.context){retain.push(ev)}}}if(!retain.length)delete this._events[name]}}return this},trigger:function(name){if(!this._events)return this;var args=slice.call(arguments,1);if(!eventsApi(this,"trigger",name,args))return this;var events=this._events[name];var allEvents=this._events.all;if(events)triggerEvents(events,args);if(allEvents)triggerEvents(allEvents,arguments);return this},stopListening:funct
 ion(obj,name,callback){var listeners=this._listeners;if(!listeners)return this;var deleteListener=!name&&!callback;if(typeof name==="object")callback=this;if(obj)(listeners={})[obj._listenerId]=obj;for(var id in listeners){listeners[id].off(name,callback,this);if(deleteListener)delete this._listeners[id]}return this}};var eventSplitter=/\s+/;var eventsApi=function(obj,action,name,rest){if(!name)return true;if(typeof name==="object"){for(var key in name){obj[action].apply(obj,[key,name[key]].concat(rest))}return false}if(eventSplitter.test(name)){var names=name.split(eventSplitter);for(var i=0,l=names.length;i<l;i++){obj[action].apply(obj,[names[i]].concat(rest))}return false}return true};var triggerEvents=function(events,args){var ev,i=-1,l=events.length,a1=args[0],a2=args[1],a3=args[2];switch(args.length){case 0:while(++i<l)(ev=events[i]).callback.call(ev.ctx);return;case 1:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1);return;case 2:while(++i<l)(ev=events[i]).callback.call(ev
 .ctx,a1,a2);return;case 3:while(++i<l)(ev=events[i]).callback.call(ev.ctx,a1,a2,a3);return;default:while(++i<l)(ev=events[i]).callback.apply(ev.ctx,args)}};var listenMethods={listenTo:"on",listenToOnce:"once"};_.each(listenMethods,function(implementation,method){Events[method]=function(obj,name,callback){var listeners=this._listeners||(this._listeners={});var id=obj._listenerId||(obj._listenerId=_.uniqueId("l"));listeners[id]=obj;if(typeof name==="object")callback=this;obj[implementation](name,callback,this);return this}});Events.bind=Events.on;Events.unbind=Events.off;_.extend(Backbone,Events);var Model=Backbone.Model=function(attributes,options){var defaults;var attrs=attributes||{};options||(options={});this.cid=_.uniqueId("c");this.attributes={};_.extend(this,_.pick(options,modelOptions));if(options.parse)attrs=this.parse(attrs,options)||{};if(defaults=_.result(this,"defaults")){attrs=_.defaults({},attrs,defaults)}this.set(attrs,options);this.changed={};this.initialize.apply(thi
 s,arguments)};var modelOptions=["url","urlRoot","collection"];_.extend(Model.prototype,Events,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(options){return _.clone(this.attributes)},sync:function(){return Backbone.sync.apply(this,arguments)},get:function(attr){return this.attributes[attr]},escape:function(attr){return _.escape(this.get(attr))},has:function(attr){return this.get(attr)!=null},set:function(key,val,options){var attr,attrs,unset,changes,silent,changing,prev,current;if(key==null)return this;if(typeof key==="object"){attrs=key;options=val}else{(attrs={})[key]=val}options||(options={});if(!this._validate(attrs,options))return false;unset=options.unset;silent=options.silent;changes=[];changing=this._changing;this._changing=true;if(!changing){this._previousAttributes=_.clone(this.attributes);this.changed={}}current=this.attributes,prev=this._previousAttributes;if(this.idAttribute in attrs)this.id=attrs[this.idAttribute];for(attr i
 n attrs){val=attrs[attr];if(!_.isEqual(current[attr],val))changes.push(attr);if(!_.isEqual(prev[attr],val)){this.changed[attr]=val}else{delete this.changed[attr]}unset?delete current[attr]:current[attr]=val}if(!silent){if(changes.length)this._pending=true;for(var i=0,l=changes.length;i<l;i++){this.trigger("change:"+changes[i],this,current[changes[i]],options)}}if(changing)return this;if(!silent){while(this._pending){this._pending=false;this.trigger("change",this,options)}}this._pending=false;this._changing=false;return this},unset:function(attr,options){return this.set(attr,void 0,_.extend({},options,{unset:true}))},clear:function(options){var attrs={};for(var key in this.attributes)attrs[key]=void 0;return this.set(attrs,_.extend({},options,{unset:true}))},hasChanged:function(attr){if(attr==null)return!_.isEmpty(this.changed);return _.has(this.changed,attr)},changedAttributes:function(diff){if(!diff)return this.hasChanged()?_.clone(this.changed):false;var val,changed=false;var old=
 this._changing?this._previousAttributes:this.attributes;for(var attr in diff){if(_.isEqual(old[attr],val=diff[attr]))continue;(changed||(changed={}))[attr]=val}return changed},previous:function(attr){if(attr==null||!this._previousAttributes)return null;return this._previousAttributes[attr]},previousAttributes:function(){return _.clone(this._previousAttributes)},fetch:function(options){options=options?_.clone(options):{};if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){if(!model.set(model.parse(resp,options),options))return false;if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);return this.sync("read",this,options)},save:function(key,val,options){var attrs,method,xhr,attributes=this.attributes;if(key==null||typeof key==="object"){attrs=key;options=val}else{(attrs={})[key]=val}if(attrs&&(!options||!options.wait)&&!this.set(attrs,options))return false;options=_.
 extend({validate:true},options);if(!this._validate(attrs,options))return false;if(attrs&&options.wait){this.attributes=_.extend({},attributes,attrs)}if(options.parse===void 0)options.parse=true;var model=this;var success=options.success;options.success=function(resp){model.attributes=attributes;var serverAttrs=model.parse(resp,options);if(options.wait)serverAttrs=_.extend(attrs||{},serverAttrs);if(_.isObject(serverAttrs)&&!model.set(serverAttrs,options)){return false}if(success)success(model,resp,options);model.trigger("sync",model,resp,options)};wrapError(this,options);method=this.isNew()?"create":options.patch?"patch":"update";if(method==="patch")options.attrs=attrs;xhr=this.sync(method,this,options);if(attrs&&options.wait)this.attributes=attributes;return xhr},destroy:function(options){options=options?_.clone(options):{};var model=this;var success=options.success;var destroy=function(){model.trigger("destroy",model,model.collection,options)};options.success=function(resp){if(opti
 ons.wait||model.isNew())destroy();if(success)success(model,resp,options);if(!model.isNew())model.trigger("sync",model,resp,options)};if(this.isNew()){options.success();return false}wrapError(this,options);var xhr=this.sync("delete",this,options);if(!options.wait)destroy();return xhr},url:function(){var base=_.result(this,"urlRoot")||_.result(this.collection,"url")||urlError();if(this.isNew())return base;return base+(base.charAt(base.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(resp,options){return resp},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(options){return this._validate({},_.extend(options||{},{validate:true}))},_validate:function(attrs,options){if(!options.validate||!this.validate)return true;attrs=_.extend({},this.attributes,attrs);var error=this.validationError=this.validate(attrs,options)||null;if(!error)return true;this.trigger("invalid",this,error,_.extend(options||{},{vali
 dationError:error}));return false}});var modelMethods=["keys","values","pairs","invert","pick","omit"];_.each(modelMethods,function(method){Model.prototype[method]=function(){var args=slice.call(arguments);args.unshift(this.attributes);return _[method].apply(_,args)}});var Collection=Backbone.Collection=function(models,options){options||(options={});if(options.url)this.url=options.url;if(options.model)this.model=options.model;if(options.comparator!==void 0)this.comparator=options.comparator;this._reset();this.initialize.apply(this,arguments);if(models)this.reset(models,_.extend({silent:true},options))};var setOptions={add:true,remove:true,merge:true};var addOptions={add:true,merge:false,remove:false};_.extend(Collection.prototype,Events,{model:Model,initialize:function(){},toJSON:function(options){return this.map(function(model){return model.toJSON(options)})},sync:function(){return Backbone.sync.apply(this,arguments)},add:function(models,options){return this.set(models,_.defaults(o
 ptions||{},addOptions))},remove:function(models,options){models=_.isArray(models)?models.slice():[models];options||(options={});var i,l,index,model;for(i=0,l=models.length;i<l;i++){model=this.get(models[i]);if(!model)continue;delete this._byId[model.id];delete this._byId[model.cid];index=this.indexOf(model);this.models.splice(index,1);this.length--;if(!options.silent){options.index=index;model.trigger("remove",model,this,options)}this._removeReference(model)}return this},set:function(models,options){options=_.defaults(options||{},setOptions);if(options.parse)models=this.parse(models,options);if(!_.isArray(models))models=models?[models]:[];var i,l,model,attrs,existing,sort;var at=options.at;var sortable=this.comparator&&at==null&&options.sort!==false;var sortAttr=_.isString(this.comparator)?this.comparator:null;var toAdd=[],toRemove=[],modelMap={};for(i=0,l=models.length;i<l;i++){if(!(model=this._prepareModel(models[i],options)))continue;if(existing=this.get(model)){if(options.remove
 )modelMap[existing.cid]=true;if(options.merge){existing.set(model.attributes,options);if(sortable&&!sort&&existing.hasChanged(sortAttr))sort=true}}else if(options.add){toAdd.push(model);model.on("all",this._onModelEvent,this);this._byId[model.cid]=model;if(model.id!=null)this._byId[model.id]=model}}if(options.remove){for(i=0,l=this.length;i<l;++i){if(!modelMap[(model=this.models[i]).cid])toRemove.push(model)}if(toRemove.length)this.remove(toRemove,options)}if(toAdd.length){if(sortable)sort=true;this.length+=toAdd.length;if(at!=null){splice.apply(this.models,[at,0].concat(toAdd))}else{push.apply(this.models,toAdd)}}if(sort)this.sort({silent:true});if(options.silent)return this;for(i=0,l=toAdd.length;i<l;i++){(model=toAdd[i]).trigger("add",model,this,options)}if(sort)this.trigger("sort",this,options);return this},reset:function(models,options){options||(options={});for(var i=0,l=this.models.length;i<l;i++){this._removeReference(this.models[i])}options.previousModels=this.models;this._
 reset();this.add(models,_.extend({silent:true},options));if(!options.silent)this.trigger("reset",this,options);return this},push:function(model,options){model=this._prepareModel(model,options);this.add(model,_.extend({at:this.length},options));return model},pop:function(options){var model=this.at(this.length-1);this.remove(model,options);return model},unshift:function(model,options){model=this._prepareModel(model,options);this.add(model,_.extend({at:0},options));return model},shift:function(options){var model=this.at(0);this.remove(model,options);return model},slice:function(begin,end){return this.models.slice(begin,end)},get:function(obj){if(obj==null)return void 0;return this._byId[obj.id!=null?obj.id:obj.cid||obj]},at:function(index){return this.models[index]},where:function(attrs,first){if(_.isEmpty(attrs))return first?void 0:[];return this[first?"find":"filter"](function(model){for(var key in attrs){if(attrs[key]!==model.get(key))return false}return true})},findWhere:function(a
 ttrs){return this.where(attrs,true)},sort:function(options){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");options||(options={});if(_.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(_.bind(this.comparator,this))}if(!options.silent)this.trigger("sort",this,options);return this},sortedIndex:function(model,value,context){value||(value=this.comparator);var iterator=_.isFunction(value)?value:function(model){return model.get(value)};return _.sortedIndex(this.models,model,iterator,context)},pluck:function(attr){return _.invoke(this.models,"get",attr)},fetch:function(options){options=options?_.clone(options):{};if(options.parse===void 0)options.parse=true;var success=options.success;var collection=this;options.success=function(resp){var method=options.reset?"reset":"set";collection[method](resp,options);if(success)success(collection,resp,options);collection.trigger("sync",collection,res
 p,options)};wrapError(this,options);return this.sync("read",this,options)},create:function(model,options){options=options?_.clone(options):{};if(!(model=this._prepareModel(model,options)))return false;if(!options.wait)this.add(model,options);var collection=this;var success=options.success;options.success=function(resp){if(options.wait)collection.add(model,options);if(success)success(model,resp,options)};model.save(null,options);return model},parse:function(resp,options){return resp},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(attrs,options){if(attrs instanceof Model){if(!attrs.collection)attrs.collection=this;return attrs}options||(options={});options.collection=this;var model=new this.model(attrs,options);if(!model._validate(attrs,options)){this.trigger("invalid",this,attrs,options);return false}return model},_removeReference:function(model){if(this===model.collection)delete model.co
 llection;model.off("all",this._onModelEvent,this)},_onModelEvent:function(event,model,collection,options){if((event==="add"||event==="remove")&&collection!==this)return;if(event==="destroy")this.remove(model,options);if(model&&event==="change:"+model.idAttribute){delete this._byId[model.previous(model.idAttribute)];if(model.id!=null)this._byId[model.id]=model}this.trigger.apply(this,arguments)}});var methods=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];_.each(methods,function(method){Collection.prototype[method]=function(){var args=slice.call(arguments);args.unshift(this.models);return _[method].apply(_,args)}});var attributeMethods=["groupBy","countBy","sortBy"];_.each(attributeMethods,function(met
 hod){Collection.prototype[method]=function(value,context){var iterator=_.isFunction(value)?value:function(model){return model.get(value)};return _[method](this.models,iterator,context)}});var View=Backbone.View=function(options){this.cid=_.uniqueId("view");this._configure(options||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var delegateEventSplitter=/^(\S+)\s*(.*)$/;var viewOptions=["model","collection","el","id","attributes","className","tagName","events"];_.extend(View.prototype,Events,{tagName:"div",$:function(selector){return this.$el.find(selector)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(element,delegate){if(this.$el)this.undelegateEvents();this.$el=element instanceof Backbone.$?element:Backbone.$(element);this.el=this.$el[0];if(delegate!==false)this.delegateEvents();return this},delegateEvents:function(events){if(!(events||(events
 =_.result(this,"events"))))return this;this.undelegateEvents();for(var key in events){var method=events[key];if(!_.isFunction(method))method=this[events[key]];if(!method)continue;var match=key.match(delegateEventSplitter);var eventName=match[1],selector=match[2];method=_.bind(method,this);eventName+=".delegateEvents"+this.cid;if(selector===""){this.$el.on(eventName,method)}else{this.$el.on(eventName,selector,method)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_configure:function(options){if(this.options)options=_.extend({},_.result(this,"options"),options);_.extend(this,_.pick(options,viewOptions));this.options=options},_ensureElement:function(){if(!this.el){var attrs=_.extend({},_.result(this,"attributes"));if(this.id)attrs.id=_.result(this,"id");if(this.className)attrs["class"]=_.result(this,"className");var $el=Backbone.$("<"+_.result(this,"tagName")+">").attr(attrs);this.setElement($el,false)}else{this.setElement(_.result(this,
 "el"),false)}}});Backbone.sync=function(method,model,options){var type=methodMap[method];_.defaults(options||(options={}),{emulateHTTP:Backbone.emulateHTTP,emulateJSON:Backbone.emulateJSON});var params={type:type,dataType:"json"};if(!options.url){params.url=_.result(model,"url")||urlError()}if(options.data==null&&model&&(method==="create"||method==="update"||method==="patch")){params.contentType="application/json";params.data=JSON.stringify(options.attrs||model.toJSON(options))}if(options.emulateJSON){params.contentType="application/x-www-form-urlencoded";params.data=params.data?{model:params.data}:{}}if(options.emulateHTTP&&(type==="PUT"||type==="DELETE"||type==="PATCH")){params.type="POST";if(options.emulateJSON)params.data._method=type;var beforeSend=options.beforeSend;options.beforeSend=function(xhr){xhr.setRequestHeader("X-HTTP-Method-Override",type);if(beforeSend)return beforeSend.apply(this,arguments)}}if(params.type!=="GET"&&!options.emulateJSON){params.processData=false}if(
 params.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){params.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var xhr=options.xhr=Backbone.ajax(_.extend(params,options));model.trigger("request",model,xhr,options);return xhr};var methodMap={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};Backbone.ajax=function(){return Backbone.$.ajax.apply(Backbone.$,arguments)};var Router=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var optionalParam=/\((.*?)\)/g;var namedParam=/(\(\?)?:\w+/g;var splatParam=/\*\w+/g;var escapeRegExp=/[\-{}\[\]+?.,\\\^$|#\s]/g;_.extend(Router.prototype,Events,{initialize:function(){},route:function(route,name,callback){if(!_.isRegExp(route))route=this._routeToRegExp(route);if(_.isFunction(name)){callback=name;name=""}if(!callback)callback=this[name];var router=this;
 Backbone.history.route(route,function(fragment){var args=router._extractParameters(route,fragment);callback&&callback.apply(router,args);router.trigger.apply(router,["route:"+name].concat(args));router.trigger("route",name,args);Backbone.history.trigger("route",router,name,args)});return this},navigate:function(fragment,options){Backbone.history.navigate(fragment,options);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=_.result(this,"routes");var route,routes=_.keys(this.routes);while((route=routes.pop())!=null){this.route(route,this.routes[route])}},_routeToRegExp:function(route){route=route.replace(escapeRegExp,"\\$&").replace(optionalParam,"(?:$1)?").replace(namedParam,function(match,optional){return optional?match:"([^/]+)"}).replace(splatParam,"(.*?)");return new RegExp("^"+route+"$")},_extractParameters:function(route,fragment){var params=route.exec(fragment).slice(1);return _.map(params,function(param){return param?decodeURIComponent(param):null})}});va
 r History=Backbone.History=function(){this.handlers=[];_.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var routeStripper=/^[#\/]|\s+$/g;var rootStripper=/^\/+|\/+$/g;var isExplorer=/msie [\w.]+/;var trailingSlash=/\/$/;History.started=false;_.extend(History.prototype,Events,{interval:50,getHash:function(window){var match=(window||this).location.href.match(/#(.*)$/);return match?match[1]:""},getFragment:function(fragment,forcePushState){if(fragment==null){if(this._hasPushState||!this._wantsHashChange||forcePushState){fragment=this.location.pathname;var root=this.root.replace(trailingSlash,"");if(!fragment.indexOf(root))fragment=fragment.substr(root.length)}else{fragment=this.getHash()}}return fragment.replace(routeStripper,"")},start:function(options){if(History.started)throw new Error("Backbone.history has already been started");History.started=true;this.options=_.extend({},{root:"/"},this.options,options);this.r
 oot=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var fragment=this.getFragment();var docMode=document.documentMode;var oldIE=isExplorer.exec(navigator.userAgent.toLowerCase())&&(!docMode||docMode<=7);this.root=("/"+this.root+"/").replace(rootStripper,"/");if(oldIE&&this._wantsHashChange){this.iframe=Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(fragment)}if(this._hasPushState){Backbone.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!oldIE){Backbone.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=fragment;var loc=this.location;var atRoot=loc.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this.
 _wantsPushState&&!this._hasPushState&&!atRoot){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._wantsPushState&&this._hasPushState&&atRoot&&loc.hash){this.fragment=this.getHash().replace(routeStripper,"");this.history.replaceState({},document.title,this.root+this.fragment+loc.search)}if(!this.options.silent)return this.loadUrl()},stop:function(){Backbone.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);History.started=false},route:function(route,callback){this.handlers.unshift({route:route,callback:callback})},checkUrl:function(e){var current=this.getFragment();if(current===this.fragment&&this.iframe){current=this.getFragment(this.getHash(this.iframe))}if(current===this.fragment)return false;if(this.iframe)this.navigate(current);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(fragmentOverride){var fragment=this.fragmen
 t=this.getFragment(fragmentOverride);var matched=_.any(this.handlers,function(handler){if(handler.route.test(fragment)){handler.callback(fragment);return true}});return matched},navigate:function(fragment,options){if(!History.started)return false;if(!options||options===true)options={trigger:options};fragment=this.getFragment(fragment||"");if(this.fragment===fragment)return;this.fragment=fragment;var url=this.root+fragment;if(this._hasPushState){this.history[options.replace?"replaceState":"pushState"]({},document.title,url)}else if(this._wantsHashChange){this._updateHash(this.location,fragment,options.replace);if(this.iframe&&fragment!==this.getFragment(this.getHash(this.iframe))){if(!options.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,fragment,options.replace)}}else{return this.location.assign(url)}if(options.trigger)this.loadUrl(fragment)},_updateHash:function(location,fragment,replace){if(replace){var href=location.href.replace(/(javascript:|#
 ).*$/,"");location.replace(href+"#"+fragment)}else{location.hash="#"+fragment}}});Backbone.history=new History;var extend=function(protoProps,staticProps){var parent=this;var child;if(protoProps&&_.has(protoProps,"constructor")){child=protoProps.constructor}else{child=function(){return parent.apply(this,arguments)}}_.extend(child,parent,staticProps);var Surrogate=function(){this.constructor=child};Surrogate.prototype=parent.prototype;child.prototype=new Surrogate;if(protoProps)_.extend(child.prototype,protoProps);child.__super__=parent.prototype;return child};Model.extend=Collection.extend=Router.extend=View.extend=History.extend=extend;var urlError=function(){throw new Error('A "url" property or function must be specified')};var wrapError=function(model,options){var error=options.error;options.error=function(resp){if(error)error(model,resp,options);model.trigger("error",model,resp,options)}}}).call(this);
+/*
+//@ sourceMappingURL=backbone-min.map
+*/
\ No newline at end of file


[13/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.css
new file mode 100644
index 0000000..a9f35ce
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.min.css
@@ -0,0 +1,5 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,s
 elect,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table
 {border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-
 halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:be
 fore{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e03
 0"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:bef
 ore{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{conten
 t:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e1
 03"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:bef
 ore{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-so
 rt:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:befor
 e{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.gly
 phicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.c
 arousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;width:100% \9;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5
  .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.tex
 t-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-
 bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blo
 ckquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-
 box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-
 md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.3333
 3333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left
 :41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull
 -2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){
 .col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.666666
 67%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{w
 idth:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-pus
 h-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:fir
 st-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td
 [class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbo
 dy>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tb
 ody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-over
 flow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table
 -bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:f
 ocus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#
 777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:20px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=check
 box]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.f
 orm-horizontal .form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.ha
 s-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#
 8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inli
 ne-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15p
 x;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgb
 a(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabl
 ed] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;
 background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-i
 nfo:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.bt
 n-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-dange
 r.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:ho
 ver,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;
 height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}
 .dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .drop
 down .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdo
 wn-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(
 0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-ve
 rtical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0
 }.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>
 .input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-siz
 e:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;whit
 e-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px s
 olid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{borde
 r-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.n
 av-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;hei
 ght:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-ind
 ex:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-n
 av{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:
 1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.na
 vbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default 
 .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a
 :hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.na
 vbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navba
 r-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:fo
 cus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagi
 nation>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pag
 ination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.
 pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.lab
 el-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumb
 otron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{
 margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@
 keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparen
 t 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-lin
 ear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-co
 lor:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgb
 a(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.lis
 t-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-gro
 up-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{co
 lor:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus
 {color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .l
 ist-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-
 child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:las
 t-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bo

<TRUNCATED>

[02/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl-BA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl-BA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl-BA.js
new file mode 100644
index 0000000..e525510
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl-BA.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture bs-Cyrl-BA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bs-Cyrl-BA", "default", {
+	name: "bs-Cyrl-BA",
+	englishName: "Bosnian (Cyrillic, Bosnia and Herzegovina)",
+	nativeName: "босански (Босна и Херцеговина)",
+	language: "bs-Cyrl",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		negativeInfinity: "-бесконачност",
+		positiveInfinity: "+бесконачност",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "КМ"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["недјеља","понедјељак","уторак","сриједа","четвртак","петак","субота"],
+				namesAbbr: ["нед","пон","уто","сре","чет","пет","суб"],
+				namesShort: ["н","п","у","с","ч","п","с"]
+			},
+			months: {
+				names: ["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар",""],
+				namesAbbr: ["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"н.е.","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl.js
new file mode 100644
index 0000000..8920d40
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Cyrl.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture bs-Cyrl
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bs-Cyrl", "default", {
+	name: "bs-Cyrl",
+	englishName: "Bosnian (Cyrillic)",
+	nativeName: "босански",
+	language: "bs-Cyrl",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		negativeInfinity: "-бесконачност",
+		positiveInfinity: "+бесконачност",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "КМ"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["недјеља","понедјељак","уторак","сриједа","четвртак","петак","субота"],
+				namesAbbr: ["нед","пон","уто","сре","чет","пет","суб"],
+				namesShort: ["н","п","у","с","ч","п","с"]
+			},
+			months: {
+				names: ["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар",""],
+				namesAbbr: ["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"н.е.","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn-BA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn-BA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn-BA.js
new file mode 100644
index 0000000..e02bb96
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn-BA.js
@@ -0,0 +1,76 @@
+/*
+ * Globalize Culture bs-Latn-BA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bs-Latn-BA", "default", {
+	name: "bs-Latn-BA",
+	englishName: "Bosnian (Latin, Bosnia and Herzegovina)",
+	nativeName: "bosanski (Bosna i Hercegovina)",
+	language: "bs-Latn",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "KM"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],
+				namesAbbr: ["ned","pon","uto","sri","čet","pet","sub"],
+				namesShort: ["ne","po","ut","sr","če","pe","su"]
+			},
+			months: {
+				names: ["januar","februar","mart","april","maj","juni","juli","avgust","septembar","oktobar","novembar","decembar",""],
+				namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn.js
new file mode 100644
index 0000000..3692487
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs-Latn.js
@@ -0,0 +1,76 @@
+/*
+ * Globalize Culture bs-Latn
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bs-Latn", "default", {
+	name: "bs-Latn",
+	englishName: "Bosnian (Latin)",
+	nativeName: "bosanski",
+	language: "bs-Latn",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "KM"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],
+				namesAbbr: ["ned","pon","uto","sri","čet","pet","sub"],
+				namesShort: ["ne","po","ut","sr","če","pe","su"]
+			},
+			months: {
+				names: ["januar","februar","mart","april","maj","juni","juli","avgust","septembar","oktobar","novembar","decembar",""],
+				namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs.js
new file mode 100644
index 0000000..0deadc9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.bs.js
@@ -0,0 +1,76 @@
+/*
+ * Globalize Culture bs
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "bs", "default", {
+	name: "bs",
+	englishName: "Bosnian",
+	nativeName: "bosanski",
+	language: "bs",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "KM"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"],
+				namesAbbr: ["ned","pon","uto","sri","čet","pet","sub"],
+				namesShort: ["ne","po","ut","sr","če","pe","su"]
+			},
+			months: {
+				names: ["januar","februar","mart","april","maj","juni","juli","avgust","septembar","oktobar","novembar","decembar",""],
+				namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","avg","sep","okt","nov","dec",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca-ES.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca-ES.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca-ES.js
new file mode 100644
index 0000000..03e21f2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca-ES.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture ca-ES
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ca-ES", "default", {
+	name: "ca-ES",
+	englishName: "Catalan (Catalan)",
+	nativeName: "català (català)",
+	language: "ca",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "NeuN",
+		negativeInfinity: "-Infinit",
+		positiveInfinity: "Infinit",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],
+				namesAbbr: ["dg.","dl.","dt.","dc.","dj.","dv.","ds."],
+				namesShort: ["dg","dl","dt","dc","dj","dv","ds"]
+			},
+			months: {
+				names: ["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],
+				namesAbbr: ["gen","feb","març","abr","maig","juny","jul","ag","set","oct","nov","des",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"d.C.","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd, d' / 'MMMM' / 'yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d' / 'MMMM' / 'yyyy HH:mm",
+				F: "dddd, d' / 'MMMM' / 'yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM' / 'yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca.js
new file mode 100644
index 0000000..06c31da
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ca.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture ca
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ca", "default", {
+	name: "ca",
+	englishName: "Catalan",
+	nativeName: "català",
+	language: "ca",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "NeuN",
+		negativeInfinity: "-Infinit",
+		positiveInfinity: "Infinit",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],
+				namesAbbr: ["dg.","dl.","dt.","dc.","dj.","dv.","ds."],
+				namesShort: ["dg","dl","dt","dc","dj","dv","ds"]
+			},
+			months: {
+				names: ["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],
+				namesAbbr: ["gen","feb","març","abr","maig","juny","jul","ag","set","oct","nov","des",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"d.C.","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd, d' / 'MMMM' / 'yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d' / 'MMMM' / 'yyyy HH:mm",
+				F: "dddd, d' / 'MMMM' / 'yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM' / 'yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co-FR.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co-FR.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co-FR.js
new file mode 100644
index 0000000..7d6ef38
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co-FR.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture co-FR
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "co-FR", "default", {
+	name: "co-FR",
+	englishName: "Corsican (France)",
+	nativeName: "Corsu (France)",
+	language: "co",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "Mica numericu",
+		negativeInfinity: "-Infinitu",
+		positiveInfinity: "+Infinitu",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["dumenica","luni","marti","mercuri","ghjovi","venderi","sabbatu"],
+				namesAbbr: ["dum.","lun.","mar.","mer.","ghj.","ven.","sab."],
+				namesShort: ["du","lu","ma","me","gh","ve","sa"]
+			},
+			months: {
+				names: ["ghjennaghju","ferraghju","marzu","aprile","maghju","ghjunghju","lugliu","aostu","settembre","ottobre","nuvembre","dicembre",""],
+				namesAbbr: ["ghje","ferr","marz","apri","magh","ghju","lugl","aost","sett","otto","nuve","dice",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"dopu J-C","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd d MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd d MMMM yyyy HH:mm",
+				F: "dddd d MMMM yyyy HH:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co.js
new file mode 100644
index 0000000..a4535aa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.co.js
@@ -0,0 +1,79 @@
+/*
+ * Globalize Culture co
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "co", "default", {
+	name: "co",
+	englishName: "Corsican",
+	nativeName: "Corsu",
+	language: "co",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "Mica numericu",
+		negativeInfinity: "-Infinitu",
+		positiveInfinity: "+Infinitu",
+		percent: {
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["dumenica","luni","marti","mercuri","ghjovi","venderi","sabbatu"],
+				namesAbbr: ["dum.","lun.","mar.","mer.","ghj.","ven.","sab."],
+				namesShort: ["du","lu","ma","me","gh","ve","sa"]
+			},
+			months: {
+				names: ["ghjennaghju","ferraghju","marzu","aprile","maghju","ghjunghju","lugliu","aostu","settembre","ottobre","nuvembre","dicembre",""],
+				namesAbbr: ["ghje","ferr","marz","apri","magh","ghju","lugl","aost","sett","otto","nuve","dice",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"dopu J-C","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dddd d MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd d MMMM yyyy HH:mm",
+				F: "dddd d MMMM yyyy HH:mm:ss",
+				M: "d MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs-CZ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs-CZ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs-CZ.js
new file mode 100644
index 0000000..6e6b2b1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs-CZ.js
@@ -0,0 +1,85 @@
+/*
+ * Globalize Culture cs-CZ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "cs-CZ", "default", {
+	name: "cs-CZ",
+	englishName: "Czech (Czech Republic)",
+	nativeName: "čeština (Česká republika)",
+	language: "cs",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "Není číslo",
+		negativeInfinity: "-nekonečno",
+		positiveInfinity: "+nekonečno",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "Kč"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],
+				namesAbbr: ["ne","po","út","st","čt","pá","so"],
+				namesShort: ["ne","po","út","st","čt","pá","so"]
+			},
+			months: {
+				names: ["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec",""],
+				namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""]
+			},
+			monthsGenitive: {
+				names: ["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince",""],
+				namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""]
+			},
+			AM: ["dop.","dop.","DOP."],
+			PM: ["odp.","odp.","ODP."],
+			eras: [{"name":"n. l.","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs.js
new file mode 100644
index 0000000..4503271
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cs.js
@@ -0,0 +1,85 @@
+/*
+ * Globalize Culture cs
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "cs", "default", {
+	name: "cs",
+	englishName: "Czech",
+	nativeName: "čeština",
+	language: "cs",
+	numberFormat: {
+		",": " ",
+		".": ",",
+		"NaN": "Není číslo",
+		negativeInfinity: "-nekonečno",
+		positiveInfinity: "+nekonečno",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": " ",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": " ",
+			".": ",",
+			symbol: "Kč"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],
+				namesAbbr: ["ne","po","út","st","čt","pá","so"],
+				namesShort: ["ne","po","út","st","čt","pá","so"]
+			},
+			months: {
+				names: ["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec",""],
+				namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""]
+			},
+			monthsGenitive: {
+				names: ["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince",""],
+				namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""]
+			},
+			AM: ["dop.","dop.","DOP."],
+			PM: ["odp.","odp.","ODP."],
+			eras: [{"name":"n. l.","start":null,"offset":0}],
+			patterns: {
+				d: "d.M.yyyy",
+				D: "d. MMMM yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "d. MMMM yyyy H:mm",
+				F: "d. MMMM yyyy H:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy-GB.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy-GB.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy-GB.js
new file mode 100644
index 0000000..0b07a62
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy-GB.js
@@ -0,0 +1,70 @@
+/*
+ * Globalize Culture cy-GB
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "cy-GB", "default", {
+	name: "cy-GB",
+	englishName: "Welsh (United Kingdom)",
+	nativeName: "Cymraeg (y Deyrnas Unedig)",
+	language: "cy",
+	numberFormat: {
+		percent: {
+			pattern: ["-%n","%n"]
+		},
+		currency: {
+			pattern: ["-$n","$n"],
+			symbol: "£"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],
+				namesAbbr: ["Sul","Llun","Maw","Mer","Iau","Gwe","Sad"],
+				namesShort: ["Su","Ll","Ma","Me","Ia","Gw","Sa"]
+			},
+			months: {
+				names: ["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr",""],
+				namesAbbr: ["Ion","Chwe","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rhag",""]
+			},
+			AM: ["a.m.","a.m.","A.M."],
+			PM: ["p.m.","p.m.","P.M."],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dd MMMM yyyy HH:mm",
+				F: "dd MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy.js
new file mode 100644
index 0000000..20b93b2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.cy.js
@@ -0,0 +1,70 @@
+/*
+ * Globalize Culture cy
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "cy", "default", {
+	name: "cy",
+	englishName: "Welsh",
+	nativeName: "Cymraeg",
+	language: "cy",
+	numberFormat: {
+		percent: {
+			pattern: ["-%n","%n"]
+		},
+		currency: {
+			pattern: ["-$n","$n"],
+			symbol: "£"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher","Dydd Iau","Dydd Gwener","Dydd Sadwrn"],
+				namesAbbr: ["Sul","Llun","Maw","Mer","Iau","Gwe","Sad"],
+				namesShort: ["Su","Ll","Ma","Me","Ia","Gw","Sa"]
+			},
+			months: {
+				names: ["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr",""],
+				namesAbbr: ["Ion","Chwe","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rhag",""]
+			},
+			AM: ["a.m.","a.m.","A.M."],
+			PM: ["p.m.","p.m.","P.M."],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dd MMMM yyyy HH:mm",
+				F: "dd MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da-DK.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da-DK.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da-DK.js
new file mode 100644
index 0000000..8d30e5a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da-DK.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture da-DK
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "da-DK", "default", {
+	name: "da-DK",
+	englishName: "Danish (Denmark)",
+	nativeName: "dansk (Danmark)",
+	language: "da",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		negativeInfinity: "-INF",
+		positiveInfinity: "INF",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["$ -n","$ n"],
+			",": ".",
+			".": ",",
+			symbol: "kr."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],
+				namesAbbr: ["sø","ma","ti","on","to","fr","lø"],
+				namesShort: ["sø","ma","ti","on","to","fr","lø"]
+			},
+			months: {
+				names: ["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december",""],
+				namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "d. MMMM yyyy HH:mm",
+				F: "d. MMMM yyyy HH:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da.js
new file mode 100644
index 0000000..8186cd5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.da.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture da
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "da", "default", {
+	name: "da",
+	englishName: "Danish",
+	nativeName: "dansk",
+	language: "da",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		negativeInfinity: "-INF",
+		positiveInfinity: "INF",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["$ -n","$ n"],
+			",": ".",
+			".": ",",
+			symbol: "kr."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],
+				namesAbbr: ["sø","ma","ti","on","to","fr","lø"],
+				namesShort: ["sø","ma","ti","on","to","fr","lø"]
+			},
+			months: {
+				names: ["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december",""],
+				namesAbbr: ["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""]
+			},
+			AM: null,
+			PM: null,
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "d. MMMM yyyy HH:mm",
+				F: "d. MMMM yyyy HH:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-AT.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-AT.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-AT.js
new file mode 100644
index 0000000..04c5aa1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-AT.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture de-AT
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de-AT", "default", {
+	name: "de-AT",
+	englishName: "German (Austria)",
+	nativeName: "Deutsch (Österreich)",
+	language: "de",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-$ n","$ n"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, dd. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, dd. MMMM yyyy HH:mm",
+				F: "dddd, dd. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-CH.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-CH.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-CH.js
new file mode 100644
index 0000000..b19e6f7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-CH.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture de-CH
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de-CH", "default", {
+	name: "de-CH",
+	englishName: "German (Switzerland)",
+	nativeName: "Deutsch (Schweiz)",
+	language: "de",
+	numberFormat: {
+		",": "'",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": "'"
+		},
+		currency: {
+			pattern: ["$-n","$ n"],
+			",": "'",
+			symbol: "Fr."
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d. MMMM yyyy HH:mm",
+				F: "dddd, d. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-DE.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-DE.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-DE.js
new file mode 100644
index 0000000..a104e76
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-DE.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture de-DE
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de-DE", "default", {
+	name: "de-DE",
+	englishName: "German (Germany)",
+	nativeName: "Deutsch (Deutschland)",
+	language: "de",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d. MMMM yyyy HH:mm",
+				F: "dddd, d. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LI.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LI.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LI.js
new file mode 100644
index 0000000..142726d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LI.js
@@ -0,0 +1,78 @@
+/*
+ * Globalize Culture de-LI
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de-LI", "default", {
+	name: "de-LI",
+	englishName: "German (Liechtenstein)",
+	nativeName: "Deutsch (Liechtenstein)",
+	language: "de",
+	numberFormat: {
+		",": "'",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": "'"
+		},
+		currency: {
+			pattern: ["$-n","$ n"],
+			",": "'",
+			symbol: "CHF"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d. MMMM yyyy HH:mm",
+				F: "dddd, d. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LU.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LU.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LU.js
new file mode 100644
index 0000000..c79b18b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de-LU.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture de-LU
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de-LU", "default", {
+	name: "de-LU",
+	englishName: "German (Luxembourg)",
+	nativeName: "Deutsch (Luxemburg)",
+	language: "de",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d. MMMM yyyy HH:mm",
+				F: "dddd, d. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de.js
new file mode 100644
index 0000000..d0c718d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.de.js
@@ -0,0 +1,81 @@
+/*
+ * Globalize Culture de
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "de", "default", {
+	name: "de",
+	englishName: "German",
+	nativeName: "Deutsch",
+	language: "de",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "n. def.",
+		negativeInfinity: "-unendlich",
+		positiveInfinity: "+unendlich",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ".",
+			firstDay: 1,
+			days: {
+				names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],
+				namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"],
+				namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"]
+			},
+			months: {
+				names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],
+				namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"n. Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "dd.MM.yyyy",
+				D: "dddd, d. MMMM yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dddd, d. MMMM yyyy HH:mm",
+				F: "dddd, d. MMMM yyyy HH:mm:ss",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb-DE.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb-DE.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb-DE.js
new file mode 100644
index 0000000..27a633e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb-DE.js
@@ -0,0 +1,84 @@
+/*
+ * Globalize Culture dsb-DE
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "dsb-DE", "default", {
+	name: "dsb-DE",
+	englishName: "Lower Sorbian (Germany)",
+	nativeName: "dolnoserbšćina (Nimska)",
+	language: "dsb",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "njedefinowane",
+		negativeInfinity: "-njekońcne",
+		positiveInfinity: "+njekońcne",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ". ",
+			firstDay: 1,
+			days: {
+				names: ["njeźela","ponjeźele","wałtora","srjoda","stwortk","pětk","sobota"],
+				namesAbbr: ["nje","pon","wał","srj","stw","pět","sob"],
+				namesShort: ["n","p","w","s","s","p","s"]
+			},
+			months: {
+				names: ["januar","februar","měrc","apryl","maj","junij","julij","awgust","september","oktober","nowember","december",""],
+				namesAbbr: ["jan","feb","měr","apr","maj","jun","jul","awg","sep","okt","now","dec",""]
+			},
+			monthsGenitive: {
+				names: ["januara","februara","měrca","apryla","maja","junija","julija","awgusta","septembra","oktobra","nowembra","decembra",""],
+				namesAbbr: ["jan","feb","měr","apr","maj","jun","jul","awg","sep","okt","now","dec",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"po Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "d. M. yyyy",
+				D: "dddd, 'dnja' d. MMMM yyyy",
+				t: "H.mm 'goź.'",
+				T: "H:mm:ss",
+				f: "dddd, 'dnja' d. MMMM yyyy H.mm 'goź.'",
+				F: "dddd, 'dnja' d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb.js
new file mode 100644
index 0000000..3098b07
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dsb.js
@@ -0,0 +1,84 @@
+/*
+ * Globalize Culture dsb
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "dsb", "default", {
+	name: "dsb",
+	englishName: "Lower Sorbian",
+	nativeName: "dolnoserbšćina",
+	language: "dsb",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "njedefinowane",
+		negativeInfinity: "-njekońcne",
+		positiveInfinity: "+njekońcne",
+		percent: {
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": ". ",
+			firstDay: 1,
+			days: {
+				names: ["njeźela","ponjeźele","wałtora","srjoda","stwortk","pětk","sobota"],
+				namesAbbr: ["nje","pon","wał","srj","stw","pět","sob"],
+				namesShort: ["n","p","w","s","s","p","s"]
+			},
+			months: {
+				names: ["januar","februar","měrc","apryl","maj","junij","julij","awgust","september","oktober","nowember","december",""],
+				namesAbbr: ["jan","feb","měr","apr","maj","jun","jul","awg","sep","okt","now","dec",""]
+			},
+			monthsGenitive: {
+				names: ["januara","februara","měrca","apryla","maja","junija","julija","awgusta","septembra","oktobra","nowembra","decembra",""],
+				namesAbbr: ["jan","feb","měr","apr","maj","jun","jul","awg","sep","okt","now","dec",""]
+			},
+			AM: null,
+			PM: null,
+			eras: [{"name":"po Chr.","start":null,"offset":0}],
+			patterns: {
+				d: "d. M. yyyy",
+				D: "dddd, 'dnja' d. MMMM yyyy",
+				t: "H.mm 'goź.'",
+				T: "H:mm:ss",
+				f: "dddd, 'dnja' d. MMMM yyyy H.mm 'goź.'",
+				F: "dddd, 'dnja' d. MMMM yyyy H:mm:ss",
+				M: "d. MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv-MV.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv-MV.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv-MV.js
new file mode 100644
index 0000000..26048c2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv-MV.js
@@ -0,0 +1,164 @@
+/*
+ * Globalize Culture dv-MV
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "dv-MV", "default", {
+	name: "dv-MV",
+	englishName: "Divehi (Maldives)",
+	nativeName: "ދިވެހިބަސް (ދިވެހި ރާއްޖެ)",
+	language: "dv",
+	isRTL: true,
+	numberFormat: {
+		currency: {
+			pattern: ["n $-","n $"],
+			symbol: "ރ."
+		}
+	},
+	calendars: {
+		standard: {
+			name: "Hijri",
+			days: {
+				names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
+			},
+			months: {
+				names: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""],
+				namesAbbr: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""]
+			},
+			AM: ["މކ","މކ","މކ"],
+			PM: ["މފ","މފ","މފ"],
+			eras: [{"name":"ހިޖްރީ","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dd/MM/yyyy HH:mm",
+				F: "dd/MM/yyyy HH:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_Localized: {
+			days: {
+				names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
+			},
+			months: {
+				names: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""],
+				namesAbbr: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""]
+			},
+			AM: ["މކ","މކ","މކ"],
+			PM: ["މފ","މފ","މފ"],
+			eras: [{"name":"މީލާދީ","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yy",
+				D: "ddd, yyyy MMMM dd",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "ddd, yyyy MMMM dd HH:mm",
+				F: "ddd, yyyy MMMM dd HH:mm:ss",
+				Y: "yyyy, MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv.js
new file mode 100644
index 0000000..9a95e0d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.dv.js
@@ -0,0 +1,164 @@
+/*
+ * Globalize Culture dv
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "dv", "default", {
+	name: "dv",
+	englishName: "Divehi",
+	nativeName: "ދިވެހިބަސް",
+	language: "dv",
+	isRTL: true,
+	numberFormat: {
+		currency: {
+			pattern: ["n $-","n $"],
+			symbol: "ރ."
+		}
+	},
+	calendars: {
+		standard: {
+			name: "Hijri",
+			days: {
+				names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
+			},
+			months: {
+				names: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""],
+				namesAbbr: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""]
+			},
+			AM: ["މކ","މކ","މކ"],
+			PM: ["މފ","މފ","މފ"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "dd/MM/yyyy HH:mm",
+				F: "dd/MM/yyyy HH:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_Localized: {
+			days: {
+				names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
+				namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
+			},
+			months: {
+				names: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""],
+				namesAbbr: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""]
+			},
+			AM: ["މކ","މކ","މކ"],
+			PM: ["މފ","މފ","މފ"],
+			eras: [{"name":"މީލާދީ","start":null,"offset":0}],
+			patterns: {
+				d: "dd/MM/yy",
+				D: "ddd, yyyy MMMM dd",
+				t: "HH:mm",
+				T: "HH:mm:ss",
+				f: "ddd, yyyy MMMM dd HH:mm",
+				F: "ddd, yyyy MMMM dd HH:mm:ss",
+				Y: "yyyy, MMMM"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el-GR.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el-GR.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el-GR.js
new file mode 100644
index 0000000..1b01a9f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el-GR.js
@@ -0,0 +1,82 @@
+/*
+ * Globalize Culture el-GR
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "el-GR", "default", {
+	name: "el-GR",
+	englishName: "Greek (Greece)",
+	nativeName: "Ελληνικά (Ελλάδα)",
+	language: "el",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "μη αριθμός",
+		negativeInfinity: "-Άπειρο",
+		positiveInfinity: "Άπειρο",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],
+				namesAbbr: ["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],
+				namesShort: ["Κυ","Δε","Τρ","Τε","Πε","Πα","Σά"]
+			},
+			months: {
+				names: ["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος",""],
+				namesAbbr: ["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ",""]
+			},
+			monthsGenitive: {
+				names: ["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου",""],
+				namesAbbr: ["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ",""]
+			},
+			AM: ["πμ","πμ","ΠΜ"],
+			PM: ["μμ","μμ","ΜΜ"],
+			eras: [{"name":"μ.Χ.","start":null,"offset":0}],
+			patterns: {
+				d: "d/M/yyyy",
+				D: "dddd, d MMMM yyyy",
+				f: "dddd, d MMMM yyyy h:mm tt",
+				F: "dddd, d MMMM yyyy h:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el.js
new file mode 100644
index 0000000..87ba4b5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.el.js
@@ -0,0 +1,82 @@
+/*
+ * Globalize Culture el
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "el", "default", {
+	name: "el",
+	englishName: "Greek",
+	nativeName: "Ελληνικά",
+	language: "el",
+	numberFormat: {
+		",": ".",
+		".": ",",
+		"NaN": "μη αριθμός",
+		negativeInfinity: "-Άπειρο",
+		positiveInfinity: "Άπειρο",
+		percent: {
+			pattern: ["-n%","n%"],
+			",": ".",
+			".": ","
+		},
+		currency: {
+			pattern: ["-n $","n $"],
+			",": ".",
+			".": ",",
+			symbol: "€"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			days: {
+				names: ["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"],
+				namesAbbr: ["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],
+				namesShort: ["Κυ","Δε","Τρ","Τε","Πε","Πα","Σά"]
+			},
+			months: {
+				names: ["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος",""],
+				namesAbbr: ["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ",""]
+			},
+			monthsGenitive: {
+				names: ["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου",""],
+				namesAbbr: ["Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ",""]
+			},
+			AM: ["πμ","πμ","ΠΜ"],
+			PM: ["μμ","μμ","ΜΜ"],
+			eras: [{"name":"μ.Χ.","start":null,"offset":0}],
+			patterns: {
+				d: "d/M/yyyy",
+				D: "dddd, d MMMM yyyy",
+				f: "dddd, d MMMM yyyy h:mm tt",
+				F: "dddd, d MMMM yyyy h:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-029.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-029.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-029.js
new file mode 100644
index 0000000..0e55864
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-029.js
@@ -0,0 +1,47 @@
+/*
+ * Globalize Culture en-029
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "en-029", "default", {
+	name: "en-029",
+	englishName: "English (Caribbean)",
+	nativeName: "English (Caribbean)",
+	numberFormat: {
+		currency: {
+			pattern: ["-$n","$n"]
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			patterns: {
+				d: "MM/dd/yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-AU.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-AU.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-AU.js
new file mode 100644
index 0000000..068722a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.en-AU.js
@@ -0,0 +1,52 @@
+/*
+ * Globalize Culture en-AU
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "en-AU", "default", {
+	name: "en-AU",
+	englishName: "English (Australia)",
+	nativeName: "English (Australia)",
+	numberFormat: {
+		currency: {
+			pattern: ["-$n","$n"]
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 1,
+			patterns: {
+				d: "d/MM/yyyy",
+				D: "dddd, d MMMM yyyy",
+				f: "dddd, d MMMM yyyy h:mm tt",
+				F: "dddd, d MMMM yyyy h:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));


[10/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery.tmpl.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery.tmpl.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery.tmpl.js
new file mode 100644
index 0000000..f731a32
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery.tmpl.js
@@ -0,0 +1,131 @@
+/*
+ * jQuery Templating Plugin
+ *   NOTE: Created for demonstration purposes.
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ */
+(function(jQuery){
+	// Override the DOM manipulation function
+	var oldManip = jQuery.fn.domManip;
+	
+	jQuery.fn.extend({
+		render: function( data ) {
+			return this.map(function(i, tmpl){
+				return jQuery.render( tmpl, data );
+			});
+		},
+		
+		// This will allow us to do: .append( "template", dataObject )
+		domManip: function( args ) {
+			// This appears to be a bug in the appendTo, etc. implementation
+			// it should be doing .call() instead of .apply(). See #6227
+			if ( args.length > 1 && args[0].nodeType ) {
+				arguments[0] = [ jQuery.makeArray(args) ];
+			}
+
+			if ( args.length === 2 && typeof args[0] === "string" && typeof args[1] !== "string" ) {
+				arguments[0] = [ jQuery.render( args[0], args[1] ) ];
+			}
+			
+			return oldManip.apply( this, arguments );
+		}
+	});
+	
+	jQuery.extend({
+		render: function( tmpl, data ) {
+			var fn;
+			
+			// Use a pre-defined template, if available
+			if ( jQuery.templates[ tmpl ] ) {
+				fn = jQuery.templates[ tmpl ];
+				
+			// We're pulling from a script node
+			} else if ( tmpl.nodeType ) {
+				var node = tmpl, elemData = jQuery.data( node );
+				fn = elemData.tmpl || jQuery.tmpl( node.innerHTML );
+			}
+
+			fn = fn || jQuery.tmpl( tmpl );
+			
+			// We assume that if the template string is being passed directly
+			// in the user doesn't want it cached. They can stick it in
+			// jQuery.templates to cache it.
+
+			if ( jQuery.isArray( data ) ) {
+				return jQuery.map( data, function( data, i ) {
+					return fn.call( data, jQuery, data, i );
+				});
+
+			} else {
+				return fn.call( data, jQuery, data, 0 );
+			}
+		},
+		
+		// You can stick pre-built template functions here
+		templates: {},
+
+		/*
+		 * For example, someone could do:
+		 *   jQuery.templates.foo = jQuery.tmpl("some long templating string");
+		 *   $("#test").append("foo", data);
+		 */
+
+		tmplcmd: {
+			each: {
+				_default: [ null, "$i" ],
+				prefix: "jQuery.each($1,function($2){with(this){",
+				suffix: "}});"
+			},
+			"if": {
+				prefix: "if($1){",
+				suffix: "}"
+			},
+			"else": {
+				prefix: "}else{"
+			},
+			html: {
+				prefix: "_.push(typeof $1==='function'?$1.call(this):$1);"
+			},
+			"=": {
+				_default: [ "this" ],
+				prefix: "_.push($.encode(typeof $1==='function'?$1.call(this):$1));"
+			}
+		},
+
+		encode: function( text ) {
+			return text != null ? document.createTextNode( text.toString() ).nodeValue : "";
+		},
+
+		tmpl: function(str, data, i) {
+			// Generate a reusable function that will serve as a template
+			// generator (and which will be cached).
+			var fn = new Function("jQuery","$data","$i",
+				"var $=jQuery,_=[];_.data=$data;_.index=$i;" +
+
+				// Introduce the data as local variables using with(){}
+				"with($data){_.push('" +
+
+				// Convert the template into pure JavaScript
+				str
+					.replace(/[\r\t\n]/g, " ")
+					.replace(/\${([^}]*)}/g, "{{= $1}}")
+					.replace(/{{(\/?)(\w+|.)(?:\((.*?)\))?(?: (.*?))?}}/g, function(all, slash, type, fnargs, args) {
+						var tmpl = jQuery.tmplcmd[ type ];
+
+						if ( !tmpl ) {
+							throw "Template not found: " + type;
+						}
+
+						var def = tmpl._default;
+
+						return "');" + tmpl[slash ? "suffix" : "prefix"]
+							.split("$1").join(args || (def?def[0]:null))
+							.split("$2").join(fnargs || (def?def[1]:null)) + "_.push('";
+					})
+				+ "');}return $(_.join('')).get();");
+
+			// Provide some basic currying to the user
+			return data ? fn.call( this, jQuery, data, i ) : fn;
+		}
+	});
+})(jQuery);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/HijriCalendar.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/HijriCalendar.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/HijriCalendar.js
new file mode 100644
index 0000000..461833b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/HijriCalendar.js
@@ -0,0 +1,70 @@
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: %HIJRIADJUSTMENT%,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Program.cs
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Program.cs b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Program.cs
new file mode 100644
index 0000000..890fbb9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Program.cs
@@ -0,0 +1,672 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO;
+using System.Globalization;
+using System.Web.Script.Serialization;
+using System.Collections.Specialized;
+using System.Collections;
+using System.Text.RegularExpressions;
+using System.Reflection;
+using System.Diagnostics;
+using Globalization;
+
+namespace Globalization {
+    public class GlobalizationInfo {
+        public string name = "";
+        public string englishName;
+        public string nativeName;
+        public string language;
+        public bool isRTL;
+        public NumberFormatInfo numberFormat;
+        public Dictionary<String, DateFormatInfo> calendars;
+        private CultureInfo culture;
+        public static Dictionary<String, Object> BasisGlobInfo;
+
+
+        private static string[] _numberNegativePatterns = "(n)|-n|- n|n-|n -".Split('|');
+        private static string[] _currencyNegativePatterns = "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)".Split('|');
+        private static string[] _percentNegativePatterns = "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %".Split('|');
+        private static string[] _currencyPositivePatterns = "$n|n$|$ n|n $".Split('|');
+        private static string[] _percentPositivePatterns = "n %|n%|%n|% n".Split('|');
+
+        public static GlobalizationInfo GetGlobInfo(CultureInfo culture) {
+            var info = new GlobalizationInfo {
+                culture = culture,
+                language = (culture == CultureInfo.InvariantCulture || culture.IsNeutralCulture) ? culture.Name : culture.Parent.Name,
+                name = String.IsNullOrEmpty(culture.Name) ? "invariant" : culture.Name,
+                englishName = String.IsNullOrEmpty(culture.Name) ? "invariant" : culture.EnglishName,
+                nativeName = String.IsNullOrEmpty(culture.Name) ? "invariant" : culture.NativeName,
+                isRTL = culture.TextInfo.IsRightToLeft,
+                numberFormat = GetNumberFormatInfo(culture),
+                calendars = GetCalendars(culture)
+            };
+            return info;
+        }
+
+        public static Dictionary<String, DateFormatInfo> GetCalendars(CultureInfo culture) {
+            var calendars = new Dictionary<String, DateFormatInfo>();
+            bool foundStandard = false;
+            var gregorianType = typeof(GregorianCalendar);
+            var defaultCalendar = culture.DateTimeFormat.Calendar;
+            var defaultCalendarType = defaultCalendar.GetType();
+            GregorianCalendarTypes? gregorianCalendarType = null;
+            if (defaultCalendarType == gregorianType) {
+                gregorianCalendarType = ((GregorianCalendar)defaultCalendar).CalendarType;
+            }
+            var optionalCalendars = culture.OptionalCalendars;
+            foreach (var calendar in optionalCalendars) {
+                var type = calendar.GetType();
+                string name;
+                bool isStandard = false;
+                if (type == gregorianType) {
+                    var calendarType = ((GregorianCalendar)calendar).CalendarType;
+                    if (calendarType == GregorianCalendarTypes.USEnglish) {
+                        // we include the Gregorian_USEnglish culture as part of the built-in 'en' culture
+                        // because it is so common -- it is an optional calendar of every single english
+                        // speaking culture. So, skip it when found for any other culture.
+                        continue;
+                    }
+                    else if (culture == CultureInfo.InvariantCulture) {
+                        // invariant has one calendar, Gregorian_Localized, which is identical
+                        // to Gregorian_USEnglish.
+                        name = " Gregorian_USEnglish";
+                    }
+                    else {
+                        name = "Gregorian_" + calendarType.ToString();
+                    }
+                    if (!foundStandard && gregorianCalendarType.HasValue && gregorianCalendarType == gregorianCalendarType.Value) {
+                        isStandard = true;
+                        foundStandard = true;
+                    }
+                }
+                else {
+                    name = type.Name.Replace("Calendar", "");
+                    if (!foundStandard) {
+                        isStandard = true;
+                        foundStandard = true;
+                    }
+                }
+                string key = name;
+                if (isStandard) {
+                    key = "standard";
+                }
+                if (culture != CultureInfo.InvariantCulture) {
+                    culture.DateTimeFormat.Calendar = calendar;
+                }
+                var calendarInfo = GetDateTimeFormatInfo(culture, name);
+                calendars.Add(key, calendarInfo);
+            }
+            if (!foundStandard) {
+                throw new ApplicationException("Could not locate the standard calendar type for culture '" + culture.Name + "'.");
+            }
+            return calendars;
+        }
+
+        public static GlobalizationInfo.NumberFormatInfo GetNumberFormatInfo(CultureInfo culture) {
+            var nf = culture.NumberFormat;
+            return new GlobalizationInfo.NumberFormatInfo {
+                decimals = nf.NumberDecimalDigits,
+                decimalSeparator = nf.NumberDecimalSeparator,
+                groupSeparator = nf.NumberGroupSeparator,
+                groupSizes = nf.NumberGroupSizes,
+                NaN = nf.NaNSymbol,
+                negative = nf.NegativeSign,
+                negativeInfinity = nf.NegativeInfinitySymbol,
+                positive = nf.PositiveSign,
+                positiveInfinity = nf.PositiveInfinitySymbol,
+                pattern = new string[] { GetFromStringList(_numberNegativePatterns, nf.NumberNegativePattern) },
+                currency = new GlobalizationInfo.NumberFormatInfo.NumberClassFormatInfo {
+                    decimals = nf.CurrencyDecimalDigits,
+                    decimalSeparator = nf.CurrencyDecimalSeparator,
+                    groupSeparator = nf.CurrencyGroupSeparator,
+                    groupSizes = nf.CurrencyGroupSizes,
+                    pattern = new string[] {
+                        GetFromStringList(_currencyNegativePatterns, nf.CurrencyNegativePattern),
+                        GetFromStringList(_currencyPositivePatterns, nf.CurrencyPositivePattern)
+                    },
+                    symbol = nf.CurrencySymbol
+                },
+                percent = new GlobalizationInfo.NumberFormatInfo.NumberClassFormatInfo {
+                    decimals = nf.PercentDecimalDigits,
+                    decimalSeparator = nf.PercentDecimalSeparator,
+                    groupSeparator = nf.PercentGroupSeparator,
+                    groupSizes = nf.PercentGroupSizes,
+                    pattern = new string[] {
+                        GetFromStringList(_percentNegativePatterns, nf.PercentNegativePattern),
+                        GetFromStringList(_percentPositivePatterns, nf.PercentPositivePattern)
+                    },
+                    symbol = nf.PercentSymbol
+                }
+            };
+        }
+
+        public static string[] GetAMPMDesignators(CultureInfo culture, string ampm) {
+            return String.IsNullOrEmpty(ampm) ? null : new string[] { ampm, culture.TextInfo.ToLower(ampm), culture.TextInfo.ToUpper(ampm) };
+        }
+
+        public static GlobalizationInfo.DateFormatInfo GetDateTimeFormatInfo(CultureInfo culture, string calendarName) {
+            var df = culture.DateTimeFormat;
+            var info = new GlobalizationInfo.DateFormatInfo {
+                name = calendarName,
+                months = new DateFormatInfo.MonthInfo { names = df.MonthNames, namesAbbr = df.AbbreviatedMonthNames },
+                monthsGenitive = new DateFormatInfo.MonthInfo { names = df.MonthGenitiveNames, namesAbbr = df.AbbreviatedMonthGenitiveNames },
+                firstDay = (int) df.FirstDayOfWeek,
+                dateSeparator = df.DateSeparator,
+                timeSeparator = df.TimeSeparator,
+                days = new DateFormatInfo.DayInfo { names = df.DayNames, namesAbbr = df.AbbreviatedDayNames, namesShort = df.ShortestDayNames },
+                eras = GetEraInfo(culture),
+                twoDigitYearMax = df.Calendar.TwoDigitYearMax,
+                patterns = GetPatterns(df)
+            };
+            info.AM = GetAMPMDesignators(culture, df.AMDesignator);
+            info.PM = GetAMPMDesignators(culture, df.PMDesignator);
+            if (df.Calendar != null) {
+                var type = df.Calendar.GetType();
+                if (type == typeof(HijriCalendar)) {
+                    string convert;
+                    using (var sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("Generator.HijriCalendar.js"))) {
+                        convert = sr.ReadToEnd();
+                    }
+                    int adjustment = ((HijriCalendar)df.Calendar).HijriAdjustment;
+                    convert = convert.Replace("%HIJRIADJUSTMENT%", adjustment.ToString(CultureInfo.InvariantCulture));
+                    info.convertScriptBlock = convert;
+                }
+                else if (type == typeof(UmAlQuraCalendar)) {
+                    using (var sr = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("Generator.UmAlQuraCalendar.js"))) {
+                        info.convertScriptBlock = sr.ReadToEnd();
+                    }
+                }
+            }
+            return info;
+        }
+
+        private static GlobalizationInfo.DateFormatInfo.EraInfo[] GetEraInfo(CultureInfo culture) {
+            Calendar cal = culture.DateTimeFormat.Calendar;
+            List<GlobalizationInfo.DateFormatInfo.EraInfo> eras = null;
+            if (cal != null) {
+                eras = new List<GlobalizationInfo.DateFormatInfo.EraInfo>();
+                foreach (var eraNum in cal.Eras) {
+                    eras.Add(GetEraInfo(culture, eraNum));
+                }
+            }
+            return eras == null ? null : eras.ToArray();
+        }
+
+        private static GlobalizationInfo.DateFormatInfo.EraInfo GetEraInfo(CultureInfo culture, int eraNum) {
+            var era = new GlobalizationInfo.DateFormatInfo.EraInfo {
+                name = culture.DateTimeFormat.GetEraName(eraNum),
+                offset = 0,
+                start = null
+            };
+            var calendar = culture.DateTimeFormat.Calendar;
+
+            Type type = calendar.GetType();
+            if (type != typeof(GregorianCalendar)) {
+                if (type == typeof(TaiwanCalendar)) {
+                    era.offset = 0x777;
+                }
+                else if (type == typeof(KoreanCalendar)) {
+                    era.offset = -2333;
+                }
+                else if (type == typeof(ThaiBuddhistCalendar)) {
+                    era.offset = -543;
+                }
+                else if (type == typeof(JapaneseCalendar)) {
+                    switch (eraNum) {
+                        case 1:
+                            era.start = 0xdf9984200L;
+                            era.offset = 0x7c4;
+                            break;
+                        case 2:
+                            era.start = -1357603200000L;
+                            era.offset = 0x785;
+                            break;
+                        case 3:
+                            era.start = -1812153600000L;
+                            era.offset = 0x777;
+                            break;
+                        case 4:
+                            era.start = null;
+                            era.offset = 0x74b;
+                            break;
+                        default:
+                            throw new InvalidOperationException("Invalid era number for JapaneseCalendar: " + eraNum.ToString());
+                    }
+                }
+            }
+            return era;
+        }
+
+        private static Dictionary<String, String> GetPatterns(DateTimeFormatInfo df) {
+            var patterns = new Dictionary<String, String> {
+                { "d", df.ShortDatePattern },
+                { "D", df.LongDatePattern },
+                { "t", df.ShortTimePattern },
+                { "T", df.LongTimePattern },
+                { "f", df.LongDatePattern + " " + df.ShortTimePattern },
+                { "F", df.FullDateTimePattern },
+                { "M", df.MonthDayPattern },
+                { "S", df.SortableDateTimePattern },
+                { "Y", df.YearMonthPattern }
+            };
+            return patterns;
+        }
+
+        private static bool ArrayEquality(Array arr1, Array arr2) {
+            if (arr1.Length == arr2.Length) {
+                for (int i = 0; i < arr1.Length; i++) {
+                    if (!arr1.GetValue(i).Equals(arr2.GetValue(i))) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+            return false;
+        }
+
+        private static bool ListEquality(IList arr1, IList arr2) {
+            if (arr1.Count == arr2.Count) {
+                for (int i = 0; i < arr1.Count; i++) {
+                    var val1 = arr1[i];
+                    var val2 = arr2[i];
+                    if (val1 == null || !val1.Equals(val2)) {
+                        if (val1 is IList && val2 is IList) {
+                            if (!ListEquality(val1 as IList, val2 as IList)) {
+                                return false;
+                            }
+                        }
+                        else if (val1 is Dictionary<String, Object> && val2 is Dictionary<String, Object>) {
+                            var diff = DiffGlobInfos((Dictionary<String, Object>)val1, (Dictionary<String, Object>)val2);
+                            if (diff.Count > 0) {
+                                return false;
+                            }
+                        }
+                        else {
+                            return false;
+                        }
+                    }
+                }
+                return true;
+            }
+            return false;
+        }
+
+        private static string GetFromStringList(string[] list, int value) {
+            return value < list.Length ? list[value] : null;
+        }
+
+        public Dictionary<String, Object> ToDictionary(bool diffCalendars) {
+            var jss = new JavaScriptSerializer();
+            var str = jss.Serialize(this);
+            var dictionary = jss.Deserialize<Dictionary<String, Object>>(str);
+            var cals = (Dictionary<String, Object>) dictionary["calendars"];
+            Dictionary<String, Object> basisStandardCal = null;
+            if (GlobalizationInfo.BasisGlobInfo != null) {
+                basisStandardCal = (Dictionary<String, Object>)((Dictionary<String, Object>)GlobalizationInfo.BasisGlobInfo["calendars"])["standard"];
+                foreach (var pair in this.calendars) {
+                    var cal = (Dictionary<String, Object>)cals[pair.Key];
+                    if (diffCalendars) {
+                        // make each calendar a diff from the standard basis calendar
+                        cals[pair.Key] = cal = DiffGlobInfos(basisStandardCal, cal);
+                    }
+                    // apply convert script if it exists
+                    if (!String.IsNullOrEmpty(pair.Value.convertScriptBlock)) {
+                        cal["convert"] = pair.Value.convertScriptBlock;
+                    }
+                    // remove redundant monthsGenitive array if it is equivilent to months
+                    Dictionary<String, Object> months = cal.ContainsKey("months") ? (Dictionary<String, Object>)cal["months"] : null;
+                    Dictionary<String, Object> monthsGenitive = cal.ContainsKey("monthsGenitive") ? (Dictionary<String, Object>)cal["monthsGenitive"] : null;
+                    Dictionary<String, Object> diff = (months != null && monthsGenitive != null) ? DiffGlobInfos(months, monthsGenitive) : null;
+                    if (diff != null && diff.Count == 0) {
+                        // the genitive months are the same as months, so remove it since it's optional
+                        cal.Remove("monthsGenitive");
+                    }
+                }
+            }
+            return dictionary;
+        }
+
+        public static string GenerateJavaScript(string extend, string global, CultureInfo culture, string name, Dictionary<String, Object> dictionary, StringBuilder aggregateScript) {
+            string cultureFragment = ToJavaScript(extend, culture, dictionary, 1, false);
+
+            if (aggregateScript != null) {
+                aggregateScript.AppendFormat(CultureInfo.InvariantCulture, @"
+Globalize.addCultureInfo( ""{0}"", ""default"", {{
+{1}
+}});
+", name, cultureFragment, extend);
+            }
+
+                return string.Format(CultureInfo.InvariantCulture, @"/*
+ * Globalize Culture {0}
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {{
+
+var Globalize;
+
+if ( typeof require !== ""undefined"" &&
+	typeof exports !== ""undefined"" &&
+	typeof module !== ""undefined"" ) {{
+	// Assume CommonJS
+	Globalize = require( ""globalize"" );
+}} else {{
+	// Global variable
+	Globalize = window.Globalize;
+}}
+
+Globalize.addCultureInfo( ""{0}"", ""default"", {{
+{1}
+}});
+
+}}( this ));
+", name, cultureFragment);
+        }
+
+        private static string Serialize(object value) {
+            // no need to escape single quotes
+            return _jss.Serialize(value).Replace("\\u0027", "'")
+                // Unsafe Characters
+                // There are characters that are handled inconsistently in browsers, and so must be escaped when placed in strings.
+                // http://www.jslint.com/lint.html#unsafe
+                .Replace("\xad", "\\xad")
+                .Replace("\u070f", "\\u070f")
+                .Replace("\u200c", "\\u200c")
+                .Replace("\u200d", "\\u200d")
+                .Replace("\u200f", "\\u200f")
+                .Replace("\u202f", "\\u202f");
+        }
+
+        private static string ToJavaScript(string extend, CultureInfo culture, Dictionary<String, Object> dictionary, int level, bool isCalendars) {
+            StringBuilder sb = new StringBuilder();
+            string padding = _padding.Substring(0, level);
+            bool first = true;
+            foreach (var pair in dictionary) {
+                if (!first) {
+                    sb.Append(",\n");
+                }
+                first = false;
+                if (pair.Value is Dictionary<String, Object>) {
+                    sb.AppendFormat("{0}{1}: {{\n{2}\n{0}}}", padding, pair.Key, ToJavaScript(extend, culture, (Dictionary<String, Object>)pair.Value, level + 1, pair.Key.Equals("calendars")));
+                }
+                else if (pair.Key.Equals("convert")) {
+                    sb.AppendFormat("{0}convert: {{\n{1}\n{0}}}", padding, pair.Value);
+                }
+                else if (pair.Key.Equals("groupSeparator")) {
+                    sb.AppendFormat("{0}\",\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("decimalSeparator")) {
+                    sb.AppendFormat("{0}\".\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("positive")) {
+                    sb.AppendFormat("{0}\"+\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("negative")) {
+                    sb.AppendFormat("{0}\"-\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("dateSeparator")) {
+                    sb.AppendFormat("{0}\"/\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("timeSeparator")) {
+                    sb.AppendFormat("{0}\":\": {1}", padding, Serialize(pair.Value));
+                }
+                else if (pair.Key.Equals("NaN")) {
+                    sb.AppendFormat("{0}\"NaN\": {1}", padding, Serialize(pair.Value));
+                }
+                else {
+                    sb.AppendFormat("{0}{1}: {2}", padding, pair.Key, Serialize(pair.Value));
+                }
+            }
+            return sb.ToString();
+        }
+
+        private static JavaScriptSerializer _jss = new JavaScriptSerializer();
+        private static string _padding = "																	";
+
+        private static Dictionary<String, Object> ToDictionary(IEnumerable<KeyValuePair<String, Object>> pairs) {
+            var d = new Dictionary<String, Object>();
+            foreach (var pair in pairs) {
+                d.Add(pair.Key, pair.Value);
+            }
+            return d;
+        }
+
+        public static Dictionary<String, Object> DiffGlobInfos(Dictionary<String, Object> glob1, Dictionary<String, Object> glob2) {
+            var unique = new Dictionary<String, Object>();
+            var comparer = new KeyValueComparer();
+
+            var diff = ToDictionary(glob2.Except(glob1, comparer));
+            foreach (var pair in glob2) {
+                if (diff.ContainsKey(pair.Key) && pair.Value != null) {
+                    if (pair.Value is Dictionary<String, Object>) {
+                        var subdiff = glob1.ContainsKey(pair.Key) ? DiffGlobInfos((Dictionary<String, Object>)glob1[pair.Key], (Dictionary<String, Object>)pair.Value) : (Dictionary<String, Object>)pair.Value;
+                        if (subdiff.Count > 0) {
+                            //Debug.WriteLine("Replacing\n    {0}\nwith\n    {1}", _jss.Serialize(diff[pair.Key]), _jss.Serialize(subdiff));
+                            diff[pair.Key] = subdiff;
+                        }
+                        else {
+                            //Debug.WriteLine("\nRemoving {0}\n", _jss.Serialize(pair.Key));
+                            diff.Remove(pair.Key);
+                        }
+                    }
+                    else if (pair.Value is IList) {
+                        if (glob1.ContainsKey(pair.Key) && ListEquality((IList)pair.Value, (IList)glob1[pair.Key])) {
+                            diff.Remove(pair.Key);
+                        }
+                    }
+                }
+            }
+
+            return diff;
+        }
+
+        public class KeyValueComparer : IEqualityComparer<KeyValuePair<String, Object>> {
+            public bool Equals(KeyValuePair<String, Object> x, KeyValuePair<String, Object> y) {
+                if (x.Key.Equals(y.Key)) {
+                    if ((x.Value == null && y.Value == null) || (x.Value != null && x.Value.Equals(y.Value))) {
+                        return true;
+                    }
+                    else if (x.Value is ArrayList && y.Value is ArrayList) {
+                        return ListEquality((IList)x.Value, (IList)y.Value);
+                    }
+                    else if (x.Value is Array && y.Value is Array) {
+                        return ArrayEquality(x.Value as Array, y.Value as Array);
+                    }
+                    else if (x.Value is Dictionary<String, Object> && y.Value is Dictionary<String, Object>) {
+                        var diff = DiffGlobInfos((Dictionary<String, Object>)x.Value, (Dictionary<String, Object>)y.Value);
+                        if (diff.Count == 0) {
+                            return true;
+                        }
+                        //else {
+                        //    Debug.WriteLine("    Dictionaries diff:\n        {0}\n        {1}", _jss.Serialize(x.Value), _jss.Serialize(y.Value));
+                        //}
+                    }
+                }
+                //Debug.WriteLine("    Diff found: {0}={1}, {2}={3}", x.Key, x.Value, y.Key, y.Value);
+                return false;
+            }
+
+            public int GetHashCode(KeyValuePair<String, Object> obj) {
+                return obj.GetHashCode();
+            }
+        }
+
+        public class NumberFormatInfo {
+            public string[] pattern;
+            public int decimals;
+            public string groupSeparator;
+            public string decimalSeparator;
+            public int[] groupSizes;
+            public string NaN;
+            public string negative;
+            public string negativeInfinity;
+            public string positive;
+            public string positiveInfinity;
+            public NumberClassFormatInfo percent;
+            public NumberClassFormatInfo currency;
+
+            public class NumberClassFormatInfo {
+                public string[] pattern;
+                public int decimals;
+                public int[] groupSizes;
+                public string groupSeparator;
+                public string decimalSeparator;
+                public string symbol;
+            }
+        }
+
+        public class DateFormatInfo {
+            public string name;
+            public string dateSeparator;
+            public string timeSeparator;
+            public int firstDay;
+            public DayInfo days;
+            public MonthInfo months;
+            public MonthInfo monthsGenitive;
+            public string[] AM;
+            public string[] PM;
+            public EraInfo[] eras;
+            public int twoDigitYearMax;
+            public Dictionary<String, String> patterns;
+            internal string convertScriptBlock;
+
+            public class EraInfo {
+                public string name;
+                public long? start;
+                public long offset;
+            }
+
+            public class MonthInfo {
+                public string[] names;
+                public string[] namesAbbr;
+            }
+
+            public class DayInfo {
+                public string[] names;
+                public string[] namesAbbr;
+                public string[] namesShort;
+            }
+        }
+
+    }
+
+    public class Program {
+
+        private static void WriteCulture(string outputdir, string fileName, string extend, string global, CultureInfo culture, StringBuilder aggregateScript) {
+            var globInfo = GlobalizationInfo.GetGlobInfo(culture);
+            var diff = (String.IsNullOrEmpty(extend) || culture == CultureInfo.InvariantCulture || culture.Name.Equals("en")) ? globInfo.ToDictionary(false) : GlobalizationInfo.DiffGlobInfos(GlobalizationInfo.BasisGlobInfo, globInfo.ToDictionary(true));
+
+            // Fix for Issue #31 - en-US 'englishName' is wrong
+            // Special case diff of englishName for en-US. The generator diff seemingly finds both "en" and "en-US" to
+            // have englishName "English (United States)" but globalize.js (correctly) has the neutral "English" for "en"/"default"
+            if (culture.Name.Equals("en-US")) {
+                diff.Add("name", globInfo.name);
+                diff.Add("englishName", globInfo.englishName);
+            }
+
+            var script = GlobalizationInfo.GenerateJavaScript(extend, global, culture, culture.Name, diff, aggregateScript);
+            var filePath = Path.Combine(outputdir, String.Format(fileName, (String.IsNullOrEmpty(culture.Name) ? "invariant" : culture.Name)));
+
+            File.WriteAllText(filePath, script);
+            Console.WriteLine(filePath);
+        }
+
+        [STAThread]
+        static void Main(string[] args) {
+            string outputdir = "lib\\cultures";
+            string extend = "extend";
+            string global = "Globalization";
+            string fileName = "globalize.culture.{0}.js";
+            string aggregateFileName = "globalize.cultures.js";
+            foreach (string param in string.Join(" ", args).SplitCommandLine()) {
+                if (param.StartsWith("/o:")) {
+                    outputdir = param.Substring("/o:".Length);
+                }
+                else if (param == "/?") {
+                    Console.Write(@"
+Usage:glob-generator [<options>]
+
+options:
+
+    /o: The directory to put the culture scripts into. The directory will be
+        created if it does not exist. Existing scripts there will be
+        overwritten if necessary.
+        default: ""lib\cultures""
+
+");
+                    return;
+                }
+            }
+            Directory.CreateDirectory(outputdir);
+            GlobalizationInfo.BasisGlobInfo = GlobalizationInfo.GetGlobInfo(CultureInfo.CreateSpecificCulture("en")).ToDictionary(false);
+
+            StringBuilder aggregateScript = new StringBuilder();
+
+/*
+
+Globalize.addCultureInfo( ""{0}"", ""default"", {{
+{1}
+}});
+
+}}( this ));
+"
+*/
+
+            aggregateScript.Append(
+    @"/*
+ * Globalize Cultures
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== ""undefined"" &&
+	typeof exports !== ""undefined"" &&
+	typeof module !== ""undefined"" ) {
+	// Assume CommonJS
+	Globalize = require( ""globalize"" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+");
+
+            int count = 0;
+            foreach (var culture in CultureInfo.GetCultures(CultureTypes.AllCultures)) {
+                if (!String.IsNullOrEmpty(culture.Name) && culture != CultureInfo.InvariantCulture && culture.Name != "en") {
+                    WriteCulture(outputdir, fileName, extend, global, culture, aggregateScript);
+                    count++;
+                }
+            }
+
+            aggregateScript.Append("\r\n}( this ));\r\n");
+            string aggregateScriptString = aggregateScript.ToString();
+            string aggregatePath = Path.Combine(outputdir, aggregateFileName);
+            File.WriteAllText(aggregatePath, aggregateScriptString);
+            Console.WriteLine(aggregatePath);
+
+            Console.WriteLine("Done! Generated scripts for a total of {0} cultures, and 1 aggregate script.", count);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Properties/AssemblyInfo.cs b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..36a678f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("GlobalizationCultures")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("jQuery")]
+[assembly: AssemblyProduct("GlobalizeCultureGenerator")]
+[assembly: AssemblyCopyright("Copyright Software Freedom Conservancy, Inc.")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("d485ddf1-b620-429a-bc9e-619e9aa5edc4")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/StringExt.cs
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/StringExt.cs b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/StringExt.cs
new file mode 100644
index 0000000..4fa450b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/StringExt.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Globalization;
+
+namespace Globalization {
+    public static class StringExtensions {
+        public static IEnumerable<string> Split(this string str, Func<char, bool> controller) {
+            int nextPiece = 0;
+
+            for (int c = 0; c < str.Length; c++) {
+                if (controller(str[c])) {
+                    yield return str.Substring(nextPiece, c - nextPiece);
+                    nextPiece = c + 1;
+                }
+            }
+
+            yield return str.Substring(nextPiece);
+        }
+
+        public static string TrimMatchingQuotes(this string input, char quote) {
+            if ((input.Length >= 2) &&
+                (input[0] == quote) && (input[input.Length - 1] == quote))
+                return input.Substring(1, input.Length - 2);
+
+            return input;
+        }
+
+        public static IEnumerable<string> SplitCommandLine(this string commandLine) {
+            bool inQuotes = false;
+
+            return commandLine.Split(c => {
+                if (c == '\"')
+                    inQuotes = !inQuotes;
+
+                return !inQuotes && c == ' ';
+            }).Select(arg => arg.Trim().TrimMatchingQuotes('\"'))
+              .Where(arg => !string.IsNullOrEmpty(arg));
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/UmAlQuraCalendar.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/UmAlQuraCalendar.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/UmAlQuraCalendar.js
new file mode 100644
index 0000000..7dc25ee
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/UmAlQuraCalendar.js
@@ -0,0 +1,190 @@
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/generator.csproj
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/generator.csproj b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/generator.csproj
new file mode 100644
index 0000000..3c9f503
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/generator/generator.csproj
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProjectGuid>{6EBDAB07-7C5E-4CF5-91CA-368ED36D6600}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <NoStandardLibraries>false</NoStandardLibraries>
+    <AssemblyName>generator</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RootNamespace>Generator</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Xml.Linq" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="StringExt.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="UmAlQuraCalendar.js" />
+    <EmbeddedResource Include="HijriCalendar.js" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
+  <ProjectExtensions>
+    <VisualStudio AllowExistingFolder="true" />
+  </ProjectExtensions>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/grunt.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/grunt.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/grunt.js
new file mode 100644
index 0000000..4e82c73
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/grunt.js
@@ -0,0 +1,36 @@
+module.exports = function( grunt ) {
+
+grunt.initConfig({
+	pkg: "<json:package.json>",
+	meta: {
+		banner: "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " +
+				"<%= grunt.template.today('isoDate') %>\n" +
+				"<%= pkg.homepage ? '* ' + pkg.homepage + '\n' : '' %>" +
+				"* Copyright <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
+				" Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */"
+	},
+	lint: {
+		files: [ "lib/globalize.js", "lib/cultures/*.js", "test/*.js" ]
+	},
+	qunit: {
+		files: [ "test/*.html" ]
+	},
+	watch: {
+		files: [ "<config:lint.files>", "test/*.html" ],
+		tasks: "lint qunit"
+	},
+	jshint: {
+		options: {
+			eqnull: true
+		}
+	},
+	min: {
+		"dist/globalize.min.js": [ "<banner:meta.banner>", "lib/globalize.js" ]
+	}
+});
+
+// Default task.
+grunt.registerTask( "default", "lint qunit" );
+
+}
+


[07/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-IQ.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-IQ.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-IQ.js
new file mode 100644
index 0000000..14658fb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-IQ.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-IQ
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-IQ", "default", {
+	name: "ar-IQ",
+	englishName: "Arabic (Iraq)",
+	nativeName: "العربية (العراق)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "د.ع.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-JO.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-JO.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-JO.js
new file mode 100644
index 0000000..9db0acd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-JO.js
@@ -0,0 +1,462 @@
+/*
+ * Globalize Culture ar-JO
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-JO", "default", {
+	name: "ar-JO",
+	englishName: "Arabic (Jordan)",
+	nativeName: "العربية (الأردن)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$ n"],
+			decimals: 3,
+			symbol: "د.ا.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-KW.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-KW.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-KW.js
new file mode 100644
index 0000000..9cdf76f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-KW.js
@@ -0,0 +1,462 @@
+/*
+ * Globalize Culture ar-KW
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-KW", "default", {
+	name: "ar-KW",
+	englishName: "Arabic (Kuwait)",
+	nativeName: "العربية (الكويت)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$ n"],
+			decimals: 3,
+			symbol: "د.ك.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));


[29/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.ttf
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.ttf b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.ttf
new file mode 100644
index 0000000..d365924
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.ttf differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.woff
new file mode 100644
index 0000000..b9bd17e
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300.woff
new file mode 100644
index 0000000..99f3353
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300i.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300i.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300i.woff
new file mode 100644
index 0000000..dd0a0ea
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-300i.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400.woff
new file mode 100644
index 0000000..55b25f8
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400i.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400i.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400i.woff
new file mode 100644
index 0000000..cedefb8
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-400i.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600.woff
new file mode 100644
index 0000000..e83bb33
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600i.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600i.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600i.woff
new file mode 100644
index 0000000..983bb33
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-600i.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700.woff
new file mode 100644
index 0000000..27619e7
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700i.woff
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700i.woff b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700i.woff
new file mode 100644
index 0000000..e12c3a9
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontopensans/open-sans-700i.woff differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/System-Settings-icon.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/System-Settings-icon.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/System-Settings-icon.png
new file mode 100644
index 0000000..2f34e5d
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/System-Settings-icon.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/avatar.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/avatar.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/avatar.png
new file mode 100644
index 0000000..74a8031
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/avatar.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blank.gif
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blank.gif b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blank.gif
new file mode 100644
index 0000000..35d42e8
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blank.gif differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blockLoading.gif
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blockLoading.gif b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blockLoading.gif
new file mode 100644
index 0000000..86a52b8
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/blockLoading.gif differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/body-bg.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/body-bg.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/body-bg.png
new file mode 100644
index 0000000..5fcb51d
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/body-bg.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/cancel_search.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/cancel_search.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/cancel_search.png
new file mode 100644
index 0000000..967bf53
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/cancel_search.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/clear.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/clear.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/clear.png
new file mode 100644
index 0000000..580b52a
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/clear.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/comp.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/comp.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/comp.png
new file mode 100644
index 0000000..deccae4
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/comp.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/data-grey.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/data-grey.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/data-grey.png
new file mode 100644
index 0000000..dabec13
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/data-grey.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/database_table_32.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/database_table_32.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/database_table_32.png
new file mode 100644
index 0000000..14bb068
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/database_table_32.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-404-icon.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-404-icon.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-404-icon.png
new file mode 100644
index 0000000..9b8f81d
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-404-icon.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-500-icon.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-500-icon.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-500-icon.png
new file mode 100644
index 0000000..017cc53
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/error-500-icon.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder-grey.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder-grey.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder-grey.png
new file mode 100644
index 0000000..0149cf2
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder-grey.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder.png
new file mode 100644
index 0000000..0613c6b
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder2.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder2.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder2.png
new file mode 100644
index 0000000..85da97f
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/folder2.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/form.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/form.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/form.png
new file mode 100644
index 0000000..3ea179c
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/form.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hbase.jpg
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hbase.jpg b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hbase.jpg
new file mode 100644
index 0000000..27c177a
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hbase.jpg differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hdfs.jpg
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hdfs.jpg b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hdfs.jpg
new file mode 100644
index 0000000..2f6dad2
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hdfs.jpg differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hive.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hive.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hive.png
new file mode 100644
index 0000000..b7939b1
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hive.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hline.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hline.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hline.png
new file mode 100644
index 0000000..b488b95
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/hline.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-collapse.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-collapse.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-collapse.png
new file mode 100644
index 0000000..ef00a8c
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-collapse.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-expand.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-expand.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-expand.png
new file mode 100644
index 0000000..c7c2480
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/icon-expand.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox.gif
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox.gif b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox.gif
new file mode 100644
index 0000000..3edc8fd
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox.gif differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox1.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox1.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox1.png
new file mode 100644
index 0000000..56265c7
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/knox1.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading.gif
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading.gif b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading.gif
new file mode 100644
index 0000000..5b33f7e
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading.gif differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading_game.gif
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading_game.gif b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading_game.gif
new file mode 100644
index 0000000..5cb5074
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/loading_game.gif differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/logo.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/logo.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/logo.png
new file mode 100644
index 0000000..ddd816d
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/logo.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/router-grey.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/router-grey.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/router-grey.png
new file mode 100644
index 0000000..5424139
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/router-grey.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/search_glyph.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/search_glyph.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/search_glyph.png
new file mode 100644
index 0000000..017a6d0
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/search_glyph.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingCollapse.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingCollapse.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingCollapse.png
new file mode 100644
index 0000000..beb6f58
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingCollapse.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingExpand.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingExpand.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingExpand.png
new file mode 100644
index 0000000..d10c11b
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/sortingExpand.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm.png
new file mode 100644
index 0000000..510cc92
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm1.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm1.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm1.png
new file mode 100644
index 0000000..a5b36c7
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/storm1.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/task-grey.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/task-grey.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/task-grey.png
new file mode 100644
index 0000000..6c76084
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/task-grey.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/timezone.png
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/timezone.png b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/timezone.png
new file mode 100644
index 0000000..963794b
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/images/timezone.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
new file mode 100644
index 0000000..58f751b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
@@ -0,0 +1,146 @@
+<!--
+  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.
+-->
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8">
+		<title>LogSearch</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1">
+		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
+		<script type="text/javascript" src="libs/other/loadCSS.js"></script>
+		<link href="libs/bower/bootstrap/bootstrap.css" rel="stylesheet">
+		<link href="libs/other/font-awesome/css/font-awesome.css" rel="stylesheet">
+		<!-- <link href="libs/other/jquery-ui/css/jquery-ui-1.11.4.min.css" rel="stylesheet"> -->
+		<script>
+	        // load a file
+	        loadCSS("libs/other/jquery-ui/css/jquery-ui-bootstrap.css");
+	        loadCSS("styles/visualsearch.css");
+	        loadCSS("libs/bower/backgrid/css/backgrid.css");
+	        loadCSS("libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css");
+	        loadCSS("libs/bower/backgrid-paginator/css/backgrid-paginator.css");
+	        loadCSS("libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css");
+	        loadCSS("libs/bower/backgrid-sizeable/backgrid-orderable-columns.css");
+	        loadCSS("libs/other/daterangepicker/css/daterangepicker.css");
+	        loadCSS("styles/animate.css");
+	        loadCSS("libs/bower/select2/select2.css");
+	        loadCSS("libs/other/nvd3/css/nv.d3.min.css");
+	        loadCSS("libs/other/timeline/css/timeline.css");
+	        loadCSS("libs/other/intro/css/introjs.min.css");
+	        loadCSS("libs/other/gridster/css/jquery.gridster.css");
+	      
+    	</script>
+<!-- 		<link href="libs/other/jquery-ui/css/jquery-ui-bootstrap.css" rel="stylesheet">
+		<link href="styles/visualsearch.css" rel="stylesheet">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/bower/backgrid/css/backgrid.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/bower/backgrid-paginator/css/backgrid-paginator.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/bower/backgrid-sizeable/backgrid-orderable-columns.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/other/daterangepicker/css/daterangepicker.css">
+		<link href="libs/bower/select2/select2.css" rel="stylesheet">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/other/nvd3/css/nv.d3.min.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="libs/other/timeline/css/timeline.css">
+		<link rel="stylesheet" type="text/css" media="screen" href="styles/animate.css">
+		<link href="libs/other/intro/css/introjs.min.css" rel="stylesheet">
+		<link href="libs/other/gridster/css/jquery.gridster.css" rel="stylesheet"> -->
+		<link href="styles/style_v2.css" rel="stylesheet">
+		<link href="styles/style.css" rel="stylesheet">
+		
+		<!-- <link href="plugins/chartist/chartist.min.css" rel="stylesheet"> -->
+		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
+		<!--[if lt IE 9]>
+				<script src="http://getbootstrap.com/docs-assets/js/html5shiv.js"></script>
+				<script src="http://getbootstrap.com/docs-assets/js/respond.min.js"></script>
+		<![endif]-->
+	</head>
+<body>
+<!--Start Header-->
+<!-- <div id="screensaver">
+	<canvas id="canvas"></canvas>
+	<i class="fa fa-lock" id="screen_unlock"></i>
+</div> -->
+
+<header class="navbar">
+	<div class="container-fluid expanded-panel">
+		<div class="row">
+			<div id="logo" class="col-xs-12 col-sm-2">
+				<a href="javascript:void(0);">Log Search</a>
+			</div>
+			<div id="r_header"></div>
+		</div>
+	</div>
+</header>
+<!--End Header-->
+<!--Start Container-->
+<div id="main" class="container-fluid">
+	<div class="row">
+		<!--div id="sidebar-left" class="col-xs-2 col-sm-2">
+			<ul class="nav main-menu">
+				<li>
+					<a href="javascript:void(0);" class="ajax-link">
+						<i class="fa fa-dashboard"></i>
+						<span class="hidden-xs">Dashboard</span>
+					</a>
+				</li>
+			</ul>
+		</div-->
+		<!--Start Content-->
+		<div id="content" class="col-xs-12 col-sm-12">
+			<div id="r_content" >
+				<div><img style="position: absolute;top: 7%;left: 44%;" alt="Loading...." src="images/loading_game.gif"></div>
+			</div>
+			<!-- <div class="preloader">
+				<img src="img/devoops_getdata.gif" class="devoops-getdata" alt="preloader"/>
+			</div> -->
+		</div>
+		<!--End Content-->
+	</div>
+</div>
+<!--End Container-->
+<!-- build:js scripts/main.js -->
+		<script data-main="scripts/Init.js?ver=build.version" src="libs/bower/requirejs/js/require.js"></script>
+		<!-- endbuild -->
+		<script type="text/javascript">
+			require.config({
+				waitSeconds : 0
+			});
+			if (!window.console) window.console = {};
+            if (!window.console.log) window.console.log = function () { };
+
+		</script>
+<!-- 		<script type="text/javascript" src="libs/other/d3/d3.min.js"></script> -->
+<div class="btn-group contextMenuBody" style="display:none;position:absolute;z-index:9999;">
+	    <button type="button" class="btn btn-info btn-circle btn-app-sm btn-context dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+	        <i class="fa fa-info"></i>
+	    </button>
+	    <ul class="dropdown-menu">
+	        <li><a data-id="I" href="javascript:void(0);">Include</a></li>
+	        <li><a data-id="E" href="javascript:void(0);">Exclude</a></li>
+	        <li><a data-id="IA" href="javascript:void(0);">*Include*</a></li>
+	        <li><a data-id="EA" href="javascript:void(0);">*Exclude*</a></li>
+	        <li role="separator" class="divider"></li>
+	        <li><a data-id="F" href="javascript:void(0);">Find</a></li>
+	    </ul>
+	</div>
+	<div class="arrowDiv">
+		<div class="bottomToTop" title="Scroll To Top"><i class="fa fa-arrow-circle-up"></i></div>
+		<div class="topToBottom" title="Scroll To bottom"><i class="fa fa-arrow-circle-down"></i></div>
+	</div>
+	
+
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone-min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone-min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone-min.js
new file mode 100644
index 0000000..8ea4b13
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-amd/js/backbone-min.js
@@ -0,0 +1,2 @@
+(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;
 return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h<u;h++){t=o[h];if(a=this._events[t]){this._events[t]=s=[];if(e||r){for(l=0,f=a.length;l<f;l++){n=a[l];if(e&&e!==n.callback&&e!==n.callback._callback||r&&r!==n.context){s.push(n)}}}if(!s.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=o.call(arguments,1);if(!c(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)f(i,e);if(r)f(r,arguments);return this},stopListening:function(t,e,r){var s=this._listeningTo;if(!s)return this;var n=!e&&!r;if(!r&&typeof e==="object")r=this;if(t)(s={})[t._listenId]=t;for(var a in s){t=s[a];t.off(e,r,this);if(n||i.isEmpty(t._events))delete this._listeningTo[a]}return this}};var l=/\s+/;var c=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(l.test(i)){var n=i.split(l);for(var a=0,o=n.length;a<o;a++){t[e].apply(t,[n[a]].concat(r))}return false}re
 turn true};var f=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],o=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,o);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e);return}};var d={listenTo:"on",listenToOnce:"once"};i.each(d,function(t,e){u[e]=function(e,r,s){var n=this._listeningTo||(this._listeningTo={});var a=e._listenId||(e._listenId=i.uniqueId("l"));n[a]=e;if(!s&&typeof r==="object")s=this;e[t](r,s,this);return this}});u.bind=u.on;u.unbind=u.off;i.extend(e,u);var p=e.Model=function(t,e){var r=t||{};e||(e={});this.cid=i.uniqueId("c");this.attributes={};if(e.collection)this.collection=e.collection;if(e.parse)r=this.parse(r,e)||{};r=i.defaults({},r,i.result(this,"defaults"));this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};i.extend(p.prototype,u,{cha
 nged:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,r){var s,n,a,o,h,u,l,c;if(t==null)return this;if(typeof t==="object"){n=t;r=e}else{(n={})[t]=e}r||(r={});if(!this._validate(n,r))return false;a=r.unset;h=r.silent;o=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=i.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in n)this.id=n[this.idAttribute];for(s in n){e=n[s];if(!i.isEqual(c[s],e))o.push(s);if(!i.isEqual(l[s],e)){this.changed[s]=e}else{delete this.changed[s]}a?delete c[s]:c[s]=e}if(!h){if(o.length)this._pending=r;for(var f=0,d=o.length;f<d;f++){this.trigger("change:"+o[f],this,c[o[f]],r)}}if(u)return this;if(!h){while(this._pend
 ing){r=this._pending;this._pending=false;this.trigger("change",this,r)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:true}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,i.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!i.isEmpty(this.changed);return i.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?i.clone(this.changed):false;var e,r=false;var s=this._changing?this._previousAttributes:this.attributes;for(var n in t){if(i.isEqual(s[n],e=t[n]))continue;(r||(r={}))[n]=e}return r},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var r=t.success;t.success=function(i){if(!e.set(e.parse(i,t),t))return false;if(r)r
 (e,i,t);e.trigger("sync",e,i,t)};q(this,t);return this.sync("read",this,t)},save:function(t,e,r){var s,n,a,o=this.attributes;if(t==null||typeof t==="object"){s=t;r=e}else{(s={})[t]=e}r=i.extend({validate:true},r);if(s&&!r.wait){if(!this.set(s,r))return false}else{if(!this._validate(s,r))return false}if(s&&r.wait){this.attributes=i.extend({},o,s)}if(r.parse===void 0)r.parse=true;var h=this;var u=r.success;r.success=function(t){h.attributes=o;var e=h.parse(t,r);if(r.wait)e=i.extend(s||{},e);if(i.isObject(e)&&!h.set(e,r)){return false}if(u)u(h,t,r);h.trigger("sync",h,t,r)};q(this,r);n=this.isNew()?"create":r.patch?"patch":"update";if(n==="patch")r.attrs=s;a=this.sync(n,this,r);if(s&&r.wait)this.attributes=o;return a},destroy:function(t){t=t?i.clone(t):{};var e=this;var r=t.success;var s=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(i){if(t.wait||e.isNew())s();if(r)r(e,i,t);if(!e.isNew())e.trigger("sync",e,i,t)};if(this.isNew()){t.success();return false}q(this,t);
 var n=this.sync("delete",this,t);if(!t.wait)s();return n},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||M();if(this.isNew())return t;return t.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=i.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;if(!r)return true;this.trigger("invalid",this,r,i.extend(e,{validationError:r}));return false}});var v=["keys","values","pairs","invert","pick","omit"];i.each(v,function(t){p.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.attributes);return i[t].apply(i,e)}});var g=e.Collection=function(t,e){e||(e={});if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=
 e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,i.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,remove:false};i.extend(g.prototype,u,{model:p,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:false},e,y))},remove:function(t,e){var r=!i.isArray(t);t=r?[t]:i.clone(t);e||(e={});var s,n,a,o;for(s=0,n=t.length;s<n;s++){o=t[s]=this.get(t[s]);if(!o)continue;delete this._byId[o.id];delete this._byId[o.cid];a=this.indexOf(o);this.models.splice(a,1);this.length--;if(!e.silent){e.index=a;o.trigger("remove",o,this,e)}this._removeReference(o,e)}return r?t[0]:t},set:function(t,e){e=i.defaults({},e,m);if(e.parse)t=this.parse(t,e);var r=!i.isArray(t);t=r?t?[t]:[]:i.clone(t);var s,n,a,o,h,u,l;var c=e.at;var f=this.model;var d=this.comparator&&c==null&&e.sort!==false;var v=i.isString(t
 his.comparator)?this.comparator:null;var g=[],y=[],_={};var b=e.add,w=e.merge,x=e.remove;var E=!d&&b&&x?[]:false;for(s=0,n=t.length;s<n;s++){h=t[s]||{};if(h instanceof p){a=o=h}else{a=h[f.prototype.idAttribute||"id"]}if(u=this.get(a)){if(x)_[u.cid]=true;if(w){h=h===o?o.attributes:h;if(e.parse)h=u.parse(h,e);u.set(h,e);if(d&&!l&&u.hasChanged(v))l=true}t[s]=u}else if(b){o=t[s]=this._prepareModel(h,e);if(!o)continue;g.push(o);this._addReference(o,e)}o=u||o;if(E&&(o.isNew()||!_[o.id]))E.push(o);_[o.id]=true}if(x){for(s=0,n=this.length;s<n;++s){if(!_[(o=this.models[s]).cid])y.push(o)}if(y.length)this.remove(y,e)}if(g.length||E&&E.length){if(d)l=true;this.length+=g.length;if(c!=null){for(s=0,n=g.length;s<n;s++){this.models.splice(c+s,0,g[s])}}else{if(E)this.models.length=0;var k=E||g;for(s=0,n=k.length;s<n;s++){this.models.push(k[s])}}}if(l)this.sort({silent:true});if(!e.silent){for(s=0,n=g.length;s<n;s++){(o=g[s]).trigger("add",o,this,e)}if(l||E&&E.length)this.trigger("sort",this,e)}retu
 rn r?t[0]:t},reset:function(t,e){e||(e={});for(var r=0,s=this.models.length;r<s;r++){this._removeReference(this.models[r],e)}e.previousModels=this.models;this._reset();t=this.add(t,i.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(t==null)return void 0;return this._byId[t]||this._byId[t.id]||this._byId[t.cid]},at:function(t){return this.models[t]},where:function(t,e){if(i.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a se
 t without a comparator");t||(t={});if(i.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(i.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},pluck:function(t){return i.invoke(this.models,"get",t)},fetch:function(t){t=t?i.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var r=this;t.success=function(i){var s=t.reset?"reset":"set";r[s](i,t);if(e)e(r,i,t);r.trigger("sync",r,i,t)};q(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?i.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var r=this;var s=e.success;e.success=function(t,i){if(e.wait)r.add(t,e);if(s)s(t,i,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof p)return t;e=e?i.clone(e):{};e.collectio
 n=this;var r=new this.model(t,e);if(!r.validationError)return r;this.trigger("invalid",this,r.validationError,e);return false},_addReference:function(t,e){this._byId[t.cid]=t;if(t.id!=null)this._byId[t.id]=t;if(!t.collection)t.collection=this;t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty
 ","chain","sample"];i.each(_,function(t){g.prototype[t]=function(){var e=o.call(arguments);e.unshift(this.models);return i[t].apply(i,e)}});var b=["groupBy","countBy","sortBy","indexBy"];i.each(b,function(t){g.prototype[t]=function(e,r){var s=i.isFunction(e)?e:function(t){return t.get(e)};return i[t](this.models,s,r)}});var w=e.View=function(t){this.cid=i.uniqueId("view");t||(t={});i.extend(this,i.pick(t,E));this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];i.extend(w.prototype,u,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,i){if(this.$el)this.undelegateEvents();this.$el=t instanceof e.$?t:e.$(t);this.el=this.$el[0];if(i!==false)this.delegateEvents();return this},delegateEvents:function(t){if(
 !(t||(t=i.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var r=t[e];if(!i.isFunction(r))r=this[t[e]];if(!r)continue;var s=e.match(x);var n=s[1],a=s[2];r=i.bind(r,this);n+=".delegateEvents"+this.cid;if(a===""){this.$el.on(n,r)}else{this.$el.on(n,a,r)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_ensureElement:function(){if(!this.el){var t=i.extend({},i.result(this,"attributes"));if(this.id)t.id=i.result(this,"id");if(this.className)t["class"]=i.result(this,"className");var r=e.$("<"+i.result(this,"tagName")+">").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSO
 N(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=
 /[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):n
 ull})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!
 !this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=a.hide().appendTo("body")[0].contentWindow;this.navigate(r)}if(this._hasPushState){e.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!n){e.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=r;var o=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){this.fragment=this.getFragment(null,true);this.location.replace(this.root+"#"+this.fragment);return true}else if(this._hasPushState&&this.atRoot()&&o.hash){this.fragment=this.getHash().repl
 ace(R,"");this.history.replaceState({},document.title,this.root+this.fragment)}}if(!this.options.silent)return this.loadUrl()},stop:function(){e.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);if(this._checkUrlInterval)clearInterval(this._checkUrlInterval);N.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()},loadUrl:function(t){t=this.fragment=this.getFragment(t);return i.any(this.handlers,function(e){if(e.route.test(t)){e.callback(t);return true}})},navigate:function(t,e){if(!N.started)return false;if(!e||e===true)e={trigger:!!e};var i=this.root+(t=this.getFragment(t||""));t=t.replace(j,"");if(this.fragment===t)return;this.fragment=t;if(t===""&&i!=="/")i=i.slice(0,-1);if(this._hasPushState){this.history[e.replace?"replaceSta
 te":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)return this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});e.history=new N;var U=function(t,e){var r=this;var s;if(t&&i.has(t,"constructor")){s=t.constructor}else{s=function(){return r.apply(this,arguments)}}i.extend(s,r,e);var n=function(){this.constructor=s};n.prototype=r.prototype;s.prototype=new n;if(t)i.extend(s.prototype,t);s.__super__=r.prototype;return s};p.extend=g.extend=$.extend=w.extend=N.extend=U;var M=function(){throw new Error('A "url" property or function must be specified')};var q=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error"
 ,t,r,e)}};return e});
+//# sourceMappingURL=backbone-min.map
\ No newline at end of file


[14/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.js
new file mode 100644
index 0000000..53da1c7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap.js
@@ -0,0 +1,2114 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
+
+/* ========================================================================
+ * Bootstrap: transition.js v3.2.0
+ * http://getbootstrap.com/javascript/#transitions
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
+  // ============================================================
+
+  function transitionEnd() {
+    var el = document.createElement('bootstrap')
+
+    var transEndEventNames = {
+      WebkitTransition : 'webkitTransitionEnd',
+      MozTransition    : 'transitionend',
+      OTransition      : 'oTransitionEnd otransitionend',
+      transition       : 'transitionend'
+    }
+
+    for (var name in transEndEventNames) {
+      if (el.style[name] !== undefined) {
+        return { end: transEndEventNames[name] }
+      }
+    }
+
+    return false // explicit for ie8 (  ._.)
+  }
+
+  // http://blog.alexmaccaw.com/css-transitions
+  $.fn.emulateTransitionEnd = function (duration) {
+    var called = false
+    var $el = this
+    $(this).one('bsTransitionEnd', function () { called = true })
+    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
+    setTimeout(callback, duration)
+    return this
+  }
+
+  $(function () {
+    $.support.transition = transitionEnd()
+
+    if (!$.support.transition) return
+
+    $.event.special.bsTransitionEnd = {
+      bindType: $.support.transition.end,
+      delegateType: $.support.transition.end,
+      handle: function (e) {
+        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
+      }
+    }
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: alert.js v3.2.0
+ * http://getbootstrap.com/javascript/#alerts
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // ALERT CLASS DEFINITION
+  // ======================
+
+  var dismiss = '[data-dismiss="alert"]'
+  var Alert   = function (el) {
+    $(el).on('click', dismiss, this.close)
+  }
+
+  Alert.VERSION = '3.2.0'
+
+  Alert.prototype.close = function (e) {
+    var $this    = $(this)
+    var selector = $this.attr('data-target')
+
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+    }
+
+    var $parent = $(selector)
+
+    if (e) e.preventDefault()
+
+    if (!$parent.length) {
+      $parent = $this.hasClass('alert') ? $this : $this.parent()
+    }
+
+    $parent.trigger(e = $.Event('close.bs.alert'))
+
+    if (e.isDefaultPrevented()) return
+
+    $parent.removeClass('in')
+
+    function removeElement() {
+      // detach from parent, fire event then clean up data
+      $parent.detach().trigger('closed.bs.alert').remove()
+    }
+
+    $.support.transition && $parent.hasClass('fade') ?
+      $parent
+        .one('bsTransitionEnd', removeElement)
+        .emulateTransitionEnd(150) :
+      removeElement()
+  }
+
+
+  // ALERT PLUGIN DEFINITION
+  // =======================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this = $(this)
+      var data  = $this.data('bs.alert')
+
+      if (!data) $this.data('bs.alert', (data = new Alert(this)))
+      if (typeof option == 'string') data[option].call($this)
+    })
+  }
+
+  var old = $.fn.alert
+
+  $.fn.alert             = Plugin
+  $.fn.alert.Constructor = Alert
+
+
+  // ALERT NO CONFLICT
+  // =================
+
+  $.fn.alert.noConflict = function () {
+    $.fn.alert = old
+    return this
+  }
+
+
+  // ALERT DATA-API
+  // ==============
+
+  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: button.js v3.2.0
+ * http://getbootstrap.com/javascript/#buttons
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // BUTTON PUBLIC CLASS DEFINITION
+  // ==============================
+
+  var Button = function (element, options) {
+    this.$element  = $(element)
+    this.options   = $.extend({}, Button.DEFAULTS, options)
+    this.isLoading = false
+  }
+
+  Button.VERSION  = '3.2.0'
+
+  Button.DEFAULTS = {
+    loadingText: 'loading...'
+  }
+
+  Button.prototype.setState = function (state) {
+    var d    = 'disabled'
+    var $el  = this.$element
+    var val  = $el.is('input') ? 'val' : 'html'
+    var data = $el.data()
+
+    state = state + 'Text'
+
+    if (data.resetText == null) $el.data('resetText', $el[val]())
+
+    $el[val](data[state] == null ? this.options[state] : data[state])
+
+    // push to event loop to allow forms to submit
+    setTimeout($.proxy(function () {
+      if (state == 'loadingText') {
+        this.isLoading = true
+        $el.addClass(d).attr(d, d)
+      } else if (this.isLoading) {
+        this.isLoading = false
+        $el.removeClass(d).removeAttr(d)
+      }
+    }, this), 0)
+  }
+
+  Button.prototype.toggle = function () {
+    var changed = true
+    var $parent = this.$element.closest('[data-toggle="buttons"]')
+
+    if ($parent.length) {
+      var $input = this.$element.find('input')
+      if ($input.prop('type') == 'radio') {
+        if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
+        else $parent.find('.active').removeClass('active')
+      }
+      if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
+    }
+
+    if (changed) this.$element.toggleClass('active')
+  }
+
+
+  // BUTTON PLUGIN DEFINITION
+  // ========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.button')
+      var options = typeof option == 'object' && option
+
+      if (!data) $this.data('bs.button', (data = new Button(this, options)))
+
+      if (option == 'toggle') data.toggle()
+      else if (option) data.setState(option)
+    })
+  }
+
+  var old = $.fn.button
+
+  $.fn.button             = Plugin
+  $.fn.button.Constructor = Button
+
+
+  // BUTTON NO CONFLICT
+  // ==================
+
+  $.fn.button.noConflict = function () {
+    $.fn.button = old
+    return this
+  }
+
+
+  // BUTTON DATA-API
+  // ===============
+
+  $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
+    var $btn = $(e.target)
+    if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+    Plugin.call($btn, 'toggle')
+    e.preventDefault()
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: carousel.js v3.2.0
+ * http://getbootstrap.com/javascript/#carousel
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // CAROUSEL CLASS DEFINITION
+  // =========================
+
+  var Carousel = function (element, options) {
+    this.$element    = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
+    this.$indicators = this.$element.find('.carousel-indicators')
+    this.options     = options
+    this.paused      =
+    this.sliding     =
+    this.interval    =
+    this.$active     =
+    this.$items      = null
+
+    this.options.pause == 'hover' && this.$element
+      .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
+      .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
+  }
+
+  Carousel.VERSION  = '3.2.0'
+
+  Carousel.DEFAULTS = {
+    interval: 5000,
+    pause: 'hover',
+    wrap: true
+  }
+
+  Carousel.prototype.keydown = function (e) {
+    switch (e.which) {
+      case 37: this.prev(); break
+      case 39: this.next(); break
+      default: return
+    }
+
+    e.preventDefault()
+  }
+
+  Carousel.prototype.cycle = function (e) {
+    e || (this.paused = false)
+
+    this.interval && clearInterval(this.interval)
+
+    this.options.interval
+      && !this.paused
+      && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+
+    return this
+  }
+
+  Carousel.prototype.getItemIndex = function (item) {
+    this.$items = item.parent().children('.item')
+    return this.$items.index(item || this.$active)
+  }
+
+  Carousel.prototype.to = function (pos) {
+    var that        = this
+    var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
+
+    if (pos > (this.$items.length - 1) || pos < 0) return
+
+    if (this.sliding)       return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
+    if (activeIndex == pos) return this.pause().cycle()
+
+    return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
+  }
+
+  Carousel.prototype.pause = function (e) {
+    e || (this.paused = true)
+
+    if (this.$element.find('.next, .prev').length && $.support.transition) {
+      this.$element.trigger($.support.transition.end)
+      this.cycle(true)
+    }
+
+    this.interval = clearInterval(this.interval)
+
+    return this
+  }
+
+  Carousel.prototype.next = function () {
+    if (this.sliding) return
+    return this.slide('next')
+  }
+
+  Carousel.prototype.prev = function () {
+    if (this.sliding) return
+    return this.slide('prev')
+  }
+
+  Carousel.prototype.slide = function (type, next) {
+    var $active   = this.$element.find('.item.active')
+    var $next     = next || $active[type]()
+    var isCycling = this.interval
+    var direction = type == 'next' ? 'left' : 'right'
+    var fallback  = type == 'next' ? 'first' : 'last'
+    var that      = this
+
+    if (!$next.length) {
+      if (!this.options.wrap) return
+      $next = this.$element.find('.item')[fallback]()
+    }
+
+    if ($next.hasClass('active')) return (this.sliding = false)
+
+    var relatedTarget = $next[0]
+    var slideEvent = $.Event('slide.bs.carousel', {
+      relatedTarget: relatedTarget,
+      direction: direction
+    })
+    this.$element.trigger(slideEvent)
+    if (slideEvent.isDefaultPrevented()) return
+
+    this.sliding = true
+
+    isCycling && this.pause()
+
+    if (this.$indicators.length) {
+      this.$indicators.find('.active').removeClass('active')
+      var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
+      $nextIndicator && $nextIndicator.addClass('active')
+    }
+
+    var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
+    if ($.support.transition && this.$element.hasClass('slide')) {
+      $next.addClass(type)
+      $next[0].offsetWidth // force reflow
+      $active.addClass(direction)
+      $next.addClass(direction)
+      $active
+        .one('bsTransitionEnd', function () {
+          $next.removeClass([type, direction].join(' ')).addClass('active')
+          $active.removeClass(['active', direction].join(' '))
+          that.sliding = false
+          setTimeout(function () {
+            that.$element.trigger(slidEvent)
+          }, 0)
+        })
+        .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
+    } else {
+      $active.removeClass('active')
+      $next.addClass('active')
+      this.sliding = false
+      this.$element.trigger(slidEvent)
+    }
+
+    isCycling && this.cycle()
+
+    return this
+  }
+
+
+  // CAROUSEL PLUGIN DEFINITION
+  // ==========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.carousel')
+      var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
+      var action  = typeof option == 'string' ? option : options.slide
+
+      if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
+      if (typeof option == 'number') data.to(option)
+      else if (action) data[action]()
+      else if (options.interval) data.pause().cycle()
+    })
+  }
+
+  var old = $.fn.carousel
+
+  $.fn.carousel             = Plugin
+  $.fn.carousel.Constructor = Carousel
+
+
+  // CAROUSEL NO CONFLICT
+  // ====================
+
+  $.fn.carousel.noConflict = function () {
+    $.fn.carousel = old
+    return this
+  }
+
+
+  // CAROUSEL DATA-API
+  // =================
+
+  $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
+    var href
+    var $this   = $(this)
+    var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
+    if (!$target.hasClass('carousel')) return
+    var options = $.extend({}, $target.data(), $this.data())
+    var slideIndex = $this.attr('data-slide-to')
+    if (slideIndex) options.interval = false
+
+    Plugin.call($target, options)
+
+    if (slideIndex) {
+      $target.data('bs.carousel').to(slideIndex)
+    }
+
+    e.preventDefault()
+  })
+
+  $(window).on('load', function () {
+    $('[data-ride="carousel"]').each(function () {
+      var $carousel = $(this)
+      Plugin.call($carousel, $carousel.data())
+    })
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: collapse.js v3.2.0
+ * http://getbootstrap.com/javascript/#collapse
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // COLLAPSE PUBLIC CLASS DEFINITION
+  // ================================
+
+  var Collapse = function (element, options) {
+    this.$element      = $(element)
+    this.options       = $.extend({}, Collapse.DEFAULTS, options)
+    this.transitioning = null
+
+    if (this.options.parent) this.$parent = $(this.options.parent)
+    if (this.options.toggle) this.toggle()
+  }
+
+  Collapse.VERSION  = '3.2.0'
+
+  Collapse.DEFAULTS = {
+    toggle: true
+  }
+
+  Collapse.prototype.dimension = function () {
+    var hasWidth = this.$element.hasClass('width')
+    return hasWidth ? 'width' : 'height'
+  }
+
+  Collapse.prototype.show = function () {
+    if (this.transitioning || this.$element.hasClass('in')) return
+
+    var startEvent = $.Event('show.bs.collapse')
+    this.$element.trigger(startEvent)
+    if (startEvent.isDefaultPrevented()) return
+
+    var actives = this.$parent && this.$parent.find('> .panel > .in')
+
+    if (actives && actives.length) {
+      var hasData = actives.data('bs.collapse')
+      if (hasData && hasData.transitioning) return
+      Plugin.call(actives, 'hide')
+      hasData || actives.data('bs.collapse', null)
+    }
+
+    var dimension = this.dimension()
+
+    this.$element
+      .removeClass('collapse')
+      .addClass('collapsing')[dimension](0)
+
+    this.transitioning = 1
+
+    var complete = function () {
+      this.$element
+        .removeClass('collapsing')
+        .addClass('collapse in')[dimension]('')
+      this.transitioning = 0
+      this.$element
+        .trigger('shown.bs.collapse')
+    }
+
+    if (!$.support.transition) return complete.call(this)
+
+    var scrollSize = $.camelCase(['scroll', dimension].join('-'))
+
+    this.$element
+      .one('bsTransitionEnd', $.proxy(complete, this))
+      .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
+  }
+
+  Collapse.prototype.hide = function () {
+    if (this.transitioning || !this.$element.hasClass('in')) return
+
+    var startEvent = $.Event('hide.bs.collapse')
+    this.$element.trigger(startEvent)
+    if (startEvent.isDefaultPrevented()) return
+
+    var dimension = this.dimension()
+
+    this.$element[dimension](this.$element[dimension]())[0].offsetHeight
+
+    this.$element
+      .addClass('collapsing')
+      .removeClass('collapse')
+      .removeClass('in')
+
+    this.transitioning = 1
+
+    var complete = function () {
+      this.transitioning = 0
+      this.$element
+        .trigger('hidden.bs.collapse')
+        .removeClass('collapsing')
+        .addClass('collapse')
+    }
+
+    if (!$.support.transition) return complete.call(this)
+
+    this.$element
+      [dimension](0)
+      .one('bsTransitionEnd', $.proxy(complete, this))
+      .emulateTransitionEnd(350)
+  }
+
+  Collapse.prototype.toggle = function () {
+    this[this.$element.hasClass('in') ? 'hide' : 'show']()
+  }
+
+
+  // COLLAPSE PLUGIN DEFINITION
+  // ==========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.collapse')
+      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+      if (!data && options.toggle && option == 'show') option = !option
+      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.collapse
+
+  $.fn.collapse             = Plugin
+  $.fn.collapse.Constructor = Collapse
+
+
+  // COLLAPSE NO CONFLICT
+  // ====================
+
+  $.fn.collapse.noConflict = function () {
+    $.fn.collapse = old
+    return this
+  }
+
+
+  // COLLAPSE DATA-API
+  // =================
+
+  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
+    var href
+    var $this   = $(this)
+    var target  = $this.attr('data-target')
+        || e.preventDefault()
+        || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
+    var $target = $(target)
+    var data    = $target.data('bs.collapse')
+    var option  = data ? 'toggle' : $this.data()
+    var parent  = $this.attr('data-parent')
+    var $parent = parent && $(parent)
+
+    if (!data || !data.transitioning) {
+      if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
+      $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
+    }
+
+    Plugin.call($target, option)
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: dropdown.js v3.2.0
+ * http://getbootstrap.com/javascript/#dropdowns
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // DROPDOWN CLASS DEFINITION
+  // =========================
+
+  var backdrop = '.dropdown-backdrop'
+  var toggle   = '[data-toggle="dropdown"]'
+  var Dropdown = function (element) {
+    $(element).on('click.bs.dropdown', this.toggle)
+  }
+
+  Dropdown.VERSION = '3.2.0'
+
+  Dropdown.prototype.toggle = function (e) {
+    var $this = $(this)
+
+    if ($this.is('.disabled, :disabled')) return
+
+    var $parent  = getParent($this)
+    var isActive = $parent.hasClass('open')
+
+    clearMenus()
+
+    if (!isActive) {
+      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
+        // if mobile we use a backdrop because click events don't delegate
+        $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
+      }
+
+      var relatedTarget = { relatedTarget: this }
+      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
+
+      if (e.isDefaultPrevented()) return
+
+      $this.trigger('focus')
+
+      $parent
+        .toggleClass('open')
+        .trigger('shown.bs.dropdown', relatedTarget)
+    }
+
+    return false
+  }
+
+  Dropdown.prototype.keydown = function (e) {
+    if (!/(38|40|27)/.test(e.keyCode)) return
+
+    var $this = $(this)
+
+    e.preventDefault()
+    e.stopPropagation()
+
+    if ($this.is('.disabled, :disabled')) return
+
+    var $parent  = getParent($this)
+    var isActive = $parent.hasClass('open')
+
+    if (!isActive || (isActive && e.keyCode == 27)) {
+      if (e.which == 27) $parent.find(toggle).trigger('focus')
+      return $this.trigger('click')
+    }
+
+    var desc = ' li:not(.divider):visible a'
+    var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
+
+    if (!$items.length) return
+
+    var index = $items.index($items.filter(':focus'))
+
+    if (e.keyCode == 38 && index > 0)                 index--                        // up
+    if (e.keyCode == 40 && index < $items.length - 1) index++                        // down
+    if (!~index)                                      index = 0
+
+    $items.eq(index).trigger('focus')
+  }
+
+  function clearMenus(e) {
+    if (e && e.which === 3) return
+    $(backdrop).remove()
+    $(toggle).each(function () {
+      var $parent = getParent($(this))
+      var relatedTarget = { relatedTarget: this }
+      if (!$parent.hasClass('open')) return
+      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
+      if (e.isDefaultPrevented()) return
+      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
+    })
+  }
+
+  function getParent($this) {
+    var selector = $this.attr('data-target')
+
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+    }
+
+    var $parent = selector && $(selector)
+
+    return $parent && $parent.length ? $parent : $this.parent()
+  }
+
+
+  // DROPDOWN PLUGIN DEFINITION
+  // ==========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this = $(this)
+      var data  = $this.data('bs.dropdown')
+
+      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
+      if (typeof option == 'string') data[option].call($this)
+    })
+  }
+
+  var old = $.fn.dropdown
+
+  $.fn.dropdown             = Plugin
+  $.fn.dropdown.Constructor = Dropdown
+
+
+  // DROPDOWN NO CONFLICT
+  // ====================
+
+  $.fn.dropdown.noConflict = function () {
+    $.fn.dropdown = old
+    return this
+  }
+
+
+  // APPLY TO STANDARD DROPDOWN ELEMENTS
+  // ===================================
+
+  $(document)
+    .on('click.bs.dropdown.data-api', clearMenus)
+    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
+    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+    .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: modal.js v3.2.0
+ * http://getbootstrap.com/javascript/#modals
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // MODAL CLASS DEFINITION
+  // ======================
+
+  var Modal = function (element, options) {
+    this.options        = options
+    this.$body          = $(document.body)
+    this.$element       = $(element)
+    this.$backdrop      =
+    this.isShown        = null
+    this.scrollbarWidth = 0
+
+    if (this.options.remote) {
+      this.$element
+        .find('.modal-content')
+        .load(this.options.remote, $.proxy(function () {
+          this.$element.trigger('loaded.bs.modal')
+        }, this))
+    }
+  }
+
+  Modal.VERSION  = '3.2.0'
+
+  Modal.DEFAULTS = {
+    backdrop: true,
+    keyboard: true,
+    show: true
+  }
+
+  Modal.prototype.toggle = function (_relatedTarget) {
+    return this.isShown ? this.hide() : this.show(_relatedTarget)
+  }
+
+  Modal.prototype.show = function (_relatedTarget) {
+    var that = this
+    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
+
+    this.$element.trigger(e)
+
+    if (this.isShown || e.isDefaultPrevented()) return
+
+    this.isShown = true
+
+    this.checkScrollbar()
+    this.$body.addClass('modal-open')
+
+    this.setScrollbar()
+    this.escape()
+
+    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
+
+    this.backdrop(function () {
+      var transition = $.support.transition && that.$element.hasClass('fade')
+
+      if (!that.$element.parent().length) {
+        that.$element.appendTo(that.$body) // don't move modals dom position
+      }
+
+      that.$element
+        .show()
+        .scrollTop(0)
+
+      if (transition) {
+        that.$element[0].offsetWidth // force reflow
+      }
+
+      that.$element
+        .addClass('in')
+        .attr('aria-hidden', false)
+
+      that.enforceFocus()
+
+      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
+
+      transition ?
+        that.$element.find('.modal-dialog') // wait for modal to slide in
+          .one('bsTransitionEnd', function () {
+            that.$element.trigger('focus').trigger(e)
+          })
+          .emulateTransitionEnd(300) :
+        that.$element.trigger('focus').trigger(e)
+    })
+  }
+
+  Modal.prototype.hide = function (e) {
+    if (e) e.preventDefault()
+
+    e = $.Event('hide.bs.modal')
+
+    this.$element.trigger(e)
+
+    if (!this.isShown || e.isDefaultPrevented()) return
+
+    this.isShown = false
+
+    this.$body.removeClass('modal-open')
+
+    this.resetScrollbar()
+    this.escape()
+
+    $(document).off('focusin.bs.modal')
+
+    this.$element
+      .removeClass('in')
+      .attr('aria-hidden', true)
+      .off('click.dismiss.bs.modal')
+
+    $.support.transition && this.$element.hasClass('fade') ?
+      this.$element
+        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
+        .emulateTransitionEnd(300) :
+      this.hideModal()
+  }
+
+  Modal.prototype.enforceFocus = function () {
+    $(document)
+      .off('focusin.bs.modal') // guard against infinite focus loop
+      .on('focusin.bs.modal', $.proxy(function (e) {
+        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
+          this.$element.trigger('focus')
+        }
+      }, this))
+  }
+
+  Modal.prototype.escape = function () {
+    if (this.isShown && this.options.keyboard) {
+      this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
+        e.which == 27 && this.hide()
+      }, this))
+    } else if (!this.isShown) {
+      this.$element.off('keyup.dismiss.bs.modal')
+    }
+  }
+
+  Modal.prototype.hideModal = function () {
+    var that = this
+    this.$element.hide()
+    this.backdrop(function () {
+      that.$element.trigger('hidden.bs.modal')
+    })
+  }
+
+  Modal.prototype.removeBackdrop = function () {
+    this.$backdrop && this.$backdrop.remove()
+    this.$backdrop = null
+  }
+
+  Modal.prototype.backdrop = function (callback) {
+    var that = this
+    var animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+    if (this.isShown && this.options.backdrop) {
+      var doAnimate = $.support.transition && animate
+
+      this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+        .appendTo(this.$body)
+
+      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
+        if (e.target !== e.currentTarget) return
+        this.options.backdrop == 'static'
+          ? this.$element[0].focus.call(this.$element[0])
+          : this.hide.call(this)
+      }, this))
+
+      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+      this.$backdrop.addClass('in')
+
+      if (!callback) return
+
+      doAnimate ?
+        this.$backdrop
+          .one('bsTransitionEnd', callback)
+          .emulateTransitionEnd(150) :
+        callback()
+
+    } else if (!this.isShown && this.$backdrop) {
+      this.$backdrop.removeClass('in')
+
+      var callbackRemove = function () {
+        that.removeBackdrop()
+        callback && callback()
+      }
+      $.support.transition && this.$element.hasClass('fade') ?
+        this.$backdrop
+          .one('bsTransitionEnd', callbackRemove)
+          .emulateTransitionEnd(150) :
+        callbackRemove()
+
+    } else if (callback) {
+      callback()
+    }
+  }
+
+  Modal.prototype.checkScrollbar = function () {
+    if (document.body.clientWidth >= window.innerWidth) return
+    this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
+  }
+
+  Modal.prototype.setScrollbar = function () {
+    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
+    if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
+  }
+
+  Modal.prototype.resetScrollbar = function () {
+    this.$body.css('padding-right', '')
+  }
+
+  Modal.prototype.measureScrollbar = function () { // thx walsh
+    var scrollDiv = document.createElement('div')
+    scrollDiv.className = 'modal-scrollbar-measure'
+    this.$body.append(scrollDiv)
+    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
+    this.$body[0].removeChild(scrollDiv)
+    return scrollbarWidth
+  }
+
+
+  // MODAL PLUGIN DEFINITION
+  // =======================
+
+  function Plugin(option, _relatedTarget) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.modal')
+      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
+
+      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
+      if (typeof option == 'string') data[option](_relatedTarget)
+      else if (options.show) data.show(_relatedTarget)
+    })
+  }
+
+  var old = $.fn.modal
+
+  $.fn.modal             = Plugin
+  $.fn.modal.Constructor = Modal
+
+
+  // MODAL NO CONFLICT
+  // =================
+
+  $.fn.modal.noConflict = function () {
+    $.fn.modal = old
+    return this
+  }
+
+
+  // MODAL DATA-API
+  // ==============
+
+  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
+    var $this   = $(this)
+    var href    = $this.attr('href')
+    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
+    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
+
+    if ($this.is('a')) e.preventDefault()
+
+    $target.one('show.bs.modal', function (showEvent) {
+      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
+      $target.one('hidden.bs.modal', function () {
+        $this.is(':visible') && $this.trigger('focus')
+      })
+    })
+    Plugin.call($target, option, this)
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tooltip.js v3.2.0
+ * http://getbootstrap.com/javascript/#tooltip
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // TOOLTIP PUBLIC CLASS DEFINITION
+  // ===============================
+
+  var Tooltip = function (element, options) {
+    this.type       =
+    this.options    =
+    this.enabled    =
+    this.timeout    =
+    this.hoverState =
+    this.$element   = null
+
+    this.init('tooltip', element, options)
+  }
+
+  Tooltip.VERSION  = '3.2.0'
+
+  Tooltip.DEFAULTS = {
+    animation: true,
+    placement: 'top',
+    selector: false,
+    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
+    trigger: 'hover focus',
+    title: '',
+    delay: 0,
+    html: false,
+    container: false,
+    viewport: {
+      selector: 'body',
+      padding: 0
+    }
+  }
+
+  Tooltip.prototype.init = function (type, element, options) {
+    this.enabled   = true
+    this.type      = type
+    this.$element  = $(element)
+    this.options   = this.getOptions(options)
+    this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport)
+
+    var triggers = this.options.trigger.split(' ')
+
+    for (var i = triggers.length; i--;) {
+      var trigger = triggers[i]
+
+      if (trigger == 'click') {
+        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+      } else if (trigger != 'manual') {
+        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
+        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
+
+        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
+      }
+    }
+
+    this.options.selector ?
+      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+      this.fixTitle()
+  }
+
+  Tooltip.prototype.getDefaults = function () {
+    return Tooltip.DEFAULTS
+  }
+
+  Tooltip.prototype.getOptions = function (options) {
+    options = $.extend({}, this.getDefaults(), this.$element.data(), options)
+
+    if (options.delay && typeof options.delay == 'number') {
+      options.delay = {
+        show: options.delay,
+        hide: options.delay
+      }
+    }
+
+    return options
+  }
+
+  Tooltip.prototype.getDelegateOptions = function () {
+    var options  = {}
+    var defaults = this.getDefaults()
+
+    this._options && $.each(this._options, function (key, value) {
+      if (defaults[key] != value) options[key] = value
+    })
+
+    return options
+  }
+
+  Tooltip.prototype.enter = function (obj) {
+    var self = obj instanceof this.constructor ?
+      obj : $(obj.currentTarget).data('bs.' + this.type)
+
+    if (!self) {
+      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+      $(obj.currentTarget).data('bs.' + this.type, self)
+    }
+
+    clearTimeout(self.timeout)
+
+    self.hoverState = 'in'
+
+    if (!self.options.delay || !self.options.delay.show) return self.show()
+
+    self.timeout = setTimeout(function () {
+      if (self.hoverState == 'in') self.show()
+    }, self.options.delay.show)
+  }
+
+  Tooltip.prototype.leave = function (obj) {
+    var self = obj instanceof this.constructor ?
+      obj : $(obj.currentTarget).data('bs.' + this.type)
+
+    if (!self) {
+      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
+      $(obj.currentTarget).data('bs.' + this.type, self)
+    }
+
+    clearTimeout(self.timeout)
+
+    self.hoverState = 'out'
+
+    if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+    self.timeout = setTimeout(function () {
+      if (self.hoverState == 'out') self.hide()
+    }, self.options.delay.hide)
+  }
+
+  Tooltip.prototype.show = function () {
+    var e = $.Event('show.bs.' + this.type)
+
+    if (this.hasContent() && this.enabled) {
+      this.$element.trigger(e)
+
+      var inDom = $.contains(document.documentElement, this.$element[0])
+      if (e.isDefaultPrevented() || !inDom) return
+      var that = this
+
+      var $tip = this.tip()
+
+      var tipId = this.getUID(this.type)
+
+      this.setContent()
+      $tip.attr('id', tipId)
+      this.$element.attr('aria-describedby', tipId)
+
+      if (this.options.animation) $tip.addClass('fade')
+
+      var placement = typeof this.options.placement == 'function' ?
+        this.options.placement.call(this, $tip[0], this.$element[0]) :
+        this.options.placement
+
+      var autoToken = /\s?auto?\s?/i
+      var autoPlace = autoToken.test(placement)
+      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
+
+      $tip
+        .detach()
+        .css({ top: 0, left: 0, display: 'block' })
+        .addClass(placement)
+        .data('bs.' + this.type, this)
+
+      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
+
+      var pos          = this.getPosition()
+      var actualWidth  = $tip[0].offsetWidth
+      var actualHeight = $tip[0].offsetHeight
+
+      if (autoPlace) {
+        var orgPlacement = placement
+        var $parent      = this.$element.parent()
+        var parentDim    = this.getPosition($parent)
+
+        placement = placement == 'bottom' && pos.top   + pos.height       + actualHeight - parentDim.scroll > parentDim.height ? 'top'    :
+                    placement == 'top'    && pos.top   - parentDim.scroll - actualHeight < 0                                   ? 'bottom' :
+                    placement == 'right'  && pos.right + actualWidth      > parentDim.width                                    ? 'left'   :
+                    placement == 'left'   && pos.left  - actualWidth      < parentDim.left                                     ? 'right'  :
+                    placement
+
+        $tip
+          .removeClass(orgPlacement)
+          .addClass(placement)
+      }
+
+      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
+
+      this.applyPlacement(calculatedOffset, placement)
+
+      var complete = function () {
+        that.$element.trigger('shown.bs.' + that.type)
+        that.hoverState = null
+      }
+
+      $.support.transition && this.$tip.hasClass('fade') ?
+        $tip
+          .one('bsTransitionEnd', complete)
+          .emulateTransitionEnd(150) :
+        complete()
+    }
+  }
+
+  Tooltip.prototype.applyPlacement = function (offset, placement) {
+    var $tip   = this.tip()
+    var width  = $tip[0].offsetWidth
+    var height = $tip[0].offsetHeight
+
+    // manually read margins because getBoundingClientRect includes difference
+    var marginTop = parseInt($tip.css('margin-top'), 10)
+    var marginLeft = parseInt($tip.css('margin-left'), 10)
+
+    // we must check for NaN for ie 8/9
+    if (isNaN(marginTop))  marginTop  = 0
+    if (isNaN(marginLeft)) marginLeft = 0
+
+    offset.top  = offset.top  + marginTop
+    offset.left = offset.left + marginLeft
+
+    // $.fn.offset doesn't round pixel values
+    // so we use setOffset directly with our own function B-0
+    $.offset.setOffset($tip[0], $.extend({
+      using: function (props) {
+        $tip.css({
+          top: Math.round(props.top),
+          left: Math.round(props.left)
+        })
+      }
+    }, offset), 0)
+
+    $tip.addClass('in')
+
+    // check to see if placing tip in new offset caused the tip to resize itself
+    var actualWidth  = $tip[0].offsetWidth
+    var actualHeight = $tip[0].offsetHeight
+
+    if (placement == 'top' && actualHeight != height) {
+      offset.top = offset.top + height - actualHeight
+    }
+
+    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
+
+    if (delta.left) offset.left += delta.left
+    else offset.top += delta.top
+
+    var arrowDelta          = delta.left ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
+    var arrowPosition       = delta.left ? 'left'        : 'top'
+    var arrowOffsetPosition = delta.left ? 'offsetWidth' : 'offsetHeight'
+
+    $tip.offset(offset)
+    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], arrowPosition)
+  }
+
+  Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
+    this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
+  }
+
+  Tooltip.prototype.setContent = function () {
+    var $tip  = this.tip()
+    var title = this.getTitle()
+
+    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
+    $tip.removeClass('fade in top bottom left right')
+  }
+
+  Tooltip.prototype.hide = function () {
+    var that = this
+    var $tip = this.tip()
+    var e    = $.Event('hide.bs.' + this.type)
+
+    this.$element.removeAttr('aria-describedby')
+
+    function complete() {
+      if (that.hoverState != 'in') $tip.detach()
+      that.$element.trigger('hidden.bs.' + that.type)
+    }
+
+    this.$element.trigger(e)
+
+    if (e.isDefaultPrevented()) return
+
+    $tip.removeClass('in')
+
+    $.support.transition && this.$tip.hasClass('fade') ?
+      $tip
+        .one('bsTransitionEnd', complete)
+        .emulateTransitionEnd(150) :
+      complete()
+
+    this.hoverState = null
+
+    return this
+  }
+
+  Tooltip.prototype.fixTitle = function () {
+    var $e = this.$element
+    if ($e.attr('title') || typeof ($e.attr('data-original-title')) != 'string') {
+      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
+    }
+  }
+
+  Tooltip.prototype.hasContent = function () {
+    return this.getTitle()
+  }
+
+  Tooltip.prototype.getPosition = function ($element) {
+    $element   = $element || this.$element
+    var el     = $element[0]
+    var isBody = el.tagName == 'BODY'
+    return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : null, {
+      scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop(),
+      width:  isBody ? $(window).width()  : $element.outerWidth(),
+      height: isBody ? $(window).height() : $element.outerHeight()
+    }, isBody ? { top: 0, left: 0 } : $element.offset())
+  }
+
+  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
+    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2  } :
+           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2  } :
+           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
+        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width   }
+
+  }
+
+  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
+    var delta = { top: 0, left: 0 }
+    if (!this.$viewport) return delta
+
+    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
+    var viewportDimensions = this.getPosition(this.$viewport)
+
+    if (/right|left/.test(placement)) {
+      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
+      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
+      if (topEdgeOffset < viewportDimensions.top) { // top overflow
+        delta.top = viewportDimensions.top - topEdgeOffset
+      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
+        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
+      }
+    } else {
+      var leftEdgeOffset  = pos.left - viewportPadding
+      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
+      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
+        delta.left = viewportDimensions.left - leftEdgeOffset
+      } else if (rightEdgeOffset > viewportDimensions.width) { // right overflow
+        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
+      }
+    }
+
+    return delta
+  }
+
+  Tooltip.prototype.getTitle = function () {
+    var title
+    var $e = this.$element
+    var o  = this.options
+
+    title = $e.attr('data-original-title')
+      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
+
+    return title
+  }
+
+  Tooltip.prototype.getUID = function (prefix) {
+    do prefix += ~~(Math.random() * 1000000)
+    while (document.getElementById(prefix))
+    return prefix
+  }
+
+  Tooltip.prototype.tip = function () {
+    return (this.$tip = this.$tip || $(this.options.template))
+  }
+
+  Tooltip.prototype.arrow = function () {
+    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
+  }
+
+  Tooltip.prototype.validate = function () {
+    if (!this.$element[0].parentNode) {
+      this.hide()
+      this.$element = null
+      this.options  = null
+    }
+  }
+
+  Tooltip.prototype.enable = function () {
+    this.enabled = true
+  }
+
+  Tooltip.prototype.disable = function () {
+    this.enabled = false
+  }
+
+  Tooltip.prototype.toggleEnabled = function () {
+    this.enabled = !this.enabled
+  }
+
+  Tooltip.prototype.toggle = function (e) {
+    var self = this
+    if (e) {
+      self = $(e.currentTarget).data('bs.' + this.type)
+      if (!self) {
+        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
+        $(e.currentTarget).data('bs.' + this.type, self)
+      }
+    }
+
+    self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
+  }
+
+  Tooltip.prototype.destroy = function () {
+    clearTimeout(this.timeout)
+    this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
+  }
+
+
+  // TOOLTIP PLUGIN DEFINITION
+  // =========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.tooltip')
+      var options = typeof option == 'object' && option
+
+      if (!data && option == 'destroy') return
+      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.tooltip
+
+  $.fn.tooltip             = Plugin
+  $.fn.tooltip.Constructor = Tooltip
+
+
+  // TOOLTIP NO CONFLICT
+  // ===================
+
+  $.fn.tooltip.noConflict = function () {
+    $.fn.tooltip = old
+    return this
+  }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: popover.js v3.2.0
+ * http://getbootstrap.com/javascript/#popovers
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // POPOVER PUBLIC CLASS DEFINITION
+  // ===============================
+
+  var Popover = function (element, options) {
+    this.init('popover', element, options)
+  }
+
+  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
+
+  Popover.VERSION  = '3.2.0'
+
+  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
+    placement: 'right',
+    trigger: 'click',
+    content: '',
+    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
+  })
+
+
+  // NOTE: POPOVER EXTENDS tooltip.js
+  // ================================
+
+  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
+
+  Popover.prototype.constructor = Popover
+
+  Popover.prototype.getDefaults = function () {
+    return Popover.DEFAULTS
+  }
+
+  Popover.prototype.setContent = function () {
+    var $tip    = this.tip()
+    var title   = this.getTitle()
+    var content = this.getContent()
+
+    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
+    $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
+      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
+    ](content)
+
+    $tip.removeClass('fade top bottom left right in')
+
+    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
+    // this manually by checking the contents.
+    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
+  }
+
+  Popover.prototype.hasContent = function () {
+    return this.getTitle() || this.getContent()
+  }
+
+  Popover.prototype.getContent = function () {
+    var $e = this.$element
+    var o  = this.options
+
+    return $e.attr('data-content')
+      || (typeof o.content == 'function' ?
+            o.content.call($e[0]) :
+            o.content)
+  }
+
+  Popover.prototype.arrow = function () {
+    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
+  }
+
+  Popover.prototype.tip = function () {
+    if (!this.$tip) this.$tip = $(this.options.template)
+    return this.$tip
+  }
+
+
+  // POPOVER PLUGIN DEFINITION
+  // =========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.popover')
+      var options = typeof option == 'object' && option
+
+      if (!data && option == 'destroy') return
+      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.popover
+
+  $.fn.popover             = Plugin
+  $.fn.popover.Constructor = Popover
+
+
+  // POPOVER NO CONFLICT
+  // ===================
+
+  $.fn.popover.noConflict = function () {
+    $.fn.popover = old
+    return this
+  }
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: scrollspy.js v3.2.0
+ * http://getbootstrap.com/javascript/#scrollspy
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // SCROLLSPY CLASS DEFINITION
+  // ==========================
+
+  function ScrollSpy(element, options) {
+    var process  = $.proxy(this.process, this)
+
+    this.$body          = $('body')
+    this.$scrollElement = $(element).is('body') ? $(window) : $(element)
+    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
+    this.selector       = (this.options.target || '') + ' .nav li > a'
+    this.offsets        = []
+    this.targets        = []
+    this.activeTarget   = null
+    this.scrollHeight   = 0
+
+    this.$scrollElement.on('scroll.bs.scrollspy', process)
+    this.refresh()
+    this.process()
+  }
+
+  ScrollSpy.VERSION  = '3.2.0'
+
+  ScrollSpy.DEFAULTS = {
+    offset: 10
+  }
+
+  ScrollSpy.prototype.getScrollHeight = function () {
+    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
+  }
+
+  ScrollSpy.prototype.refresh = function () {
+    var offsetMethod = 'offset'
+    var offsetBase   = 0
+
+    if (!$.isWindow(this.$scrollElement[0])) {
+      offsetMethod = 'position'
+      offsetBase   = this.$scrollElement.scrollTop()
+    }
+
+    this.offsets = []
+    this.targets = []
+    this.scrollHeight = this.getScrollHeight()
+
+    var self     = this
+
+    this.$body
+      .find(this.selector)
+      .map(function () {
+        var $el   = $(this)
+        var href  = $el.data('target') || $el.attr('href')
+        var $href = /^#./.test(href) && $(href)
+
+        return ($href
+          && $href.length
+          && $href.is(':visible')
+          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
+      })
+      .sort(function (a, b) { return a[0] - b[0] })
+      .each(function () {
+        self.offsets.push(this[0])
+        self.targets.push(this[1])
+      })
+  }
+
+  ScrollSpy.prototype.process = function () {
+    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
+    var scrollHeight = this.getScrollHeight()
+    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
+    var offsets      = this.offsets
+    var targets      = this.targets
+    var activeTarget = this.activeTarget
+    var i
+
+    if (this.scrollHeight != scrollHeight) {
+      this.refresh()
+    }
+
+    if (scrollTop >= maxScroll) {
+      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
+    }
+
+    if (activeTarget && scrollTop <= offsets[0]) {
+      return activeTarget != (i = targets[0]) && this.activate(i)
+    }
+
+    for (i = offsets.length; i--;) {
+      activeTarget != targets[i]
+        && scrollTop >= offsets[i]
+        && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+        && this.activate(targets[i])
+    }
+  }
+
+  ScrollSpy.prototype.activate = function (target) {
+    this.activeTarget = target
+
+    $(this.selector)
+      .parentsUntil(this.options.target, '.active')
+      .removeClass('active')
+
+    var selector = this.selector +
+        '[data-target="' + target + '"],' +
+        this.selector + '[href="' + target + '"]'
+
+    var active = $(selector)
+      .parents('li')
+      .addClass('active')
+
+    if (active.parent('.dropdown-menu').length) {
+      active = active
+        .closest('li.dropdown')
+        .addClass('active')
+    }
+
+    active.trigger('activate.bs.scrollspy')
+  }
+
+
+  // SCROLLSPY PLUGIN DEFINITION
+  // ===========================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.scrollspy')
+      var options = typeof option == 'object' && option
+
+      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.scrollspy
+
+  $.fn.scrollspy             = Plugin
+  $.fn.scrollspy.Constructor = ScrollSpy
+
+
+  // SCROLLSPY NO CONFLICT
+  // =====================
+
+  $.fn.scrollspy.noConflict = function () {
+    $.fn.scrollspy = old
+    return this
+  }
+
+
+  // SCROLLSPY DATA-API
+  // ==================
+
+  $(window).on('load.bs.scrollspy.data-api', function () {
+    $('[data-spy="scroll"]').each(function () {
+      var $spy = $(this)
+      Plugin.call($spy, $spy.data())
+    })
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: tab.js v3.2.0
+ * http://getbootstrap.com/javascript/#tabs
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // TAB CLASS DEFINITION
+  // ====================
+
+  var Tab = function (element) {
+    this.element = $(element)
+  }
+
+  Tab.VERSION = '3.2.0'
+
+  Tab.prototype.show = function () {
+    var $this    = this.element
+    var $ul      = $this.closest('ul:not(.dropdown-menu)')
+    var selector = $this.data('target')
+
+    if (!selector) {
+      selector = $this.attr('href')
+      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
+    }
+
+    if ($this.parent('li').hasClass('active')) return
+
+    var previous = $ul.find('.active:last a')[0]
+    var e        = $.Event('show.bs.tab', {
+      relatedTarget: previous
+    })
+
+    $this.trigger(e)
+
+    if (e.isDefaultPrevented()) return
+
+    var $target = $(selector)
+
+    this.activate($this.closest('li'), $ul)
+    this.activate($target, $target.parent(), function () {
+      $this.trigger({
+        type: 'shown.bs.tab',
+        relatedTarget: previous
+      })
+    })
+  }
+
+  Tab.prototype.activate = function (element, container, callback) {
+    var $active    = container.find('> .active')
+    var transition = callback
+      && $.support.transition
+      && $active.hasClass('fade')
+
+    function next() {
+      $active
+        .removeClass('active')
+        .find('> .dropdown-menu > .active')
+        .removeClass('active')
+
+      element.addClass('active')
+
+      if (transition) {
+        element[0].offsetWidth // reflow for transition
+        element.addClass('in')
+      } else {
+        element.removeClass('fade')
+      }
+
+      if (element.parent('.dropdown-menu')) {
+        element.closest('li.dropdown').addClass('active')
+      }
+
+      callback && callback()
+    }
+
+    transition ?
+      $active
+        .one('bsTransitionEnd', next)
+        .emulateTransitionEnd(150) :
+      next()
+
+    $active.removeClass('in')
+  }
+
+
+  // TAB PLUGIN DEFINITION
+  // =====================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this = $(this)
+      var data  = $this.data('bs.tab')
+
+      if (!data) $this.data('bs.tab', (data = new Tab(this)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.tab
+
+  $.fn.tab             = Plugin
+  $.fn.tab.Constructor = Tab
+
+
+  // TAB NO CONFLICT
+  // ===============
+
+  $.fn.tab.noConflict = function () {
+    $.fn.tab = old
+    return this
+  }
+
+
+  // TAB DATA-API
+  // ============
+
+  $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+    e.preventDefault()
+    Plugin.call($(this), 'show')
+  })
+
+}(jQuery);
+
+/* ========================================================================
+ * Bootstrap: affix.js v3.2.0
+ * http://getbootstrap.com/javascript/#affix
+ * ========================================================================
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * ======================================================================== */
+
+
++function ($) {
+  'use strict';
+
+  // AFFIX CLASS DEFINITION
+  // ======================
+
+  var Affix = function (element, options) {
+    this.options = $.extend({}, Affix.DEFAULTS, options)
+
+    this.$target = $(this.options.target)
+      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
+      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))
+
+    this.$element     = $(element)
+    this.affixed      =
+    this.unpin        =
+    this.pinnedOffset = null
+
+    this.checkPosition()
+  }
+
+  Affix.VERSION  = '3.2.0'
+
+  Affix.RESET    = 'affix affix-top affix-bottom'
+
+  Affix.DEFAULTS = {
+    offset: 0,
+    target: window
+  }
+
+  Affix.prototype.getPinnedOffset = function () {
+    if (this.pinnedOffset) return this.pinnedOffset
+    this.$element.removeClass(Affix.RESET).addClass('affix')
+    var scrollTop = this.$target.scrollTop()
+    var position  = this.$element.offset()
+    return (this.pinnedOffset = position.top - scrollTop)
+  }
+
+  Affix.prototype.checkPositionWithEventLoop = function () {
+    setTimeout($.proxy(this.checkPosition, this), 1)
+  }
+
+  Affix.prototype.checkPosition = function () {
+    if (!this.$element.is(':visible')) return
+
+    var scrollHeight = $(document).height()
+    var scrollTop    = this.$target.scrollTop()
+    var position     = this.$element.offset()
+    var offset       = this.options.offset
+    var offsetTop    = offset.top
+    var offsetBottom = offset.bottom
+
+    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
+    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
+    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
+
+    var affix = this.unpin   != null && (scrollTop + this.unpin <= position.top) ? false :
+                offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
+                offsetTop    != null && (scrollTop <= offsetTop) ? 'top' : false
+
+    if (this.affixed === affix) return
+    if (this.unpin != null) this.$element.css('top', '')
+
+    var affixType = 'affix' + (affix ? '-' + affix : '')
+    var e         = $.Event(affixType + '.bs.affix')
+
+    this.$element.trigger(e)
+
+    if (e.isDefaultPrevented()) return
+
+    this.affixed = affix
+    this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
+
+    this.$element
+      .removeClass(Affix.RESET)
+      .addClass(affixType)
+      .trigger($.Event(affixType.replace('affix', 'affixed')))
+
+    if (affix == 'bottom') {
+      this.$element.offset({
+        top: scrollHeight - this.$element.height() - offsetBottom
+      })
+    }
+  }
+
+
+  // AFFIX PLUGIN DEFINITION
+  // =======================
+
+  function Plugin(option) {
+    return this.each(function () {
+      var $this   = $(this)
+      var data    = $this.data('bs.affix')
+      var options = typeof option == 'object' && option
+
+      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
+      if (typeof option == 'string') data[option]()
+    })
+  }
+
+  var old = $.fn.affix
+
+  $.fn.affix             = Plugin
+  $.fn.affix.Constructor = Affix
+
+
+  // AFFIX NO CONFLICT
+  // =================
+
+  $.fn.affix.noConflict = function () {
+    $.fn.affix = old
+    return this
+  }
+
+
+  // AFFIX DATA-API
+  // ==============
+
+  $(window).on('load', function () {
+    $('[data-spy="affix"]').each(function () {
+      var $spy = $(this)
+      var data = $spy.data()
+
+      data.offset = data.offset || {}
+
+      if (data.offsetBottom) data.offset.bottom = data.offsetBottom
+      if (data.offsetTop)    data.offset.top    = data.offsetTop
+
+      Plugin.call($spy, data)
+    })
+  })
+
+}(jQuery);


[43/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/run.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/run.sh b/ambari-logsearch/ambari-logsearch-portal/run.sh
new file mode 100755
index 0000000..4b1be8b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/run.sh
@@ -0,0 +1,22 @@
+#   Licensed 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.
+echo "
+██╗      ██████╗  ██████╗     ███████╗███████╗ █████╗ ██████╗  ██████╗██╗  ██╗
+██║     ██╔═══██╗██╔════╝     ██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██║  ██║
+██║     ██║   ██║██║  ███╗    ███████╗█████╗  ███████║██████╔╝██║     ███████║
+██║     ██║   ██║██║   ██║    ╚════██║██╔══╝  ██╔══██║██╔══██╗██║     ██╔══██║
+███████╗╚██████╔╝╚██████╔╝    ███████║███████╗██║  ██║██║  ██║╚██████╗██║  ██║
+╚══════╝ ╚═════╝  ╚═════╝     ╚══════╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝╚═╝  ╚═╝
+"
+mvn clean compile -Pdev
+mvn exec:java -Pdev
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.html
new file mode 100755
index 0000000..fecab20
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.html
@@ -0,0 +1,24 @@
+<!--
+ 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.
+-->
+
+<!-- The content of this page will be statically included into the top-
+right box of the cores overview page. Uncomment this as an example to 
+see there the content will show up.
+
+<img src="img/ico/construction.png"> This line will appear at the top-
+right box on collection1's Overview
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-bottom.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-bottom.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-bottom.html
new file mode 100755
index 0000000..3359a46
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-bottom.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-bottom.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    LAST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-top.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-top.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-top.html
new file mode 100755
index 0000000..0886cee
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/admin-extra.menu-top.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-top.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    FIRST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/elevate.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/elevate.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/elevate.xml
new file mode 100644
index 0000000..25d5ceb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/elevate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- If this file is found in the config directory, it will only be
+     loaded once at startup.  If it is found in Solr's data
+     directory, it will be re-loaded every commit.
+
+   See http://wiki.apache.org/solr/QueryElevationComponent for more info
+
+-->
+<elevate>
+ <query text="foo bar">
+  <doc id="1" />
+  <doc id="2" />
+  <doc id="3" />
+ </query>
+ 
+ <query text="ipod">
+   <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
+   <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
+ </query>
+ 
+</elevate>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/enumsConfig.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/enumsConfig.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/enumsConfig.xml
new file mode 100644
index 0000000..458ee7e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/enumsConfig.xml
@@ -0,0 +1,28 @@
+<?xml version="1.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.
+-->
+<enumsConfig>
+  <enum name="log_levels">
+    <value>UNKNOWN</value>
+    <value>TRACE</value>
+    <value>DEBUG</value>
+    <value>INFO</value>
+    <value>WARN</value>
+    <value>ERROR</value>
+    <value>FATAL</value>
+  </enum>
+</enumsConfig>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema
new file mode 100644
index 0000000..4a6d3ac
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/managed-schema
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<schema name="audit-logs-schema" version="1.5">
+  <uniqueKey>id</uniqueKey>
+  <fieldType name="binary" class="solr.BinaryField"/>
+  <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+  <fieldType name="booleans" class="solr.BoolField" multiValued="true" sortMissingLast="true"/>
+  <fieldType name="date" class="solr.TrieDateField" precisionStep="0" positionIncrementGap="0"/>
+  <fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" positionIncrementGap="0"/>
+  <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>
+  <fieldType name="ignored" class="solr.StrField" multiValued="true" indexed="false" stored="false"/>
+  <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
+  <fieldType name="key_lower_case" class="solr.TextField" multiValued="false" sortMissingLast="true" omitNorms="true">
+    <analyzer>
+      <tokenizer class="solr.KeywordTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
+  <fieldType name="random" class="solr.RandomSortField" indexed="true"/>
+  <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
+  <fieldType name="tdate" class="solr.TrieDateField" precisionStep="6" positionIncrementGap="0"/>
+  <fieldType name="tdates" class="solr.TrieDateField" precisionStep="6" multiValued="true" positionIncrementGap="0"/>
+  <fieldType name="tdouble" class="solr.TrieDoubleField" precisionStep="8" positionIncrementGap="0"/>
+  <fieldType name="tdoubles" class="solr.TrieDoubleField" precisionStep="8" multiValued="true" positionIncrementGap="0"/>
+  <fieldType name="text_std_token_lower_case" class="solr.TextField" multiValued="true" positionIncrementGap="100">
+    <analyzer>
+      <tokenizer class="solr.StandardTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
+    <analyzer>
+      <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="n_gram" class="solr.TextField" sortMissingLast="true" omitNorms="true">
+    <analyzer>
+      <tokenizer class="solr.NGramTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  
+  <fieldType name="tfloat" class="solr.TrieFloatField" precisionStep="8" positionIncrementGap="0"/>
+  <fieldType name="tfloats" class="solr.TrieFloatField" precisionStep="8" multiValued="true" positionIncrementGap="0"/>
+  <fieldType name="tint" class="solr.TrieIntField" precisionStep="8" positionIncrementGap="0"/>
+  <fieldType name="tints" class="solr.TrieIntField" precisionStep="8" multiValued="true" positionIncrementGap="0"/>
+  <fieldType name="tlong" class="solr.TrieLongField" precisionStep="8" positionIncrementGap="0"/>
+  <fieldType name="tlongs" class="solr.TrieLongField" precisionStep="8" multiValued="true" positionIncrementGap="0"/>
+  <field name="_expire_at_" type="tdate" multiValued="false" stored="true"/>
+  <field name="_ttl_" type="string" multiValued="false" indexed="true" stored="true"/>
+  <field name="_version_" type="long" indexed="true" stored="true"/>
+  <field name="_router_field_" type="int" indexed="false" stored="false" multiValued="false"/>
+    
+  <field name="access" type="key_lower_case" multiValued="false"/>
+  <field name="action" type="key_lower_case" multiValued="false"/>
+  <field name="agent" type="key_lower_case" multiValued="false"/>
+  <field name="agentHost" type="key_lower_case" multiValued="false"/>
+  <field name="cliIP" type="key_lower_case" multiValued="false"/>
+  <field name="cliType" type="key_lower_case" multiValued="false"/>
+  <field name="cluster" type="key_lower_case" multiValued="false"/>
+  <field name="reqContext" type="key_lower_case" multiValued="true"/>
+  <field name="enforcer" type="key_lower_case" multiValued="false"/>
+  <field name="event_count" type="tlong" multiValued="false" docValues="true" default="1"/>
+  <field name="event_dur_ms" type="tlong" multiValued="false" docValues="true"/>
+  <field name="evtTime" type="tdate"  docValues="true"/>
+  <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
+  <field name="logType" type="key_lower_case" multiValued="false"/>
+  <field name="policy" type="tlong" docValues="true"/>
+  <field name="proxyUsers" type="key_lower_case" multiValued="true"/>
+  <field name="reason" type="text_std_token_lower_case" multiValued="false" omitNorms="false"/>
+  <field name="repo" type="key_lower_case" multiValued="false"/>
+  <field name="repoType" type="tint" multiValued="false" docValues="true"/>
+  <field name="reqData" type="text_std_token_lower_case" multiValued="false"/>
+  <field name="reqUser" type="key_lower_case" multiValued="false"/>
+  <field name="resType" type="key_lower_case" multiValued="false"/>
+  <field name="resource" type="key_lower_case" multiValued="false"/>
+  <field name="result" type="tint" multiValued="false"/>
+  <field name="seq_num" type="tlong" multiValued="false" docValues="true"/>
+  <field name="sess" type="key_lower_case" multiValued="false"/>
+  <field name="tags" type="key_lower_case" multiValued="true"/>
+  <field name="tags_str" type="text_std_token_lower_case" multiValued="false"/>
+  <field name="text" type="text_std_token_lower_case" multiValued="true" indexed="true" stored="false"/>
+
+  <field name="bundle_id" type="key_lower_case" multiValued="false"/>
+  <field name="case_id" type="key_lower_case" multiValued="false"/>
+  <field name="req_caller_id" type="key_lower_case" multiValued="false"/>
+  <field name="req_self_id" type="key_lower_case" multiValued="false"/>
+  <field name="event_md5" type="string" multiValued="false"/>
+  <field name="file" type="key_lower_case" multiValued="false"/>
+  <field name="log_message" type="key_lower_case" multiValued="false" omitNorms="false"/>
+  <field name="logfile_line_number" type="tint" omitNorms="false"/>
+  <field name="message" type="text_std_token_lower_case" indexed="true" stored="true"/>
+  <field name="message_md5" type="string" multiValued="false"/>
+  <field name="type" type="key_lower_case" multiValued="false"/>
+  
+  <dynamicField name='ngram_*' type="n_gram" multiValued="false" stored="false"/>
+  <dynamicField name='std_*' type="text_std_token_lower_case" multiValued="false" stored="false"/>
+  
+  <!-- Copying everything text -->
+  <copyField source="*" dest="text" maxChars="25000" />
+  
+  
+</schema>


[57/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
new file mode 100644
index 0000000..36e88db
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_pid_dir</name>
+    <value>/var/run/ambari-logsearch-portal</value>
+    <description>Logsearch Process ID Directory</description>
+    <display-name>Logsearch pid dir</display-name>
+  </property> 
+
+  <property>
+    <name>logsearch_log_dir</name>
+    <value>/var/log/ambari-logsearch-portal</value>
+    <description>Log directory for Logsearch</description>
+    <display-name>Logsearch log dir</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_user</name>
+    <value>logsearch</value>
+    <property-type>USER</property-type>
+    <description>Logsearch user</description>
+    <display-name>Logsearch User</display-name>
+  </property>  
+
+  <property>
+    <name>logsearch_group</name>
+    <value>logsearch</value>
+    <property-type>GROUP</property-type>
+    <description>Logsearch group</description>
+    <display-name>Logsearch Group</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_app_max_memory</name>
+    <value>1g</value>
+    <description>Max memory for LogSearch</description>
+    <display-name>Logearch Max Memory</display-name>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_use_ranger</name>
+    <value>false</value>
+    <display-name>Ranger Audit Enabled</display-name>
+    <description>Use Ranger Audit collection. This is supported only if Ranger Solr is installed in SolrCloud mode</description>
+  </property>
+
+  <property>
+    <name>logsearch_debug_enabled</name>
+    <value>false</value>
+    <display-name>Logsearch Debug Enabled</display-name>
+    <description>Enable debug mode for Logsearch Server</description>
+  </property>
+
+  <property>
+    <name>logsearch_debug_port</name>
+    <value>5005</value>
+    <display-name>Logsearch Debug Port</display-name>
+    <description>Debug port for Logsearch Server</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_zk_node</name>
+    <value>{logsearch_solr_znode}</value>
+    <display-name>Solr Audit Logs Znode</display-name>
+    <description>Only needed if using custom solr cloud. E.g. /audit_logs</description>
+  </property>
+
+  <property>
+    <name>logsearch_solr_audit_logs_zk_quorum</name>
+    <value>{zookeeper_quorum}</value>
+    <display-name>Solr Audit Logs ZK Quorum</display-name>
+    <description>Only needed if using custom solr cloud. E.g. zk1:2181,zk2:2182</description>
+  </property>
+
+  <!-- logsearch-env.sh -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for logsearch-env.sh file</description>
+    <value>#!/bin/bash
+# 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.
+
+
+set -e
+
+#path containing LogSearch.jar file
+export LOGSEARCH_PATH={{logsearch_dir}}
+
+export LOGSEARCH_CONF_DIR={{logsearch_server_conf}}
+
+export LOGFILE={{logsearch_log_dir}}/logsearch.log
+
+export PID_FILE={{logsearch_pid_file}}
+
+export JAVA_HOME={{java64_home}}
+
+export LOGSEARCH_JAVA_MEM=-Xmx{{logsearch_app_max_memory}}
+if [ "$LOGSEARCH_JAVA_MEM" = "" ]; then
+  export LOGSEARCH_JAVA_MEM="-Xmx1g"
+fi
+
+export LOGSEARCH_DEBUG={{logsearch_debug_enabled}}
+
+export LOGSEARCH_DEBUG_PORT={{logsearch_debug_port}}
+    </value>
+  </property>
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
new file mode 100644
index 0000000..a0a7bc9
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-log4j.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <!-- log4j.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for log4j.xml file for logsearch server</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+  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.
+--&gt;
+&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
+&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt;
+  &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
+    &lt;param name="Target" value="System.out" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="rolling_file" class="org.apache.log4j.RollingFileAppender"&gt; 
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch.log" /&gt; 
+    &lt;param name="append" value="true" /&gt; 
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt; 
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt; 
+    &lt;/layout&gt; 
+  &lt;/appender&gt;
+
+  &lt;appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender"&gt;
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch-audit.log" /&gt;
+    &lt;param name="append" value="true" /&gt;
+    &lt;param name="maxFileSize" value="10MB" /&gt;
+    &lt;param name="maxBackupIndex" value="10" /&gt;
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender"&gt;
+    &lt;param name="file" value="{{logsearch_log_dir}}/logsearch-performance.log" /&gt;
+    &lt;param name="Threshold" value="info" /&gt;
+    &lt;param name="append" value="true" /&gt;
+    &lt;param name="maxFileSize" value="10MB" /&gt; 
+    &lt;param name="maxBackupIndex" value="10" /&gt; 
+    &lt;layout class="org.apache.log4j.PatternLayout"&gt;
+      &lt;param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" /&gt;
+    &lt;/layout&gt;
+  &lt;/appender&gt;
+
+  &lt;logger name="org.apache.ambari.logsearch.audit" additivity="true"&gt;
+    &lt;appender-ref ref="audit_rolling_file" /&gt;
+  &lt;/logger&gt;
+  
+  &lt;logger name="org.apache.ambari.logsearch.performance" additivity="false"&gt;
+   &lt;appender-ref ref="performance_analyzer" /&gt;
+  &lt;/logger&gt;
+
+  &lt;category name="org.apache.ambari.logsearch" additivity="false"&gt;
+    &lt;priority value="info" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/category&gt;
+
+  &lt;root&gt;
+    &lt;priority value="warn" /&gt;
+    &lt;appender-ref ref="rolling_file" /&gt;
+  &lt;/root&gt;
+&lt;/log4j:configuration&gt;  
+    </value>
+  </property>
+
+  
+</configuration>  


[11/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery-1.4.4.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery-1.4.4.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery-1.4.4.js
new file mode 100644
index 0000000..a4f1145
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/examples/browser/jquery-1.4.4.js
@@ -0,0 +1,7179 @@
+/*!
+ * jQuery JavaScript Library v1.4.4
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Thu Nov 11 19:04:53 2010 -0500
+ */
+(function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document;
+var jQuery = (function() {
+
+// Define a local copy of jQuery
+var jQuery = function( selector, context ) {
+		// The jQuery object is actually just the init constructor 'enhanced'
+		return new jQuery.fn.init( selector, context );
+	},
+
+	// Map over jQuery in case of overwrite
+	_jQuery = window.jQuery,
+
+	// Map over the $ in case of overwrite
+	_$ = window.$,
+
+	// A central reference to the root jQuery(document)
+	rootjQuery,
+
+	// A simple way to check for HTML strings or ID strings
+	// (both of which we optimize for)
+	quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
+
+	// Is it a simple selector
+	isSimple = /^.[^:#\[\.,]*$/,
+
+	// Check if a string has a non-whitespace character in it
+	rnotwhite = /\S/,
+	rwhite = /\s/,
+
+	// Used for trimming whitespace
+	trimLeft = /^\s+/,
+	trimRight = /\s+$/,
+
+	// Check for non-word characters
+	rnonword = /\W/,
+
+	// Check for digits
+	rdigit = /\d/,
+
+	// Match a standalone tag
+	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+
+	// JSON RegExp
+	rvalidchars = /^[\],:{}\s]*$/,
+	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+	// Useragent RegExp
+	rwebkit = /(webkit)[ \/]([\w.]+)/,
+	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+	rmsie = /(msie) ([\w.]+)/,
+	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
+	// Keep a UserAgent string for use with jQuery.browser
+	userAgent = navigator.userAgent,
+
+	// For matching the engine and version of the browser
+	browserMatch,
+	
+	// Has the ready events already been bound?
+	readyBound = false,
+	
+	// The functions to execute on DOM ready
+	readyList = [],
+
+	// The ready event handler
+	DOMContentLoaded,
+
+	// Save a reference to some core methods
+	toString = Object.prototype.toString,
+	hasOwn = Object.prototype.hasOwnProperty,
+	push = Array.prototype.push,
+	slice = Array.prototype.slice,
+	trim = String.prototype.trim,
+	indexOf = Array.prototype.indexOf,
+	
+	// [[Class]] -> type pairs
+	class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+	init: function( selector, context ) {
+		var match, elem, ret, doc;
+
+		// Handle $(""), $(null), or $(undefined)
+		if ( !selector ) {
+			return this;
+		}
+
+		// Handle $(DOMElement)
+		if ( selector.nodeType ) {
+			this.context = this[0] = selector;
+			this.length = 1;
+			return this;
+		}
+		
+		// The body element only exists once, optimize finding it
+		if ( selector === "body" && !context && document.body ) {
+			this.context = document;
+			this[0] = document.body;
+			this.selector = "body";
+			this.length = 1;
+			return this;
+		}
+
+		// Handle HTML strings
+		if ( typeof selector === "string" ) {
+			// Are we dealing with HTML string or an ID?
+			match = quickExpr.exec( selector );
+
+			// Verify a match, and that no context was specified for #id
+			if ( match && (match[1] || !context) ) {
+
+				// HANDLE: $(html) -> $(array)
+				if ( match[1] ) {
+					doc = (context ? context.ownerDocument || context : document);
+
+					// If a single string is passed in and it's a single tag
+					// just do a createElement and skip the rest
+					ret = rsingleTag.exec( selector );
+
+					if ( ret ) {
+						if ( jQuery.isPlainObject( context ) ) {
+							selector = [ document.createElement( ret[1] ) ];
+							jQuery.fn.attr.call( selector, context, true );
+
+						} else {
+							selector = [ doc.createElement( ret[1] ) ];
+						}
+
+					} else {
+						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
+					}
+					
+					return jQuery.merge( this, selector );
+					
+				// HANDLE: $("#id")
+				} else {
+					elem = document.getElementById( match[2] );
+
+					// Check parentNode to catch when Blackberry 4.6 returns
+					// nodes that are no longer in the document #6963
+					if ( elem && elem.parentNode ) {
+						// Handle the case where IE and Opera return items
+						// by name instead of ID
+						if ( elem.id !== match[2] ) {
+							return rootjQuery.find( selector );
+						}
+
+						// Otherwise, we inject the element directly into the jQuery object
+						this.length = 1;
+						this[0] = elem;
+					}
+
+					this.context = document;
+					this.selector = selector;
+					return this;
+				}
+
+			// HANDLE: $("TAG")
+			} else if ( !context && !rnonword.test( selector ) ) {
+				this.selector = selector;
+				this.context = document;
+				selector = document.getElementsByTagName( selector );
+				return jQuery.merge( this, selector );
+
+			// HANDLE: $(expr, $(...))
+			} else if ( !context || context.jquery ) {
+				return (context || rootjQuery).find( selector );
+
+			// HANDLE: $(expr, context)
+			// (which is just equivalent to: $(context).find(expr)
+			} else {
+				return jQuery( context ).find( selector );
+			}
+
+		// HANDLE: $(function)
+		// Shortcut for document ready
+		} else if ( jQuery.isFunction( selector ) ) {
+			return rootjQuery.ready( selector );
+		}
+
+		if (selector.selector !== undefined) {
+			this.selector = selector.selector;
+			this.context = selector.context;
+		}
+
+		return jQuery.makeArray( selector, this );
+	},
+
+	// Start with an empty selector
+	selector: "",
+
+	// The current version of jQuery being used
+	jquery: "1.4.4",
+
+	// The default length of a jQuery object is 0
+	length: 0,
+
+	// The number of elements contained in the matched element set
+	size: function() {
+		return this.length;
+	},
+
+	toArray: function() {
+		return slice.call( this, 0 );
+	},
+
+	// Get the Nth element in the matched element set OR
+	// Get the whole matched element set as a clean array
+	get: function( num ) {
+		return num == null ?
+
+			// Return a 'clean' array
+			this.toArray() :
+
+			// Return just the object
+			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+	},
+
+	// Take an array of elements and push it onto the stack
+	// (returning the new matched element set)
+	pushStack: function( elems, name, selector ) {
+		// Build a new jQuery matched element set
+		var ret = jQuery();
+
+		if ( jQuery.isArray( elems ) ) {
+			push.apply( ret, elems );
+		
+		} else {
+			jQuery.merge( ret, elems );
+		}
+
+		// Add the old object onto the stack (as a reference)
+		ret.prevObject = this;
+
+		ret.context = this.context;
+
+		if ( name === "find" ) {
+			ret.selector = this.selector + (this.selector ? " " : "") + selector;
+		} else if ( name ) {
+			ret.selector = this.selector + "." + name + "(" + selector + ")";
+		}
+
+		// Return the newly-formed element set
+		return ret;
+	},
+
+	// Execute a callback for every element in the matched set.
+	// (You can seed the arguments with an array of args, but this is
+	// only used internally.)
+	each: function( callback, args ) {
+		return jQuery.each( this, callback, args );
+	},
+	
+	ready: function( fn ) {
+		// Attach the listeners
+		jQuery.bindReady();
+
+		// If the DOM is already ready
+		if ( jQuery.isReady ) {
+			// Execute the function immediately
+			fn.call( document, jQuery );
+
+		// Otherwise, remember the function for later
+		} else if ( readyList ) {
+			// Add the function to the wait list
+			readyList.push( fn );
+		}
+
+		return this;
+	},
+	
+	eq: function( i ) {
+		return i === -1 ?
+			this.slice( i ) :
+			this.slice( i, +i + 1 );
+	},
+
+	first: function() {
+		return this.eq( 0 );
+	},
+
+	last: function() {
+		return this.eq( -1 );
+	},
+
+	slice: function() {
+		return this.pushStack( slice.apply( this, arguments ),
+			"slice", slice.call(arguments).join(",") );
+	},
+
+	map: function( callback ) {
+		return this.pushStack( jQuery.map(this, function( elem, i ) {
+			return callback.call( elem, i, elem );
+		}));
+	},
+	
+	end: function() {
+		return this.prevObject || jQuery(null);
+	},
+
+	// For internal use only.
+	// Behaves like an Array's method, not like a jQuery method.
+	push: push,
+	sort: [].sort,
+	splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+	 var options, name, src, copy, copyIsArray, clone,
+		target = arguments[0] || {},
+		i = 1,
+		length = arguments.length,
+		deep = false;
+
+	// Handle a deep copy situation
+	if ( typeof target === "boolean" ) {
+		deep = target;
+		target = arguments[1] || {};
+		// skip the boolean and the target
+		i = 2;
+	}
+
+	// Handle case when target is a string or something (possible in deep copy)
+	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+		target = {};
+	}
+
+	// extend jQuery itself if only one argument is passed
+	if ( length === i ) {
+		target = this;
+		--i;
+	}
+
+	for ( ; i < length; i++ ) {
+		// Only deal with non-null/undefined values
+		if ( (options = arguments[ i ]) != null ) {
+			// Extend the base object
+			for ( name in options ) {
+				src = target[ name ];
+				copy = options[ name ];
+
+				// Prevent never-ending loop
+				if ( target === copy ) {
+					continue;
+				}
+
+				// Recurse if we're merging plain objects or arrays
+				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+					if ( copyIsArray ) {
+						copyIsArray = false;
+						clone = src && jQuery.isArray(src) ? src : [];
+
+					} else {
+						clone = src && jQuery.isPlainObject(src) ? src : {};
+					}
+
+					// Never move original objects, clone them
+					target[ name ] = jQuery.extend( deep, clone, copy );
+
+				// Don't bring in undefined values
+				} else if ( copy !== undefined ) {
+					target[ name ] = copy;
+				}
+			}
+		}
+	}
+
+	// Return the modified object
+	return target;
+};
+
+jQuery.extend({
+	noConflict: function( deep ) {
+		window.$ = _$;
+
+		if ( deep ) {
+			window.jQuery = _jQuery;
+		}
+
+		return jQuery;
+	},
+	
+	// Is the DOM ready to be used? Set to true once it occurs.
+	isReady: false,
+
+	// A counter to track how many items to wait for before
+	// the ready event fires. See #6781
+	readyWait: 1,
+	
+	// Handle when the DOM is ready
+	ready: function( wait ) {
+		// A third-party is pushing the ready event forwards
+		if ( wait === true ) {
+			jQuery.readyWait--;
+		}
+
+		// Make sure that the DOM is not already loaded
+		if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
+			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+			if ( !document.body ) {
+				return setTimeout( jQuery.ready, 1 );
+			}
+
+			// Remember that the DOM is ready
+			jQuery.isReady = true;
+
+			// If a normal DOM Ready event fired, decrement, and wait if need be
+			if ( wait !== true && --jQuery.readyWait > 0 ) {
+				return;
+			}
+
+			// If there are functions bound, to execute
+			if ( readyList ) {
+				// Execute all of them
+				var fn,
+					i = 0,
+					ready = readyList;
+
+				// Reset the list of functions
+				readyList = null;
+
+				while ( (fn = ready[ i++ ]) ) {
+					fn.call( document, jQuery );
+				}
+
+				// Trigger any bound ready events
+				if ( jQuery.fn.trigger ) {
+					jQuery( document ).trigger( "ready" ).unbind( "ready" );
+				}
+			}
+		}
+	},
+	
+	bindReady: function() {
+		if ( readyBound ) {
+			return;
+		}
+
+		readyBound = true;
+
+		// Catch cases where $(document).ready() is called after the
+		// browser event has already occurred.
+		if ( document.readyState === "complete" ) {
+			// Handle it asynchronously to allow scripts the opportunity to delay ready
+			return setTimeout( jQuery.ready, 1 );
+		}
+
+		// Mozilla, Opera and webkit nightlies currently support this event
+		if ( document.addEventListener ) {
+			// Use the handy event callback
+			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+			
+			// A fallback to window.onload, that will always work
+			window.addEventListener( "load", jQuery.ready, false );
+
+		// If IE event model is used
+		} else if ( document.attachEvent ) {
+			// ensure firing before onload,
+			// maybe late but safe also for iframes
+			document.attachEvent("onreadystatechange", DOMContentLoaded);
+			
+			// A fallback to window.onload, that will always work
+			window.attachEvent( "onload", jQuery.ready );
+
+			// If IE and not a frame
+			// continually check to see if the document is ready
+			var toplevel = false;
+
+			try {
+				toplevel = window.frameElement == null;
+			} catch(e) {}
+
+			if ( document.documentElement.doScroll && toplevel ) {
+				doScrollCheck();
+			}
+		}
+	},
+
+	// See test/unit/core.js for details concerning isFunction.
+	// Since version 1.3, DOM methods and functions like alert
+	// aren't supported. They return false on IE (#2968).
+	isFunction: function( obj ) {
+		return jQuery.type(obj) === "function";
+	},
+
+	isArray: Array.isArray || function( obj ) {
+		return jQuery.type(obj) === "array";
+	},
+
+	// A crude way of determining if an object is a window
+	isWindow: function( obj ) {
+		return obj && typeof obj === "object" && "setInterval" in obj;
+	},
+
+	isNaN: function( obj ) {
+		return obj == null || !rdigit.test( obj ) || isNaN( obj );
+	},
+
+	type: function( obj ) {
+		return obj == null ?
+			String( obj ) :
+			class2type[ toString.call(obj) ] || "object";
+	},
+
+	isPlainObject: function( obj ) {
+		// Must be an Object.
+		// Because of IE, we also have to check the presence of the constructor property.
+		// Make sure that DOM nodes and window objects don't pass through, as well
+		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+			return false;
+		}
+		
+		// Not own constructor property must be Object
+		if ( obj.constructor &&
+			!hasOwn.call(obj, "constructor") &&
+			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+			return false;
+		}
+		
+		// Own properties are enumerated firstly, so to speed up,
+		// if last one is own, then all properties are own.
+	
+		var key;
+		for ( key in obj ) {}
+		
+		return key === undefined || hasOwn.call( obj, key );
+	},
+
+	isEmptyObject: function( obj ) {
+		for ( var name in obj ) {
+			return false;
+		}
+		return true;
+	},
+	
+	error: function( msg ) {
+		throw msg;
+	},
+	
+	parseJSON: function( data ) {
+		if ( typeof data !== "string" || !data ) {
+			return null;
+		}
+
+		// Make sure leading/trailing whitespace is removed (IE can't handle it)
+		data = jQuery.trim( data );
+		
+		// Make sure the incoming data is actual JSON
+		// Logic borrowed from http://json.org/json2.js
+		if ( rvalidchars.test(data.replace(rvalidescape, "@")
+			.replace(rvalidtokens, "]")
+			.replace(rvalidbraces, "")) ) {
+
+			// Try to use the native JSON parser first
+			return window.JSON && window.JSON.parse ?
+				window.JSON.parse( data ) :
+				(new Function("return " + data))();
+
+		} else {
+			jQuery.error( "Invalid JSON: " + data );
+		}
+	},
+
+	noop: function() {},
+
+	// Evalulates a script in a global context
+	globalEval: function( data ) {
+		if ( data && rnotwhite.test(data) ) {
+			// Inspired by code by Andrea Giammarchi
+			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+			var head = document.getElementsByTagName("head")[0] || document.documentElement,
+				script = document.createElement("script");
+
+			script.type = "text/javascript";
+
+			if ( jQuery.support.scriptEval ) {
+				script.appendChild( document.createTextNode( data ) );
+			} else {
+				script.text = data;
+			}
+
+			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
+			// This arises when a base node is used (#2709).
+			head.insertBefore( script, head.firstChild );
+			head.removeChild( script );
+		}
+	},
+
+	nodeName: function( elem, name ) {
+		return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+	},
+
+	// args is for internal usage only
+	each: function( object, callback, args ) {
+		var name, i = 0,
+			length = object.length,
+			isObj = length === undefined || jQuery.isFunction(object);
+
+		if ( args ) {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.apply( object[ name ], args ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( ; i < length; ) {
+					if ( callback.apply( object[ i++ ], args ) === false ) {
+						break;
+					}
+				}
+			}
+
+		// A special, fast, case for the most common use of each
+		} else {
+			if ( isObj ) {
+				for ( name in object ) {
+					if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+						break;
+					}
+				}
+			} else {
+				for ( var value = object[0];
+					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+			}
+		}
+
+		return object;
+	},
+
+	// Use native String.trim function wherever possible
+	trim: trim ?
+		function( text ) {
+			return text == null ?
+				"" :
+				trim.call( text );
+		} :
+
+		// Otherwise use our own trimming functionality
+		function( text ) {
+			return text == null ?
+				"" :
+				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+		},
+
+	// results is for internal usage only
+	makeArray: function( array, results ) {
+		var ret = results || [];
+
+		if ( array != null ) {
+			// The window, strings (and functions) also have 'length'
+			// The extra typeof function check is to prevent crashes
+			// in Safari 2 (See: #3039)
+			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+			var type = jQuery.type(array);
+
+			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
+				push.call( ret, array );
+			} else {
+				jQuery.merge( ret, array );
+			}
+		}
+
+		return ret;
+	},
+
+	inArray: function( elem, array ) {
+		if ( array.indexOf ) {
+			return array.indexOf( elem );
+		}
+
+		for ( var i = 0, length = array.length; i < length; i++ ) {
+			if ( array[ i ] === elem ) {
+				return i;
+			}
+		}
+
+		return -1;
+	},
+
+	merge: function( first, second ) {
+		var i = first.length,
+			j = 0;
+
+		if ( typeof second.length === "number" ) {
+			for ( var l = second.length; j < l; j++ ) {
+				first[ i++ ] = second[ j ];
+			}
+		
+		} else {
+			while ( second[j] !== undefined ) {
+				first[ i++ ] = second[ j++ ];
+			}
+		}
+
+		first.length = i;
+
+		return first;
+	},
+
+	grep: function( elems, callback, inv ) {
+		var ret = [], retVal;
+		inv = !!inv;
+
+		// Go through the array, only saving the items
+		// that pass the validator function
+		for ( var i = 0, length = elems.length; i < length; i++ ) {
+			retVal = !!callback( elems[ i ], i );
+			if ( inv !== retVal ) {
+				ret.push( elems[ i ] );
+			}
+		}
+
+		return ret;
+	},
+
+	// arg is for internal usage only
+	map: function( elems, callback, arg ) {
+		var ret = [], value;
+
+		// Go through the array, translating each of the items to their
+		// new value (or values).
+		for ( var i = 0, length = elems.length; i < length; i++ ) {
+			value = callback( elems[ i ], i, arg );
+
+			if ( value != null ) {
+				ret[ ret.length ] = value;
+			}
+		}
+
+		return ret.concat.apply( [], ret );
+	},
+
+	// A global GUID counter for objects
+	guid: 1,
+
+	proxy: function( fn, proxy, thisObject ) {
+		if ( arguments.length === 2 ) {
+			if ( typeof proxy === "string" ) {
+				thisObject = fn;
+				fn = thisObject[ proxy ];
+				proxy = undefined;
+
+			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
+				thisObject = proxy;
+				proxy = undefined;
+			}
+		}
+
+		if ( !proxy && fn ) {
+			proxy = function() {
+				return fn.apply( thisObject || this, arguments );
+			};
+		}
+
+		// Set the guid of unique handler to the same of original handler, so it can be removed
+		if ( fn ) {
+			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+		}
+
+		// So proxy can be declared as an argument
+		return proxy;
+	},
+
+	// Mutifunctional method to get and set values to a collection
+	// The value/s can be optionally by executed if its a function
+	access: function( elems, key, value, exec, fn, pass ) {
+		var length = elems.length;
+	
+		// Setting many attributes
+		if ( typeof key === "object" ) {
+			for ( var k in key ) {
+				jQuery.access( elems, k, key[k], exec, fn, value );
+			}
+			return elems;
+		}
+	
+		// Setting one attribute
+		if ( value !== undefined ) {
+			// Optionally, function values get executed if exec is true
+			exec = !pass && exec && jQuery.isFunction(value);
+		
+			for ( var i = 0; i < length; i++ ) {
+				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+			}
+		
+			return elems;
+		}
+	
+		// Getting an attribute
+		return length ? fn( elems[0], key ) : undefined;
+	},
+
+	now: function() {
+		return (new Date()).getTime();
+	},
+
+	// Use of jQuery.browser is frowned upon.
+	// More details: http://docs.jquery.com/Utilities/jQuery.browser
+	uaMatch: function( ua ) {
+		ua = ua.toLowerCase();
+
+		var match = rwebkit.exec( ua ) ||
+			ropera.exec( ua ) ||
+			rmsie.exec( ua ) ||
+			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+			[];
+
+		return { browser: match[1] || "", version: match[2] || "0" };
+	},
+
+	browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+	class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+browserMatch = jQuery.uaMatch( userAgent );
+if ( browserMatch.browser ) {
+	jQuery.browser[ browserMatch.browser ] = true;
+	jQuery.browser.version = browserMatch.version;
+}
+
+// Deprecated, use jQuery.browser.webkit instead
+if ( jQuery.browser.webkit ) {
+	jQuery.browser.safari = true;
+}
+
+if ( indexOf ) {
+	jQuery.inArray = function( elem, array ) {
+		return indexOf.call( array, elem );
+	};
+}
+
+// Verify that \s matches non-breaking spaces
+// (IE fails on this test)
+if ( !rwhite.test( "\xA0" ) ) {
+	trimLeft = /^[\s\xA0]+/;
+	trimRight = /[\s\xA0]+$/;
+}
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+
+// Cleanup functions for the document ready method
+if ( document.addEventListener ) {
+	DOMContentLoaded = function() {
+		document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+		jQuery.ready();
+	};
+
+} else if ( document.attachEvent ) {
+	DOMContentLoaded = function() {
+		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+		if ( document.readyState === "complete" ) {
+			document.detachEvent( "onreadystatechange", DOMContentLoaded );
+			jQuery.ready();
+		}
+	};
+}
+
+// The DOM ready check for Internet Explorer
+function doScrollCheck() {
+	if ( jQuery.isReady ) {
+		return;
+	}
+
+	try {
+		// If IE is used, use the trick by Diego Perini
+		// http://javascript.nwbox.com/IEContentLoaded/
+		document.documentElement.doScroll("left");
+	} catch(e) {
+		setTimeout( doScrollCheck, 1 );
+		return;
+	}
+
+	// and execute any waiting functions
+	jQuery.ready();
+}
+
+// Expose jQuery to the global object
+return (window.jQuery = window.$ = jQuery);
+
+})();
+
+
+(function() {
+
+	jQuery.support = {};
+
+	var root = document.documentElement,
+		script = document.createElement("script"),
+		div = document.createElement("div"),
+		id = "script" + jQuery.now();
+
+	div.style.display = "none";
+	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+	var all = div.getElementsByTagName("*"),
+		a = div.getElementsByTagName("a")[0],
+		select = document.createElement("select"),
+		opt = select.appendChild( document.createElement("option") );
+
+	// Can't get basic test support
+	if ( !all || !all.length || !a ) {
+		return;
+	}
+
+	jQuery.support = {
+		// IE strips leading whitespace when .innerHTML is used
+		leadingWhitespace: div.firstChild.nodeType === 3,
+
+		// Make sure that tbody elements aren't automatically inserted
+		// IE will insert them into empty tables
+		tbody: !div.getElementsByTagName("tbody").length,
+
+		// Make sure that link elements get serialized correctly by innerHTML
+		// This requires a wrapper element in IE
+		htmlSerialize: !!div.getElementsByTagName("link").length,
+
+		// Get the style information from getAttribute
+		// (IE uses .cssText insted)
+		style: /red/.test( a.getAttribute("style") ),
+
+		// Make sure that URLs aren't manipulated
+		// (IE normalizes it by default)
+		hrefNormalized: a.getAttribute("href") === "/a",
+
+		// Make sure that element opacity exists
+		// (IE uses filter instead)
+		// Use a regex to work around a WebKit issue. See #5145
+		opacity: /^0.55$/.test( a.style.opacity ),
+
+		// Verify style float existence
+		// (IE uses styleFloat instead of cssFloat)
+		cssFloat: !!a.style.cssFloat,
+
+		// Make sure that if no value is specified for a checkbox
+		// that it defaults to "on".
+		// (WebKit defaults to "" instead)
+		checkOn: div.getElementsByTagName("input")[0].value === "on",
+
+		// Make sure that a selected-by-default option has a working selected property.
+		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+		optSelected: opt.selected,
+
+		// Will be defined later
+		deleteExpando: true,
+		optDisabled: false,
+		checkClone: false,
+		scriptEval: false,
+		noCloneEvent: true,
+		boxModel: null,
+		inlineBlockNeedsLayout: false,
+		shrinkWrapBlocks: false,
+		reliableHiddenOffsets: true
+	};
+
+	// Make sure that the options inside disabled selects aren't marked as disabled
+	// (WebKit marks them as diabled)
+	select.disabled = true;
+	jQuery.support.optDisabled = !opt.disabled;
+
+	script.type = "text/javascript";
+	try {
+		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+	} catch(e) {}
+
+	root.insertBefore( script, root.firstChild );
+
+	// Make sure that the execution of code works by injecting a script
+	// tag with appendChild/createTextNode
+	// (IE doesn't support this, fails, and uses .text instead)
+	if ( window[ id ] ) {
+		jQuery.support.scriptEval = true;
+		delete window[ id ];
+	}
+
+	// Test to see if it's possible to delete an expando from an element
+	// Fails in Internet Explorer
+	try {
+		delete script.test;
+
+	} catch(e) {
+		jQuery.support.deleteExpando = false;
+	}
+
+	root.removeChild( script );
+
+	if ( div.attachEvent && div.fireEvent ) {
+		div.attachEvent("onclick", function click() {
+			// Cloning a node shouldn't copy over any
+			// bound event handlers (IE does this)
+			jQuery.support.noCloneEvent = false;
+			div.detachEvent("onclick", click);
+		});
+		div.cloneNode(true).fireEvent("onclick");
+	}
+
+	div = document.createElement("div");
+	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
+
+	var fragment = document.createDocumentFragment();
+	fragment.appendChild( div.firstChild );
+
+	// WebKit doesn't clone checked state correctly in fragments
+	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
+
+	// Figure out if the W3C box model works as expected
+	// document.body must exist before we can do this
+	jQuery(function() {
+		var div = document.createElement("div");
+		div.style.width = div.style.paddingLeft = "1px";
+
+		document.body.appendChild( div );
+		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+
+		if ( "zoom" in div.style ) {
+			// Check if natively block-level elements act like inline-block
+			// elements when setting their display to 'inline' and giving
+			// them layout
+			// (IE < 8 does this)
+			div.style.display = "inline";
+			div.style.zoom = 1;
+			jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
+
+			// Check if elements with layout shrink-wrap their children
+			// (IE 6 does this)
+			div.style.display = "";
+			div.innerHTML = "<div style='width:4px;'></div>";
+			jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
+		}
+
+		div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
+		var tds = div.getElementsByTagName("td");
+
+		// Check if table cells still have offsetWidth/Height when they are set
+		// to display:none and there are still other visible table cells in a
+		// table row; if so, offsetWidth/Height are not reliable for use when
+		// determining if an element has been hidden directly using
+		// display:none (it is still safe to use offsets if a parent element is
+		// hidden; don safety goggles and see bug #4512 for more information).
+		// (only IE 8 fails this test)
+		jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
+
+		tds[0].style.display = "";
+		tds[1].style.display = "none";
+
+		// Check if empty table cells still have offsetWidth/Height
+		// (IE < 8 fail this test)
+		jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
+		div.innerHTML = "";
+
+		document.body.removeChild( div ).style.display = "none";
+		div = tds = null;
+	});
+
+	// Technique from Juriy Zaytsev
+	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
+	var eventSupported = function( eventName ) {
+		var el = document.createElement("div");
+		eventName = "on" + eventName;
+
+		var isSupported = (eventName in el);
+		if ( !isSupported ) {
+			el.setAttribute(eventName, "return;");
+			isSupported = typeof el[eventName] === "function";
+		}
+		el = null;
+
+		return isSupported;
+	};
+
+	jQuery.support.submitBubbles = eventSupported("submit");
+	jQuery.support.changeBubbles = eventSupported("change");
+
+	// release memory in IE
+	root = script = div = all = a = null;
+})();
+
+
+
+var windowData = {},
+	rbrace = /^(?:\{.*\}|\[.*\])$/;
+
+jQuery.extend({
+	cache: {},
+
+	// Please use with caution
+	uuid: 0,
+
+	// Unique for each copy of jQuery on the page	
+	expando: "jQuery" + jQuery.now(),
+
+	// The following elements throw uncatchable exceptions if you
+	// attempt to add expando properties to them.
+	noData: {
+		"embed": true,
+		// Ban all objects except for Flash (which handle expandos)
+		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+		"applet": true
+	},
+
+	data: function( elem, name, data ) {
+		if ( !jQuery.acceptData( elem ) ) {
+			return;
+		}
+
+		elem = elem == window ?
+			windowData :
+			elem;
+
+		var isNode = elem.nodeType,
+			id = isNode ? elem[ jQuery.expando ] : null,
+			cache = jQuery.cache, thisCache;
+
+		if ( isNode && !id && typeof name === "string" && data === undefined ) {
+			return;
+		}
+
+		// Get the data from the object directly
+		if ( !isNode ) {
+			cache = elem;
+
+		// Compute a unique ID for the element
+		} else if ( !id ) {
+			elem[ jQuery.expando ] = id = ++jQuery.uuid;
+		}
+
+		// Avoid generating a new cache unless none exists and we
+		// want to manipulate it.
+		if ( typeof name === "object" ) {
+			if ( isNode ) {
+				cache[ id ] = jQuery.extend(cache[ id ], name);
+
+			} else {
+				jQuery.extend( cache, name );
+			}
+
+		} else if ( isNode && !cache[ id ] ) {
+			cache[ id ] = {};
+		}
+
+		thisCache = isNode ? cache[ id ] : cache;
+
+		// Prevent overriding the named cache with undefined values
+		if ( data !== undefined ) {
+			thisCache[ name ] = data;
+		}
+
+		return typeof name === "string" ? thisCache[ name ] : thisCache;
+	},
+
+	removeData: function( elem, name ) {
+		if ( !jQuery.acceptData( elem ) ) {
+			return;
+		}
+
+		elem = elem == window ?
+			windowData :
+			elem;
+
+		var isNode = elem.nodeType,
+			id = isNode ? elem[ jQuery.expando ] : elem,
+			cache = jQuery.cache,
+			thisCache = isNode ? cache[ id ] : id;
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( thisCache ) {
+				// Remove the section of cache data
+				delete thisCache[ name ];
+
+				// If we've removed all the data, remove the element's cache
+				if ( isNode && jQuery.isEmptyObject(thisCache) ) {
+					jQuery.removeData( elem );
+				}
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			if ( isNode && jQuery.support.deleteExpando ) {
+				delete elem[ jQuery.expando ];
+
+			} else if ( elem.removeAttribute ) {
+				elem.removeAttribute( jQuery.expando );
+
+			// Completely remove the data cache
+			} else if ( isNode ) {
+				delete cache[ id ];
+
+			// Remove all fields from the object
+			} else {
+				for ( var n in elem ) {
+					delete elem[ n ];
+				}
+			}
+		}
+	},
+
+	// A method for determining if a DOM node can handle the data expando
+	acceptData: function( elem ) {
+		if ( elem.nodeName ) {
+			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+			if ( match ) {
+				return !(match === true || elem.getAttribute("classid") !== match);
+			}
+		}
+
+		return true;
+	}
+});
+
+jQuery.fn.extend({
+	data: function( key, value ) {
+		var data = null;
+
+		if ( typeof key === "undefined" ) {
+			if ( this.length ) {
+				var attr = this[0].attributes, name;
+				data = jQuery.data( this[0] );
+
+				for ( var i = 0, l = attr.length; i < l; i++ ) {
+					name = attr[i].name;
+
+					if ( name.indexOf( "data-" ) === 0 ) {
+						name = name.substr( 5 );
+						dataAttr( this[0], name, data[ name ] );
+					}
+				}
+			}
+
+			return data;
+
+		} else if ( typeof key === "object" ) {
+			return this.each(function() {
+				jQuery.data( this, key );
+			});
+		}
+
+		var parts = key.split(".");
+		parts[1] = parts[1] ? "." + parts[1] : "";
+
+		if ( value === undefined ) {
+			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+			// Try to fetch any internally stored data first
+			if ( data === undefined && this.length ) {
+				data = jQuery.data( this[0], key );
+				data = dataAttr( this[0], key, data );
+			}
+
+			return data === undefined && parts[1] ?
+				this.data( parts[0] ) :
+				data;
+
+		} else {
+			return this.each(function() {
+				var $this = jQuery( this ),
+					args = [ parts[0], value ];
+
+				$this.triggerHandler( "setData" + parts[1] + "!", args );
+				jQuery.data( this, key, value );
+				$this.triggerHandler( "changeData" + parts[1] + "!", args );
+			});
+		}
+	},
+
+	removeData: function( key ) {
+		return this.each(function() {
+			jQuery.removeData( this, key );
+		});
+	}
+});
+
+function dataAttr( elem, key, data ) {
+	// If nothing was found internally, try to fetch any
+	// data from the HTML5 data-* attribute
+	if ( data === undefined && elem.nodeType === 1 ) {
+		data = elem.getAttribute( "data-" + key );
+
+		if ( typeof data === "string" ) {
+			try {
+				data = data === "true" ? true :
+				data === "false" ? false :
+				data === "null" ? null :
+				!jQuery.isNaN( data ) ? parseFloat( data ) :
+					rbrace.test( data ) ? jQuery.parseJSON( data ) :
+					data;
+			} catch( e ) {}
+
+			// Make sure we set the data so it isn't changed later
+			jQuery.data( elem, key, data );
+
+		} else {
+			data = undefined;
+		}
+	}
+
+	return data;
+}
+
+
+
+
+jQuery.extend({
+	queue: function( elem, type, data ) {
+		if ( !elem ) {
+			return;
+		}
+
+		type = (type || "fx") + "queue";
+		var q = jQuery.data( elem, type );
+
+		// Speed up dequeue by getting out quickly if this is just a lookup
+		if ( !data ) {
+			return q || [];
+		}
+
+		if ( !q || jQuery.isArray(data) ) {
+			q = jQuery.data( elem, type, jQuery.makeArray(data) );
+
+		} else {
+			q.push( data );
+		}
+
+		return q;
+	},
+
+	dequeue: function( elem, type ) {
+		type = type || "fx";
+
+		var queue = jQuery.queue( elem, type ),
+			fn = queue.shift();
+
+		// If the fx queue is dequeued, always remove the progress sentinel
+		if ( fn === "inprogress" ) {
+			fn = queue.shift();
+		}
+
+		if ( fn ) {
+			// Add a progress sentinel to prevent the fx queue from being
+			// automatically dequeued
+			if ( type === "fx" ) {
+				queue.unshift("inprogress");
+			}
+
+			fn.call(elem, function() {
+				jQuery.dequeue(elem, type);
+			});
+		}
+	}
+});
+
+jQuery.fn.extend({
+	queue: function( type, data ) {
+		if ( typeof type !== "string" ) {
+			data = type;
+			type = "fx";
+		}
+
+		if ( data === undefined ) {
+			return jQuery.queue( this[0], type );
+		}
+		return this.each(function( i ) {
+			var queue = jQuery.queue( this, type, data );
+
+			if ( type === "fx" && queue[0] !== "inprogress" ) {
+				jQuery.dequeue( this, type );
+			}
+		});
+	},
+	dequeue: function( type ) {
+		return this.each(function() {
+			jQuery.dequeue( this, type );
+		});
+	},
+
+	// Based off of the plugin by Clint Helfers, with permission.
+	// http://blindsignals.com/index.php/2009/07/jquery-delay/
+	delay: function( time, type ) {
+		time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
+		type = type || "fx";
+
+		return this.queue( type, function() {
+			var elem = this;
+			setTimeout(function() {
+				jQuery.dequeue( elem, type );
+			}, time );
+		});
+	},
+
+	clearQueue: function( type ) {
+		return this.queue( type || "fx", [] );
+	}
+});
+
+
+
+
+var rclass = /[\n\t]/g,
+	rspaces = /\s+/,
+	rreturn = /\r/g,
+	rspecialurl = /^(?:href|src|style)$/,
+	rtype = /^(?:button|input)$/i,
+	rfocusable = /^(?:button|input|object|select|textarea)$/i,
+	rclickable = /^a(?:rea)?$/i,
+	rradiocheck = /^(?:radio|checkbox)$/i;
+
+jQuery.props = {
+	"for": "htmlFor",
+	"class": "className",
+	readonly: "readOnly",
+	maxlength: "maxLength",
+	cellspacing: "cellSpacing",
+	rowspan: "rowSpan",
+	colspan: "colSpan",
+	tabindex: "tabIndex",
+	usemap: "useMap",
+	frameborder: "frameBorder"
+};
+
+jQuery.fn.extend({
+	attr: function( name, value ) {
+		return jQuery.access( this, name, value, true, jQuery.attr );
+	},
+
+	removeAttr: function( name, fn ) {
+		return this.each(function(){
+			jQuery.attr( this, name, "" );
+			if ( this.nodeType === 1 ) {
+				this.removeAttribute( name );
+			}
+		});
+	},
+
+	addClass: function( value ) {
+		if ( jQuery.isFunction(value) ) {
+			return this.each(function(i) {
+				var self = jQuery(this);
+				self.addClass( value.call(this, i, self.attr("class")) );
+			});
+		}
+
+		if ( value && typeof value === "string" ) {
+			var classNames = (value || "").split( rspaces );
+
+			for ( var i = 0, l = this.length; i < l; i++ ) {
+				var elem = this[i];
+
+				if ( elem.nodeType === 1 ) {
+					if ( !elem.className ) {
+						elem.className = value;
+
+					} else {
+						var className = " " + elem.className + " ",
+							setClass = elem.className;
+
+						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
+								setClass += " " + classNames[c];
+							}
+						}
+						elem.className = jQuery.trim( setClass );
+					}
+				}
+			}
+		}
+
+		return this;
+	},
+
+	removeClass: function( value ) {
+		if ( jQuery.isFunction(value) ) {
+			return this.each(function(i) {
+				var self = jQuery(this);
+				self.removeClass( value.call(this, i, self.attr("class")) );
+			});
+		}
+
+		if ( (value && typeof value === "string") || value === undefined ) {
+			var classNames = (value || "").split( rspaces );
+
+			for ( var i = 0, l = this.length; i < l; i++ ) {
+				var elem = this[i];
+
+				if ( elem.nodeType === 1 && elem.className ) {
+					if ( value ) {
+						var className = (" " + elem.className + " ").replace(rclass, " ");
+						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
+							className = className.replace(" " + classNames[c] + " ", " ");
+						}
+						elem.className = jQuery.trim( className );
+
+					} else {
+						elem.className = "";
+					}
+				}
+			}
+		}
+
+		return this;
+	},
+
+	toggleClass: function( value, stateVal ) {
+		var type = typeof value,
+			isBool = typeof stateVal === "boolean";
+
+		if ( jQuery.isFunction( value ) ) {
+			return this.each(function(i) {
+				var self = jQuery(this);
+				self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+			});
+		}
+
+		return this.each(function() {
+			if ( type === "string" ) {
+				// toggle individual class names
+				var className,
+					i = 0,
+					self = jQuery( this ),
+					state = stateVal,
+					classNames = value.split( rspaces );
+
+				while ( (className = classNames[ i++ ]) ) {
+					// check each className given, space seperated list
+					state = isBool ? state : !self.hasClass( className );
+					self[ state ? "addClass" : "removeClass" ]( className );
+				}
+
+			} else if ( type === "undefined" || type === "boolean" ) {
+				if ( this.className ) {
+					// store className if set
+					jQuery.data( this, "__className__", this.className );
+				}
+
+				// toggle whole className
+				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+			}
+		});
+	},
+
+	hasClass: function( selector ) {
+		var className = " " + selector + " ";
+		for ( var i = 0, l = this.length; i < l; i++ ) {
+			if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+				return true;
+			}
+		}
+
+		return false;
+	},
+
+	val: function( value ) {
+		if ( !arguments.length ) {
+			var elem = this[0];
+
+			if ( elem ) {
+				if ( jQuery.nodeName( elem, "option" ) ) {
+					// attributes.value is undefined in Blackberry 4.7 but
+					// uses .value. See #6932
+					var val = elem.attributes.value;
+					return !val || val.specified ? elem.value : elem.text;
+				}
+
+				// We need to handle select boxes special
+				if ( jQuery.nodeName( elem, "select" ) ) {
+					var index = elem.selectedIndex,
+						values = [],
+						options = elem.options,
+						one = elem.type === "select-one";
+
+					// Nothing was selected
+					if ( index < 0 ) {
+						return null;
+					}
+
+					// Loop through all the selected options
+					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+						var option = options[ i ];
+
+						// Don't return options that are disabled or in a disabled optgroup
+						if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && 
+								(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+							// Get the specific value for the option
+							value = jQuery(option).val();
+
+							// We don't need an array for one selects
+							if ( one ) {
+								return value;
+							}
+
+							// Multi-Selects return an array
+							values.push( value );
+						}
+					}
+
+					return values;
+				}
+
+				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
+					return elem.getAttribute("value") === null ? "on" : elem.value;
+				}
+				
+
+				// Everything else, we just grab the value
+				return (elem.value || "").replace(rreturn, "");
+
+			}
+
+			return undefined;
+		}
+
+		var isFunction = jQuery.isFunction(value);
+
+		return this.each(function(i) {
+			var self = jQuery(this), val = value;
+
+			if ( this.nodeType !== 1 ) {
+				return;
+			}
+
+			if ( isFunction ) {
+				val = value.call(this, i, self.val());
+			}
+
+			// Treat null/undefined as ""; convert numbers to string
+			if ( val == null ) {
+				val = "";
+			} else if ( typeof val === "number" ) {
+				val += "";
+			} else if ( jQuery.isArray(val) ) {
+				val = jQuery.map(val, function (value) {
+					return value == null ? "" : value + "";
+				});
+			}
+
+			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
+				this.checked = jQuery.inArray( self.val(), val ) >= 0;
+
+			} else if ( jQuery.nodeName( this, "select" ) ) {
+				var values = jQuery.makeArray(val);
+
+				jQuery( "option", this ).each(function() {
+					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+				});
+
+				if ( !values.length ) {
+					this.selectedIndex = -1;
+				}
+
+			} else {
+				this.value = val;
+			}
+		});
+	}
+});
+
+jQuery.extend({
+	attrFn: {
+		val: true,
+		css: true,
+		html: true,
+		text: true,
+		data: true,
+		width: true,
+		height: true,
+		offset: true
+	},
+		
+	attr: function( elem, name, value, pass ) {
+		// don't set attributes on text and comment nodes
+		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+			return undefined;
+		}
+
+		if ( pass && name in jQuery.attrFn ) {
+			return jQuery(elem)[name](value);
+		}
+
+		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
+			// Whether we are setting (or getting)
+			set = value !== undefined;
+
+		// Try to normalize/fix the name
+		name = notxml && jQuery.props[ name ] || name;
+
+		// These attributes require special treatment
+		var special = rspecialurl.test( name );
+
+		// Safari mis-reports the default selected property of an option
+		// Accessing the parent's selectedIndex property fixes it
+		if ( name === "selected" && !jQuery.support.optSelected ) {
+			var parent = elem.parentNode;
+			if ( parent ) {
+				parent.selectedIndex;
+
+				// Make sure that it also works with optgroups, see #5701
+				if ( parent.parentNode ) {
+					parent.parentNode.selectedIndex;
+				}
+			}
+		}
+
+		// If applicable, access the attribute via the DOM 0 way
+		// 'in' checks fail in Blackberry 4.7 #6931
+		if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) {
+			if ( set ) {
+				// We can't allow the type property to be changed (since it causes problems in IE)
+				if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
+					jQuery.error( "type property can't be changed" );
+				}
+
+				if ( value === null ) {
+					if ( elem.nodeType === 1 ) {
+						elem.removeAttribute( name );
+					}
+
+				} else {
+					elem[ name ] = value;
+				}
+			}
+
+			// browsers index elements by id/name on forms, give priority to attributes.
+			if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
+				return elem.getAttributeNode( name ).nodeValue;
+			}
+
+			// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+			// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+			if ( name === "tabIndex" ) {
+				var attributeNode = elem.getAttributeNode( "tabIndex" );
+
+				return attributeNode && attributeNode.specified ?
+					attributeNode.value :
+					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+						0 :
+						undefined;
+			}
+
+			return elem[ name ];
+		}
+
+		if ( !jQuery.support.style && notxml && name === "style" ) {
+			if ( set ) {
+				elem.style.cssText = "" + value;
+			}
+
+			return elem.style.cssText;
+		}
+
+		if ( set ) {
+			// convert the value to a string (all browsers do this but IE) see #1070
+			elem.setAttribute( name, "" + value );
+		}
+
+		// Ensure that missing attributes return undefined
+		// Blackberry 4.7 returns "" from getAttribute #6938
+		if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) {
+			return undefined;
+		}
+
+		var attr = !jQuery.support.hrefNormalized && notxml && special ?
+				// Some attributes require a special call on IE
+				elem.getAttribute( name, 2 ) :
+				elem.getAttribute( name );
+
+		// Non-existent attributes return null, we normalize to undefined
+		return attr === null ? undefined : attr;
+	}
+});
+
+
+
+
+var rnamespaces = /\.(.*)$/,
+	rformElems = /^(?:textarea|input|select)$/i,
+	rperiod = /\./g,
+	rspace = / /g,
+	rescape = /[^\w\s.|`]/g,
+	fcleanup = function( nm ) {
+		return nm.replace(rescape, "\\$&");
+	},
+	focusCounts = { focusin: 0, focusout: 0 };
+
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+	// Bind an event to an element
+	// Original by Dean Edwards
+	add: function( elem, types, handler, data ) {
+		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+			return;
+		}
+
+		// For whatever reason, IE has trouble passing the window object
+		// around, causing it to be cloned in the process
+		if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) {
+			elem = window;
+		}
+
+		if ( handler === false ) {
+			handler = returnFalse;
+		} else if ( !handler ) {
+			// Fixes bug #7229. Fix recommended by jdalton
+		  return;
+		}
+
+		var handleObjIn, handleObj;
+
+		if ( handler.handler ) {
+			handleObjIn = handler;
+			handler = handleObjIn.handler;
+		}
+
+		// Make sure that the function being executed has a unique ID
+		if ( !handler.guid ) {
+			handler.guid = jQuery.guid++;
+		}
+
+		// Init the element's event structure
+		var elemData = jQuery.data( elem );
+
+		// If no elemData is found then we must be trying to bind to one of the
+		// banned noData elements
+		if ( !elemData ) {
+			return;
+		}
+
+		// Use a key less likely to result in collisions for plain JS objects.
+		// Fixes bug #7150.
+		var eventKey = elem.nodeType ? "events" : "__events__",
+			events = elemData[ eventKey ],
+			eventHandle = elemData.handle;
+			
+		if ( typeof events === "function" ) {
+			// On plain objects events is a fn that holds the the data
+			// which prevents this data from being JSON serialized
+			// the function does not need to be called, it just contains the data
+			eventHandle = events.handle;
+			events = events.events;
+
+		} else if ( !events ) {
+			if ( !elem.nodeType ) {
+				// On plain objects, create a fn that acts as the holder
+				// of the values to avoid JSON serialization of event data
+				elemData[ eventKey ] = elemData = function(){};
+			}
+
+			elemData.events = events = {};
+		}
+
+		if ( !eventHandle ) {
+			elemData.handle = eventHandle = function() {
+				// Handle the second event of a trigger and when
+				// an event is called after a page has unloaded
+				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+					jQuery.event.handle.apply( eventHandle.elem, arguments ) :
+					undefined;
+			};
+		}
+
+		// Add elem as a property of the handle function
+		// This is to prevent a memory leak with non-native events in IE.
+		eventHandle.elem = elem;
+
+		// Handle multiple events separated by a space
+		// jQuery(...).bind("mouseover mouseout", fn);
+		types = types.split(" ");
+
+		var type, i = 0, namespaces;
+
+		while ( (type = types[ i++ ]) ) {
+			handleObj = handleObjIn ?
+				jQuery.extend({}, handleObjIn) :
+				{ handler: handler, data: data };
+
+			// Namespaced event handlers
+			if ( type.indexOf(".") > -1 ) {
+				namespaces = type.split(".");
+				type = namespaces.shift();
+				handleObj.namespace = namespaces.slice(0).sort().join(".");
+
+			} else {
+				namespaces = [];
+				handleObj.namespace = "";
+			}
+
+			handleObj.type = type;
+			if ( !handleObj.guid ) {
+				handleObj.guid = handler.guid;
+			}
+
+			// Get the current list of functions bound to this event
+			var handlers = events[ type ],
+				special = jQuery.event.special[ type ] || {};
+
+			// Init the event handler queue
+			if ( !handlers ) {
+				handlers = events[ type ] = [];
+
+				// Check for a special event handler
+				// Only use addEventListener/attachEvent if the special
+				// events handler returns false
+				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+					// Bind the global event handler to the element
+					if ( elem.addEventListener ) {
+						elem.addEventListener( type, eventHandle, false );
+
+					} else if ( elem.attachEvent ) {
+						elem.attachEvent( "on" + type, eventHandle );
+					}
+				}
+			}
+			
+			if ( special.add ) { 
+				special.add.call( elem, handleObj ); 
+
+				if ( !handleObj.handler.guid ) {
+					handleObj.handler.guid = handler.guid;
+				}
+			}
+
+			// Add the function to the element's handler list
+			handlers.push( handleObj );
+
+			// Keep track of which events have been used, for global triggering
+			jQuery.event.global[ type ] = true;
+		}
+
+		// Nullify elem to prevent memory leaks in IE
+		elem = null;
+	},
+
+	global: {},
+
+	// Detach an event or set of events from an element
+	remove: function( elem, types, handler, pos ) {
+		// don't do events on text and comment nodes
+		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+			return;
+		}
+
+		if ( handler === false ) {
+			handler = returnFalse;
+		}
+
+		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+			eventKey = elem.nodeType ? "events" : "__events__",
+			elemData = jQuery.data( elem ),
+			events = elemData && elemData[ eventKey ];
+
+		if ( !elemData || !events ) {
+			return;
+		}
+		
+		if ( typeof events === "function" ) {
+			elemData = events;
+			events = events.events;
+		}
+
+		// types is actually an event object here
+		if ( types && types.type ) {
+			handler = types.handler;
+			types = types.type;
+		}
+
+		// Unbind all events for the element
+		if ( !types || typeof types === "string" && types.charAt(0) === "." ) {
+			types = types || "";
+
+			for ( type in events ) {
+				jQuery.event.remove( elem, type + types );
+			}
+
+			return;
+		}
+
+		// Handle multiple events separated by a space
+		// jQuery(...).unbind("mouseover mouseout", fn);
+		types = types.split(" ");
+
+		while ( (type = types[ i++ ]) ) {
+			origType = type;
+			handleObj = null;
+			all = type.indexOf(".") < 0;
+			namespaces = [];
+
+			if ( !all ) {
+				// Namespaced event handlers
+				namespaces = type.split(".");
+				type = namespaces.shift();
+
+				namespace = new RegExp("(^|\\.)" + 
+					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
+			}
+
+			eventType = events[ type ];
+
+			if ( !eventType ) {
+				continue;
+			}
+
+			if ( !handler ) {
+				for ( j = 0; j < eventType.length; j++ ) {
+					handleObj = eventType[ j ];
+
+					if ( all || namespace.test( handleObj.namespace ) ) {
+						jQuery.event.remove( elem, origType, handleObj.handler, j );
+						eventType.splice( j--, 1 );
+					}
+				}
+
+				continue;
+			}
+
+			special = jQuery.event.special[ type ] || {};
+
+			for ( j = pos || 0; j < eventType.length; j++ ) {
+				handleObj = eventType[ j ];
+
+				if ( handler.guid === handleObj.guid ) {
+					// remove the given handler for the given type
+					if ( all || namespace.test( handleObj.namespace ) ) {
+						if ( pos == null ) {
+							eventType.splice( j--, 1 );
+						}
+
+						if ( special.remove ) {
+							special.remove.call( elem, handleObj );
+						}
+					}
+
+					if ( pos != null ) {
+						break;
+					}
+				}
+			}
+
+			// remove generic event handler if no more handlers exist
+			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
+				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+					jQuery.removeEvent( elem, type, elemData.handle );
+				}
+
+				ret = null;
+				delete events[ type ];
+			}
+		}
+
+		// Remove the expando if it's no longer used
+		if ( jQuery.isEmptyObject( events ) ) {
+			var handle = elemData.handle;
+			if ( handle ) {
+				handle.elem = null;
+			}
+
+			delete elemData.events;
+			delete elemData.handle;
+
+			if ( typeof elemData === "function" ) {
+				jQuery.removeData( elem, eventKey );
+
+			} else if ( jQuery.isEmptyObject( elemData ) ) {
+				jQuery.removeData( elem );
+			}
+		}
+	},
+
+	// bubbling is internal
+	trigger: function( event, data, elem /*, bubbling */ ) {
+		// Event object or event type
+		var type = event.type || event,
+			bubbling = arguments[3];
+
+		if ( !bubbling ) {
+			event = typeof event === "object" ?
+				// jQuery.Event object
+				event[ jQuery.expando ] ? event :
+				// Object literal
+				jQuery.extend( jQuery.Event(type), event ) :
+				// Just the event type (string)
+				jQuery.Event(type);
+
+			if ( type.indexOf("!") >= 0 ) {
+				event.type = type = type.slice(0, -1);
+				event.exclusive = true;
+			}
+
+			// Handle a global trigger
+			if ( !elem ) {
+				// Don't bubble custom events when global (to avoid too much overhead)
+				event.stopPropagation();
+
+				// Only trigger if we've ever bound an event for it
+				if ( jQuery.event.global[ type ] ) {
+					jQuery.each( jQuery.cache, function() {
+						if ( this.events && this.events[type] ) {
+							jQuery.event.trigger( event, data, this.handle.elem );
+						}
+					});
+				}
+			}
+
+			// Handle triggering a single element
+
+			// don't do events on text and comment nodes
+			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+				return undefined;
+			}
+
+			// Clean up in case it is reused
+			event.result = undefined;
+			event.target = elem;
+
+			// Clone the incoming data, if any
+			data = jQuery.makeArray( data );
+			data.unshift( event );
+		}
+
+		event.currentTarget = elem;
+
+		// Trigger the event, it is assumed that "handle" is a function
+		var handle = elem.nodeType ?
+			jQuery.data( elem, "handle" ) :
+			(jQuery.data( elem, "__events__" ) || {}).handle;
+
+		if ( handle ) {
+			handle.apply( elem, data );
+		}
+
+		var parent = elem.parentNode || elem.ownerDocument;
+
+		// Trigger an inline bound script
+		try {
+			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
+				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
+					event.result = false;
+					event.preventDefault();
+				}
+			}
+
+		// prevent IE from throwing an error for some elements with some event types, see #3533
+		} catch (inlineError) {}
+
+		if ( !event.isPropagationStopped() && parent ) {
+			jQuery.event.trigger( event, data, parent, true );
+
+		} else if ( !event.isDefaultPrevented() ) {
+			var old,
+				target = event.target,
+				targetType = type.replace( rnamespaces, "" ),
+				isClick = jQuery.nodeName( target, "a" ) && targetType === "click",
+				special = jQuery.event.special[ targetType ] || {};
+
+			if ( (!special._default || special._default.call( elem, event ) === false) && 
+				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
+
+				try {
+					if ( target[ targetType ] ) {
+						// Make sure that we don't accidentally re-trigger the onFOO events
+						old = target[ "on" + targetType ];
+
+						if ( old ) {
+							target[ "on" + targetType ] = null;
+						}
+
+						jQuery.event.triggered = true;
+						target[ targetType ]();
+					}
+
+				// prevent IE from throwing an error for some elements with some event types, see #3533
+				} catch (triggerError) {}
+
+				if ( old ) {
+					target[ "on" + targetType ] = old;
+				}
+
+				jQuery.event.triggered = false;
+			}
+		}
+	},
+
+	handle: function( event ) {
+		var all, handlers, namespaces, namespace_re, events,
+			namespace_sort = [],
+			args = jQuery.makeArray( arguments );
+
+		event = args[0] = jQuery.event.fix( event || window.event );
+		event.currentTarget = this;
+
+		// Namespaced event handlers
+		all = event.type.indexOf(".") < 0 && !event.exclusive;
+
+		if ( !all ) {
+			namespaces = event.type.split(".");
+			event.type = namespaces.shift();
+			namespace_sort = namespaces.slice(0).sort();
+			namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)");
+		}
+
+		event.namespace = event.namespace || namespace_sort.join(".");
+
+		events = jQuery.data(this, this.nodeType ? "events" : "__events__");
+
+		if ( typeof events === "function" ) {
+			events = events.events;
+		}
+
+		handlers = (events || {})[ event.type ];
+
+		if ( events && handlers ) {
+			// Clone the handlers to prevent manipulation
+			handlers = handlers.slice(0);
+
+			for ( var j = 0, l = handlers.length; j < l; j++ ) {
+				var handleObj = handlers[ j ];
+
+				// Filter the functions by class
+				if ( all || namespace_re.test( handleObj.namespace ) ) {
+					// Pass in a reference to the handler function itself
+					// So that we can later remove it
+					event.handler = handleObj.handler;
+					event.data = handleObj.data;
+					event.handleObj = handleObj;
+	
+					var ret = handleObj.handler.apply( this, args );
+
+					if ( ret !== undefined ) {
+						event.result = ret;
+						if ( ret === false ) {
+							event.preventDefault();
+							event.stopPropagation();
+						}
+					}
+
+					if ( event.isImmediatePropagationStopped() ) {
+						break;
+					}
+				}
+			}
+		}
+
+		return event.result;
+	},
+
+	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+
+	fix: function( event ) {
+		if ( event[ jQuery.expando ] ) {
+			return event;
+		}
+
+		// store a copy of the original event object
+		// and "clone" to set read-only properties
+		var originalEvent = event;
+		event = jQuery.Event( originalEvent );
+
+		for ( var i = this.props.length, prop; i; ) {
+			prop = this.props[ --i ];
+			event[ prop ] = originalEvent[ prop ];
+		}
+
+		// Fix target property, if necessary
+		if ( !event.target ) {
+			// Fixes #1925 where srcElement might not be defined either
+			event.target = event.srcElement || document;
+		}
+
+		// check if target is a textnode (safari)
+		if ( event.target.nodeType === 3 ) {
+			event.target = event.target.parentNode;
+		}
+
+		// Add relatedTarget, if necessary
+		if ( !event.relatedTarget && event.fromElement ) {
+			event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;
+		}
+
+		// Calculate pageX/Y if missing and clientX/Y available
+		if ( event.pageX == null && event.clientX != null ) {
+			var doc = document.documentElement,
+				body = document.body;
+
+			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
+		}
+
+		// Add which for key events
+		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+			event.which = event.charCode != null ? event.charCode : event.keyCode;
+		}
+
+		// Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+		if ( !event.metaKey && event.ctrlKey ) {
+			event.metaKey = event.ctrlKey;
+		}
+
+		// Add which for click: 1 === left; 2 === middle; 3 === right
+		// Note: button is not normalized, so don't use it
+		if ( !event.which && event.button !== undefined ) {
+			event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+		}
+
+		return event;
+	},
+
+	// Deprecated, use jQuery.guid instead
+	guid: 1E8,
+
+	// Deprecated, use jQuery.proxy instead
+	proxy: jQuery.proxy,
+
+	special: {
+		ready: {
+			// Make sure the ready event is setup
+			setup: jQuery.bindReady,
+			teardown: jQuery.noop
+		},
+
+		live: {
+			add: function( handleObj ) {
+				jQuery.event.add( this,
+					liveConvert( handleObj.origType, handleObj.selector ),
+					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); 
+			},
+
+			remove: function( handleObj ) {
+				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+			}
+		},
+
+		beforeunload: {
+			setup: function( data, namespaces, eventHandle ) {
+				// We only want to do this special case on windows
+				if ( jQuery.isWindow( this ) ) {
+					this.onbeforeunload = eventHandle;
+				}
+			},
+
+			teardown: function( namespaces, eventHandle ) {
+				if ( this.onbeforeunload === eventHandle ) {
+					this.onbeforeunload = null;
+				}
+			}
+		}
+	}
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+	function( elem, type, handle ) {
+		if ( elem.removeEventListener ) {
+			elem.removeEventListener( type, handle, false );
+		}
+	} : 
+	function( elem, type, handle ) {
+		if ( elem.detachEvent ) {
+			elem.detachEvent( "on" + type, handle );
+		}
+	};
+
+jQuery.Event = function( src ) {
+	// Allow instantiation without the 'new' keyword
+	if ( !this.preventDefault ) {
+		return new jQuery.Event( src );
+	}
+
+	// Event object
+	if ( src && src.type ) {
+		this.originalEvent = src;
+		this.type = src.type;
+	// Event type
+	} else {
+		this.type = src;
+	}
+
+	// timeStamp is buggy for some events on Firefox(#3843)
+	// So we won't rely on the native value
+	this.timeStamp = jQuery.now();
+
+	// Mark it as fixed
+	this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+	return false;
+}
+function returnTrue() {
+	return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+	preventDefault: function() {
+		this.isDefaultPrevented = returnTrue;
+
+		var e = this.originalEvent;
+		if ( !e ) {
+			return;
+		}
+		
+		// if preventDefault exists run it on the original event
+		if ( e.preventDefault ) {
+			e.preventDefault();
+
+		// otherwise set the returnValue property of the original event to false (IE)
+		} else {
+			e.returnValue = false;
+		}
+	},
+	stopPropagation: function() {
+		this.isPropagationStopped = returnTrue;
+
+		var e = this.originalEvent;
+		if ( !e ) {
+			return;
+		}
+		// if stopPropagation exists run it on the original event
+		if ( e.stopPropagation ) {
+			e.stopPropagation();
+		}
+		// otherwise set the cancelBubble property of the original event to true (IE)
+		e.cancelBubble = true;
+	},
+	stopImmediatePropagation: function() {
+		this.isImmediatePropagationStopped = returnTrue;
+		this.stopPropagation();
+	},
+	isDefaultPrevented: returnFalse,
+	isPropagationStopped: returnFalse,
+	isImmediatePropagationStopped: returnFalse
+};
+
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function( event ) {
+	// Check if mouse(over|out) are still within the same parent element
+	var parent = event.relatedTarget;
+
+	// Firefox sometimes assigns relatedTarget a XUL element
+	// which we cannot access the parentNode property of
+	try {
+		// Traverse up the tree
+		while ( parent && parent !== this ) {
+			parent = parent.parentNode;
+		}
+
+		if ( parent !== this ) {
+			// set the correct event type
+			event.type = event.data;
+
+			// handle event if we actually just moused on to a non sub-element
+			jQuery.event.handle.apply( this, arguments );
+		}
+
+	// assuming we've left the element since we most likely mousedover a xul element
+	} catch(e) { }
+},
+
+// In case of event delegation, we only need to rename the event.type,
+// liveHandler will take care of the rest.
+delegate = function( event ) {
+	event.type = event.data;
+	jQuery.event.handle.apply( this, arguments );
+};
+
+// Create mouseenter and mouseleave events
+jQuery.each({
+	mouseenter: "mouseover",
+	mouseleave: "mouseout"
+}, function( orig, fix ) {
+	jQuery.event.special[ orig ] = {
+		setup: function( data ) {
+			jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig );
+		},
+		teardown: function( data ) {
+			jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement );
+		}
+	};
+});
+
+// submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+	jQuery.event.special.submit = {
+		setup: function( data, namespaces ) {
+			if ( this.nodeName.toLowerCase() !== "form" ) {
+				jQuery.event.add(this, "click.specialSubmit", function( e ) {
+					var elem = e.target,
+						type = elem.type;
+
+					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
+						e.liveFired = undefined;
+						return trigger( "submit", this, arguments );
+					}
+				});
+	 
+				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
+					var elem = e.target,
+						type = elem.type;
+
+					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
+						e.liveFired = undefined;
+						return trigger( "submit", this, arguments );
+					}
+				});
+
+			} else {
+				return false;
+			}
+		},
+
+		teardown: function( namespaces ) {
+			jQuery.event.remove( this, ".specialSubmit" );
+		}
+	};
+
+}
+
+// change delegation, happens here so we have bind.
+if ( !jQuery.support.changeBubbles ) {
+
+	var changeFilters,
+
+	getVal = function( elem ) {
+		var type = elem.type, val = elem.value;
+
+		if ( type === "radio" || type === "checkbox" ) {
+			val = elem.checked;
+
+		} else if ( type === "select-multiple" ) {
+			val = elem.selectedIndex > -1 ?
+				jQuery.map( elem.options, function( elem ) {
+					return elem.selected;
+				}).join("-") :
+				"";
+
+		} else if ( elem.nodeName.toLowerCase() === "select" ) {
+			val = elem.selectedIndex;
+		}
+
+		return val;
+	},
+
+	testChange = function testChange( e ) {
+		var elem = e.target, data, val;
+
+		if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
+			return;
+		}
+
+		data = jQuery.data( elem, "_change_data" );
+		val = getVal(elem);
+
+		// the current data will be also retrieved by beforeactivate
+		if ( e.type !== "focusout" || elem.type !== "radio" ) {
+			jQuery.data( elem, "_change_data", val );
+		}
+		
+		if ( data === undefined || val === data ) {
+			return;
+		}
+
+		if ( data != null || val ) {
+			e.type = "change";
+			e.liveFired = undefined;
+			return jQuery.event.trigger( e, arguments[1], elem );
+		}
+	};
+
+	jQuery.event.special.change = {
+		filters: {
+			focusout: testChange, 
+
+			beforedeactivate: testChange,
+
+			click: function( e ) {
+				var elem = e.target, type = elem.type;
+
+				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
+					return testChange.call( this, e );
+				}
+			},
+
+			// Change has to be called before submit
+			// Keydown will be called before keypress, which is used in submit-event delegation
+			keydown: function( e ) {
+				var elem = e.target, type = elem.type;
+
+				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
+					type === "select-multiple" ) {
+					return testChange.call( this, e );
+				}
+			},
+
+			// Beforeactivate happens also before the previous element is blurred
+			// with this event you can't trigger a change event, but you can store
+			// information
+			beforeactivate: function( e ) {
+				var elem = e.target;
+				jQuery.data( elem, "_change_data", getVal(elem) );
+			}
+		},
+
+		setup: function( data, namespaces ) {
+			if ( this.type === "file" ) {
+				return false;
+			}
+
+			for ( var type in changeFilters ) {
+				jQuery.event.add( this, type + ".specialChange", changeFilters[type] );
+			}
+
+			return rformElems.test( this.nodeName );
+		},
+
+		teardown: function( namespaces ) {
+			jQuery.event.remove( this, ".specialChange" );
+
+			return rformElems.test( this.nodeName );
+		}
+	};
+
+	changeFilters = jQuery.event.special.change.filters;
+
+	// Handle when the input is .focus()'d
+	changeFilters.focus = changeFilters.beforeactivate;
+}
+
+function trigger( type, elem, args ) {
+	args[0].type = type;
+	return jQuery.event.handle.apply( elem, args );
+}
+
+// Create "bubbling" focus and blur events
+if ( document.addEventListener ) {
+	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+		jQuery.event.special[ fix ] = {
+			setup: function() {
+				if ( focusCounts[fix]++ === 0 ) {
+					document.addEventListener( orig, handler, true );
+				}
+			}, 
+			teardown: function() { 
+				if ( --focusCounts[fix] === 0 ) {
+					document.removeEventListener( orig, handler, true );
+				}
+			}
+		};
+
+		function handler( e ) { 
+			e = jQuery.event.fix( e );
+			e.type = fix;
+			return jQuery.event.trigger( e, null, e.target );
+		}
+	});
+}
+
+jQuery.each(["bind", "one"], function( i, name ) {
+	jQuery.fn[ name ] = function( type, data, fn ) {
+		// Handle object literals
+		if ( typeof type === "object" ) {
+			for ( var key in type ) {
+				this[ name ](key, data, type[key], fn);
+			}
+			return this;
+		}
+		
+		if ( jQuery.isFunction( data ) || data === false ) {
+			fn = data;
+			data = undefined;
+		}
+
+		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
+			jQuery( this ).unbind( event, handler );
+			return fn.apply( this, arguments );
+		}) : fn;
+
+		if ( type === "unload" && name !== "one" ) {
+			this.one( type, data, fn );
+
+		} else {
+			for ( var i = 0, l = this.length; i < l; i++ ) {
+				jQuery.event.add( this[i], type, handler, data );
+			}
+		}
+
+		return this;
+	};
+});
+
+jQuery.fn.extend({
+	unbind: function( type, fn ) {
+		// Handle object literals
+		if ( typeof type === "object" && !type.preventDefault ) {
+			for ( var key in type ) {
+				this.unbind(key, type[key]);
+			}
+
+		} else {
+			for ( var i = 0, l = this.length; i < l; i++ ) {
+				jQuery.event.remove( this[i], type, fn );
+			}
+		}
+
+		return this;
+	},
+	
+	delegate: function( selector, types, data, fn ) {
+		return this.live( types, data, fn, selector );
+	},
+	
+	undelegate: function( selector, types, fn ) {
+		if ( arguments.length === 0 ) {
+				return this.unbind( "live" );
+		
+		} else {
+			return this.die( types, null, fn, selector );
+		}
+	},
+	
+	trigger: function( type, data ) {
+		return this.each(function() {
+			jQuery.event.trigger( type, data, this );
+		});
+	},
+
+	triggerHandler: function( type, data ) {
+		if ( this[0] ) {
+			var event = jQuery.Event( type );
+			event.preventDefault();
+			event.stopPropagation();
+			jQuery.event.trigger( event, data, this[0] );
+			return event.result;
+		}
+	},
+
+	toggle: function( fn ) {
+		// Save reference to arguments for access in closure
+		var args = arguments,
+			i = 1;
+
+		// link all the functions, so any of them can unbind this click handler
+		while ( i < args.length ) {
+			jQuery.proxy( fn, args[ i++ ] );
+		}
+
+		return this.click( jQuery.proxy( fn, function( event ) {
+			// Figure out which function to execute
+			var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+			jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+			// Make sure that clicks stop
+			event.preventDefault();
+
+			// and execute the function
+			return args[ lastToggle ].apply( this, arguments ) || false;
+		}));
+	},
+
+	hover: function( fnOver, fnOut ) {
+		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+	}
+});
+
+var liveMap = {
+	focus: "focusin",
+	blur: "focusout",
+	mouseenter: "mouseover",
+	mouseleave: "mouseout"
+};
+
+jQuery.each(["live", "die"], function( i, name ) {
+	jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) {
+		var type, i = 0, match, namespaces, preType,
+			selector = origSelector || this.selector,
+			context = origSelector ? this : jQuery( this.context );
+		
+		if ( typeof types === "object" && !types.preventDefault ) {
+			for ( var key in types ) {
+				context[ name ]( key, data, types[key], selector );
+			}
+			
+			return this;
+		}
+
+		if ( jQuery.isFunction( data ) ) {
+			fn = data;
+			data = undefined;
+		}
+
+		types = (types || "").split(" ");
+
+		while ( (type = types[ i++ ]) != null ) {
+			match = rnamespaces.exec( type );
+			namespaces = "";
+
+			if ( match )  {
+				namespaces = match[0];
+				type = type.replace( rnamespaces, "" );
+			}
+
+			if ( type === "hover" ) {
+				types.push( "mouseenter" + namespaces, "mouseleave" + namespaces );
+				continue;
+			}
+
+			preType = type;
+
+			if ( type === "focus" || type === "blur" ) {
+				types.push( liveMap[ type ] + namespaces );
+				type = type + namespaces;
+
+			} else {
+				type = (liveMap[ type ] || type) + namespaces;
+			}
+
+			if ( name === "live" ) {
+				// bind live handler
+				for ( var j = 0, l = context.length; j < l; j++ ) {
+					jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
+						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
+				}
+
+			} else {
+				// unbind live handler
+				context.unbind( "live." + liveConvert( type, selector ), fn );
+			}
+		}
+		
+		return this;
+	};
+});
+
+function liveHandler( event ) {
+	var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+		elems = [],
+		selectors = [],
+		events = jQuery.data( this, this.nodeType ? "events" : "__events__" );
+
+	if ( typeof events === "function" ) {
+		events = events.events;
+	}
+
+	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
+	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
+		return;
+	}
+	
+	if ( event.namespace ) {
+		namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
+	}
+
+	event.liveFired = this;
+
+	var live = events.live.slice(0);
+
+	for ( j = 0; j < live.length; j++ ) {
+		handleObj = live[j];
+
+		if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) {
+			selectors.push( handleObj.selector );
+
+		} else {
+			live.splice( j--, 1 );
+		}
+	}
+
+	match = jQuery( event.target ).closest( selectors, event.currentTarget );
+
+	for ( i = 0, l = match.length; i < l; i++ ) {
+		close = match[i];
+
+		for ( j = 0; j < live.length; j++ ) {
+			handleObj = live[j];
+
+			if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) {
+				elem = close.elem;
+				related = null;
+
+				// Those two events require additional checking
+				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+					event.type = handleObj.preType;
+					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+				}
+
+				if ( !related || related !== elem ) {
+					elems.push({ elem: elem, handleObj: handleObj, level: close.level });
+				}
+			}
+		}
+	}
+
+	for ( i = 0, l = elems.length; i < l; i++ ) {
+		match = elems[i];
+
+		if ( maxLevel && match.level > maxLevel ) {
+			break;
+		}
+
+		event.currentTarget = match.elem;
+		event.data = match.handleObj.data;
+		event.handleObj = match.handleObj;
+
+		ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+		if ( ret === false || event.isPropagationStopped() ) {
+			maxLevel = match.level;
+
+			if ( ret === false ) {
+				stop = false;
+			}
+			if ( event.isImmediatePropagationStopped() ) {
+				break;
+			}
+		}
+	}
+
+	return stop;
+}
+
+function liveConvert( type, selector ) {
+	return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&");
+}
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+	"change select submit keydown keypress keyup error").split(" "), function( i, name ) {
+
+	// Handle event binding
+	jQuery.fn[ name ] = function( data, fn ) {
+		if ( fn == null ) {
+			fn = data;
+			data = null;
+		}
+
+		return arguments.length > 0 ?
+			this.bind( name, data, fn ) :
+			this.trigger( name );
+	};
+
+	if ( jQuery.attrFn ) {
+		jQuery.attrFn[ name ] = true;
+	}
+});
+
+// Prevent memory leaks in IE
+// Window isn't included so as not to unbind existing unload events
+// More info:
+//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
+if ( window.attachEvent && !window.addEventListener ) {
+	jQuery(window).bind("unload", function() {
+		for ( var id in jQuery.cache ) {
+			if ( jQuery.cache[ id ].handle ) {
+				// Try/Catch is to handle iframes being unloaded, see #4280
+				try {
+					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+				} catch(e) {}
+			}
+		}
+	});
+}
+
+
+/*!
+ * Sizzle CSS Selector Engine - v1.0
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){
+
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+	done = 0,
+	toString = Object.prototype.toString,
+	hasDuplicate = false,
+	baseHasDuplicate = true;
+
+// Here we check if the JavaScript engine is using some sort of
+// optimization where it does not always call our comparision
+// function. If that is the case, discard the hasDuplicate value.
+//   Thus far that includes Google Chrome.
+[0, 0].sort(function() {
+	baseHasDuplicate = false;
+	return 0;
+});
+
+var Sizzle = function( selector, context, results, seed ) {
+	results = results || [];
+	context = context || document;
+
+	var origContext = context;
+
+	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
+		return [];
+	}
+	
+	if ( !selector || typeof selector !== "string" ) {
+		return results;
+	}
+
+	var m, set, checkSet, extra, ret, cur, pop, i,
+		prune = true,
+		contextXML = Sizzle.isXML( context ),
+		parts = [],
+		soFar = selector;
+	
+	// Reset the position of the chunker regexp (start from head)
+	do {
+		chunker.exec( "" );
+		m = chunker.exec( soFar );
+
+		if ( m ) {
+			soFar = m[3];
+		
+			parts.push( m[1] );
+		
+			if ( m[2] ) {
+				extra = m[3];
+				break;
+			}
+		}
+	} while ( m );
+
+	if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
+		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+			set = posProcess( parts[0] + parts[1], context );
+
+		} else {
+			set = Expr.relative[ parts[0] ] ?
+				[ context ] :
+				Sizzle( parts.shift(), context );
+
+			while ( parts.length ) {
+				selector = parts.shift();
+
+				if ( Expr.relative[ selector ] ) {
+					selector += parts.shift();
+				}
+				
+				set = posProcess( selector, set );
+			}
+		}
+
+	} else {
+		// Take a shortcut and set the context if the root selector is an ID
+		// (but not if it'll be faster if the inner selector is an ID)
+		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
+				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+
+			ret = Sizzle.find( parts.shift(), context, contextXML );
+			context = ret.expr ?
+				Sizzle.filter( ret.expr, ret.set )[0] :
+				ret.set[0];
+		}
+
+		if ( context ) {
+			ret = seed ?
+				{ expr: parts.pop(), set: makeArray(seed) } :
+				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+
+			set = ret.expr ?
+				Sizzle.filter( ret.expr, ret.set ) :
+				ret.set;
+
+			if ( parts.length > 0 ) {
+				checkSet = makeArray( set );
+
+			} else {
+				prune = false;
+			}
+
+			while ( parts.length ) {
+				cur = parts.pop();
+				pop = cur;
+
+				if ( !Expr.relative[ cur ] ) {
+					cur = "";
+				} else {
+					pop = parts.pop();
+				}
+
+				if ( pop == null ) {
+					pop = context;
+				}
+
+				Expr.relative[ cur ]( checkSet, pop, contextXML );
+			}
+
+		} else {
+			checkSet = parts = [];
+		}
+	}
+
+	if ( !checkSet ) {
+		checkSet = set;
+	}
+
+	if ( !checkSet ) {
+		Sizzle.error( cur || selector );
+	}
+
+	if ( toString.call(checkSet) === "[object Array]" ) {
+		if ( !prune ) {
+			results.push.apply( results, checkSet );
+
+		} else if ( context && context.nodeType === 1 ) {
+			for ( i = 0; checkSet[i] != null; i++ ) {
+				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
+					results.push( set[i] );
+				}
+			}
+
+		} else {
+			for ( i = 0; checkSet[i] != null; i++ ) {
+				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+					results.push( set[i] );
+				}
+			}
+		}
+
+	} else {
+		makeArray( checkSet, results );
+	}
+
+	if ( extra ) {
+		Sizzle( extra, origContext, results, seed );
+		Sizzle.uniqueSort( results );
+	}
+
+	return results;
+};
+
+Sizzle.uniqueSort = function( results ) {
+	if ( sortOrder ) {
+		hasDuplicate = baseHasDuplicate;
+		results.sort( sortOrder );
+
+		if ( hasDuplicate ) {
+			for ( var i = 1; i < results.length; i++ ) {
+				if ( results[i] === results[ i - 1 ] ) {
+					results.splice( i--, 1 );
+				}
+			}
+		}
+	}
+
+	return results;
+};
+
+Sizzle.matches = function( expr, set ) {
+	return Sizzle( expr, null, null, set );
+};
+
+Sizzle.matchesSelector = function( node, expr ) {
+	return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+	var set;
+
+	if ( !expr ) {
+		return [];
+	}
+
+	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+		var match,
+			type = Expr.order[i];
+		
+		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
+			var left = match[1];
+			match.splice( 1, 1 );
+
+			if ( left.substr( left.length - 1 ) !== "\\" ) {
+				match[1] = (match[1] || "").replace(/\\/g, "");
+				set = Expr.find[ type ]( match, context, isXML );
+
+				if ( set != null ) {
+					expr = expr.replace( Expr.match[ type ], "" );
+					break;
+				}
+			}
+		}
+	}
+
+	if ( !set ) {
+		set = context.getElementsByTagName( "*" );
+	}
+
+	return { set: set, expr: expr };
+};
+
+Sizzle.filter = function( expr, set, inplace, not ) {
+	var match, anyFound,
+		old = expr,
+		result = [],
+		curLoop = set,
+		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
+
+	while ( expr && set.length ) {
+		for ( var type in Expr.filter ) {
+			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
+				var found, item,
+					filter = Expr.filter[ type ],
+					left = match[1];
+
+				anyFound = false;
+
+				match.splice(1,1);
+
+				if ( left.substr( left.length - 1 ) === "\\" ) {
+					continue;
+				}
+
+				if ( curLoop === result ) {
+					result = [];
+				}
+
+				if ( Expr.preFilter[ type ] ) {
+					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+					if ( !match ) {
+						anyFound = found = true;
+
+					} else if ( match === true ) {
+						continue;
+					}
+				}
+
+				if ( match ) {
+					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+						if ( item ) {
+							found = filter( item, match, i, curLoop );
+							var pass = not ^ !!found;
+
+							if ( inplace && found != null ) {
+								if ( pass ) {
+									anyFound = true;
+
+								} else {
+									curLoop[i] = false;
+								}
+
+							} else if ( pass ) {
+								result.push( item );
+								anyFound = true;
+							}
+						}
+					}
+				}
+
+				if ( found !== undefined ) {
+					if ( !inplace ) {
+						curLoop = result;
+					}
+
+					expr = expr.replace( Expr.match[ type ], "" );
+
+					if ( !anyFound ) {
+						return [];
+					}
+
+					break;
+				}
+			}
+		}
+
+		// Improper expression
+		if ( expr === old ) {
+			if ( anyFound == null ) {
+				Sizzle.error( expr );
+
+			} else {
+				break;
+			}
+		}
+
+		old = expr;
+	}
+
+	return curLoop;
+};
+
+Sizzle.error = function( msg ) {
+	throw "Syntax error, unrecognized expression: " + msg;
+};
+
+var Expr = Sizzle.selectors = {
+	order: [ "ID", "NAME", "TAG" ],
+
+	match: {
+		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
+		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
+		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
+		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,
+		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
+		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+	},
+
+	leftMatch: {},
+
+	attrMap: {
+		"class": "className",
+		"for": "htmlFor"
+	},
+
+	attrHandle: {
+		href: function( elem ) {
+			return elem.getAttribute( "href" );
+		}
+	},
+
+	relative: {
+		"+": function(checkSet, part){
+			var isPartStr = typeof part === "string",
+				isTag = isPartStr && !/\W/.test( part ),
+				isPartStrNotTag = isPartStr && !isTag;
+
+			if ( isTag ) {
+				part = part.toLowerCase();
+			}
+
+			for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+				if ( (elem = checkSet[i]) ) {
+					while ( (elem = elem.previousSibling

<TRUNCATED>

[44/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/production/r.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/production/r.js b/ambari-logsearch/ambari-logsearch-portal/production/r.js
new file mode 100644
index 0000000..6e6ffd0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/production/r.js
@@ -0,0 +1,32140 @@
+/**
+ * @license r.js 2.1.22 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * This is a bootstrap script to allow running RequireJS in the command line
+ * in either a Java/Rhino or Node environment. It is modified by the top-level
+ * dist.js file to inject other files to completely enable this file. It is
+ * the shell of the r.js file.
+ */
+
+/*jslint evil: true, nomen: true, sloppy: true */
+/*global readFile: true, process: false, Packages: false, print: false,
+console: false, java: false, module: false, requirejsVars, navigator,
+document, importScripts, self, location, Components, FileUtils */
+
+var requirejs, require, define, xpcUtil;
+(function (console, args, readFileFunc) {
+    var fileName, env, fs, vm, path, exec, rhinoContext, dir, nodeRequire,
+        nodeDefine, exists, reqMain, loadedOptimizedLib, existsForNode, Cc, Ci,
+        version = '2.1.22',
+        jsSuffixRegExp = /\.js$/,
+        commandOption = '',
+        useLibLoaded = {},
+        //Used by jslib/rhino/args.js
+        rhinoArgs = args,
+        //Used by jslib/xpconnect/args.js
+        xpconnectArgs = args,
+        readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
+
+    function showHelp() {
+        console.log('See https://github.com/jrburke/r.js for usage.');
+    }
+
+    if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||
+            (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {
+        env = 'browser';
+
+        readFile = function (path) {
+            return fs.readFileSync(path, 'utf8');
+        };
+
+        exec = function (string) {
+            return eval(string);
+        };
+
+        exists = function () {
+            console.log('x.js exists not applicable in browser env');
+            return false;
+        };
+
+    } else if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {
+        env = 'node';
+
+        //Get the fs module via Node's require before it
+        //gets replaced. Used in require/node.js
+        fs = require('fs');
+        vm = require('vm');
+        path = require('path');
+        //In Node 0.7+ existsSync is on fs.
+        existsForNode = fs.existsSync || path.existsSync;
+
+        nodeRequire = require;
+        nodeDefine = define;
+        reqMain = require.main;
+
+        //Temporarily hide require and define to allow require.js to define
+        //them.
+        require = undefined;
+        define = undefined;
+
+        readFile = function (path) {
+            return fs.readFileSync(path, 'utf8');
+        };
+
+        exec = function (string, name) {
+            return vm.runInThisContext(this.requirejsVars.require.makeNodeWrapper(string),
+                                       name ? fs.realpathSync(name) : '');
+        };
+
+        exists = function (fileName) {
+            return existsForNode(fileName);
+        };
+
+
+        fileName = process.argv[2];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = process.argv[3];
+        }
+    } else if (typeof Packages !== 'undefined') {
+        env = 'rhino';
+
+        fileName = args[0];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = args[1];
+        }
+
+        //Exec/readFile differs between Rhino and Nashorn. Rhino has an
+        //importPackage where Nashorn does not, so branch on that. This is a
+        //coarser check -- detecting readFile existence might also be enough for
+        //this spot. However, sticking with importPackage to keep it the same
+        //as other Rhino/Nashorn detection branches.
+        if (typeof importPackage !== 'undefined') {
+            rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext();
+
+            exec = function (string, name) {
+                return rhinoContext.evaluateString(this, string, name, 0, null);
+            };
+        } else {
+            exec = function (string, name) {
+                load({ script: string, name: name});
+            };
+            readFile = readFully;
+        }
+
+        exists = function (fileName) {
+            return (new java.io.File(fileName)).exists();
+        };
+
+        //Define a console.log for easier logging. Don't
+        //get fancy though.
+        if (typeof console === 'undefined') {
+            console = {
+                log: function () {
+                    print.apply(undefined, arguments);
+                }
+            };
+        }
+    } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {
+        env = 'xpconnect';
+
+        Components.utils['import']('resource://gre/modules/FileUtils.jsm');
+        Cc = Components.classes;
+        Ci = Components.interfaces;
+
+        fileName = args[0];
+
+        if (fileName && fileName.indexOf('-') === 0) {
+            commandOption = fileName.substring(1);
+            fileName = args[1];
+        }
+
+        xpcUtil = {
+            isWindows: ('@mozilla.org/windows-registry-key;1' in Cc),
+            cwd: function () {
+                return FileUtils.getFile("CurWorkD", []).path;
+            },
+
+            //Remove . and .. from paths, normalize on front slashes
+            normalize: function (path) {
+                //There has to be an easier way to do this.
+                var i, part, ary,
+                    firstChar = path.charAt(0);
+
+                if (firstChar !== '/' &&
+                        firstChar !== '\\' &&
+                        path.indexOf(':') === -1) {
+                    //A relative path. Use the current working directory.
+                    path = xpcUtil.cwd() + '/' + path;
+                }
+
+                ary = path.replace(/\\/g, '/').split('/');
+
+                for (i = 0; i < ary.length; i += 1) {
+                    part = ary[i];
+                    if (part === '.') {
+                        ary.splice(i, 1);
+                        i -= 1;
+                    } else if (part === '..') {
+                        ary.splice(i - 1, 2);
+                        i -= 2;
+                    }
+                }
+                return ary.join('/');
+            },
+
+            xpfile: function (path) {
+                var fullPath;
+                try {
+                    fullPath = xpcUtil.normalize(path);
+                    if (xpcUtil.isWindows) {
+                        fullPath = fullPath.replace(/\//g, '\\');
+                    }
+                    return new FileUtils.File(fullPath);
+                } catch (e) {
+                    throw new Error((fullPath || path) + ' failed: ' + e);
+                }
+            },
+
+            readFile: function (/*String*/path, /*String?*/encoding) {
+                //A file read function that can deal with BOMs
+                encoding = encoding || "utf-8";
+
+                var inStream, convertStream,
+                    readData = {},
+                    fileObj = xpcUtil.xpfile(path);
+
+                //XPCOM, you so crazy
+                try {
+                    inStream = Cc['@mozilla.org/network/file-input-stream;1']
+                               .createInstance(Ci.nsIFileInputStream);
+                    inStream.init(fileObj, 1, 0, false);
+
+                    convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
+                                    .createInstance(Ci.nsIConverterInputStream);
+                    convertStream.init(inStream, encoding, inStream.available(),
+                    Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
+
+                    convertStream.readString(inStream.available(), readData);
+                    return readData.value;
+                } catch (e) {
+                    throw new Error((fileObj && fileObj.path || '') + ': ' + e);
+                } finally {
+                    if (convertStream) {
+                        convertStream.close();
+                    }
+                    if (inStream) {
+                        inStream.close();
+                    }
+                }
+            }
+        };
+
+        readFile = xpcUtil.readFile;
+
+        exec = function (string) {
+            return eval(string);
+        };
+
+        exists = function (fileName) {
+            return xpcUtil.xpfile(fileName).exists();
+        };
+
+        //Define a console.log for easier logging. Don't
+        //get fancy though.
+        if (typeof console === 'undefined') {
+            console = {
+                log: function () {
+                    print.apply(undefined, arguments);
+                }
+            };
+        }
+    }
+
+    /** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.22 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+
+(function (global) {
+    var req, s, head, baseElement, dataMain, src,
+        interactiveScript, currentlyAddingScript, mainScript, subPath,
+        version = '2.1.22',
+        commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+        cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+        jsSuffixRegExp = /\.js$/,
+        currDirRegExp = /^\.\//,
+        op = Object.prototype,
+        ostring = op.toString,
+        hasOwn = op.hasOwnProperty,
+        ap = Array.prototype,
+        isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
+        isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+        //PS3 indicates loaded and complete, but need to wait for complete
+        //specifically. Sequence is 'loading', 'loaded', execution,
+        // then 'complete'. The UA check is unfortunate, but not sure how
+        //to feature test w/o causing perf issues.
+        readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+                      /^complete$/ : /^(complete|loaded)$/,
+        defContextName = '_',
+        //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+        isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+        contexts = {},
+        cfg = {},
+        globalDefQueue = [],
+        useInteractive = false;
+
+    function isFunction(it) {
+        return ostring.call(it) === '[object Function]';
+    }
+
+    function isArray(it) {
+        return ostring.call(it) === '[object Array]';
+    }
+
+    /**
+     * Helper function for iterating over an array. If the func returns
+     * a true value, it will break out of the loop.
+     */
+    function each(ary, func) {
+        if (ary) {
+            var i;
+            for (i = 0; i < ary.length; i += 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Helper function for iterating over an array backwards. If the func
+     * returns a true value, it will break out of the loop.
+     */
+    function eachReverse(ary, func) {
+        if (ary) {
+            var i;
+            for (i = ary.length - 1; i > -1; i -= 1) {
+                if (ary[i] && func(ary[i], i, ary)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    function hasProp(obj, prop) {
+        return hasOwn.call(obj, prop);
+    }
+
+    function getOwn(obj, prop) {
+        return hasProp(obj, prop) && obj[prop];
+    }
+
+    /**
+     * Cycles over properties in an object and calls a function for each
+     * property value. If the function returns a truthy value, then the
+     * iteration is stopped.
+     */
+    function eachProp(obj, func) {
+        var prop;
+        for (prop in obj) {
+            if (hasProp(obj, prop)) {
+                if (func(obj[prop], prop)) {
+                    break;
+                }
+            }
+        }
+    }
+
+    /**
+     * Simple function to mix in properties from source into target,
+     * but only if target does not already have a property of the same name.
+     */
+    function mixin(target, source, force, deepStringMixin) {
+        if (source) {
+            eachProp(source, function (value, prop) {
+                if (force || !hasProp(target, prop)) {
+                    if (deepStringMixin && typeof value === 'object' && value &&
+                        !isArray(value) && !isFunction(value) &&
+                        !(value instanceof RegExp)) {
+
+                        if (!target[prop]) {
+                            target[prop] = {};
+                        }
+                        mixin(target[prop], value, force, deepStringMixin);
+                    } else {
+                        target[prop] = value;
+                    }
+                }
+            });
+        }
+        return target;
+    }
+
+    //Similar to Function.prototype.bind, but the 'this' object is specified
+    //first, since it is easier to read/figure out what 'this' will be.
+    function bind(obj, fn) {
+        return function () {
+            return fn.apply(obj, arguments);
+        };
+    }
+
+    function scripts() {
+        return document.getElementsByTagName('script');
+    }
+
+    function defaultOnError(err) {
+        throw err;
+    }
+
+    //Allow getting a global that is expressed in
+    //dot notation, like 'a.b.c'.
+    function getGlobal(value) {
+        if (!value) {
+            return value;
+        }
+        var g = global;
+        each(value.split('.'), function (part) {
+            g = g[part];
+        });
+        return g;
+    }
+
+    /**
+     * Constructs an error with a pointer to an URL with more information.
+     * @param {String} id the error ID that maps to an ID on a web page.
+     * @param {String} message human readable error.
+     * @param {Error} [err] the original error, if there is one.
+     *
+     * @returns {Error}
+     */
+    function makeError(id, msg, err, requireModules) {
+        var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+        e.requireType = id;
+        e.requireModules = requireModules;
+        if (err) {
+            e.originalError = err;
+        }
+        return e;
+    }
+
+    if (typeof define !== 'undefined') {
+        //If a define is already in play via another AMD loader,
+        //do not overwrite.
+        return;
+    }
+
+    if (typeof requirejs !== 'undefined') {
+        if (isFunction(requirejs)) {
+            //Do not overwrite an existing requirejs instance.
+            return;
+        }
+        cfg = requirejs;
+        requirejs = undefined;
+    }
+
+    //Allow for a require config object
+    if (typeof require !== 'undefined' && !isFunction(require)) {
+        //assume it is a config object.
+        cfg = require;
+        require = undefined;
+    }
+
+    function newContext(contextName) {
+        var inCheckLoaded, Module, context, handlers,
+            checkLoadedTimeoutId,
+            config = {
+                //Defaults. Do not set a default for map
+                //config to speed up normalize(), which
+                //will run faster if there is no default.
+                waitSeconds: 7,
+                baseUrl: './',
+                paths: {},
+                bundles: {},
+                pkgs: {},
+                shim: {},
+                config: {}
+            },
+            registry = {},
+            //registry of just enabled modules, to speed
+            //cycle breaking code when lots of modules
+            //are registered, but not activated.
+            enabledRegistry = {},
+            undefEvents = {},
+            defQueue = [],
+            defined = {},
+            urlFetched = {},
+            bundlesMap = {},
+            requireCounter = 1,
+            unnormalizedCounter = 1;
+
+        /**
+         * Trims the . and .. from an array of path segments.
+         * It will keep a leading path segment if a .. will become
+         * the first path segment, to help with module name lookups,
+         * which act like paths, but can be remapped. But the end result,
+         * all paths that use this function should look normalized.
+         * NOTE: this method MODIFIES the input array.
+         * @param {Array} ary the array of path segments.
+         */
+        function trimDots(ary) {
+            var i, part;
+            for (i = 0; i < ary.length; i++) {
+                part = ary[i];
+                if (part === '.') {
+                    ary.splice(i, 1);
+                    i -= 1;
+                } else if (part === '..') {
+                    // If at the start, or previous value is still ..,
+                    // keep them so that when converted to a path it may
+                    // still work when converted to a path, even though
+                    // as an ID it is less than ideal. In larger point
+                    // releases, may be better to just kick out an error.
+                    if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {
+                        continue;
+                    } else if (i > 0) {
+                        ary.splice(i - 1, 2);
+                        i -= 2;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Given a relative module name, like ./something, normalize it to
+         * a real name that can be mapped to a path.
+         * @param {String} name the relative name
+         * @param {String} baseName a real name that the name arg is relative
+         * to.
+         * @param {Boolean} applyMap apply the map config to the value. Should
+         * only be done if this normalization is for a dependency ID.
+         * @returns {String} normalized name
+         */
+        function normalize(name, baseName, applyMap) {
+            var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
+                foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
+                baseParts = (baseName && baseName.split('/')),
+                map = config.map,
+                starMap = map && map['*'];
+
+            //Adjust any relative paths.
+            if (name) {
+                name = name.split('/');
+                lastIndex = name.length - 1;
+
+                // If wanting node ID compatibility, strip .js from end
+                // of IDs. Have to do this here, and not in nameToUrl
+                // because node allows either .js or non .js to map
+                // to same file.
+                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+                }
+
+                // Starts with a '.' so need the baseName
+                if (name[0].charAt(0) === '.' && baseParts) {
+                    //Convert baseName to array, and lop off the last part,
+                    //so that . matches that 'directory' and not name of the baseName's
+                    //module. For instance, baseName of 'one/two/three', maps to
+                    //'one/two/three.js', but we want the directory, 'one/two' for
+                    //this normalization.
+                    normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+                    name = normalizedBaseParts.concat(name);
+                }
+
+                trimDots(name);
+                name = name.join('/');
+            }
+
+            //Apply map config if available.
+            if (applyMap && map && (baseParts || starMap)) {
+                nameParts = name.split('/');
+
+                outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
+                    nameSegment = nameParts.slice(0, i).join('/');
+
+                    if (baseParts) {
+                        //Find the longest baseName segment match in the config.
+                        //So, do joins on the biggest to smallest lengths of baseParts.
+                        for (j = baseParts.length; j > 0; j -= 1) {
+                            mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+                            //baseName segment has config, find if it has one for
+                            //this name.
+                            if (mapValue) {
+                                mapValue = getOwn(mapValue, nameSegment);
+                                if (mapValue) {
+                                    //Match, update name to the new value.
+                                    foundMap = mapValue;
+                                    foundI = i;
+                                    break outerLoop;
+                                }
+                            }
+                        }
+                    }
+
+                    //Check for a star map match, but just hold on to it,
+                    //if there is a shorter segment match later in a matching
+                    //config, then favor over this star map.
+                    if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+                        foundStarMap = getOwn(starMap, nameSegment);
+                        starI = i;
+                    }
+                }
+
+                if (!foundMap && foundStarMap) {
+                    foundMap = foundStarMap;
+                    foundI = starI;
+                }
+
+                if (foundMap) {
+                    nameParts.splice(0, foundI, foundMap);
+                    name = nameParts.join('/');
+                }
+            }
+
+            // If the name points to a package's name, use
+            // the package main instead.
+            pkgMain = getOwn(config.pkgs, name);
+
+            return pkgMain ? pkgMain : name;
+        }
+
+        function removeScript(name) {
+            if (isBrowser) {
+                each(scripts(), function (scriptNode) {
+                    if (scriptNode.getAttribute('data-requiremodule') === name &&
+                            scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+                        scriptNode.parentNode.removeChild(scriptNode);
+                        return true;
+                    }
+                });
+            }
+        }
+
+        function hasPathFallback(id) {
+            var pathConfig = getOwn(config.paths, id);
+            if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+                //Pop off the first array value, since it failed, and
+                //retry
+                pathConfig.shift();
+                context.require.undef(id);
+
+                //Custom require that does not do map translation, since
+                //ID is "absolute", already mapped/resolved.
+                context.makeRequire(null, {
+                    skipMap: true
+                })([id]);
+
+                return true;
+            }
+        }
+
+        //Turns a plugin!resource to [plugin, resource]
+        //with the plugin being undefined if the name
+        //did not have a plugin prefix.
+        function splitPrefix(name) {
+            var prefix,
+                index = name ? name.indexOf('!') : -1;
+            if (index > -1) {
+                prefix = name.substring(0, index);
+                name = name.substring(index + 1, name.length);
+            }
+            return [prefix, name];
+        }
+
+        /**
+         * Creates a module mapping that includes plugin prefix, module
+         * name, and path. If parentModuleMap is provided it will
+         * also normalize the name via require.normalize()
+         *
+         * @param {String} name the module name
+         * @param {String} [parentModuleMap] parent module map
+         * for the module name, used to resolve relative names.
+         * @param {Boolean} isNormalized: is the ID already normalized.
+         * This is true if this call is done for a define() module ID.
+         * @param {Boolean} applyMap: apply the map config to the ID.
+         * Should only be true if this map is for a dependency.
+         *
+         * @returns {Object}
+         */
+        function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+            var url, pluginModule, suffix, nameParts,
+                prefix = null,
+                parentName = parentModuleMap ? parentModuleMap.name : null,
+                originalName = name,
+                isDefine = true,
+                normalizedName = '';
+
+            //If no name, then it means it is a require call, generate an
+            //internal name.
+            if (!name) {
+                isDefine = false;
+                name = '_@r' + (requireCounter += 1);
+            }
+
+            nameParts = splitPrefix(name);
+            prefix = nameParts[0];
+            name = nameParts[1];
+
+            if (prefix) {
+                prefix = normalize(prefix, parentName, applyMap);
+                pluginModule = getOwn(defined, prefix);
+            }
+
+            //Account for relative paths if there is a base name.
+            if (name) {
+                if (prefix) {
+                    if (pluginModule && pluginModule.normalize) {
+                        //Plugin is loaded, use its normalize method.
+                        normalizedName = pluginModule.normalize(name, function (name) {
+                            return normalize(name, parentName, applyMap);
+                        });
+                    } else {
+                        // If nested plugin references, then do not try to
+                        // normalize, as it will not normalize correctly. This
+                        // places a restriction on resourceIds, and the longer
+                        // term solution is not to normalize until plugins are
+                        // loaded and all normalizations to allow for async
+                        // loading of a loader plugin. But for now, fixes the
+                        // common uses. Details in #1131
+                        normalizedName = name.indexOf('!') === -1 ?
+                                         normalize(name, parentName, applyMap) :
+                                         name;
+                    }
+                } else {
+                    //A regular module.
+                    normalizedName = normalize(name, parentName, applyMap);
+
+                    //Normalized name may be a plugin ID due to map config
+                    //application in normalize. The map config values must
+                    //already be normalized, so do not need to redo that part.
+                    nameParts = splitPrefix(normalizedName);
+                    prefix = nameParts[0];
+                    normalizedName = nameParts[1];
+                    isNormalized = true;
+
+                    url = context.nameToUrl(normalizedName);
+                }
+            }
+
+            //If the id is a plugin id that cannot be determined if it needs
+            //normalization, stamp it with a unique ID so two matching relative
+            //ids that may conflict can be separate.
+            suffix = prefix && !pluginModule && !isNormalized ?
+                     '_unnormalized' + (unnormalizedCounter += 1) :
+                     '';
+
+            return {
+                prefix: prefix,
+                name: normalizedName,
+                parentMap: parentModuleMap,
+                unnormalized: !!suffix,
+                url: url,
+                originalName: originalName,
+                isDefine: isDefine,
+                id: (prefix ?
+                        prefix + '!' + normalizedName :
+                        normalizedName) + suffix
+            };
+        }
+
+        function getModule(depMap) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (!mod) {
+                mod = registry[id] = new context.Module(depMap);
+            }
+
+            return mod;
+        }
+
+        function on(depMap, name, fn) {
+            var id = depMap.id,
+                mod = getOwn(registry, id);
+
+            if (hasProp(defined, id) &&
+                    (!mod || mod.defineEmitComplete)) {
+                if (name === 'defined') {
+                    fn(defined[id]);
+                }
+            } else {
+                mod = getModule(depMap);
+                if (mod.error && name === 'error') {
+                    fn(mod.error);
+                } else {
+                    mod.on(name, fn);
+                }
+            }
+        }
+
+        function onError(err, errback) {
+            var ids = err.requireModules,
+                notified = false;
+
+            if (errback) {
+                errback(err);
+            } else {
+                each(ids, function (id) {
+                    var mod = getOwn(registry, id);
+                    if (mod) {
+                        //Set error on module, so it skips timeout checks.
+                        mod.error = err;
+                        if (mod.events.error) {
+                            notified = true;
+                            mod.emit('error', err);
+                        }
+                    }
+                });
+
+                if (!notified) {
+                    req.onError(err);
+                }
+            }
+        }
+
+        /**
+         * Internal method to transfer globalQueue items to this context's
+         * defQueue.
+         */
+        function takeGlobalQueue() {
+            //Push all the globalDefQueue items into the context's defQueue
+            if (globalDefQueue.length) {
+                each(globalDefQueue, function(queueItem) {
+                    var id = queueItem[0];
+                    if (typeof id === 'string') {
+                        context.defQueueMap[id] = true;
+                    }
+                    defQueue.push(queueItem);
+                });
+                globalDefQueue = [];
+            }
+        }
+
+        handlers = {
+            'require': function (mod) {
+                if (mod.require) {
+                    return mod.require;
+                } else {
+                    return (mod.require = context.makeRequire(mod.map));
+                }
+            },
+            'exports': function (mod) {
+                mod.usingExports = true;
+                if (mod.map.isDefine) {
+                    if (mod.exports) {
+                        return (defined[mod.map.id] = mod.exports);
+                    } else {
+                        return (mod.exports = defined[mod.map.id] = {});
+                    }
+                }
+            },
+            'module': function (mod) {
+                if (mod.module) {
+                    return mod.module;
+                } else {
+                    return (mod.module = {
+                        id: mod.map.id,
+                        uri: mod.map.url,
+                        config: function () {
+                            return getOwn(config.config, mod.map.id) || {};
+                        },
+                        exports: mod.exports || (mod.exports = {})
+                    });
+                }
+            }
+        };
+
+        function cleanRegistry(id) {
+            //Clean up machinery used for waiting modules.
+            delete registry[id];
+            delete enabledRegistry[id];
+        }
+
+        function breakCycle(mod, traced, processed) {
+            var id = mod.map.id;
+
+            if (mod.error) {
+                mod.emit('error', mod.error);
+            } else {
+                traced[id] = true;
+                each(mod.depMaps, function (depMap, i) {
+                    var depId = depMap.id,
+                        dep = getOwn(registry, depId);
+
+                    //Only force things that have not completed
+                    //being defined, so still in the registry,
+                    //and only if it has not been matched up
+                    //in the module already.
+                    if (dep && !mod.depMatched[i] && !processed[depId]) {
+                        if (getOwn(traced, depId)) {
+                            mod.defineDep(i, defined[depId]);
+                            mod.check(); //pass false?
+                        } else {
+                            breakCycle(dep, traced, processed);
+                        }
+                    }
+                });
+                processed[id] = true;
+            }
+        }
+
+        function checkLoaded() {
+            var err, usingPathFallback,
+                waitInterval = config.waitSeconds * 1000,
+                //It is possible to disable the wait interval by using waitSeconds of 0.
+                expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+                noLoads = [],
+                reqCalls = [],
+                stillLoading = false,
+                needCycleCheck = true;
+
+            //Do not bother if this call was a result of a cycle break.
+            if (inCheckLoaded) {
+                return;
+            }
+
+            inCheckLoaded = true;
+
+            //Figure out the state of all the modules.
+            eachProp(enabledRegistry, function (mod) {
+                var map = mod.map,
+                    modId = map.id;
+
+                //Skip things that are not enabled or in error state.
+                if (!mod.enabled) {
+                    return;
+                }
+
+                if (!map.isDefine) {
+                    reqCalls.push(mod);
+                }
+
+                if (!mod.error) {
+                    //If the module should be executed, and it has not
+                    //been inited and time is up, remember it.
+                    if (!mod.inited && expired) {
+                        if (hasPathFallback(modId)) {
+                            usingPathFallback = true;
+                            stillLoading = true;
+                        } else {
+                            noLoads.push(modId);
+                            removeScript(modId);
+                        }
+                    } else if (!mod.inited && mod.fetched && map.isDefine) {
+                        stillLoading = true;
+                        if (!map.prefix) {
+                            //No reason to keep looking for unfinished
+                            //loading. If the only stillLoading is a
+                            //plugin resource though, keep going,
+                            //because it may be that a plugin resource
+                            //is waiting on a non-plugin cycle.
+                            return (needCycleCheck = false);
+                        }
+                    }
+                }
+            });
+
+            if (expired && noLoads.length) {
+                //If wait time expired, throw error of unloaded modules.
+                err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+                err.contextName = context.contextName;
+                return onError(err);
+            }
+
+            //Not expired, check for a cycle.
+            if (needCycleCheck) {
+                each(reqCalls, function (mod) {
+                    breakCycle(mod, {}, {});
+                });
+            }
+
+            //If still waiting on loads, and the waiting load is something
+            //other than a plugin resource, or there are still outstanding
+            //scripts, then just try back later.
+            if ((!expired || usingPathFallback) && stillLoading) {
+                //Something is still waiting to load. Wait for it, but only
+                //if a timeout is not already in effect.
+                if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+                    checkLoadedTimeoutId = setTimeout(function () {
+                        checkLoadedTimeoutId = 0;
+                        checkLoaded();
+                    }, 50);
+                }
+            }
+
+            inCheckLoaded = false;
+        }
+
+        Module = function (map) {
+            this.events = getOwn(undefEvents, map.id) || {};
+            this.map = map;
+            this.shim = getOwn(config.shim, map.id);
+            this.depExports = [];
+            this.depMaps = [];
+            this.depMatched = [];
+            this.pluginMaps = {};
+            this.depCount = 0;
+
+            /* this.exports this.factory
+               this.depMaps = [],
+               this.enabled, this.fetched
+            */
+        };
+
+        Module.prototype = {
+            init: function (depMaps, factory, errback, options) {
+                options = options || {};
+
+                //Do not do more inits if already done. Can happen if there
+                //are multiple define calls for the same module. That is not
+                //a normal, common case, but it is also not unexpected.
+                if (this.inited) {
+                    return;
+                }
+
+                this.factory = factory;
+
+                if (errback) {
+                    //Register for errors on this module.
+                    this.on('error', errback);
+                } else if (this.events.error) {
+                    //If no errback already, but there are error listeners
+                    //on this module, set up an errback to pass to the deps.
+                    errback = bind(this, function (err) {
+                        this.emit('error', err);
+                    });
+                }
+
+                //Do a copy of the dependency array, so that
+                //source inputs are not modified. For example
+                //"shim" deps are passed in here directly, and
+                //doing a direct modification of the depMaps array
+                //would affect that config.
+                this.depMaps = depMaps && depMaps.slice(0);
+
+                this.errback = errback;
+
+                //Indicate this module has be initialized
+                this.inited = true;
+
+                this.ignore = options.ignore;
+
+                //Could have option to init this module in enabled mode,
+                //or could have been previously marked as enabled. However,
+                //the dependencies are not known until init is called. So
+                //if enabled previously, now trigger dependencies as enabled.
+                if (options.enabled || this.enabled) {
+                    //Enable this module and dependencies.
+                    //Will call this.check()
+                    this.enable();
+                } else {
+                    this.check();
+                }
+            },
+
+            defineDep: function (i, depExports) {
+                //Because of cycles, defined callback for a given
+                //export can be called more than once.
+                if (!this.depMatched[i]) {
+                    this.depMatched[i] = true;
+                    this.depCount -= 1;
+                    this.depExports[i] = depExports;
+                }
+            },
+
+            fetch: function () {
+                if (this.fetched) {
+                    return;
+                }
+                this.fetched = true;
+
+                context.startTime = (new Date()).getTime();
+
+                var map = this.map;
+
+                //If the manager is for a plugin managed resource,
+                //ask the plugin to load it now.
+                if (this.shim) {
+                    context.makeRequire(this.map, {
+                        enableBuildCallback: true
+                    })(this.shim.deps || [], bind(this, function () {
+                        return map.prefix ? this.callPlugin() : this.load();
+                    }));
+                } else {
+                    //Regular dependency.
+                    return map.prefix ? this.callPlugin() : this.load();
+                }
+            },
+
+            load: function () {
+                var url = this.map.url;
+
+                //Regular dependency.
+                if (!urlFetched[url]) {
+                    urlFetched[url] = true;
+                    context.load(this.map.id, url);
+                }
+            },
+
+            /**
+             * Checks if the module is ready to define itself, and if so,
+             * define it.
+             */
+            check: function () {
+                if (!this.enabled || this.enabling) {
+                    return;
+                }
+
+                var err, cjsModule,
+                    id = this.map.id,
+                    depExports = this.depExports,
+                    exports = this.exports,
+                    factory = this.factory;
+
+                if (!this.inited) {
+                    // Only fetch if not already in the defQueue.
+                    if (!hasProp(context.defQueueMap, id)) {
+                        this.fetch();
+                    }
+                } else if (this.error) {
+                    this.emit('error', this.error);
+                } else if (!this.defining) {
+                    //The factory could trigger another require call
+                    //that would result in checking this module to
+                    //define itself again. If already in the process
+                    //of doing that, skip this work.
+                    this.defining = true;
+
+                    if (this.depCount < 1 && !this.defined) {
+                        if (isFunction(factory)) {
+                            try {
+                                exports = context.execCb(id, factory, depExports, exports);
+                            } catch (e) {
+                                err = e;
+                            }
+
+                            // Favor return value over exports. If node/cjs in play,
+                            // then will not have a return value anyway. Favor
+                            // module.exports assignment over exports object.
+                            if (this.map.isDefine && exports === undefined) {
+                                cjsModule = this.module;
+                                if (cjsModule) {
+                                    exports = cjsModule.exports;
+                                } else if (this.usingExports) {
+                                    //exports already set the defined value.
+                                    exports = this.exports;
+                                }
+                            }
+
+                            if (err) {
+                                // If there is an error listener, favor passing
+                                // to that instead of throwing an error. However,
+                                // only do it for define()'d  modules. require
+                                // errbacks should not be called for failures in
+                                // their callbacks (#699). However if a global
+                                // onError is set, use that.
+                                if ((this.events.error && this.map.isDefine) ||
+                                    req.onError !== defaultOnError) {
+                                    err.requireMap = this.map;
+                                    err.requireModules = this.map.isDefine ? [this.map.id] : null;
+                                    err.requireType = this.map.isDefine ? 'define' : 'require';
+                                    return onError((this.error = err));
+                                } else if (typeof console !== 'undefined' &&
+                                           console.error) {
+                                    // Log the error for debugging. If promises could be
+                                    // used, this would be different, but making do.
+                                    console.error(err);
+                                } else {
+                                    // Do not want to completely lose the error. While this
+                                    // will mess up processing and lead to similar results
+                                    // as bug 1440, it at least surfaces the error.
+                                    req.onError(err);
+                                }
+                            }
+                        } else {
+                            //Just a literal value
+                            exports = factory;
+                        }
+
+                        this.exports = exports;
+
+                        if (this.map.isDefine && !this.ignore) {
+                            defined[id] = exports;
+
+                            if (req.onResourceLoad) {
+                                var resLoadMaps = [];
+                                each(this.depMaps, function (depMap) {
+                                    resLoadMaps.push(depMap.normalizedMap || depMap);
+                                });
+                                req.onResourceLoad(context, this.map, resLoadMaps);
+                            }
+                        }
+
+                        //Clean up
+                        cleanRegistry(id);
+
+                        this.defined = true;
+                    }
+
+                    //Finished the define stage. Allow calling check again
+                    //to allow define notifications below in the case of a
+                    //cycle.
+                    this.defining = false;
+
+                    if (this.defined && !this.defineEmitted) {
+                        this.defineEmitted = true;
+                        this.emit('defined', this.exports);
+                        this.defineEmitComplete = true;
+                    }
+
+                }
+            },
+
+            callPlugin: function () {
+                var map = this.map,
+                    id = map.id,
+                    //Map already normalized the prefix.
+                    pluginMap = makeModuleMap(map.prefix);
+
+                //Mark this as a dependency for this plugin, so it
+                //can be traced for cycles.
+                this.depMaps.push(pluginMap);
+
+                on(pluginMap, 'defined', bind(this, function (plugin) {
+                    var load, normalizedMap, normalizedMod,
+                        bundleId = getOwn(bundlesMap, this.map.id),
+                        name = this.map.name,
+                        parentName = this.map.parentMap ? this.map.parentMap.name : null,
+                        localRequire = context.makeRequire(map.parentMap, {
+                            enableBuildCallback: true
+                        });
+
+                    //If current map is not normalized, wait for that
+                    //normalized name to load instead of continuing.
+                    if (this.map.unnormalized) {
+                        //Normalize the ID if the plugin allows it.
+                        if (plugin.normalize) {
+                            name = plugin.normalize(name, function (name) {
+                                return normalize(name, parentName, true);
+                            }) || '';
+                        }
+
+                        //prefix and name should already be normalized, no need
+                        //for applying map config again either.
+                        normalizedMap = makeModuleMap(map.prefix + '!' + name,
+                                                      this.map.parentMap);
+                        on(normalizedMap,
+                            'defined', bind(this, function (value) {
+                                this.map.normalizedMap = normalizedMap;
+                                this.init([], function () { return value; }, null, {
+                                    enabled: true,
+                                    ignore: true
+                                });
+                            }));
+
+                        normalizedMod = getOwn(registry, normalizedMap.id);
+                        if (normalizedMod) {
+                            //Mark this as a dependency for this plugin, so it
+                            //can be traced for cycles.
+                            this.depMaps.push(normalizedMap);
+
+                            if (this.events.error) {
+                                normalizedMod.on('error', bind(this, function (err) {
+                                    this.emit('error', err);
+                                }));
+                            }
+                            normalizedMod.enable();
+                        }
+
+                        return;
+                    }
+
+                    //If a paths config, then just load that file instead to
+                    //resolve the plugin, as it is built into that paths layer.
+                    if (bundleId) {
+                        this.map.url = context.nameToUrl(bundleId);
+                        this.load();
+                        return;
+                    }
+
+                    load = bind(this, function (value) {
+                        this.init([], function () { return value; }, null, {
+                            enabled: true
+                        });
+                    });
+
+                    load.error = bind(this, function (err) {
+                        this.inited = true;
+                        this.error = err;
+                        err.requireModules = [id];
+
+                        //Remove temp unnormalized modules for this module,
+                        //since they will never be resolved otherwise now.
+                        eachProp(registry, function (mod) {
+                            if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+                                cleanRegistry(mod.map.id);
+                            }
+                        });
+
+                        onError(err);
+                    });
+
+                    //Allow plugins to load other code without having to know the
+                    //context or how to 'complete' the load.
+                    load.fromText = bind(this, function (text, textAlt) {
+                        /*jslint evil: true */
+                        var moduleName = map.name,
+                            moduleMap = makeModuleMap(moduleName),
+                            hasInteractive = useInteractive;
+
+                        //As of 2.1.0, support just passing the text, to reinforce
+                        //fromText only being called once per resource. Still
+                        //support old style of passing moduleName but discard
+                        //that moduleName in favor of the internal ref.
+                        if (textAlt) {
+                            text = textAlt;
+                        }
+
+                        //Turn off interactive script matching for IE for any define
+                        //calls in the text, then turn it back on at the end.
+                        if (hasInteractive) {
+                            useInteractive = false;
+                        }
+
+                        //Prime the system by creating a module instance for
+                        //it.
+                        getModule(moduleMap);
+
+                        //Transfer any config to this other module.
+                        if (hasProp(config.config, id)) {
+                            config.config[moduleName] = config.config[id];
+                        }
+
+                        try {
+                            req.exec(text);
+                        } catch (e) {
+                            return onError(makeError('fromtexteval',
+                                             'fromText eval for ' + id +
+                                            ' failed: ' + e,
+                                             e,
+                                             [id]));
+                        }
+
+                        if (hasInteractive) {
+                            useInteractive = true;
+                        }
+
+                        //Mark this as a dependency for the plugin
+                        //resource
+                        this.depMaps.push(moduleMap);
+
+                        //Support anonymous modules.
+                        context.completeLoad(moduleName);
+
+                        //Bind the value of that module to the value for this
+                        //resource ID.
+                        localRequire([moduleName], load);
+                    });
+
+                    //Use parentName here since the plugin's name is not reliable,
+                    //could be some weird string with no path that actually wants to
+                    //reference the parentName's path.
+                    plugin.load(map.name, localRequire, load, config);
+                }));
+
+                context.enable(pluginMap, this);
+                this.pluginMaps[pluginMap.id] = pluginMap;
+            },
+
+            enable: function () {
+                enabledRegistry[this.map.id] = this;
+                this.enabled = true;
+
+                //Set flag mentioning that the module is enabling,
+                //so that immediate calls to the defined callbacks
+                //for dependencies do not trigger inadvertent load
+                //with the depCount still being zero.
+                this.enabling = true;
+
+                //Enable each dependency
+                each(this.depMaps, bind(this, function (depMap, i) {
+                    var id, mod, handler;
+
+                    if (typeof depMap === 'string') {
+                        //Dependency needs to be converted to a depMap
+                        //and wired up to this module.
+                        depMap = makeModuleMap(depMap,
+                                               (this.map.isDefine ? this.map : this.map.parentMap),
+                                               false,
+                                               !this.skipMap);
+                        this.depMaps[i] = depMap;
+
+                        handler = getOwn(handlers, depMap.id);
+
+                        if (handler) {
+                            this.depExports[i] = handler(this);
+                            return;
+                        }
+
+                        this.depCount += 1;
+
+                        on(depMap, 'defined', bind(this, function (depExports) {
+                            if (this.undefed) {
+                                return;
+                            }
+                            this.defineDep(i, depExports);
+                            this.check();
+                        }));
+
+                        if (this.errback) {
+                            on(depMap, 'error', bind(this, this.errback));
+                        } else if (this.events.error) {
+                            // No direct errback on this module, but something
+                            // else is listening for errors, so be sure to
+                            // propagate the error correctly.
+                            on(depMap, 'error', bind(this, function(err) {
+                                this.emit('error', err);
+                            }));
+                        }
+                    }
+
+                    id = depMap.id;
+                    mod = registry[id];
+
+                    //Skip special modules like 'require', 'exports', 'module'
+                    //Also, don't call enable if it is already enabled,
+                    //important in circular dependency cases.
+                    if (!hasProp(handlers, id) && mod && !mod.enabled) {
+                        context.enable(depMap, this);
+                    }
+                }));
+
+                //Enable each plugin that is used in
+                //a dependency
+                eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+                    var mod = getOwn(registry, pluginMap.id);
+                    if (mod && !mod.enabled) {
+                        context.enable(pluginMap, this);
+                    }
+                }));
+
+                this.enabling = false;
+
+                this.check();
+            },
+
+            on: function (name, cb) {
+                var cbs = this.events[name];
+                if (!cbs) {
+                    cbs = this.events[name] = [];
+                }
+                cbs.push(cb);
+            },
+
+            emit: function (name, evt) {
+                each(this.events[name], function (cb) {
+                    cb(evt);
+                });
+                if (name === 'error') {
+                    //Now that the error handler was triggered, remove
+                    //the listeners, since this broken Module instance
+                    //can stay around for a while in the registry.
+                    delete this.events[name];
+                }
+            }
+        };
+
+        function callGetModule(args) {
+            //Skip modules already defined.
+            if (!hasProp(defined, args[0])) {
+                getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+            }
+        }
+
+        function removeListener(node, func, name, ieName) {
+            //Favor detachEvent because of IE9
+            //issue, see attachEvent/addEventListener comment elsewhere
+            //in this file.
+            if (node.detachEvent && !isOpera) {
+                //Probably IE. If not it will throw an error, which will be
+                //useful to know.
+                if (ieName) {
+                    node.detachEvent(ieName, func);
+                }
+            } else {
+                node.removeEventListener(name, func, false);
+            }
+        }
+
+        /**
+         * Given an event from a script node, get the requirejs info from it,
+         * and then removes the event listeners on the node.
+         * @param {Event} evt
+         * @returns {Object}
+         */
+        function getScriptData(evt) {
+            //Using currentTarget instead of target for Firefox 2.0's sake. Not
+            //all old browsers will be supported, but this one was easy enough
+            //to support and still makes sense.
+            var node = evt.currentTarget || evt.srcElement;
+
+            //Remove the listeners once here.
+            removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+            removeListener(node, context.onScriptError, 'error');
+
+            return {
+                node: node,
+                id: node && node.getAttribute('data-requiremodule')
+            };
+        }
+
+        function intakeDefines() {
+            var args;
+
+            //Any defined modules in the global queue, intake them now.
+            takeGlobalQueue();
+
+            //Make sure any remaining defQueue items get properly processed.
+            while (defQueue.length) {
+                args = defQueue.shift();
+                if (args[0] === null) {
+                    return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +
+                        args[args.length - 1]));
+                } else {
+                    //args are id, deps, factory. Should be normalized by the
+                    //define() function.
+                    callGetModule(args);
+                }
+            }
+            context.defQueueMap = {};
+        }
+
+        context = {
+            config: config,
+            contextName: contextName,
+            registry: registry,
+            defined: defined,
+            urlFetched: urlFetched,
+            defQueue: defQueue,
+            defQueueMap: {},
+            Module: Module,
+            makeModuleMap: makeModuleMap,
+            nextTick: req.nextTick,
+            onError: onError,
+
+            /**
+             * Set a configuration for the context.
+             * @param {Object} cfg config object to integrate.
+             */
+            configure: function (cfg) {
+                //Make sure the baseUrl ends in a slash.
+                if (cfg.baseUrl) {
+                    if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+                        cfg.baseUrl += '/';
+                    }
+                }
+
+                //Save off the paths since they require special processing,
+                //they are additive.
+                var shim = config.shim,
+                    objs = {
+                        paths: true,
+                        bundles: true,
+                        config: true,
+                        map: true
+                    };
+
+                eachProp(cfg, function (value, prop) {
+                    if (objs[prop]) {
+                        if (!config[prop]) {
+                            config[prop] = {};
+                        }
+                        mixin(config[prop], value, true, true);
+                    } else {
+                        config[prop] = value;
+                    }
+                });
+
+                //Reverse map the bundles
+                if (cfg.bundles) {
+                    eachProp(cfg.bundles, function (value, prop) {
+                        each(value, function (v) {
+                            if (v !== prop) {
+                                bundlesMap[v] = prop;
+                            }
+                        });
+                    });
+                }
+
+                //Merge shim
+                if (cfg.shim) {
+                    eachProp(cfg.shim, function (value, id) {
+                        //Normalize the structure
+                        if (isArray(value)) {
+                            value = {
+                                deps: value
+                            };
+                        }
+                        if ((value.exports || value.init) && !value.exportsFn) {
+                            value.exportsFn = context.makeShimExports(value);
+                        }
+                        shim[id] = value;
+                    });
+                    config.shim = shim;
+                }
+
+                //Adjust packages if necessary.
+                if (cfg.packages) {
+                    each(cfg.packages, function (pkgObj) {
+                        var location, name;
+
+                        pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;
+
+                        name = pkgObj.name;
+                        location = pkgObj.location;
+                        if (location) {
+                            config.paths[name] = pkgObj.location;
+                        }
+
+                        //Save pointer to main module ID for pkg name.
+                        //Remove leading dot in main, so main paths are normalized,
+                        //and remove any trailing .js, since different package
+                        //envs have different conventions: some use a module name,
+                        //some use a file name.
+                        config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
+                                     .replace(currDirRegExp, '')
+                                     .replace(jsSuffixRegExp, '');
+                    });
+                }
+
+                //If there are any "waiting to execute" modules in the registry,
+                //update the maps for them, since their info, like URLs to load,
+                //may have changed.
+                eachProp(registry, function (mod, id) {
+                    //If module already has init called, since it is too
+                    //late to modify them, and ignore unnormalized ones
+                    //since they are transient.
+                    if (!mod.inited && !mod.map.unnormalized) {
+                        mod.map = makeModuleMap(id, null, true);
+                    }
+                });
+
+                //If a deps array or a config callback is specified, then call
+                //require with those args. This is useful when require is defined as a
+                //config object before require.js is loaded.
+                if (cfg.deps || cfg.callback) {
+                    context.require(cfg.deps || [], cfg.callback);
+                }
+            },
+
+            makeShimExports: function (value) {
+                function fn() {
+                    var ret;
+                    if (value.init) {
+                        ret = value.init.apply(global, arguments);
+                    }
+                    return ret || (value.exports && getGlobal(value.exports));
+                }
+                return fn;
+            },
+
+            makeRequire: function (relMap, options) {
+                options = options || {};
+
+                function localRequire(deps, callback, errback) {
+                    var id, map, requireMod;
+
+                    if (options.enableBuildCallback && callback && isFunction(callback)) {
+                        callback.__requireJsBuild = true;
+                    }
+
+                    if (typeof deps === 'string') {
+                        if (isFunction(callback)) {
+                            //Invalid call
+                            return onError(makeError('requireargs', 'Invalid require call'), errback);
+                        }
+
+                        //If require|exports|module are requested, get the
+                        //value for them from the special handlers. Caveat:
+                        //this only works while module is being defined.
+                        if (relMap && hasProp(handlers, deps)) {
+                            return handlers[deps](registry[relMap.id]);
+                        }
+
+                        //Synchronous access to one module. If require.get is
+                        //available (as in the Node adapter), prefer that.
+                        if (req.get) {
+                            return req.get(context, deps, relMap, localRequire);
+                        }
+
+                        //Normalize module name, if it contains . or ..
+                        map = makeModuleMap(deps, relMap, false, true);
+                        id = map.id;
+
+                        if (!hasProp(defined, id)) {
+                            return onError(makeError('notloaded', 'Module name "' +
+                                        id +
+                                        '" has not been loaded yet for context: ' +
+                                        contextName +
+                                        (relMap ? '' : '. Use require([])')));
+                        }
+                        return defined[id];
+                    }
+
+                    //Grab defines waiting in the global queue.
+                    intakeDefines();
+
+                    //Mark all the dependencies as needing to be loaded.
+                    context.nextTick(function () {
+                        //Some defines could have been added since the
+                        //require call, collect them.
+                        intakeDefines();
+
+                        requireMod = getModule(makeModuleMap(null, relMap));
+
+                        //Store if map config should be applied to this require
+                        //call for dependencies.
+                        requireMod.skipMap = options.skipMap;
+
+                        requireMod.init(deps, callback, errback, {
+                            enabled: true
+                        });
+
+                        checkLoaded();
+                    });
+
+                    return localRequire;
+                }
+
+                mixin(localRequire, {
+                    isBrowser: isBrowser,
+
+                    /**
+                     * Converts a module name + .extension into an URL path.
+                     * *Requires* the use of a module name. It does not support using
+                     * plain URLs like nameToUrl.
+                     */
+                    toUrl: function (moduleNamePlusExt) {
+                        var ext,
+                            index = moduleNamePlusExt.lastIndexOf('.'),
+                            segment = moduleNamePlusExt.split('/')[0],
+                            isRelative = segment === '.' || segment === '..';
+
+                        //Have a file extension alias, and it is not the
+                        //dots from a relative path.
+                        if (index !== -1 && (!isRelative || index > 1)) {
+                            ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+                            moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+                        }
+
+                        return context.nameToUrl(normalize(moduleNamePlusExt,
+                                                relMap && relMap.id, true), ext,  true);
+                    },
+
+                    defined: function (id) {
+                        return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+                    },
+
+                    specified: function (id) {
+                        id = makeModuleMap(id, relMap, false, true).id;
+                        return hasProp(defined, id) || hasProp(registry, id);
+                    }
+                });
+
+                //Only allow undef on top level require calls
+                if (!relMap) {
+                    localRequire.undef = function (id) {
+                        //Bind any waiting define() calls to this context,
+                        //fix for #408
+                        takeGlobalQueue();
+
+                        var map = makeModuleMap(id, relMap, true),
+                            mod = getOwn(registry, id);
+
+                        mod.undefed = true;
+                        removeScript(id);
+
+                        delete defined[id];
+                        delete urlFetched[map.url];
+                        delete undefEvents[id];
+
+                        //Clean queued defines too. Go backwards
+                        //in array so that the splices do not
+                        //mess up the iteration.
+                        eachReverse(defQueue, function(args, i) {
+                            if (args[0] === id) {
+                                defQueue.splice(i, 1);
+                            }
+                        });
+                        delete context.defQueueMap[id];
+
+                        if (mod) {
+                            //Hold on to listeners in case the
+                            //module will be attempted to be reloaded
+                            //using a different config.
+                            if (mod.events.defined) {
+                                undefEvents[id] = mod.events;
+                            }
+
+                            cleanRegistry(id);
+                        }
+                    };
+                }
+
+                return localRequire;
+            },
+
+            /**
+             * Called to enable a module if it is still in the registry
+             * awaiting enablement. A second arg, parent, the parent module,
+             * is passed in for context, when this method is overridden by
+             * the optimizer. Not shown here to keep code compact.
+             */
+            enable: function (depMap) {
+                var mod = getOwn(registry, depMap.id);
+                if (mod) {
+                    getModule(depMap).enable();
+                }
+            },
+
+            /**
+             * Internal method used by environment adapters to complete a load event.
+             * A load event could be a script load or just a load pass from a synchronous
+             * load call.
+             * @param {String} moduleName the name of the module to potentially complete.
+             */
+            completeLoad: function (moduleName) {
+                var found, args, mod,
+                    shim = getOwn(config.shim, moduleName) || {},
+                    shExports = shim.exports;
+
+                takeGlobalQueue();
+
+                while (defQueue.length) {
+                    args = defQueue.shift();
+                    if (args[0] === null) {
+                        args[0] = moduleName;
+                        //If already found an anonymous module and bound it
+                        //to this name, then this is some other anon module
+                        //waiting for its completeLoad to fire.
+                        if (found) {
+                            break;
+                        }
+                        found = true;
+                    } else if (args[0] === moduleName) {
+                        //Found matching define call for this script!
+                        found = true;
+                    }
+
+                    callGetModule(args);
+                }
+                context.defQueueMap = {};
+
+                //Do this after the cycle of callGetModule in case the result
+                //of those calls/init calls changes the registry.
+                mod = getOwn(registry, moduleName);
+
+                if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+                    if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+                        if (hasPathFallback(moduleName)) {
+                            return;
+                        } else {
+                            return onError(makeError('nodefine',
+                                             'No define call for ' + moduleName,
+                                             null,
+                                             [moduleName]));
+                        }
+                    } else {
+                        //A script that does not call define(), so just simulate
+                        //the call for it.
+                        callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+                    }
+                }
+
+                checkLoaded();
+            },
+
+            /**
+             * Converts a module name to a file path. Supports cases where
+             * moduleName may actually be just an URL.
+             * Note that it **does not** call normalize on the moduleName,
+             * it is assumed to have already been normalized. This is an
+             * internal API, not a public one. Use toUrl for the public API.
+             */
+            nameToUrl: function (moduleName, ext, skipExt) {
+                var paths, syms, i, parentModule, url,
+                    parentPath, bundleId,
+                    pkgMain = getOwn(config.pkgs, moduleName);
+
+                if (pkgMain) {
+                    moduleName = pkgMain;
+                }
+
+                bundleId = getOwn(bundlesMap, moduleName);
+
+                if (bundleId) {
+                    return context.nameToUrl(bundleId, ext, skipExt);
+                }
+
+                //If a colon is in the URL, it indicates a protocol is used and it is just
+                //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+                //or ends with .js, then assume the user meant to use an url and not a module id.
+                //The slash is important for protocol-less URLs as well as full paths.
+                if (req.jsExtRegExp.test(moduleName)) {
+                    //Just a plain path, not module name lookup, so just return it.
+                    //Add extension if it is included. This is a bit wonky, only non-.js things pass
+                    //an extension, this method probably needs to be reworked.
+                    url = moduleName + (ext || '');
+                } else {
+                    //A module that needs to be converted to a path.
+                    paths = config.paths;
+
+                    syms = moduleName.split('/');
+                    //For each module name segment, see if there is a path
+                    //registered for it. Start with most specific name
+                    //and work up from it.
+                    for (i = syms.length; i > 0; i -= 1) {
+                        parentModule = syms.slice(0, i).join('/');
+
+                        parentPath = getOwn(paths, parentModule);
+                        if (parentPath) {
+                            //If an array, it means there are a few choices,
+                            //Choose the one that is desired
+                            if (isArray(parentPath)) {
+                                parentPath = parentPath[0];
+                            }
+                            syms.splice(0, i, parentPath);
+                            break;
+                        }
+                    }
+
+                    //Join the path parts together, then figure out if baseUrl is needed.
+                    url = syms.join('/');
+                    url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+                    url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+                }
+
+                return config.urlArgs ? url +
+                                        ((url.indexOf('?') === -1 ? '?' : '&') +
+                                         config.urlArgs) : url;
+            },
+
+            //Delegates to req.load. Broken out as a separate function to
+            //allow overriding in the optimizer.
+            load: function (id, url) {
+                req.load(context, id, url);
+            },
+
+            /**
+             * Executes a module callback function. Broken out as a separate function
+             * solely to allow the build system to sequence the files in the built
+             * layer in the right sequence.
+             *
+             * @private
+             */
+            execCb: function (name, callback, args, exports) {
+                return callback.apply(exports, args);
+            },
+
+            /**
+             * callback for script loads, used to check status of loading.
+             *
+             * @param {Event} evt the event from the browser for the script
+             * that was loaded.
+             */
+            onScriptLoad: function (evt) {
+                //Using currentTarget instead of target for Firefox 2.0's sake. Not
+                //all old browsers will be supported, but this one was easy enough
+                //to support and still makes sense.
+                if (evt.type === 'load' ||
+                        (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+                    //Reset interactive script so a script node is not held onto for
+                    //to long.
+                    interactiveScript = null;
+
+                    //Pull out the name of the module and the context.
+                    var data = getScriptData(evt);
+                    context.completeLoad(data.id);
+                }
+            },
+
+            /**
+             * Callback for script errors.
+             */
+            onScriptError: function (evt) {
+                var data = getScriptData(evt);
+                if (!hasPathFallback(data.id)) {
+                    var parents = [];
+                    eachProp(registry, function(value, key) {
+                        if (key.indexOf('_@r') !== 0) {
+                            each(value.depMaps, function(depMap) {
+                                if (depMap.id === data.id) {
+                                    parents.push(key);
+                                }
+                                return true;
+                            });
+                        }
+                    });
+                    return onError(makeError('scripterror', 'Script error for "' + data.id +
+                                             (parents.length ?
+                                             '", needed by: ' + parents.join(', ') :
+                                             '"'), evt, [data.id]));
+                }
+            }
+        };
+
+        context.require = context.makeRequire();
+        return context;
+    }
+
+    /**
+     * Main entry point.
+     *
+     * If the only argument to require is a string, then the module that
+     * is represented by that string is fetched for the appropriate context.
+     *
+     * If the first argument is an array, then it will be treated as an array
+     * of dependency string names to fetch. An optional function callback can
+     * be specified to execute when all of those dependencies are available.
+     *
+     * Make a local req variable to help Caja compliance (it assumes things
+     * on a require that are not standardized), and to give a short
+     * name for minification/local scope use.
+     */
+    req = requirejs = function (deps, callback, errback, optional) {
+
+        //Find the right context, use default
+        var context, config,
+            contextName = defContextName;
+
+        // Determine if have config object in the call.
+        if (!isArray(deps) && typeof deps !== 'string') {
+            // deps is a config object
+            config = deps;
+            if (isArray(callback)) {
+                // Adjust args if there are dependencies
+                deps = callback;
+                callback = errback;
+                errback = optional;
+            } else {
+                deps = [];
+            }
+        }
+
+        if (config && config.context) {
+            contextName = config.context;
+        }
+
+        context = getOwn(contexts, contextName);
+        if (!context) {
+            context = contexts[contextName] = req.s.newContext(contextName);
+        }
+
+        if (config) {
+            context.configure(config);
+        }
+
+        return context.require(deps, callback, errback);
+    };
+
+    /**
+     * Support require.config() to make it easier to cooperate with other
+     * AMD loaders on globally agreed names.
+     */
+    req.config = function (config) {
+        return req(config);
+    };
+
+    /**
+     * Execute something after the current tick
+     * of the event loop. Override for other envs
+     * that have a better solution than setTimeout.
+     * @param  {Function} fn function to execute later.
+     */
+    req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+        setTimeout(fn, 4);
+    } : function (fn) { fn(); };
+
+    /**
+     * Export require as a global, but only if it does not already exist.
+     */
+    if (!require) {
+        require = req;
+    }
+
+    req.version = version;
+
+    //Used to filter out dependencies that are already paths.
+    req.jsExtRegExp = /^\/|:|\?|\.js$/;
+    req.isBrowser = isBrowser;
+    s = req.s = {
+        contexts: contexts,
+        newContext: newContext
+    };
+
+    //Create default context.
+    req({});
+
+    //Exports some context-sensitive methods on global require.
+    each([
+        'toUrl',
+        'undef',
+        'defined',
+        'specified'
+    ], function (prop) {
+        //Reference from contexts instead of early binding to default context,
+        //so that during builds, the latest instance of the default context
+        //with its config gets used.
+        req[prop] = function () {
+            var ctx = contexts[defContextName];
+            return ctx.require[prop].apply(ctx, arguments);
+        };
+    });
+
+    if (isBrowser) {
+        head = s.head = document.getElementsByTagName('head')[0];
+        //If BASE tag is in play, using appendChild is a problem for IE6.
+        //When that browser dies, this can be removed. Details in this jQuery bug:
+        //http://dev.jquery.com/ticket/2709
+        baseElement = document.getElementsByTagName('base')[0];
+        if (baseElement) {
+            head = s.head = baseElement.parentNode;
+        }
+    }
+
+    /**
+     * Any errors that require explicitly generates will be passed to this
+     * function. Intercept/override it if you want custom error handling.
+     * @param {Error} err the error object.
+     */
+    req.onError = defaultOnError;
+
+    /**
+     * Creates the node for the load command. Only used in browser envs.
+     */
+    req.createNode = function (config, moduleName, url) {
+        var node = config.xhtml ?
+                document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+                document.createElement('script');
+        node.type = config.scriptType || 'text/javascript';
+        node.charset = 'utf-8';
+        node.async = true;
+        return node;
+    };
+
+    /**
+     * Does the request to load a module for the browser case.
+     * Make this a separate function to allow other environments
+     * to override it.
+     *
+     * @param {Object} context the require context to find state.
+     * @param {String} moduleName the name of the module.
+     * @param {Object} url the URL to the module.
+     */
+    req.load = function (context, moduleName, url) {
+        var config = (context && context.config) || {},
+            node;
+        if (isBrowser) {
+            //In the browser so use a script tag
+            node = req.createNode(config, moduleName, url);
+            if (config.onNodeCreated) {
+                config.onNodeCreated(node, config, moduleName, url);
+            }
+
+            node.setAttribute('data-requirecontext', context.contextName);
+            node.setAttribute('data-requiremodule', moduleName);
+
+            //Set up load listener. Test attachEvent first because IE9 has
+            //a subtle issue in its addEventListener and script onload firings
+            //that do not match the behavior of all other browsers with
+            //addEventListener support, which fire the onload event for a
+            //script right after the script execution. See:
+            //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+            //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+            //script execution mode.
+            if (node.attachEvent &&
+                    //Check if node.attachEvent is artificially added by custom script or
+                    //natively supported by browser
+                    //read https://github.com/jrburke/requirejs/issues/187
+                    //if we can NOT find [native code] then it must NOT natively supported.
+                    //in IE8, node.attachEvent does not have toString()
+                    //Note the test for "[native code" with no closing brace, see:
+                    //https://github.com/jrburke/requirejs/issues/273
+                    !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+                    !isOpera) {
+                //Probably IE. IE (at least 6-8) do not fire
+                //script onload right after executing the script, so
+                //we cannot tie the anonymous define call to a name.
+                //However, IE reports the script as being in 'interactive'
+                //readyState at the time of the define call.
+                useInteractive = true;
+
+                node.attachEvent('onreadystatechange', context.onScriptLoad);
+                //It would be great to add an error handler here to catch
+                //404s in IE9+. However, onreadystatechange will fire before
+                //the error handler, so that does not help. If addEventListener
+                //is used, then IE will fire error before load, but we cannot
+                //use that pathway given the connect.microsoft.com issue
+                //mentioned above abo

<TRUNCATED>

[20/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.min.js
new file mode 100644
index 0000000..8f9fd39
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-paginator/js/backgrid-paginator.min.js
@@ -0,0 +1,8 @@
+/*
+  backgrid-paginator
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+!function(a,b){"object"==typeof exports?module.exports=b(require("underscore"),require("backbone"),require("backgrid"),require("backbone-pageable")):b(a._,a.Backbone,a.Backgrid)}(this,function(a,b,c){"use strict";var d=c.Extension.PageHandle=b.View.extend({tagName:"li",events:{"click a":"changePage"},title:a.template("Page <%- label %>",null,{variable:null}),isRewind:!1,isBack:!1,isForward:!1,isFastForward:!1,initialize:function(b){var c=this.collection,d=c.state,e=d.currentPage,f=d.firstPage,g=d.lastPage;a.extend(this,a.pick(b,["isRewind","isBack","isForward","isFastForward"]));var h;this.isRewind?h=f:this.isBack?h=Math.max(f,e-1):this.isForward?h=Math.min(g,e+1):this.isFastForward?h=g:(h=+b.pageIndex,h=f?h+1:h),this.pageIndex=h,this.label=(b.label||(f?h:h+1))+"";var i=b.title||this.title;this.title=a.isFunction(i)?i({label:this.label}):i},render:function(){this.$el.empty();var a=document.createElement("a");a.href="#",this.title&&(a.title=this.title),a.innerHTML=this.label,this.el.
 appendChild(a);var b=this.collection,c=b.state,d=c.currentPage,e=this.pageIndex;return this.isRewind&&d==c.firstPage||this.isBack&&!b.hasPrevious()||this.isForward&&!b.hasNext()||this.isFastForward&&(d==c.lastPage||c.totalPages<1)?this.$el.addClass("disabled"):this.isRewind||this.isBack||this.isForward||this.isFastForward||c.currentPage!=e||this.$el.addClass("active"),this.delegateEvents(),this},changePage:function(a){a.preventDefault();var b=this.$el,c=this.collection;return b.hasClass("active")||b.hasClass("disabled")||(this.isRewind?c.getFirstPage():this.isBack?c.getPreviousPage():this.isForward?c.getNextPage():this.isFastForward?c.getLastPage():c.getPage(this.pageIndex,{reset:!0})),this}}),e=c.Extension.Paginator=b.View.extend({className:"backgrid-paginator",windowSize:10,slideScale:.5,controls:{rewind:{label:"《",title:"First"},back:{label:"〈",title:"Previous"},forward:{label:"〉",title:"Next"},fastForward:{label:"》",title:"Last"}},renderIndexedPageHandles:!0,pageHandle:d
 ,goBackFirstOnSort:!0,initialize:function(b){var c=this;c.controls=a.defaults(b.controls||{},c.controls,e.prototype.controls),a.extend(c,a.pick(b||{},"windowSize","pageHandle","slideScale","goBackFirstOnSort","renderIndexedPageHandles"));var d=c.collection;c.listenTo(d,"add",c.render),c.listenTo(d,"remove",c.render),c.listenTo(d,"reset",c.render),c.listenTo(d,"backgrid:sorted",function(){c.goBackFirstOnSort&&d.getFirstPage({reset:!0})})},slideMaybe:function(a,b,c,d){return Math.round(c%d/d)},slideThisMuch:function(a,b,c,d,e){return~~(d*e)},_calculateWindow:function(){var a=this.collection,b=a.state,c=b.firstPage,d=+b.lastPage;d=Math.max(0,c?d-1:d);var e=Math.max(b.currentPage,b.firstPage);e=c?e-1:e;var f=this.windowSize,g=this.slideScale,h=Math.floor(e/f)*f;e<=d-this.slideThisMuch()&&(h+=this.slideMaybe(c,d,e,f,g)*this.slideThisMuch(c,d,e,f,g));var i=Math.min(d+1,h+f);return[h,i]},makeHandles:function(){var b=[],c=this.collection,d=this._calculateWindow(),e=d[0],f=d[1];if(this.rende
 rIndexedPageHandles)for(var g=e;f>g;g++)b.push(new this.pageHandle({collection:c,pageIndex:g}));var h=this.controls;return a.each(["back","rewind","forward","fastForward"],function(a){var d=h[a];if(d){var e={collection:c,title:d.title,label:d.label};e["is"+a.slice(0,1).toUpperCase()+a.slice(1)]=!0;var f=new this.pageHandle(e);"rewind"==a||"back"==a?b.unshift(f):b.push(f)}},this),b},render:function(){if(this.$el.empty(),this.handles)for(var a=0,b=this.handles.length;b>a;a++)this.handles[a].remove();for(var c=this.handles=this.makeHandles(),d=document.createElement("ul"),a=0;a<c.length;a++)d.appendChild(c[a].render().el);return this.el.appendChild(d),this}})});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.js
new file mode 100644
index 0000000..1777f11
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.js
@@ -0,0 +1,274 @@
+/*
+  backgrid-select-all
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+(function (root, factory) {
+
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(require("backbone"), require("backgrid"));
+  }
+  // Browser
+  else factory(root.Backbone, root.Backgrid);
+
+}(this, function (Backbone, Backgrid) {
+
+  "use strict";
+
+  /**
+     Renders a checkbox for row selection.
+
+     @class Backgrid.Extension.SelectRowCell
+     @extends Backbone.View
+  */
+  var SelectRowCell = Backgrid.Extension.SelectRowCell = Backbone.View.extend({
+
+    /** @property */
+    className: "select-row-cell",
+
+    /** @property */
+    tagName: "td",
+
+    /** @property */
+    events: {
+      "keydown input[type=checkbox]": "onKeydown",
+      "change input[type=checkbox]": "onChange",
+      "click input[type=checkbox]": "enterEditMode"
+    },
+
+    /**
+       Initializer. If the underlying model triggers a `select` event, this cell
+       will change its checked value according to the event's `selected` value.
+
+       @param {Object} options
+       @param {Backgrid.Column} options.column
+       @param {Backbone.Model} options.model
+    */
+    initialize: function (options) {
+
+      this.column = options.column;
+      if (!(this.column instanceof Backgrid.Column)) {
+        this.column = new Backgrid.Column(this.column);
+      }
+
+      var column = this.column, model = this.model, $el = this.$el;
+      this.listenTo(column, "change:renderable", function (column, renderable) {
+        $el.toggleClass("renderable", renderable);
+      });
+
+      if (Backgrid.callByNeed(column.renderable(), column, model)) $el.addClass("renderable");
+
+      this.listenTo(model, "backgrid:select", function (model, selected) {
+        this.$el.find("input[type=checkbox]").prop("checked", selected).change();
+      });
+    },
+
+    /**
+       Focuses the checkbox.
+    */
+    enterEditMode: function () {
+      this.$el.find("input[type=checkbox]").focus();
+    },
+
+    /**
+       Unfocuses the checkbox.
+    */
+    exitEditMode: function () {
+      this.$el.find("input[type=checkbox]").blur();
+    },
+
+    /**
+       Process keyboard navigation.
+    */
+    onKeydown: function (e) {
+      var command = new Backgrid.Command(e);
+      if (command.passThru()) return true; // skip ahead to `change`
+      if (command.cancel()) {
+        e.stopPropagation();
+        this.$el.find("input[type=checkbox]").blur();
+      }
+      else if (command.save() || command.moveLeft() || command.moveRight() ||
+               command.moveUp() || command.moveDown()) {
+        e.preventDefault();
+        e.stopPropagation();
+        this.model.trigger("backgrid:edited", this.model, this.column, command);
+      }
+    },
+
+    /**
+       When the checkbox's value changes, this method will trigger a Backbone
+       `backgrid:selected` event with a reference of the model and the
+       checkbox's `checked` value.
+    */
+    onChange: function () {
+      var checked = this.$el.find("input[type=checkbox]").prop("checked");
+      this.$el.parent().toggleClass("selected", checked);
+      this.model.trigger("backgrid:selected", this.model, checked);
+    },
+
+    /**
+       Renders a checkbox in a table cell.
+    */
+    render: function () {
+      this.$el.empty().append('<input tabindex="-1" type="checkbox" />');
+      this.delegateEvents();
+      return this;
+    }
+
+  });
+
+  /**
+     Renders a checkbox to select all rows on the current page.
+
+     @class Backgrid.Extension.SelectAllHeaderCell
+     @extends Backgrid.Extension.SelectRowCell
+  */
+  var SelectAllHeaderCell = Backgrid.Extension.SelectAllHeaderCell = SelectRowCell.extend({
+
+    /** @property */
+    className: "select-all-header-cell",
+
+    /** @property */
+    tagName: "th",
+
+    /**
+       Initializer. When this cell's checkbox is checked, a Backbone
+       `backgrid:select` event will be triggered for each model for the current
+       page in the underlying collection. If a `SelectRowCell` instance exists
+       for the rows representing the models, they will check themselves. If any
+       of the SelectRowCell instances trigger a Backbone `backgrid:selected`
+       event with a `false` value, this cell will uncheck its checkbox. In the
+       event of a Backbone `backgrid:refresh` event, which is triggered when the
+       body refreshes its rows, which can happen under a number of conditions
+       such as paging or the columns were reset, this cell will still remember
+       the previously selected models and trigger a Backbone `backgrid:select`
+       event on them such that the SelectRowCells can recheck themselves upon
+       refreshing.
+
+       @param {Object} options
+       @param {Backgrid.Column} options.column
+       @param {Backbone.Collection} options.collection
+    */
+    initialize: function (options) {
+
+      this.column = options.column;
+      if (!(this.column instanceof Backgrid.Column)) {
+        this.column = new Backgrid.Column(this.column);
+      }
+
+      var collection = this.collection;
+      var selectedModels = this.selectedModels = {};
+      this.listenTo(collection.fullCollection || collection,
+                    "backgrid:selected", function (model, selected) {
+        if (selected) selectedModels[model.id || model.cid] = 1;
+        else {
+          delete selectedModels[model.id || model.cid];
+          this.$el.find("input[type=checkbox]").prop("checked", false);
+        }
+      });
+
+      this.listenTo(collection.fullCollection || collection, "remove", function (model) {
+        delete selectedModels[model.id || model.cid];
+      });
+
+      this.listenTo(collection, "backgrid:refresh", function () {
+        var checked = this.$el.find("input[type=checkbox]").prop("checked");
+        for (var i = 0; i < collection.length; i++) {
+          var model = collection.at(i);
+          if (checked || selectedModels[model.id || model.cid]) {
+            model.trigger("backgrid:select", model, true);
+          }
+        }
+      });
+
+      var column = this.column, $el = this.$el;
+      this.listenTo(column, "change:renderable", function (column, renderable) {
+        $el.toggleClass("renderable", renderable);
+      });
+
+      if (Backgrid.callByNeed(column.renderable(), column, collection)) $el.addClass("renderable");
+    },
+
+    /**
+       Propagates the checked value of this checkbox to all the models of the
+       underlying collection by triggering a Backbone `backgrid:select` event on
+       the models on the current page, passing each model and the current
+       `checked` value of the checkbox in each event.
+
+       A `backgrid:selected` event will also be triggered with the current
+       `checked` value on all the models regardless of whether they are on the
+       current page.
+
+       This method triggers a 'backgrid:select-all' event on the collection
+       afterwards.
+    */
+    onChange: function () {
+      var checked = this.$el.find("input[type=checkbox]").prop("checked");
+
+      var collection = this.collection;
+      collection.each(function (model) {
+        model.trigger("backgrid:select", model, checked);
+      });
+
+      if (collection.fullCollection) {
+        collection.fullCollection.each(function (model) {
+          if (!collection.get(model.cid)) {
+            model.trigger("backgrid:selected", model, checked);
+          }
+        });
+      }
+
+      this.collection.trigger("backgrid:select-all", this.collection, checked);
+    }
+
+  });
+
+  /**
+     Convenient method to retrieve a list of selected models. This method only
+     exists when the `SelectAll` extension has been included. Selected models
+     are retained across pagination.
+
+     @member Backgrid.Grid
+     @return {Array.<Backbone.Model>}
+  */
+  Backgrid.Grid.prototype.getSelectedModels = function () {
+    var selectAllHeaderCell;
+    var headerCells = this.header.row.cells;
+    for (var i = 0, l = headerCells.length; i < l; i++) {
+      var headerCell = headerCells[i];
+      if (headerCell instanceof SelectAllHeaderCell) {
+        selectAllHeaderCell = headerCell;
+        break;
+      }
+    }
+
+    var result = [];
+    if (selectAllHeaderCell) {
+      var selectedModels = selectAllHeaderCell.selectedModels;
+      var collection = this.collection.fullCollection || this.collection;
+      for (var modelId in selectedModels) {
+        result.push(collection.get(modelId));
+      }
+    }
+
+    return result;
+  };
+
+  /**
+     Convenient method to deselect the selected models. This method is only
+     available when the `SelectAll` extension has been included.
+
+     @member Backgrid.Grid
+   */
+  Backgrid.Grid.prototype.clearSelectedModels = function () {
+    var selectedModels = this.getSelectedModels();
+    for (var i = 0, l = selectedModels.length; i < l; i++) {
+      var model = selectedModels[i];
+      model.trigger("backgrid:select", model, false);
+    }
+  };
+
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.min.js
new file mode 100644
index 0000000..1e49adf
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-select-all/js/backgrid-select-all.min.js
@@ -0,0 +1,8 @@
+/*
+  backgrid-select-all
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT @license.
+*/
+!function(a,b){"object"==typeof exports?module.exports=b(require("backbone"),require("backgrid")):b(a.Backbone,a.Backgrid)}(this,function(a,b){"use strict";var c=b.Extension.SelectRowCell=a.View.extend({className:"select-row-cell",tagName:"td",events:{"keydown input[type=checkbox]":"onKeydown","change input[type=checkbox]":"onChange","click input[type=checkbox]":"enterEditMode"},initialize:function(a){this.column=a.column,this.column instanceof b.Column||(this.column=new b.Column(this.column));var c=this.column,d=this.model,e=this.$el;this.listenTo(c,"change:renderable",function(a,b){e.toggleClass("renderable",b)}),b.callByNeed(c.renderable(),c,d)&&e.addClass("renderable"),this.listenTo(d,"backgrid:select",function(a,b){this.$el.find("input[type=checkbox]").prop("checked",b).change()})},enterEditMode:function(){this.$el.find("input[type=checkbox]").focus()},exitEditMode:function(){this.$el.find("input[type=checkbox]").blur()},onKeydown:function(a){var c=new b.Command(a);return c.pas
 sThru()?!0:(c.cancel()?(a.stopPropagation(),this.$el.find("input[type=checkbox]").blur()):(c.save()||c.moveLeft()||c.moveRight()||c.moveUp()||c.moveDown())&&(a.preventDefault(),a.stopPropagation(),this.model.trigger("backgrid:edited",this.model,this.column,c)),void 0)},onChange:function(){var a=this.$el.find("input[type=checkbox]").prop("checked");this.$el.parent().toggleClass("selected",a),this.model.trigger("backgrid:selected",this.model,a)},render:function(){return this.$el.empty().append('<input tabindex="-1" type="checkbox" />'),this.delegateEvents(),this}}),d=b.Extension.SelectAllHeaderCell=c.extend({className:"select-all-header-cell",tagName:"th",initialize:function(a){this.column=a.column,this.column instanceof b.Column||(this.column=new b.Column(this.column));var c=this.collection,d=this.selectedModels={};this.listenTo(c.fullCollection||c,"backgrid:selected",function(a,b){b?d[a.id||a.cid]=1:(delete d[a.id||a.cid],this.$el.find("input[type=checkbox]").prop("checked",!1))}),t
 his.listenTo(c.fullCollection||c,"remove",function(a){delete d[a.id||a.cid]}),this.listenTo(c,"backgrid:refresh",function(){for(var a=this.$el.find("input[type=checkbox]").prop("checked"),b=0;b<c.length;b++){var e=c.at(b);(a||d[e.id||e.cid])&&e.trigger("backgrid:select",e,!0)}});var e=this.column,f=this.$el;this.listenTo(e,"change:renderable",function(a,b){f.toggleClass("renderable",b)}),b.callByNeed(e.renderable(),e,c)&&f.addClass("renderable")},onChange:function(){var a=this.$el.find("input[type=checkbox]").prop("checked"),b=this.collection;b.each(function(b){b.trigger("backgrid:select",b,a)}),b.fullCollection&&b.fullCollection.each(function(c){b.get(c.cid)||c.trigger("backgrid:selected",c,a)}),this.collection.trigger("backgrid:select-all",this.collection,a)}});b.Grid.prototype.getSelectedModels=function(){for(var a,b=this.header.row.cells,c=0,e=b.length;e>c;c++){var f=b[c];if(f instanceof d){a=f;break}}var g=[];if(a){var h=a.selectedModels,i=this.collection.fullCollection||this.c
 ollection;for(var j in h)g.push(i.get(j))}return g},b.Grid.prototype.clearSelectedModels=function(){for(var a=this.getSelectedModels(),b=0,c=a.length;c>b;b++){var d=a[b];d.trigger("backgrid:select",d,!1)}}});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.css
new file mode 100644
index 0000000..759f47c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.css
@@ -0,0 +1,34 @@
+/*
+ backgrid-orderable-columns
+ https://github.com/WRidder/backgrid-orderable-columns
+
+ Copyright (c) 2014 Wilbert van de Ridder
+ Licensed under the MIT @license.
+ */
+.backgrid .orderable-indicator {
+    width: 3px;
+    top: 0;
+    position: absolute;
+    z-index: 1;
+}
+
+.backgrid .orderable-indicator-active {
+    background-color: #000; /* IE8 fallback */
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE8 fallback */
+    background-color: rgba(0, 0, 0, 0.5);
+}
+
+.backgrid thead th.orderable-ordering {
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /* IE8 fallback */
+    opacity: 0.3;
+}
+
+.backgrid .orderable-draggable {
+    position: absolute;
+    display: block;
+    background-color: #000; /* IE8 fallback */
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; /* IE8 fallback */
+    background-color: rgba(0, 0, 0, 0.1);
+    z-index: 3;
+    cursor: move;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.js
new file mode 100644
index 0000000..03cbbd2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/backgrid-orderable-columns.js
@@ -0,0 +1,680 @@
+/*
+ backgrid-orderable-columns
+ https://github.com/WRidder/backgrid-orderable-columns
+
+ Copyright (c) 2014 Wilbert van de Ridder
+ Licensed under the MIT @license.
+ */
+(function (root, factory) {
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(require("underscore"), require("backgrid"), require("jquery"));
+  }
+  // AMD. Register as an anonymous module.
+  else if (typeof define === 'function' && define.amd) {
+    define(['underscore', 'backgrid', 'jquery'], factory);
+  }
+  // Browser
+  else {
+    factory(root._, root.Backgrid, root.jQuery);
+  }
+}(this, function (_, Backgrid, $) {
+  "use strict";
+
+  // Adds width support to columns
+  Backgrid.Extension.OrderableColumns = Backbone.View.extend({
+    dragHooks: {},
+
+    /**
+     * Initializer
+     * @param options
+     */
+    initialize: function (options) {
+      this.sizeAbleColumns = options.sizeAbleColumns;
+      this.grid = this.sizeAbleColumns.grid;
+      this.columns = this.grid.columns;
+      this.header = this.grid.header;
+      this.collection = this.grid.collection;
+      this.moveThreshold = options.moveThreshold || 10;
+      this.orderAlignTop = options.orderAlignTop;
+
+      this.attachEvents();
+      this.setHeaderElements();
+
+      // Set scope handlers
+      this.mouseMoveHandler = _.bind(this.mouseMoveHandler, this);
+      this.mouseUpHandler = _.bind(this.mouseUpHandler, this);
+    },
+
+    /**
+     * Adds handlers to reorder the columns
+     * @returns {Backgrid.Extension.OrderableColumns}
+     */
+    render: function () {
+      var self = this;
+      self.$el.empty();
+
+      // Create indicators
+      self.addIndicators();
+
+      // Loop all rows
+      var headerRows = self.header.headerRows || [self.header.row];
+      _.each(headerRows, function (row) {
+        // Loop cells of row
+        _.each(row.cells, function (cell) {
+          // Get column model
+          var columnModel = cell.column;
+
+          // Attach handler if main orderable cell or has child
+          var orderable = false;
+          if (!columnModel.get("childColumns")) {
+            orderable = typeof columnModel.get("orderable") == "undefined" || columnModel.get("orderable");
+          }
+          else {
+            // Parent element is orderable if any of the children is orderable
+            orderable = _.some(columnModel.get("childColumns"), function(child) {
+              var childColumnModel = child.column;
+              return typeof childColumnModel.get("orderable") == "undefined" || childColumnModel.get("orderable");
+            });
+          }
+
+          // If orderable, add handler
+          if (orderable) {
+            cell.$el.on("mousedown",
+              _.bind(self.mouseDownHandler, {
+                view: self,
+                cell: cell,
+                column: columnModel
+              })
+            );
+          }
+        });
+      });
+
+      // Position drag handlers
+      self.updateIndicatorPosition();
+
+      return this;
+    },
+
+    /**
+     * Drag state object
+     */
+    dragState: {
+      dragIntention: false,
+      dragging: false,
+      $dragElement: null,
+      $activeIndicator: null,
+      column: null,
+      cell: null,
+      coordinateElementStartX: null,
+      coordinatePointerStartX: null,
+      oldFirstDisplayOrderValue: null,
+      oldLastDisplayOrderValue: null,
+      newDisplayOrderValue: null,
+      orderPrevented: null
+    },
+
+    mouseDownHandler: function(evt) {
+      var self = this.view;
+      var cell = this.cell;
+      var column = this.column;
+      var $headerElement = $(cell.$el);
+
+      // Check if left-click
+      if (evt.which === 1) {
+        self._stopEvent(evt);
+
+        // Set drag state
+        self.dragState.dragIntention = true;
+        self.dragState.column = column;
+        self.dragState.cell = cell;
+        self.dragState.coordinatePointerStartX = evt.pageX;
+        self.dragState.coordinateElementStartX = $headerElement.position().left;
+
+        if (column.get("childColumns")) {
+          self.dragState.oldFirstDisplayOrderValue = _.first(column.get("childColumns")).column.get("displayOrder");
+          self.dragState.newDisplayOrderValue = _.first(column.get("childColumns")).column.get("displayOrder");
+          self.dragState.oldLastDisplayOrderValue = _.last(column.get("childColumns")).column.get("displayOrder");
+        }
+        else {
+          self.dragState.oldFirstDisplayOrderValue = column.get("displayOrder");
+          self.dragState.newDisplayOrderValue = column.get("displayOrder");
+          self.dragState.oldLastDisplayOrderValue = column.get("displayOrder");
+        }
+
+        // Create copy of column element
+        self.dragState.$dragElement = $("<div/>")
+          .addClass("orderable-draggable")
+          .hide()
+          .appendTo(self.$el)
+          .width($headerElement.outerWidth())
+          .height($headerElement.outerHeight())
+          .css({
+            left: $headerElement.position().left,
+            top: $headerElement.position().top
+          });
+
+        // Add move and mouse up handler
+        $(document).on("mousemove", self.mouseMoveHandler);
+        $(document).on("mouseup", self.mouseUpHandler);
+      }
+    },
+
+    /**
+     * Mouse move event handler
+     * @param evt
+     */
+    mouseMoveHandler: function(evt) {
+      var self = this;
+      var pageX = evt.pageX;
+      var leftPosition = self.dragState.coordinateElementStartX + (pageX - self.dragState.coordinatePointerStartX);
+      self._stopEvent(evt);
+      var delta = Math.abs(pageX - self.dragState.coordinatePointerStartX);
+
+      if (self.dragState.dragging) {
+        // Highlight nearest indicator
+        self.calculateDropPosition(leftPosition, evt);
+
+        // Notify drag hooks
+        self.dragHookInvoke("dragMove", self.dragState.$dragElement, evt, self.dragState.column);
+
+        // Set draggable eleent position
+        self.dragState.$dragElement.css({
+          left: leftPosition
+        });
+      }
+      // Only move beyond threshold
+      else if (delta >= self.moveThreshold && !self.dragState.dragging) {
+        self.dragState.cell.$el.addClass("orderable-ordering");
+        self.dragState.dragging = true;
+
+        // Notify drag hooks
+        self.dragHookInvoke("dragStart", evt, self.dragState.column);
+
+        // Show and position drag element
+        self.dragState.$dragElement.css({
+          left: leftPosition
+        }).show();
+      }
+    },
+
+    /**
+     * Mouse up event handler
+     * @param evt
+     */
+    mouseUpHandler: function(evt) {
+      var self = this;
+
+      // Remove handlers
+      $(document).off("mousemove", self.mouseMoveHandler);
+      $(document).off("mouseup", self.mouseUpHandler);
+
+      // Notify drag hooks
+      self.dragHookInvoke("dragEnd", evt, self.dragState.column);
+
+      // Check if the columns have actually been re-ordered
+      if (!self.dragState.orderPrevented &&
+        self.dragState.oldFirstDisplayOrderValue !== self.dragState.newDisplayOrderValue) {
+
+        // Update positions
+        self.updateDisplayOrders();
+
+        // Trigger event indicating column reordering
+        self.columns.trigger("ordered");
+
+        // Sort columns
+        self.columns.sort();
+      }
+
+      // Reset drag state
+      self.resetDragState();
+    },
+
+    /**
+     * Find the drop position for the current position of the dragged header element
+     * @param leftPosition
+     * @param evt
+     */
+    calculateDropPosition: function(leftPosition, evt) {
+      var self = this;
+
+      // Find closest indicator
+      var closest = null;
+      var $closestIndicator = null;
+      _.each(self.indicatorPositions, function (indicator, displayOrder) {
+        if (closest == null ||
+          Math.abs(indicator.x - leftPosition) < Math.abs(closest - leftPosition) &&
+          (displayOrder <= self.dragState.oldFirstDisplayOrderValue || displayOrder > self.dragState.oldLastDisplayOrderValue + 1)
+        ) {
+          closest = indicator.x;
+          $closestIndicator = indicator.$el;
+        }
+      });
+
+      // Set active class on current indicator
+      if ($closestIndicator !== self.dragState.$activeIndicator) {
+        if (self.dragState.$activeIndicator) {
+          self.dragState.$activeIndicator.removeClass('orderable-indicator-active');
+        }
+      }
+
+      // Check if the move is valid
+      if (!self.dragHookPreventOrder(self.dragState.$dragElement, evt, self.dragState.column)) {
+        // Set active class on current indicator
+        if ($closestIndicator !== self.dragState.$activeIndicator) {
+          if (self.dragState.$activeIndicator) {
+            self.dragState.$activeIndicator.removeClass('orderable-indicator-active');
+          }
+          self.dragState.$activeIndicator = $closestIndicator;
+          $closestIndicator.addClass('orderable-indicator-active');
+
+          // Save new order
+          self.dragState.newDisplayOrderValue = $closestIndicator.data("column-displayOrder");
+        }
+        self.dragState.orderPrevented = false;
+      }
+      else {
+        self.dragState.orderPrevented = true;
+      }
+    },
+
+    /**
+     * Calculates displayOrder attributes for columns after re-ordering
+     */
+    updateDisplayOrders: function() {
+      var self = this;
+      var oldFirstDO = self.dragState.oldFirstDisplayOrderValue;
+      var oldLastDO = self.dragState.oldLastDisplayOrderValue;
+      var newDO = self.dragState.newDisplayOrderValue;
+      var movedRight = oldFirstDO < newDO;
+      var span = (oldLastDO - oldFirstDO) + 1;
+      var positionShift = (movedRight) ? (newDO - oldFirstDO - span) : (oldFirstDO - newDO);
+
+      // Update position attributes
+      self.columns.each(function (model) {
+        var mDO = model.get("displayOrder");
+        var nDO = mDO;
+        if (movedRight) {
+          if (mDO > oldLastDO && mDO < newDO) {
+            nDO = mDO - span;
+          }
+          else if (mDO >= oldFirstDO && mDO <= oldLastDO) {
+            nDO = mDO + positionShift;
+          }
+        }
+        else {
+          if (mDO >= newDO && mDO < oldFirstDO) {
+            nDO = mDO + span;
+          }
+          else if (mDO >= oldFirstDO && mDO <= oldLastDO) {
+            nDO = mDO - positionShift;
+          }
+        }
+
+        // Update displayOrder value
+        if (mDO !== nDO) {
+          model.set("displayOrder", nDO, {silent: true});
+        }
+      });
+    },
+
+    /**
+     * Reset drag state
+     */
+    resetDragState: function() {
+      this.dragState.dragging = false;
+      this.dragState.dragIntention = false;
+      if (this.dragState.cell) {
+        this.dragState.cell.$el.removeClass("orderable-ordering");
+        this.dragState.cell = null;
+      }
+      if (this.dragState.$dragElement) {
+        this.dragState.$dragElement.remove();
+        this.dragState.$dragElement = null;
+      }
+      if (this.dragState.$activeIndicator) {
+        this.dragState.$activeIndicator.removeClass('orderable-indicator-active');
+      }
+      this.dragState.$activeIndicator = null;
+      this.dragState.column = null;
+      this.dragState.coordinateElementStartX = null;
+      this.dragState.coordinatePointerStartX = null;
+      this.dragState.orderPrevented = null;
+    },
+
+    /**
+     * Adds indicators which will show at which spot the column will be placed while dragging
+     * @private
+     */
+    addIndicators: function () {
+      var self = this;
+      self.indicators = [];
+
+      var previousIndicators = false;
+      var previousDisplayOrder = 0;
+      var previousRealDisplayOrder = 0;
+      _.each(self.headerCells, function (headerCell) {
+        var model = headerCell.column;
+        if (previousIndicators || model.get("orderable")) {
+          var DO = model.get("displayOrder");
+
+          if (!previousIndicators) {
+            previousDisplayOrder = previousRealDisplayOrder = DO - 1;
+          }
+
+          // Check whether to add columns after front or tail when gaps exist.
+          if (!self.orderAlignTop && DO !== previousDisplayOrder + 1 && previousDisplayOrder === previousRealDisplayOrder) {
+            DO = previousDisplayOrder + 1;
+          }
+          self.$el.append(self.createIndicator(DO, headerCell));
+
+          // This boolean is used to see to what extend we can omit indicators upfront
+          previousIndicators = true;
+          previousDisplayOrder = DO;
+          previousRealDisplayOrder = model.get("displayOrder");
+        }
+      });
+
+      // Add trailing indicator
+      if (!_.isEmpty(self.headerCells) && _.last(self.headerCells).column.get("orderable")) {
+        self.$el.append(self.createIndicator(_.last(self.headerCells).column.get("displayOrder") + 1, null));
+      }
+
+      // Set indicator height
+      self.setIndicatorHeight(self.grid.header.$el.height());
+    },
+
+    /**
+     * Create a single indicator
+     * @param {Integer} displayOrder
+     * @returns {*|JQuery|any|jQuery}
+     * @private
+     */
+    createIndicator: function (displayOrder, cell) {
+      var self = this;
+
+      // Create helper elements
+      var $indicator = $("<div></div>")
+        .addClass("orderable-indicator")
+        .data("column-cell", cell)
+        .data("column-displayOrder", displayOrder);
+      self.indicators.push($indicator);
+
+      return $indicator;
+    },
+
+    /**
+     * Updates the position of all handlers
+     * @private
+     */
+    updateIndicatorPosition: function () {
+      var self = this;
+      self.indicatorPositions = {};
+
+      _.each(self.indicators, function ($indicator, indx) {
+        var cell = $indicator.data("column-cell");
+        var displayOrder = $indicator.data("column-displayOrder");
+
+        var left;
+        if (cell) {
+          left = cell.$el.position().left;
+        }
+        else {
+          var prevCell = self.indicators[indx - 1].data("column-cell");
+          left = prevCell.$el.position().left + prevCell.$el.width();
+        }
+        self.indicatorPositions[displayOrder] = {
+          x: left,
+          $el: $indicator
+        };
+
+        // Get handler for current column and update position
+        $indicator.css("left", left);
+      });
+      self.setIndicatorHeight();
+    },
+
+    /**
+     * Sets height of all indicators matching the table header
+     * @private
+     */
+    setIndicatorHeight: function () {
+      this.$el.children().height(this.grid.header.$el.height());
+    },
+
+    /**
+     * Attach event handlers
+     * @private
+     */
+    attachEvents: function () {
+      var self = this;
+      self.listenTo(self.columns, "resize", self.handleColumnResize);
+      self.listenTo(self.columns, "remove", self.handleColumnRemove);
+      self.listenTo(self.columns, "sort", self.handleColumnSort);
+      self.listenTo(self.grid.collection, "backgrid:colgroup:updated", self.updateIndicatorPosition);
+      self.listenTo(self.grid.collection, "backgrid:colgroup:changed", self.handleHeaderRender);
+
+      // Listen to window resize events
+      var resizeEvtHandler = _.debounce(_.bind(self.updateIndicatorPosition, self), 250);
+      self.listenTo(self._asEvents(window), "resize", resizeEvtHandler);
+    },
+
+    /**
+     * Handlers when columns are resized
+     * @private
+     */
+    handleColumnResize: function () {
+      var self = this;
+      self.updateIndicatorPosition();
+      self.setIndicatorHeight();
+    },
+
+    /**
+     * Handler when header is (re)rendered
+     * @private
+     */
+    handleHeaderRender: function () {
+      var self = this;
+      // Wait for callstack to be cleared
+      _.defer(function () {
+        self.setHeaderElements();
+        self.render();
+        self.updateIndicatorPosition();
+      });
+    },
+
+    /**
+     * Handler for when a column is removed
+     * @param {Backgrid.Column} model
+     * @param {Backgrid.Columns} collection
+     * @private
+     */
+    handleColumnRemove: function (model, collection) {
+      // Get position of removed model
+      var removedPosition = model.get("displayOrder");
+
+      // Update position values of models
+      collection.each(function (mod) {
+        if (mod.get("displayOrder") > removedPosition) {
+          mod.set("displayOrder", mod.get("displayOrder") - 1, {silent: true});
+        }
+      });
+    },
+
+    /**
+     * Handler when the column collection is sorted
+     * @private
+     */
+    handleColumnSort: function() {
+      // Refresh body
+      this.grid.body.refresh();
+    },
+
+    /**
+     * Finds and saves current column header elements
+     * @private
+     */
+    setHeaderElements: function () {
+      var self = this;
+      var rows = self.header.headerRows || [self.header.row];
+      self.headerCells = [];
+
+      // Loop all rows
+      _.each(rows, function (row) {
+        // Loop cells of row
+        _.each(row.cells, function (cell) {
+          var columnModel = self.columns.get({cid: cell.column.cid});
+          if (!_.isEmpty(columnModel)) {
+            self.headerCells.push({
+              $el: cell.$el,
+              el: cell.el,
+              column: columnModel
+            });
+          }
+        });
+      });
+
+      // Sort cells
+      var headerCells = _.sortBy(self.headerCells, function (cell) {
+        return self.columns.indexOf(cell.column);
+      });
+
+      // Filter cells
+      self.headerCells = _.filter(headerCells, function (cell) {
+        return cell.column.get("renderable") === true ||
+          typeof cell.column.get("renderable") === "undefined"
+      });
+
+      self.headerElements = _.map(self.headerCells, function (cell) {
+        return cell.el;
+      });
+    },
+
+    /**
+     * Adds a drag hook
+     * @param {String} id
+     * @param {Function} hook
+     */
+    addDragHook: function (id, hook) {
+      this.dragHooks[id] = hook;
+    },
+
+    /**
+     * Removes a drag hook
+     * @param {String} id
+     */
+    removeDragHook: function (id) {
+      if (this.dragHooks.hasOwnProperty(id)) {
+        delete this.dragHooks[id];
+      }
+    },
+
+    /**
+     * Invokes a drag hook
+     * @param {String} key
+     * @private
+     */
+    dragHookInvoke: function (key) {
+      var args = [].slice.apply(arguments);
+      args.shift();
+      _.each(this.dragHooks, function (obj) {
+        if (typeof obj[key] == "function") {
+          obj[key].apply(obj, args);
+        }
+      });
+    },
+
+    /**
+     * Checks whether the ordering should be prevented
+     * @returns {boolean}
+     * @private
+     */
+    dragHookPreventOrder: function () {
+      var prevent = false;
+      _.each(this.dragHooks, function (obj) {
+        if (typeof obj.preventOrder == "function") {
+          prevent |= obj.preventOrder();
+        }
+      });
+      return prevent;
+    },
+
+    /**
+     * Helper function to stop event propagation
+     * @param e
+     * @private
+     */
+    _stopEvent: function (e) {
+      if (e.stopPropagation) {
+        e.stopPropagation();
+      }
+      if (e.preventDefault) {
+        e.preventDefault();
+      }
+      e.cancelBubble = true;
+      e.returnValue = false;
+    },
+
+    /**
+     * Use Backbone Events listenTo/stopListening with any DOM element
+     *
+     * @param {DOM Element}
+     * @return {Backbone Events style object}
+     **/
+    _asEvents: function(el) {
+      var args;
+      return {
+        on: function(event, handler) {
+          if (args) throw new Error("this is one off wrapper");
+          el.addEventListener(event, handler, false);
+          args = [event, handler];
+        },
+        off: function() {
+          el.removeEventListener.apply(el, args);
+        }
+      };
+    }
+  });
+
+  /**
+   * Extendable
+   * @type {Function}
+   */
+  var orderableDragHook = Backgrid.Extension.OrderableDragHook = function () {
+    this.initialize.apply(this, arguments);
+  };
+
+  /**
+   *  Prototype for the drag hook
+   */
+  _.extend(orderableDragHook.prototype, {
+    initialize: function () {
+    },
+    dragStart: function () {
+    },
+    dragMove: function () {
+    },
+    dragEnd: function () {
+    },
+    preventOrder: function () {
+    }
+  });
+
+  /**
+   * Sample collection for orderable columns
+   */
+  Backgrid.Extension.OrderableColumns.orderableColumnCollection = Backgrid.Columns.extend({
+    sortKey: "displayOrder",
+    comparator: function (item) {
+      return item.get(this.sortKey) || 1e6;
+    },
+    setPositions: function () {
+      _.each(this.models, function (model, index) {
+        // If a displayOrder is defined already, do not touch
+        model.set("displayOrder", model.get("displayOrder") || index + 1, {silent: true});
+      });
+      return this;
+    }
+  });
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css
new file mode 100644
index 0000000..1b4f130
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css
@@ -0,0 +1,35 @@
+/*
+ backgrid-sizeable-columns
+ https://github.com/WRidder/backgrid-sizeable-columns
+
+ Copyright (c) 2014 Wilbert van de Ridder
+ Licensed under the MIT @license.
+ */
+table.backgrid {
+    overflow: hidden;
+    position: relative;
+}
+
+.backgrid .resizeHandler {
+    width: 16px;
+    height: 100%;
+    margin-left: -8px;
+    top: 0;
+    position: absolute;
+    cursor: col-resize;
+    z-index: 2;
+}
+
+.backgrid .resizeHandler.grid-draggable {
+    opacity: 1;
+    width: 1px;
+    margin-left: 0px;
+    background-color: #000;
+}
+
+.backgrid .resizeHandler .grid-draggable-cursor {
+    cursor: col-resize;
+    width: 100px;
+    margin-left: -50px;
+    height: 100%;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns.js
new file mode 100644
index 0000000..2704ca1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns.js
@@ -0,0 +1,480 @@
+/*
+ backgrid-sizeable-columns
+ https://github.com/WRidder/backgrid-sizeable-columns
+
+ Copyright (c) 2014 Wilbert van de Ridder
+ Licensed under the MIT @license.
+ */
+(function (root, factory) {
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(require("underscore"), require("backgrid"));
+  }
+  // AMD. Register as an anonymous module.
+  else if (typeof define === 'function' && define.amd) {
+    define(['underscore', 'backgrid'], factory);
+  }
+  // Browser
+  else {
+    factory(root._, root.Backgrid);
+  }
+
+}(this, function (_, Backgrid) {
+  "use strict";
+
+  // Adds width support to columns
+  Backgrid.Extension.SizeAbleColumns = Backbone.View.extend({
+    /** @property */
+    tagName: "colgroup",
+
+    /**
+     * Initializer
+     * @param options
+     */
+    initialize: function (options) {
+      this.grid = options.grid;
+
+      // Attach event listeners once on render
+      this.listenTo(this.grid.header, "backgrid:header:rendered", this.render);
+      this.listenTo(this.grid.columns, "width:auto", this.setWidthAuto);
+      this.listenTo(this.grid.columns, "width:fixed", this.setWidthFixed);
+      this.listenTo(this.grid, "backgrid:refresh", this.setColToActualWidth);
+      this.listenTo(this.grid.collection, "add remove reset", this.setColToActualWidth);
+    },
+
+    /**
+     * Adds sizeable columns using <col> elements in a <colgroup>
+     * @returns {Backgrid.Extension.SizeAbleColumns}
+     */
+    render: function () {
+      var view = this;
+      view.$el.empty();
+
+      view.grid.columns.each(function (col) {
+        if (typeof col.get("renderable") == "undefined" || col.get("renderable")) {
+          var $colEl = $("<col>").appendTo(view.$el).attr("data-column-cid", col.cid);
+          var colWidth = col.get("width");
+          var colMinWidth = col.get("minWidth");
+          var colMaxWidth = col.get("maxWidth");
+          if (colWidth && colWidth != "*") {
+            if (colMinWidth && colWidth < colMinWidth) {
+              colWidth = colMinWidth;
+            }
+            if (colMaxWidth && colWidth > colMaxWidth) {
+              colWidth = colMaxWidth;
+            }
+            $colEl.width(colWidth);
+          }
+        }
+      });
+      
+      // Add data attribute to column cells
+      if (view.grid.header.headerRows) {
+       _.each(view.grid.header.headerRows, function(row) {
+        _.each(row.cells, function(cell) {
+         cell.$el.attr("data-column-cid", cell.column.cid);
+        });
+       });
+      }
+      else {
+       _.each(view.grid.header.row.cells, function(cell) {
+        cell.$el.attr("data-column-cid", cell.column.cid);
+       });
+      }
+
+      // Trigger event
+      view.grid.collection.trigger("backgrid:colgroup:changed");
+      return this;
+    },
+
+    /**
+     * Gets a <col> element belonging to given model
+     * @param colModel Backgrid.Column
+     * @returns {*|JQuery|any|jQuery}
+     * @private
+     */
+    getColumnElement: function (colModel) {
+      return this.$el.find('col[data-column-cid="' + colModel.cid + '"]');
+    },
+
+    /**
+     * Get the column width of given model
+     * @param colModel Backgrid.Column
+     * @returns {Integer}
+     * @private
+     */
+    getHeaderElementWidth: function(colModel) {
+      return this.grid.header.$el.find("th[data-column-cid='" + colModel.cid + "']").outerWidth();
+    },
+
+    /**
+     * Sets a width of the given column to "*" (auto)
+     * @param colModel Backgrid.Column
+     * @private
+     */
+    setWidthAuto: function (colModel) {
+      // Get column element
+      var $colElement = this.getColumnElement(colModel);
+
+      // Save width
+      colModel.set("width", "*");
+
+      // Set column width to auto
+      $colElement.css("width", "");
+
+      view.grid.collection.trigger("backgrid:colgroup:updated");
+    },
+
+    /**
+     * Sets a width of the given column to a fixed width defined in the model.
+     * @param colModel Backgrid.Column
+     * @private
+     */
+    setWidthFixed: function (colModel) {
+      // Get column element
+      var $colElement = this.getColumnElement(colModel);
+
+      // Get width of header element
+      var width = this.getHeaderElementWidth(colModel);
+
+      // Set column width to the original width
+      $colElement.css("width", width);
+
+      // Save width
+      colModel.set("width", width);
+
+      view.grid.collection.trigger("backgrid:colgroup:updated");
+    },
+
+    /**
+     * Updates the view's <col> elements to current width
+     * @private
+     */
+    setColToActualWidth: function() {
+      var view = this;
+      var changed = false;
+      _.each(view.grid.header.row.cells, function(cell) {
+        var $colEl = view.getColumnElement(cell.column);
+        if (cell.column.get("width") !== "*") {
+          changed = changed || $colEl.width() == cell.$el.outerWidth();
+          $colEl.width(cell.$el.outerWidth());
+        }
+      });
+
+      if (changed) {
+        view.grid.collection.trigger("backgrid:colgroup:updated");
+      }
+    }
+  });
+
+  // Makes column resizable; requires Backgrid.Extension.sizeAbleColumns
+  Backgrid.Extension.SizeAbleColumnsHandlers = Backbone.View.extend({
+
+    /**
+     * Initializer
+     * @param options
+     */
+    initialize: function (options) {
+      this.sizeAbleColumns = options.sizeAbleColumns;
+      this.grid = this.sizeAbleColumns.grid;
+      this.columns = this.grid.columns;
+      this.header = this.grid.header;
+
+      this.saveColumnWidth = options.saveColumnWidth;
+      this.setHeaderElements();
+      this.attachEvents();
+    },
+
+    /**
+     * Adds handlers to resize the columns
+     * @returns {Backgrid.Extension.SizeAbleColumnsHandlers}
+     */
+    render: function () {
+      var view = this;
+      view.$el.empty();
+
+      // For now, loop tds in first row
+      _.each(view.headerElements, function (columnEl, index) {
+        // Get matching col element
+        var $column = $(columnEl);
+        var columnModelCid = $column.data("column-cid");
+        var $col = view.sizeAbleColumns.$el.find("col[data-column-cid=" + columnModelCid + "]");
+        var columnModel = view.columns.get({ cid: columnModelCid});
+
+        if (columnModel && columnModel.get("resizeable")) {
+          // Create helper elements
+          var $resizeHandler = $("<div></div>")
+            .addClass("resizeHandler")
+            .attr("data-column-index", index)
+            .appendTo(view.$el);
+          var $resizeHandlerHelper = $("<div></div>")
+            .hide()
+            .addClass("grid-draggable-cursor")
+            .appendTo($resizeHandler);
+
+          // Make draggable
+          $resizeHandler.on("mousedown", function (e) {
+            view._stopEvent(e);
+            var startX = Math.round($resizeHandler.offset().left);
+            var $doc = $(document);
+            var handlerNonDragSize = $resizeHandler.outerWidth();
+
+            // Set class
+            $resizeHandler.addClass("grid-draggable");
+            $resizeHandlerHelper.show();
+
+            // Follow the mouse
+            var mouseMoveHandler = function (evt) {
+              view._stopEvent(evt);
+
+              // Check for constraints
+              var minWidth = columnModel.get("minWidth");
+              if (!minWidth || minWidth < 20) {
+                minWidth = 20;
+              }
+              var maxWidth = columnModel.get("maxWidth");
+              var newLeftPos = evt.pageX;
+              var currentWidth = columnModel.get("width");
+              var newWidth = currentWidth + (newLeftPos - startX) - handlerNonDragSize / 2;
+
+              if (minWidth && newWidth <= minWidth) {
+                newLeftPos = startX - (currentWidth - minWidth) + handlerNonDragSize / 2;
+              }
+              if (maxWidth && newWidth >= maxWidth) {
+                newLeftPos = startX + maxWidth - currentWidth + handlerNonDragSize / 2;
+              }
+
+              // Apply mouse change to handler
+              $resizeHandler.offset({
+                left: newLeftPos
+              });
+            };
+            $doc.on("mousemove", mouseMoveHandler);
+
+            // Add handler to listen for mouseup
+            var mouseUpHandler = function (evt) {
+              // Cleanup
+              view._stopEvent(evt);
+              $resizeHandler.removeClass("grid-draggable");
+              $resizeHandlerHelper.hide();
+              $doc.off("mouseup", mouseUpHandler);
+              $doc.off("mousemove", mouseMoveHandler);
+
+              // Adjust column size
+              var stopX = Math.round($resizeHandler.offset().left);
+              var offset = (startX - stopX);
+              var oldWidth = $column.outerWidth();
+              var newWidth = oldWidth - offset;
+              $col.width(newWidth);
+
+              // Get actual width
+              var finalWidth = $column.outerWidth();
+              $col.width(finalWidth);
+
+              // Save width and trigger events
+              if (finalWidth != oldWidth) {
+                if (view.saveColumnWidth) {
+                  // Save updated width
+                  columnModel.set("width", finalWidth, {silent: true});
+                }
+
+                // Trigger event
+                columnModel.trigger("resize", columnModel, finalWidth, oldWidth);
+
+                // Check if we have an autosize column, if so, trigger resize on it as well
+                var autoWidthColumn = view.columns.findWhere({
+                  width: "*"
+                });
+                if (autoWidthColumn) {
+                  autoWidthColumn.trigger("resize", autoWidthColumn);
+                }
+              }
+              view.updateHandlerPosition();
+            };
+            $doc.on("mouseup", mouseUpHandler);
+          });
+        }
+      });
+
+      // Position drag handlers
+      view.updateHandlerPosition();
+
+      return this;
+    },
+    /**
+     * Helper function to prevent event propagation
+     * @param e {Event}
+     * @private
+     */
+    _stopEvent: function (e) {
+      if (e.stopPropagation) {
+        e.stopPropagation();
+      }
+      if (e.preventDefault) {
+        e.preventDefault();
+      }
+      e.cancelBubble = true;
+      e.returnValue = false;
+    },
+
+    /**
+     * Add listeners
+     * @private
+     */
+    attachEvents: function () {
+      var view = this;
+      view.listenTo(view.columns, "change:resizeable", view.render);
+      view.listenTo(view.columns, "resize width:auto width:fixed add remove", view.checkSpacerColumn);
+      view.listenTo(view.grid.collection, "backgrid:colgroup:updated", view.updateHandlerPosition);
+      view.listenTo(view.grid.collection, "backgrid:colgroup:changed", function () {
+        // Wait for callstack to be cleared
+        _.defer(function () {
+          view.setHeaderElements();
+          view.render();
+        });
+      });
+      
+      var resizeEvtHandler = _.debounce(_.bind(view.updateHandlerPosition, view), 250);
+      view.listenTo(view._asEvents(window), "resize", resizeEvtHandler);
+    },
+
+    /**
+     * Checks whether a spacer column is nessecary. This is the case when widths are set on all columns and it's smaller
+     * that the grid element width.
+     * @private
+     */
+    checkSpacerColumn: function () {
+      var view = this;
+      var spacerColumn = _.first(view.columns.where({name: "__spacerColumn"}));
+      var autoColumns = view.columns.filter(function (col) {
+        return col.get("width") == "*" && col.get("name") != "__spacerColumn";
+      });
+
+      // Check if there is a column with auto width, if so, no need to do anything
+      if (_.isEmpty(autoColumns)) {
+        var totalWidth = view.columns.reduce(function (memo, num) {
+          var colWidth = (num.get("width") == "*") ? 0 : num.get("width");
+          return memo + colWidth;
+        }, 0);
+        var gridWidth = view.grid.$el.width();
+
+        if (gridWidth > totalWidth) {
+          // The grid is larger than the cumulative column width, we need a spacer column
+          if (!spacerColumn) {
+            // Create new column model
+            view.columns.add(view.getSpacerColumn());
+          }
+        }
+        else {
+          // Cumulative column width exceeds grid width, no need for a spacerColumn.
+          if (spacerColumn) {
+            view.columns.remove(spacerColumn);
+          }
+        }
+      }
+      else if (spacerColumn) {
+        view.columns.remove(spacerColumn);
+      }
+    },
+
+    /**
+     * Returns a spacer column definition
+     * @returns Object
+     * @private
+     */
+    getSpacerColumn: function() {
+      return Backgrid.Extension.SizeAbleColumns.spacerColumnDefinition;
+    },
+
+    /**
+     * Updates the position of the handlers
+     * @private
+     */
+    updateHandlerPosition: function () {
+      var view = this;
+      _.each(view.headerElements, function (columnEl, index) {
+        var $column = $(columnEl);
+
+        // Get handler for current column and update position
+        view.$el.children().filter("[data-column-index='" + index + "']")
+          .css("left", $column.position().left + $column.outerWidth());
+      });
+    },
+
+    /**
+     * Find the current header elements and stores them
+     */
+    setHeaderElements: function () {
+     var self = this;
+     var rows = self.grid.header.headerRows || [self.grid.header.row];
+     self.headerCells = [];
+
+     // Loop all rows
+     _.each(rows, function (row) {
+       // Loop cells of row
+       _.each(row.cells, function (cell) {
+       var columnModel = self.columns.get({cid: cell.column.cid});
+       if (!_.isEmpty(columnModel)) {
+         self.headerCells.push({
+           $el: cell.$el,
+           el: cell.el,
+           column: columnModel
+         });
+       }
+      });
+     });
+
+     // Sort cells
+     var headerCells = _.sortBy(self.headerCells, function (cell) {
+       return self.columns.indexOf(cell.column);
+     });
+
+     // Filter cells
+     self.headerCells = _.filter(headerCells, function(cell) {
+       return cell.column.get("renderable") === true ||
+       typeof cell.column.get("renderable") === "undefined"
+     });
+
+     self.headerElements = _.map(self.headerCells, function (cell) {
+       return cell.el;
+     });
+		},
+
+    /**
+     * Use Backbone Events listenTo/stopListening with any DOM element
+     *
+     * @param {DOM Element}
+     * @return {Backbone Events style object}
+     **/
+    _asEvents: function(el) {
+      var args;
+      return {
+        on: function(event, handler) {
+          if (args) throw new Error("this is one off wrapper");
+          el.addEventListener(event, handler, false);
+          args = [event, handler];
+        },
+        off: function() {
+          el.removeEventListener.apply(el, args);
+        }
+      };
+    }
+  });
+
+  /**
+   * Sample definition for the spacer column
+   */
+  Backgrid.Extension.SizeAbleColumns.spacerColumnDefinition = {
+    name: "__spacerColumn",
+    label: "",
+    editable: false,
+    cell: Backgrid.StringCell,
+    width: "*",
+    nesting: [],
+    resizeable: false,
+    sortable: false,
+    orderable: false,
+    displayOrder: 9999
+  };
+  return Backgrid;
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.css
new file mode 100644
index 0000000..da7b4a4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.css
@@ -0,0 +1,240 @@
+/*
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
+  Licensed under the MIT license.
+*/
+
+.backgrid-container {
+  position: relative;
+  display: block;
+  width: 100%;
+  height: 465px;
+  padding: 0;
+  overflow: auto;
+  border: 0;
+}
+
+.backgrid {
+  width: 100%;
+  max-width: 100%;
+  background-color: transparent;
+  border-collapse: collapse;
+  -webkit-border-radius: 4px;
+     -moz-border-radius: 4px;
+          border-radius: 4px;
+}
+
+.backgrid th,
+.backgrid td {
+  display: none;
+  height: 20px;
+  max-width: 250px;
+  padding: 4px 5px;
+  /*overflow: hidden;*/
+  line-height: 20px;
+  text-align: left;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+  vertical-align: middle;
+  border-bottom: 1px solid #DDD;
+}
+
+.backgrid th.renderable,
+.backgrid td.renderable {
+  display: table-cell;
+}
+
+.backgrid th {
+  font-weight: bold;
+  text-align: center;
+}
+
+.backgrid th.sortable a {
+  text-decoration: none;
+  white-space: nowrap;
+  cursor: pointer;
+}
+
+.backgrid thead th {
+  vertical-align: bottom;
+  background-color: #f9f9f9;
+}
+
+.backgrid thead th a {
+  display: block;
+}
+
+.backgrid.backgrid-striped tbody tr:nth-child(even) {
+  background-color: #f9f9f9;
+}
+
+.backgrid tbody tr.empty {
+  font-style: italic;
+  color: gray;
+}
+
+.backgrid tbody tr.empty td {
+  display: inherit;
+  text-align: center;
+}
+
+.backgrid td.editor {
+  padding: 0;
+}
+
+.backgrid td.editor,
+.backgrid tbody tr:nth-child(odd) td.editor {
+  background-color: rgba(82, 168, 236, 0.1);
+  outline: 1px solid rgba(82, 168, 236, 0.8);
+  outline-offset: -1px;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+  -webkit-transition-duration: 200ms;
+     -moz-transition-duration: 200ms;
+       -o-transition-duration: 200ms;
+          transition-duration: 200ms;
+  -webkit-transition-property: width, outline, background-color;
+     -moz-transition-property: width, outline, background-color;
+       -o-transition-property: width, outline, background-color;
+          transition-property: width, outline, background-color;
+  -webkit-transition-timing-function: ease-in-out;
+     -moz-transition-timing-function: ease-in-out;
+       -o-transition-timing-function: ease-in-out;
+          transition-timing-function: ease-in-out;
+}
+
+.backgrid td.editor input[type=text] {
+  display: block;
+  width: 100%;
+  height: 100%;
+  padding: 0 5px;
+  margin: 0;
+  background-color: transparent;
+  border: 0;
+  outline: 0;
+  -webkit-box-shadow: none;
+     -moz-box-shadow: none;
+          box-shadow: none;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+  -webkit-appearance: none;
+     -moz-appearance: none;
+}
+
+.backgrid td.editor input[type=text]::-ms-clear {
+  display: none;
+}
+
+.backgrid td.error,
+.backgrid tbody tr:nth-child(odd) td.error {
+  background-color: rgba(255, 210, 77, 0.1);
+  outline: 1px solid #ffd24d;
+}
+
+.backgrid td.editor :focus,
+.backgrid th.editor :focus {
+  outline: 0;
+}
+
+.backgrid .sort-caret {
+  display: inline-block;
+  width: 0;
+  height: 0;
+  margin-left: 0.3em;
+  border: 0;
+  content: "";
+}
+
+.backgrid .ascending .sort-caret {
+  vertical-align: baseline;
+  border-top: none;
+  border-right: 4px solid transparent;
+  border-bottom: 4px solid #000000;
+  border-left: 4px solid transparent;
+}
+
+.backgrid .descending .sort-caret {
+  vertical-align: super;
+  border-top: 4px solid #000000;
+  border-right: 4px solid transparent;
+  border-bottom: none;
+  border-left: 4px solid transparent;
+}
+
+.backgrid .string-cell,
+.backgrid .uri-cell,
+.backgrid .email-cell,
+.backgrid .string-cell.editor input[type=text],
+.backgrid .uri-cell.editor input[type=text],
+.backgrid .email-cell.editor input[type=text] {
+  text-align: left;
+}
+
+.backgrid .date-cell,
+.backgrid .time-cell,
+.backgrid .datetime-cell,
+.backgrid .number-cell,
+.backgrid .integer-cell,
+.backgrid .percent-cell,
+.backgrid .date-cell.editor input[type=text],
+.backgrid .time-cell.editor input[type=text],
+.backgrid .datetime-cell.editor input[type=text],
+.backgrid .number-cell.editor input[type=text],
+.backgrid .integer-cell.editor input[type=text],
+.backgrid .percent-cell.editor input[type=text] {
+  text-align: right;
+}
+
+.backgrid .boolean-cell,
+.backgrid .boolean-cell.editor input[type=checkbox] {
+  text-align: center;
+}
+
+.backgrid .select-cell {
+  text-align: center;
+}
+
+.backgrid .select-cell.editor {
+  padding: 0;
+}
+
+.backgrid .select-cell.editor select {
+  display: block;
+  width: 100%;
+  height: 28px;
+  padding: 4px 5px;
+  margin: 0;
+  line-height: 28px;
+  vertical-align: middle;
+  background-color: white;
+  border: 0;
+  outline: 0;
+  -webkit-box-shadow: none;
+     -moz-box-shadow: none;
+          box-shadow: none;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+
+.backgrid .select-cell.editor select[multiple] {
+  height: auto;
+}
+
+.backgrid .select-cell.editor :focus {
+  border: 0;
+  outline: 0;
+}
+
+.backgrid .select-cell.editor select::-moz-focus-inner,
+.backgrid .select-cell.editor optgroup::-moz-focus-inner,
+.backgrid .select-cell.editor option::-moz-focus-inner,
+.backgrid .select-cell.editor select::-o-focus-inner,
+.backgrid .select-cell.editor optgroup::-o-focus-inner,
+.backgrid .select-cell.editor option::-o-focus-inner {
+  border: 0;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.min.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.min.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.min.css
new file mode 100644
index 0000000..764e799
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/css/backgrid.min.css
@@ -0,0 +1 @@
+.backgrid-container{position:relative;display:block;width:100%;height:465px;padding:0;overflow:auto;border:0}.backgrid{width:100%;max-width:100%;background-color:transparent;border-collapse:collapse;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.backgrid th,.backgrid td{display:none;height:20px;max-width:250px;padding:4px 5px;overflow:hidden;line-height:20px;text-align:left;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;border-bottom:1px solid #DDD}.backgrid th.renderable,.backgrid td.renderable{display:table-cell}.backgrid th{font-weight:bold;text-align:center}.backgrid th.sortable a{text-decoration:none;white-space:nowrap;cursor:pointer}.backgrid thead th{vertical-align:bottom;background-color:#f9f9f9}.backgrid thead th a{display:block}.backgrid.backgrid-striped tbody tr:nth-child(even){background-color:#f9f9f9}.backgrid tbody tr.empty{font-style:italic;color:gray}.backgrid tbody tr.empty td{display:inherit;text-align:center}.backgrid td.edito
 r{padding:0}.backgrid td.editor,.backgrid tbody tr:nth-child(odd) td.editor{background-color:rgba(82,168,236,0.1);outline:1px solid rgba(82,168,236,0.8);outline-offset:-1px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition-duration:200ms;-moz-transition-duration:200ms;-o-transition-duration:200ms;transition-duration:200ms;-webkit-transition-property:width,outline,background-color;-moz-transition-property:width,outline,background-color;-o-transition-property:width,outline,background-color;transition-property:width,outline,background-color;-webkit-transition-timing-function:ease-in-out;-moz-transition-timing-function:ease-in-out;-o-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}.backgrid td.editor input[type=text]{display:block;width:100%;height:100%;padding:0 5px;margin:0;background-color:transparent;border:0;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-b
 ox;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none}.backgrid td.editor input[type=text]::-ms-clear{display:none}.backgrid td.error,.backgrid tbody tr:nth-child(odd) td.error{background-color:rgba(255,210,77,0.1);outline:1px solid #ffd24d}.backgrid td.editor :focus,.backgrid th.editor:focus{outline:0}.backgrid .sort-caret{display:inline-block;width:0;height:0;margin-left:.3em;border:0;content:""}.backgrid .ascending .sort-caret{vertical-align:baseline;border-top:0;border-right:4px solid transparent;border-bottom:4px solid #000;border-left:4px solid transparent}.backgrid .descending .sort-caret{vertical-align:super;border-top:4px solid #000;border-right:4px solid transparent;border-bottom:0;border-left:4px solid transparent}.backgrid .string-cell,.backgrid .uri-cell,.backgrid .email-cell,.backgrid .string-cell.editor input[type=text],.backgrid .uri-cell.editor input[type=text],.backgrid .email-cell.editor input[type=text]{text-align:left}.
 backgrid .date-cell,.backgrid .time-cell,.backgrid .datetime-cell,.backgrid .number-cell,.backgrid .integer-cell,.backgrid .percent-cell,.backgrid .date-cell.editor input[type=text],.backgrid .time-cell.editor input[type=text],.backgrid .datetime-cell.editor input[type=text],.backgrid .number-cell.editor input[type=text],.backgrid .integer-cell.editor input[type=text],.backgrid .percent-cell.editor input[type=text]{text-align:right}.backgrid .boolean-cell,.backgrid .boolean-cell.editor input[type=checkbox]{text-align:center}.backgrid .select-cell{text-align:center}.backgrid .select-cell.editor{padding:0}.backgrid .select-cell.editor select{display:block;width:100%;height:28px;padding:4px 5px;margin:0;line-height:28px;vertical-align:middle;background-color:white;border:0;outline:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.backgrid .select-cell.editor select[multiple]{height:auto}.backgr
 id .select-cell.editor :focus{border:0;outline:0}.backgrid .select-cell.editor select::-moz-focus-inner,.backgrid .select-cell.editor optgroup::-moz-focus-inner,.backgrid .select-cell.editor option::-moz-focus-inner,.backgrid .select-cell.editor select::-o-focus-inner,.backgrid .select-cell.editor optgroup::-o-focus-inner,.backgrid .select-cell.editor option::-o-focus-inner{border:0}
\ No newline at end of file


[38/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/solr.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/solr.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/solr.xml
new file mode 100644
index 0000000..e0d93df
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/solr.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+ 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.
+-->
+<solr>
+</solr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md
new file mode 100644
index 0000000..3cc4915
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/README.md
@@ -0,0 +1,35 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+This folder contains scripts to configure and run SolrCloud for development. 
+
+This helps in seting up SolrCloud using embedded zookeeper.
+
+##Setup Solr Collections
+```./update_config.sh <path to solr install folder>
+```
+
+
+##Run Solr
+```./restart_solr.sh
+```
+
+##Delete collections
+```./reset_collections.sh
+```
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh
new file mode 100755
index 0000000..7c742c0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/reset_collections.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# 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.
+
+# This script is used to delete all the documents in Solr
+host_port=localhost:8983
+if [ $# -eq 1 ]; then
+    host_port=$1
+fi
+set -x
+curl http://${host_port}/solr/hadoop_logs/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
+curl http://${host_port}/solr/hadoop_logs/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
+
+curl http://${host_port}/solr/audit_logs/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
+curl http://${host_port}/solr/audit_logs/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh
new file mode 100755
index 0000000..bd436bb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/restart_solr.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# 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.
+
+
+function usage {
+    echo "Usage: $0 <Solr Install Folder>"
+}
+
+if [ $# -ne 1 ]; then
+    usage
+    exit 1
+fi
+
+SOLR_INSTALL=$1
+if [ -x $SOLR_INSTALL/bin/solr ]; then
+    SOLR_BIN=$SOLR_INSTALL/bin/solr
+else
+    echo "ERROR: Invalid Solr install folder $SOLR_INSTALL"
+    usage
+    exit 1
+fi
+
+set -x
+$SOLR_BIN restart -c

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh
new file mode 100755
index 0000000..93e3496
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/dev/solrcloud/update_config.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+# 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.
+
+function usage {
+    echo "Usage: $0 <Solr Install Folder> [zk_hosts]"
+}
+
+if [ $# -lt 1 ]; then
+    usage
+    exit 1
+fi
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+SOLR_INSTALL=$1
+if [ -x $SOLR_INSTALL/server/scripts/cloud-scripts/zkcli.sh ]; then
+    ZK_CLI=$SOLR_INSTALL/server/scripts/cloud-scripts/zkcli.sh
+else
+    echo "ERROR: Invalid Solr install folder $SOLR_INSTALL"
+    usage
+    exit 1
+fi
+
+zk_hosts="localhost:9983"
+if [ $# -eq 2 ]; then
+    zk_hosts=$2
+fi
+
+
+CONFIGSET_FOLDER=$script_dir/../../configsets
+
+set -x
+$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/audit_logs/conf -confname audit_logs
+$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/hadoop_logs/conf -confname hadoop_logs
+$ZK_CLI -zkhost $zk_hosts -cmd upconfig -confdir $CONFIGSET_FOLDER/history/conf -confname history

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
new file mode 100644
index 0000000..14c0c1e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/LogSearch.java
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+
+import org.apache.ambari.logsearch.common.ManageStartEndTime;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.hadoop.http.HttpServer2;
+import org.apache.log4j.Logger;
+
+public class LogSearch {
+  static Logger logger = Logger.getLogger(LogSearch.class);
+
+  public static void main(String argv[]) {
+    String port = (argv.length > 0) ? argv[0] : "61888";
+    HttpServer2.Builder builder = new HttpServer2.Builder();
+    builder.setName("app");
+    builder.addEndpoint(URI.create("http://0.0.0.0:" + port));
+    builder.setFindPort(false);
+    List<String> pathList = new ArrayList<String>();
+    pathList.add("/*");
+    builder.setPathSpec(pathList.toArray(new String[0]));
+    builder.needsClientAuth(false);
+    Timer timer = new Timer();
+    timer.schedule(new ManageStartEndTime(), 0, 40000);
+    try {
+      logger.info("Starting logsearch server...");
+      HttpServer2 server = builder.build();
+      server.start();
+      ConfigUtil.initializeApplicationConfig();
+      logger.info(server.toString());
+    } catch (Throwable e) {
+      logger.error("Error running logsearch server", e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
new file mode 100644
index 0000000..7398098
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogSearchConstants.java
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.common;
+
+public class LogSearchConstants {
+  // Log Levels
+  public static final String INFO = "INFO";
+  public static final String WARN = "WARN";
+  public static final String DEBUG = "DEBUG";
+  public static final String ERROR = "ERROR";
+  public static final String TRACE = "TRACE";
+  public static final String FATAL = "FATAL";
+
+  // Application Constants
+  public static final String HOST = "H";
+  public static final String SERVICE = "S";
+  public static final String COMPONENT = "C";
+  public static final String SCROLL_TYPE_AFTER = "after";
+  public static final String SCROLL_TYPE_BEFORE = "before";
+
+  // UserConfig Constants
+  public static final String ID = "id";
+  public static final String USER_NAME = "username";
+  public static final String VALUES = "jsons";
+  public static final String FILTER_NAME = "filtername";
+  public static final String ROW_TYPE = "rowtype";
+  public static final String USER_CONFIG_DASHBOARD = "dashboard";
+  public static final String USER_CONFIG_HISTORY = "history";
+  public static final String COMPOSITE_KEY = "composite_filtername-username";
+  public static final String SHARE_NAME_LIST = "share_username_list";
+
+  // SOLR Document Constants for ServiceLogs
+  public static final String BUNDLE_ID = "bundle_id";
+  public static final String LOGTIME = "logtime";
+  public static final String SEQUNCE_ID = "seq_num";
+  public static final String SOLR_COMPONENT = "type";
+  public static final String SOLR_LOG_MESSAGE = "log_message";
+  public static final String SOLR_HOST = "host";
+  public static final String SOLR_LEVEL = "level";
+  public static final String SOLR_THREAD_NAME = "thread_name";
+  public static final String SOLR_LOGGER_NAME = "logger_name";
+  public static final String SOLR_FILE = "file";
+  public static final String SOLR_LINE_NUMBER = "line_number";
+  public static final String SOLR_PATH = "path";
+
+  //SOLR Document Constant for audit log
+  public static final String AUDIT_COMPONENT = "repo";
+  public static final String AUDIT_EVTTIME = "evtTime";
+  public static final String AUDIT_REQUEST_USER = "reqUser";
+
+  // Operator's
+  public static final String MINUS_OPERATOR = "-";
+  public static final String NO_OPERATOR = "";
+
+
+  //operation
+  public static final String EXCLUDE_QUERY = "excludeQuery";
+  public static final String INCLUDE_QUERY = "includeQuery";
+  public static final String COLUMN_QUERY = "columnQuery";
+
+  //URL PARAMS
+  public static final String GLOBAL_START_TIME = "globalStartTime";
+  public static final String GLOBAL_END_TIME = "globalEndTime";
+
+
+  // Seprator's
+  public static final String I_E_SEPRATOR = "\\|i\\:\\:e\\|";
+
+  //SUFFIX
+  public static final String UI_SUFFIX = "@UI@";
+  public static final String SOLR_SUFFIX = "@Solr@";
+  public static final String NGRAM_SUFFIX = "ngram_";
+
+  //Date Format for SOLR
+  public static final String SOLR_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss,SSS";
+  public static final String SOLR_DATE_FORMAT_PREFIX_Z = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
+
+  //Solr Order By
+  public static final String ASCENDING_ORDER = "asc";
+  public static final String DESCENDING_ORDER = "desc";
+
+  //Solr Facet Sort By
+  public static final String FACET_INDEX = "index";
+  public static final String FACET_COUNT = "count";
+
+  // logfeeder 
+  public static final String LOGFEEDER_FILTER_NAME = "log_feeder_config";
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogsearchContextUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogsearchContextUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogsearchContextUtil.java
new file mode 100644
index 0000000..617f2fd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/LogsearchContextUtil.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.common;
+
+import org.apache.ambari.logsearch.security.context.LogsearchContextHolder;
+import org.apache.ambari.logsearch.security.context.LogsearchSecurityContext;
+
+public class LogsearchContextUtil {
+
+  /**
+   * Singleton class
+   */
+  private LogsearchContextUtil() {
+  }
+
+  public static String getCurrentUsername() {
+    LogsearchSecurityContext context = LogsearchContextHolder.getSecurityContext();
+    if (context != null) {
+      UserSessionInfo userSession = context.getUserSession();
+      if (userSession != null) {
+        return userSession.getUsername();
+      }
+    }
+    return null;
+  }
+
+  public static UserSessionInfo getCurrentUserSession() {
+    UserSessionInfo userSession = null;
+    LogsearchSecurityContext context = LogsearchContextHolder.getSecurityContext();
+    if (context != null) {
+      userSession = context.getUserSession();
+    }
+    return userSession;
+  }
+
+  public static RequestContext getCurrentRequestContext() {
+    LogsearchSecurityContext context = LogsearchContextHolder.getSecurityContext();
+    if (context != null) {
+      return context.getRequestContext();
+    }
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ManageStartEndTime.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ManageStartEndTime.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ManageStartEndTime.java
new file mode 100644
index 0000000..2525e61
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/ManageStartEndTime.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.common;
+
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.TimerTask;
+
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.log4j.Logger;
+
+public class ManageStartEndTime extends TimerTask {
+  static Logger logger = Logger.getLogger(ManageStartEndTime.class);
+
+  public static Date startDate = new Date();
+
+  public static Date endDate = new Date();
+
+  public ManageStartEndTime() {
+    intailizeStartEndTime();
+  }
+
+  @Override
+  public void run() {
+    if (startDate == null)
+      intailizeStartEndTime();
+    else
+      adjustStartEndTime();
+  }
+
+  private void adjustStartEndTime() {
+    startDate = addSecondsToDate(startDate, 40);
+    endDate = addHoursToDate(startDate, 1);
+  }
+
+  private Date addSecondsToDate(Date date, int i) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.SECOND, i);
+    return greorianCalendar.getTime();
+  }
+
+  private Date addHoursToDate(Date date, int i) {
+    GregorianCalendar greorianCalendar = new GregorianCalendar();
+    greorianCalendar.setTime(date);
+    greorianCalendar.add(GregorianCalendar.HOUR_OF_DAY, i);
+    return greorianCalendar.getTime();
+  }
+
+  private void intailizeStartEndTime() {
+
+    endDate = new Date();
+    startDate = addHoursToDate(endDate, -1);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java
new file mode 100644
index 0000000..77ee854
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/MessageEnums.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.common;
+
+import org.apache.ambari.logsearch.view.VMessage;
+
+public enum MessageEnums {
+
+  // Common Errors
+  DATA_NOT_FOUND("fs.error.data_not_found", "Data not found"), OPER_NOT_ALLOWED_FOR_STATE(
+    "fs.error.oper_not_allowed_for_state",
+    "Operation not allowed in current state"), OPER_NOT_ALLOWED_FOR_ENTITY(
+    "fs.error.oper_not_allowed_for_state",
+    "Operation not allowed for entity"), OPER_NO_PERMISSION(
+    "fs.error.oper_no_permission",
+    "User doesn't have permission to perform this operation"), DATA_NOT_UPDATABLE(
+    "fs.error.data_not_updatable", "Data not updatable"), ERROR_CREATING_OBJECT(
+    "fs.error.create_object", "Error creating object"), ERROR_DUPLICATE_OBJECT(
+    "fs.error.duplicate_object", "Error creating duplicate object"), ERROR_SYSTEM(
+    "fs.error.system", "System Error. Please try later."),
+
+  // Common Validations
+  INVALID_PASSWORD("fs.validation.invalid_password", "Invalid password"), INVALID_INPUT_DATA(
+    "fs.validation.invalid_input_data", "Invalid input data"), NO_INPUT_DATA(
+    "fs.validation.no_input_data", "Input data is not provided"), INPUT_DATA_OUT_OF_BOUND(
+    "fs.validation.data_out_of_bound", "Input data if out of bound"), NO_NAME(
+    "fs.validation.no_name", "Name is not provided"), NO_OR_INVALID_COUNTRY_ID(
+    "fs.validation.no_country_id", "Valid Country Id was not provided"), NO_OR_INVALID_CITY_ID(
+    "fs.validation.no_city_id", "Valid City Id was not provided"), NO_OR_INVALID_STATE_ID(
+    "fs.validation.no_state_id", "Valid State Id was not provided");
+
+  String rbKey;
+  String messageDesc;
+
+  MessageEnums(String rbKey, String messageDesc) {
+    this.rbKey = rbKey;
+    this.messageDesc = messageDesc;
+  }
+
+  public VMessage getMessage() {
+    VMessage msg = new VMessage();
+    msg.setName(this.toString());
+    msg.setRbKey(rbKey);
+    msg.setMessage(messageDesc);
+    return msg;
+  }
+
+  public VMessage getMessage(Long objectId, String fieldName) {
+    VMessage msg = new VMessage();
+    msg.setName(this.toString());
+    msg.setRbKey(rbKey);
+    msg.setMessage(messageDesc);
+    msg.setObjectId(objectId);
+    msg.setFieldName(fieldName);
+    return msg;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/RequestContext.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/RequestContext.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/RequestContext.java
new file mode 100644
index 0000000..83ed3bd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/RequestContext.java
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.common;
+
+import java.io.Serializable;
+
+public class RequestContext implements Serializable {
+  private static final long serialVersionUID = -7083383106845193385L;
+  String ipAddress = null;
+  String msaCookie = null;
+  String userAgent = null;
+  String requestURL = null;
+  String serverRequestId = null;
+  String clientTimeOffset;
+  boolean isSync = true;
+  long startTime = System.currentTimeMillis();
+
+  /**
+   * @return the ipAddress
+   */
+  public String getIpAddress() {
+    return ipAddress;
+  }
+
+  /**
+   * @param ipAddress the ipAddress to set
+   */
+  public void setIpAddress(String ipAddress) {
+    this.ipAddress = ipAddress;
+  }
+
+  /**
+   * @return the msaCookie
+   */
+  public String getMsaCookie() {
+    return msaCookie;
+  }
+
+  /**
+   * @param msaCookie the msaCookie to set
+   */
+  public void setMsaCookie(String msaCookie) {
+    this.msaCookie = msaCookie;
+  }
+
+  /**
+   * @return the userAgent
+   */
+  public String getUserAgent() {
+    return userAgent;
+  }
+
+  /**
+   * @param userAgent the userAgent to set
+   */
+  public void setUserAgent(String userAgent) {
+    this.userAgent = userAgent;
+  }
+
+  /**
+   * @return the serverRequestId
+   */
+  public String getServerRequestId() {
+    return serverRequestId;
+  }
+
+  /**
+   * @param serverRequestId the serverRequestId to set
+   */
+  public void setServerRequestId(String serverRequestId) {
+    this.serverRequestId = serverRequestId;
+  }
+
+  /**
+   * @return the isSync
+   */
+  public boolean isSync() {
+    return isSync;
+  }
+
+  /**
+   * @param isSync the isSync to set
+   */
+  public void setSync(boolean isSync) {
+    this.isSync = isSync;
+  }
+
+  /**
+   * @return the requestURL
+   */
+  public String getRequestURL() {
+    return requestURL;
+  }
+
+  /**
+   * @param requestURL the requestURL to set
+   */
+  public void setRequestURL(String requestURL) {
+    this.requestURL = requestURL;
+  }
+
+  /**
+   * @return the startTime
+   */
+  public long getStartTime() {
+    return startTime;
+  }
+
+  /**
+   * @param startTime the startTime to set
+   */
+  public void setStartTime(long startTime) {
+    this.startTime = startTime;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see java.lang.Object#toString()
+   */
+  @Override
+  public String toString() {
+    return "RequestContext [ipAddress=" + ipAddress + ", msaCookie=" + msaCookie + ", userAgent=" + userAgent
+      + ", requestURL=" + requestURL + ",serverRequestId=" + serverRequestId + ", isSync=" + isSync
+      + ", startTime=" + startTime + "]";
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java
new file mode 100644
index 0000000..a5c9770
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/SearchCriteria.java
@@ -0,0 +1,336 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.common;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.commons.lang.StringEscapeUtils;
+
+public class SearchCriteria {
+  private int startIndex = 0;
+  private int maxRows = Integer.MAX_VALUE;
+  private String sortBy = null;
+  private String sortType = null;
+  private int page = 0;
+
+  private String globalStartTime = null;
+  private String globalEndTime = null;
+
+  private boolean getCount = true;
+  private boolean isDistinct = false;
+  private HashMap<String, Object> paramList = new HashMap<String, Object>();
+  final private Set<String> nullParamList = new HashSet<String>();
+  final private Set<String> notNullParamList = new HashSet<String>();
+
+  private Map<String, Object> urlParamMap = new HashMap<String, Object>();
+
+  public SearchCriteria(HttpServletRequest request) {
+    try {
+      if (request.getParameter("startIndex") != null
+        && (!request.getParameter("startIndex").isEmpty())) {
+        this.startIndex = new Integer(
+          request.getParameter("startIndex"));
+      }
+      if (request.getParameter("page") != null
+        && (!request.getParameter("page").isEmpty())) {
+        this.page = new Integer(request.getParameter("page"));
+      }
+      if (request.getParameter("pageSize") != null
+        && (!request.getParameter("pageSize").isEmpty())) {
+        this.maxRows = new Integer(request.getParameter("pageSize"));
+      } else {
+        this.maxRows = PropertiesUtil.getIntProperty("db.maxResults",
+          50);
+      }
+    } catch (NumberFormatException e) {
+      // do nothing
+    }
+
+    // Sort fields
+    if (request.getParameter("sortBy") != null
+      && (!request.getParameter("sortBy").isEmpty())) {
+      this.sortBy = "" + request.getParameter("sortBy");
+    }
+    if (request.getParameter("sortType") != null
+      && (!request.getParameter("sortType").isEmpty())) {
+      this.sortType = "" + request.getParameter("sortType");
+    }
+
+    // url params
+    if (request.getParameter("start_time") != null
+      && (!request.getParameter("start_time").isEmpty())) {
+      this.globalStartTime = "" + request.getParameter("start_time");
+      this.urlParamMap.put("globalStartTime", request.getParameter("start_time"));
+    }
+    if (request.getParameter("end_time") != null
+      && (!request.getParameter("end_time").isEmpty())) {
+      this.globalEndTime = "" + request.getParameter("end_time");
+      this.urlParamMap.put("globalEndTime", request.getParameter("end_time"));
+    }
+  }
+
+  public SearchCriteria() {
+    // Auto-generated constructor stub
+  }
+
+  /**
+   * @return the startIndex
+   */
+  public int getStartIndex() {
+    return startIndex;
+  }
+
+  /**
+   * @param startIndex the startIndex to set
+   */
+  public void setStartIndex(int startIndex) {
+    this.startIndex = startIndex;
+  }
+
+  /**
+   * @return the maxRows
+   */
+  public int getMaxRows() {
+    return maxRows;
+  }
+
+  /**
+   * @param maxRows the maxRows to set
+   */
+  public void setMaxRows(int maxRows) {
+    this.maxRows = maxRows;
+  }
+
+  /**
+   * @return the sortType
+   */
+
+  public String getSortType() {
+    return sortType;
+  }
+
+  /**
+   * @param sortType the sortType to set
+   */
+
+  public boolean isGetCount() {
+    return getCount;
+  }
+
+  public void setGetCount(boolean getCount) {
+    this.getCount = getCount;
+  }
+
+  /**
+   * @return the paramList
+   */
+  public HashMap<String, Object> getParamList() {
+    return paramList;
+  }
+
+  /**
+   * @param paramList the paramList to set
+   */
+  public void setParamList(HashMap<String, Object> paramList) {
+    this.paramList = paramList;
+  }
+
+  /**
+   * @param request
+   */
+  public void addRequiredServiceLogsParams(HttpServletRequest request) {
+    this.addParam("advanceSearch", StringEscapeUtils.unescapeXml(request.getParameter("advanceSearch")));
+    this.addParam("q", request.getParameter("q"));
+    this.addParam("treeParams", StringEscapeUtils
+      .unescapeHtml(request.getParameter("treeParams")));
+    this.addParam("level", request.getParameter("level"));
+    this.addParam("gMustNot", request.getParameter("gMustNot"));
+    this.addParam("from", request.getParameter("from"));
+    this.addParam("to", request.getParameter("to"));
+    this.addParam("selectComp", request.getParameter("mustBe"));
+    this.addParam("unselectComp", request.getParameter("mustNot"));
+    this.addParam("iMessage", StringEscapeUtils.unescapeXml(request
+      .getParameter("iMessage")));
+    this.addParam("gEMessage", StringEscapeUtils
+      .unescapeXml(request.getParameter("gEMessage")));
+    this
+      .addParam("eMessage", StringEscapeUtils.unescapeXml(request
+        .getParameter("eMessage")));
+    this.addParam(LogSearchConstants.BUNDLE_ID, request.getParameter(LogSearchConstants.BUNDLE_ID));
+    this.addParam("host_name", request.getParameter("host_name"));
+    this.addParam("components_name", request.getParameter("components_name"));
+    this.addParam("startDate", request.getParameter("start_time"));
+    this.addParam("endDate", request.getParameter("end_time"));
+    this.addParam("excludeQuery", StringEscapeUtils.unescapeXml(
+      request.getParameter("excludeQuery")));
+    this.addParam("includeQuery", StringEscapeUtils.unescapeXml(
+      request.getParameter("includeQuery")));
+    this.addParam("includeQuery", StringEscapeUtils.unescapeXml(
+      request.getParameter("includeQuery")));
+  }
+
+  /**
+   * @param request
+   */
+  public void addRequiredAuditLogsParams(HttpServletRequest request) {
+    this.addParam("q", request.getParameter("q"));
+    this.addParam("columnQuery", StringEscapeUtils
+      .unescapeXml(request.getParameter("columnQuery")));
+    this.addParam("iMessage", StringEscapeUtils.unescapeXml(request
+      .getParameter("iMessage")));
+    this.addParam("gEMessage", StringEscapeUtils
+      .unescapeXml(request.getParameter("gEMessage")));
+    this.addParam("eMessage", StringEscapeUtils.unescapeXml(request
+      .getParameter("eMessage")));
+    this.addParam("includeString", request.getParameter("mustBe"));
+    this.addParam("unselectComp", request.getParameter("mustNot"));
+    this.addParam("excludeQuery", StringEscapeUtils.unescapeXml(
+      request.getParameter("excludeQuery")));
+    this.addParam("includeQuery", StringEscapeUtils.unescapeXml(
+      request.getParameter("includeQuery")));
+    this.addParam("startTime", request.getParameter("from"));
+    this.addParam("endTime", request.getParameter("to"));
+  }
+
+  /**
+   * @param string
+   * @param caId
+   */
+  public void addParam(String name, Object value) {
+    String solrValue = PropertiesUtil.getProperty(name);
+    if (solrValue == null || solrValue.isEmpty())
+      paramList.put(name, value);
+    else {
+      try {
+        String propertyFieldMappings[] = solrValue.split(",");
+        HashMap<String, String> propertyFieldValue = new HashMap<String, String>();
+        for (String temp : propertyFieldMappings) {
+          String arrayValue[] = temp.split(":");
+          propertyFieldValue.put(arrayValue[0].toLowerCase(Locale.ENGLISH), arrayValue[1].toLowerCase(Locale.ENGLISH));
+        }
+        String originalValue = propertyFieldValue.get(value.toString().toLowerCase(Locale.ENGLISH));
+        if (originalValue != null && !originalValue.isEmpty())
+          paramList.put(name, originalValue);
+
+      } catch (Exception e) {
+        //do nothing
+      }
+    }
+  }
+
+  public void setNullParam(String name) {
+    nullParamList.add(name);
+  }
+
+  public void setNotNullParam(String name) {
+    notNullParamList.add(name);
+  }
+
+  public Object getParamValue(String name) {
+    return paramList.get(name);
+  }
+
+  /**
+   * @param string
+   * @param caId
+   */
+  public Object removeParam(String name) {
+    return paramList.remove(name);
+  }
+
+  /**
+   * @return the nullParamList
+   */
+  public Set<String> getNullParamList() {
+    return nullParamList;
+  }
+
+  /**
+   * @return the notNullParamList
+   */
+  public Set<String> getNotNullParamList() {
+    return notNullParamList;
+  }
+
+  /**
+   * @return the isDistinct
+   */
+  public boolean isDistinct() {
+    return isDistinct;
+  }
+
+  public String getSortBy() {
+    return sortBy;
+  }
+
+  public void setSortBy(String sortBy) {
+    this.sortBy = sortBy;
+  }
+
+  public void setSortType(String sortType) {
+    this.sortType = sortType;
+  }
+
+  /**
+   * @param isDistinct the isDistinct to set
+   */
+  public void setDistinct(boolean isDistinct) {
+    this.isDistinct = isDistinct;
+  }
+
+  public int getPage() {
+    return page;
+  }
+
+  public void setPage(int page) {
+    this.page = page;
+  }
+
+  public String getGlobalStartTime() {
+    return globalStartTime;
+  }
+
+  public void setGlobalStartTime(String globalStartTime) {
+    this.globalStartTime = globalStartTime;
+  }
+
+  public String getGlobalEndTime() {
+    return globalEndTime;
+  }
+
+  public void setGlobalEndTime(String globalEndTime) {
+    this.globalEndTime = globalEndTime;
+  }
+
+  public Map<String, Object> getUrlParamMap() {
+    return urlParamMap;
+  }
+
+  public void setUrlParamMap(Map<String, Object> urlParamMap) {
+    this.urlParamMap = urlParamMap;
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/UserSessionInfo.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/UserSessionInfo.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/UserSessionInfo.java
new file mode 100644
index 0000000..e8db862
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/common/UserSessionInfo.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.common;
+
+import java.io.Serializable;
+
+import org.apache.ambari.logsearch.web.model.User;
+
+public class UserSessionInfo implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  User user;
+
+  public User getUser() {
+    return user;
+  }
+
+  public void setUser(User user) {
+    this.user = user;
+  }
+
+  public String getUsername() {
+    if (user != null) {
+      return user.getUsername();
+    }
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
new file mode 100644
index 0000000..990ad00
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/AuditSolrDao.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.dao;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditSolrDao extends SolrDaoBase {
+
+  static private Logger logger = Logger.getLogger(AuditSolrDao.class);
+
+  @PostConstruct
+  public void postConstructor() {
+    String solrUrl = PropertiesUtil.getProperty("auditlog.solr.url");
+    String zkHosts = PropertiesUtil.getProperty("auditlog.solr.zkhosts");
+    String collection = PropertiesUtil.getProperty(
+      "auditlog.solr.core.logs", "audit_logs");
+    String splitInterval = PropertiesUtil.getProperty(
+      "solr.audit_logs.split_interval_mins", "none");
+    String configName = PropertiesUtil.getProperty(
+      "solr.audit_logs.config_name", "audit_logs");
+    int numberOfShards = PropertiesUtil.getIntProperty(
+      "solr.audit_logs.shards", 1);
+    int replicationFactor = PropertiesUtil.getIntProperty(
+      "solr.audit_logs.replication_factor", 1);
+
+    try {
+      connectToSolr(solrUrl, zkHosts, collection);
+      setupCollections(splitInterval, configName, numberOfShards,
+        replicationFactor);
+    } catch (Exception e) {
+      logger.error(
+        "Error while connecting to Solr for audit logs : solrUrl="
+          + solrUrl + ", zkHosts=" + zkHosts
+          + ", collection=" + collection, e);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
new file mode 100644
index 0000000..9703273
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/ServiceLogsSolrDao.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.dao;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class ServiceLogsSolrDao extends SolrDaoBase {
+  static private Logger logger = Logger.getLogger(ServiceLogsSolrDao.class);
+
+  @PostConstruct
+  public void postConstructor() {
+    logger.info("postConstructor() called.");
+    String solrUrl = PropertiesUtil.getProperty("solr.url");
+    String zkHosts = PropertiesUtil.getProperty("solr.zkhosts");
+    String collection = PropertiesUtil.getProperty("solr.core.logs",
+      "hadoop_logs");
+    String splitInterval = PropertiesUtil.getProperty(
+      "solr.service_logs.split_interval_mins", "none");
+    String configName = PropertiesUtil.getProperty(
+      "solr.service_logs.config_name", "hadoop_logs");
+    int numberOfShards = PropertiesUtil.getIntProperty(
+      "solr.service_logs.shards", 1);
+    int replicationFactor = PropertiesUtil.getIntProperty(
+      "solr.service_logs.replication_factor", 1);
+
+    try {
+      connectToSolr(solrUrl, zkHosts, collection);
+      setupCollections(splitInterval, configName, numberOfShards,
+        replicationFactor);
+    } catch (Exception e) {
+      logger.error(
+        "error while connecting to Solr for service logs : solrUrl="
+          + solrUrl + ", zkHosts=" + zkHosts
+          + ", collection=" + collection, e);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
new file mode 100644
index 0000000..228ddd1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/SolrDaoBase.java
@@ -0,0 +1,541 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.dao;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.LogsearchContextUtil;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrRequest;
+import org.apache.solr.client.solrj.SolrRequest.METHOD;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.schema.SchemaRequest;
+import org.apache.solr.client.solrj.response.CollectionAdminResponse;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.UpdateResponse;
+import org.apache.solr.client.solrj.response.schema.SchemaResponse;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.cloud.Replica;
+import org.apache.solr.common.cloud.Slice;
+import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.common.util.NamedList;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public abstract class SolrDaoBase {
+  static private Logger logger = Logger.getLogger(SolrDaoBase.class);
+
+  static Logger logPerfomance = Logger
+    .getLogger("org.apache.ambari.logsearch.performance");
+
+  private static final String ROUTER_FIELD = "_router_field_";
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  String collectionName = null;
+  // List<String> collectionList = new ArrayList<String>();
+
+  private SolrClient solrClient = null;
+  CloudSolrClient solrClouldClient = null;
+
+  boolean isSolrCloud = true;
+  String solrDetail = "";
+
+  boolean isSolrInitialized = false;
+
+  private boolean setup_status = false;
+  private boolean populateFieldsThreadActive = false;
+
+  int SETUP_RETRY_SECOND = 30;
+
+  public SolrClient connectToSolr(String url, String zkHosts,
+                                  String collection) throws Exception {
+    this.collectionName = collection;
+    solrDetail = "zkHosts=" + zkHosts + ", collection=" + collection
+      + ", url=" + url;
+
+    logger.info("connectToSolr() " + solrDetail);
+    if (stringUtil.isEmpty(collection)) {
+      throw new Exception("For solr, collection name is mandatory. "
+        + solrDetail);
+    }
+    if (!stringUtil.isEmpty(zkHosts)) {
+      solrDetail = "zkHosts=" + zkHosts + ", collection=" + collection;
+      logger.info("Using zookeepr. " + solrDetail);
+      solrClouldClient = new CloudSolrClient(zkHosts);
+      solrClouldClient.setDefaultCollection(collection);
+      solrClient = solrClouldClient;
+      int waitDurationMS = 3 * 60 * 1000;
+      checkSolrStatus(waitDurationMS);
+    } else {
+      if (stringUtil.isEmpty(url)) {
+        throw new Exception("Both zkHosts and URL are empty. zkHosts="
+          + zkHosts + ", collection=" + collection + ", url="
+          + url);
+      }
+      solrDetail = "collection=" + collection + ", url=" + url;
+      String collectionURL = url + "/" + collection;
+      logger.info("Connecting to  solr : " + collectionURL);
+      solrClient = new HttpSolrClient(collectionURL);
+
+    }
+    // populateSchemaFields(collection);
+    return solrClient;
+  }
+
+  public SolrClient getSolrClient() {
+    return solrClient;
+  }
+
+  /**
+   * This will try to get the collections from the Solr. Ping doesn't work if
+   * collection is not given
+   *
+   * @param waitDurationMS
+   */
+  public boolean checkSolrStatus(int waitDurationMS) {
+    boolean status = false;
+    try {
+      long beginTimeMS = System.currentTimeMillis();
+      long waitIntervalMS = 2000;
+      int pingCount = 0;
+      while (true) {
+        pingCount++;
+        try {
+          List<String> collectionList = getCollections();
+          if (collectionList != null) {
+            logger.info("checkSolrStatus(): Solr getCollections() is success. solr="
+              + solrDetail
+              + ", collectionList="
+              + collectionList);
+            status = true;
+            break;
+          }
+        } catch (Exception ex) {
+          logger.error("Error while doing Solr check", ex);
+        }
+        if (System.currentTimeMillis() - beginTimeMS > waitDurationMS) {
+          logger.error("Solr is not reachable even after "
+            + (System.currentTimeMillis() - beginTimeMS)
+            + " ms. If you are using alias, then you might have to restart LogSearch after Solr is up and running. solr="
+            + solrDetail);
+          break;
+        } else {
+          logger.warn("Solr is not not reachable yet. getCollections() attempt count="
+            + pingCount
+            + ". Will sleep for "
+            + waitIntervalMS
+            + " ms and try again." + " solr=" + solrDetail);
+        }
+        Thread.sleep(waitIntervalMS);
+
+      }
+    } catch (Throwable t) {
+      logger.error("Seems Solr is not up. solrDetail=" + solrDetail);
+    }
+    return status;
+  }
+
+  public void setupCollections(final String splitMode,
+                               final String configName, final int numberOfShards,
+                               final int replicationFactor) throws Exception {
+    setup_status = createCollectionsIfNeeded(splitMode, configName,
+      numberOfShards, replicationFactor);
+    logger.info("Setup status for " + collectionName + " is "
+      + setup_status);
+    if (!setup_status) {
+      // Start a background thread to do setup
+      Thread setupThread = new Thread("setup_collection_"
+        + collectionName) {
+        @Override
+        public void run() {
+          logger.info("Started monitoring thread to check availability of Solr server. collection="
+            + collectionName);
+          int retryCount = 0;
+          while (true) {
+            try {
+              Thread.sleep(SETUP_RETRY_SECOND);
+              retryCount++;
+              setup_status = createCollectionsIfNeeded(splitMode,
+                configName, numberOfShards,
+                replicationFactor);
+              if (setup_status) {
+                logger.info("Setup for collection "
+                  + collectionName
+                  + " is successful. Exiting setup retry thread");
+                break;
+              }
+            } catch (InterruptedException sleepInterrupted) {
+              logger.info("Sleep interrupted while setting up collection "
+                + collectionName);
+              break;
+            } catch (Exception e) {
+              logger.error("Error setting up collection="
+                + collectionName, e);
+            }
+            logger.error("Error setting collection. collection="
+              + collectionName + ", retryCount=" + retryCount);
+          }
+        }
+
+      };
+      setupThread.setDaemon(true);
+      setupThread.start();
+    }
+    populateSchemaFields();
+  }
+
+  public boolean createCollectionsIfNeeded(final String splitMode,
+                                           final String configName, final int numberOfShards,
+                                           final int replicationFactor) {
+    boolean result = false;
+    try {
+      List<String> allCollectionList = getCollections();
+      if (splitMode.equalsIgnoreCase("none")) {
+        // Just create regular collection
+        result = createCollection(collectionName, configName,
+          numberOfShards, replicationFactor, allCollectionList);
+      } else {
+        result = setupCollectionsWithImplicitRouting(splitMode,
+          configName, numberOfShards, allCollectionList);
+      }
+    } catch (Exception ex) {
+      logger.error("Error creating collection. collectionName="
+        + collectionName, ex);
+    }
+    return result;
+  }
+
+  public List<String> getCollections() throws SolrServerException,
+    IOException {
+    try {
+      CollectionAdminRequest.List colListReq = new CollectionAdminRequest.List();
+      CollectionAdminResponse response = colListReq.process(solrClient);
+      if (response.getStatus() != 0) {
+        logger.error("Error getting collection list from solr.  response="
+          + response);
+        return null;
+      }
+
+      @SuppressWarnings("unchecked")
+      List<String> allCollectionList = (List<String>) response
+        .getResponse().get("collections");
+      return allCollectionList;
+    } catch (SolrException e) {
+      logger.error(e);
+      return null;
+    }
+  }
+
+  public boolean setupCollectionsWithImplicitRouting(String splitMode,
+                                                     String configName, int numberOfShards,
+                                                     List<String> allCollectionList) throws Exception {
+    logger.info("setupCollectionsWithImplicitRouting(). collectionName="
+      + collectionName + ", numberOfShards=" + numberOfShards);
+    return createCollectionWithImplicitRoute(collectionName, configName,
+      numberOfShards, allCollectionList);
+  }
+
+  public boolean createCollectionWithImplicitRoute(String colName,
+                                                   String configName, int numberOfShards,
+                                                   List<String> allCollectionList) throws SolrServerException,
+    IOException {
+
+    // Default is true, because if the collection and shard is already
+    // there, then it will return true
+    boolean returnValue = true;
+    String shardsListStr = "";
+    List<String> shardsList = new ArrayList<String>();
+    for (int i = 0; i < numberOfShards; i++) {
+      if (i != 0) {
+        shardsListStr += ",";
+      }
+      String shard = "shard" + i;
+      shardsListStr += shard;
+      shardsList.add(shard);
+    }
+
+    // Check if collection is already in zookeeper
+    if (!allCollectionList.contains(colName)) {
+      logger.info("Creating collection " + colName + ", shardsList="
+        + shardsList + ", solrDetail=" + solrDetail);
+      int replicationFactor = 1;
+      CollectionAdminRequest.Create collectionCreateRequest = new CollectionAdminRequest.Create();
+      collectionCreateRequest.setCollectionName(colName);
+      collectionCreateRequest.setRouterName("implicit");
+      collectionCreateRequest.setShards(shardsListStr);
+      collectionCreateRequest.setMaxShardsPerNode(numberOfShards);
+      collectionCreateRequest.setReplicationFactor(replicationFactor);
+      collectionCreateRequest.setConfigName(configName);
+      collectionCreateRequest.setRouterField(ROUTER_FIELD);
+      collectionCreateRequest.setMaxShardsPerNode(replicationFactor
+        * numberOfShards);
+
+      CollectionAdminResponse createResponse = collectionCreateRequest
+        .process(solrClient);
+      if (createResponse.getStatus() != 0) {
+        returnValue = false;
+        logger.error("Error creating collection. collectionName="
+          + colName + ", shardsList=" + shardsList
+          + ", solrDetail=" + solrDetail + ", response="
+          + createResponse);
+      } else {
+        logger.info("Created collection " + colName + ", shardsList="
+          + shardsList + ", solrDetail=" + solrDetail);
+      }
+    } else {
+      logger.info("Collection "
+        + colName
+        + " is already there. Will check whether it has the required shards");
+      Collection<String> existingShards = getShards();
+      for (String shard : shardsList) {
+        if (!existingShards.contains(shard)) {
+          try {
+            logger.info("Going to add Shard " + shard
+              + " to collection " + collectionName);
+            CollectionAdminRequest.CreateShard createShardRequest = new CollectionAdminRequest.CreateShard();
+            createShardRequest.setCollectionName(collectionName);
+            createShardRequest.setShardName(shard);
+            CollectionAdminResponse response = createShardRequest
+              .process(solrClient);
+            if (response.getStatus() != 0) {
+              logger.error("Error creating shard " + shard
+                + " in collection " + collectionName
+                + ", response=" + response
+                + ", solrDetail=" + solrDetail);
+              returnValue = false;
+              break;
+            } else {
+              logger.info("Successfully created shard " + shard
+                + " in collection " + collectionName);
+            }
+          } catch (Throwable t) {
+            logger.error("Error creating shard " + shard
+              + " in collection " + collectionName
+              + ", solrDetail=" + solrDetail, t);
+            returnValue = false;
+            break;
+          }
+        }
+      }
+    }
+    return returnValue;
+  }
+
+  public Collection<String> getShards() {
+    Collection<String> list = new HashSet<String>();
+
+    if (solrClouldClient == null) {
+      logger.error("getShards(). Only supporting in SolrCloud mode");
+      return list;
+    }
+
+    ZkStateReader reader = solrClouldClient.getZkStateReader();
+    Collection<Slice> slices = reader.getClusterState().getSlices(
+      collectionName);
+    Iterator<Slice> iter = slices.iterator();
+
+    while (iter.hasNext()) {
+      Slice slice = iter.next();
+      for (Replica replica : slice.getReplicas()) {
+        logger.info("colName=" + collectionName + ", slice.name="
+          + slice.getName() + ", slice.state=" + slice.getState()
+          + ", replica.core=" + replica.getStr("core")
+          + ", replica.state=" + replica.getStr("state"));
+        list.add(slice.getName());
+      }
+    }
+    return list;
+  }
+
+  public boolean createCollection(String colName, String configName,
+                                  int numberOfShards, int replicationFactor,
+                                  List<String> allCollectionList) throws SolrServerException,
+    IOException {
+    // Check if collection is already in zookeeper
+    if (allCollectionList.contains(colName)) {
+      logger.info("Collection " + colName
+        + " is already there. Won't create it");
+      return true;
+    }
+
+    logger.info("Creating collection " + colName + ", numberOfShards="
+      + numberOfShards + ", replicationFactor=" + replicationFactor
+      + ", solrDetail=" + solrDetail);
+
+    CollectionAdminRequest.Create collectionCreateRequest = new CollectionAdminRequest.Create();
+    collectionCreateRequest.setCollectionName(colName);
+    collectionCreateRequest.setNumShards(numberOfShards);
+    collectionCreateRequest.setReplicationFactor(replicationFactor);
+    collectionCreateRequest.setConfigName(configName);
+    collectionCreateRequest.setMaxShardsPerNode(replicationFactor
+      * numberOfShards);
+    CollectionAdminResponse createResponse = collectionCreateRequest
+      .process(solrClient);
+    if (createResponse.getStatus() != 0) {
+      logger.error("Error creating collection. collectionName=" + colName
+        + ", solrDetail=" + solrDetail + ", response="
+        + createResponse);
+      return false;
+    } else {
+      logger.info("Created collection " + colName + ", numberOfShards="
+        + numberOfShards + ", replicationFactor="
+        + replicationFactor + ", solrDetail=" + solrDetail);
+      return true;
+    }
+  }
+
+  public QueryResponse process(SolrQuery solrQuery)
+    throws SolrServerException, IOException, SolrException {
+    if (solrClient != null) {
+      String event = solrQuery.get("event");
+      solrQuery.remove("event");
+      QueryResponse queryResponse = solrClient.query(solrQuery,
+        METHOD.POST);
+
+      if (event != null && !"/getLiveLogsCount".equalsIgnoreCase(event)) {
+        logPerfomance.info("\n Username :- "
+          + LogsearchContextUtil.getCurrentUsername()
+          + " Event :- " + event + " SolrQuery :- " + solrQuery
+          + "\nQuery Time Execution :- "
+          + queryResponse.getQTime()
+          + " Total Time Elapsed is :- "
+          + queryResponse.getElapsedTime());
+      }
+      return queryResponse;
+    } else {
+      return null;
+    }
+  }
+
+  public UpdateResponse addDocs(SolrInputDocument doc)
+    throws SolrServerException, IOException, SolrException {
+    UpdateResponse updateResoponse = solrClient.add(doc);
+    logPerfomance.info("\n Username :- "
+      + LogsearchContextUtil.getCurrentUsername()
+      + " Update Time Execution :- " + updateResoponse.getQTime()
+      + " Total Time Elapsed is :- "
+      + updateResoponse.getElapsedTime());
+    solrClient.commit();
+    return updateResoponse;
+  }
+
+  public UpdateResponse removeDoc(String query) throws SolrServerException,
+    IOException, SolrException {
+    UpdateResponse updateResoponse = solrClient.deleteByQuery(query);
+    solrClient.commit();
+    logPerfomance.info("\n Username :- "
+      + LogsearchContextUtil.getCurrentUsername()
+      + " Remove Time Execution :- " + updateResoponse.getQTime()
+      + " Total Time Elapsed is :- "
+      + updateResoponse.getElapsedTime());
+    return updateResoponse;
+  }
+
+  private void populateSchemaFields() {
+    boolean result = _populateSchemaFields();
+    if (!result && !populateFieldsThreadActive) {
+      populateFieldsThreadActive = true;
+      logger.info("Creating thread to populated fields for collection="
+        + collectionName);
+      Thread fieldPopulationThread = new Thread("populated_fields_"
+        + collectionName) {
+        @Override
+        public void run() {
+          logger.info("Started thread to get fields for collection="
+            + collectionName);
+          int retryCount = 0;
+          while (true) {
+            try {
+              Thread.sleep(SETUP_RETRY_SECOND);
+              retryCount++;
+              boolean _result = _populateSchemaFields();
+              if (_result) {
+                logger.info("Populate fields for collection "
+                  + collectionName + " is success");
+                break;
+              }
+            } catch (InterruptedException sleepInterrupted) {
+              logger.info("Sleep interrupted while populating fields for collection "
+                + collectionName);
+              break;
+            } catch (Exception ex) {
+              logger.error("Error while populating fields for collection "
+                + collectionName
+                + ", retryCount="
+                + retryCount);
+            } finally {
+              populateFieldsThreadActive = false;
+            }
+          }
+          logger.info("Exiting thread for populating fields. collection="
+            + collectionName);
+        }
+
+      };
+      fieldPopulationThread.setDaemon(true);
+      fieldPopulationThread.start();
+    }
+  }
+
+  /**
+   * Called from the thread. Don't call this directly
+   */
+  private boolean _populateSchemaFields() {
+    SolrRequest<SchemaResponse> request = new SchemaRequest();
+    request.setMethod(METHOD.GET);
+    request.setPath("/schema/fields");
+    if (solrClient != null) {
+      NamedList<Object> namedList = null;
+      try {
+        namedList = solrClient.request(request);
+        logger.info("populateSchemaFields() collection="
+          + collectionName + ", fields=" + namedList);
+      } catch (SolrException | SolrServerException | IOException e) {
+        logger.error(
+          "Error occured while popuplating field. collection="
+            + collectionName, e);
+      }
+      if (namedList != null) {
+        ConfigUtil.extractSchemaFieldsName(namedList.toString(),
+          collectionName);
+        return true;
+      }
+    }
+    return false;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java
new file mode 100644
index 0000000..750cf07
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserConfigSolrDao.java
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.dao;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+@Component
+public class UserConfigSolrDao extends SolrDaoBase {
+
+  static private Logger logger = Logger.getLogger(UserConfigSolrDao.class);
+
+  @PostConstruct
+  public void postConstructor() {
+
+    String solrUrl = PropertiesUtil.getProperty("solr.url");
+    String zkHosts = PropertiesUtil.getProperty("solr.zkhosts");
+    String collection = PropertiesUtil.getProperty("solr.core.history",
+      "history");
+    String configName = PropertiesUtil.getProperty(
+      "solr.history.config_name", "history");
+    int replicationFactor = PropertiesUtil.getIntProperty(
+      "solr.history.replication_factor", 2);
+    String splitInterval = "none";
+    int numberOfShards = 1;
+
+    try {
+      connectToSolr(solrUrl, zkHosts, collection);
+      setupCollections(splitInterval, configName, numberOfShards,
+        replicationFactor);
+
+    } catch (Exception e) {
+      logger.error(
+        "error while connecting to Solr for history logs : solrUrl="
+          + solrUrl + ", zkHosts=" + zkHosts
+          + ", collection=" + collection, e);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
new file mode 100644
index 0000000..091c40b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserDao.java
@@ -0,0 +1,199 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.dao;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.stereotype.Repository;
+import org.apache.ambari.logsearch.util.FileUtil;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.web.model.Privilege;
+import org.apache.ambari.logsearch.web.model.Role;
+import org.apache.ambari.logsearch.web.model.User;
+import org.apache.ambari.logsearch.web.security.LogsearchFileAuthenticationProvider;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.Predicate;
+import org.apache.log4j.Logger;
+
+@Repository
+public class UserDao {
+
+  private static final Logger logger = Logger.getLogger(UserDao.class);
+  private static final Md5PasswordEncoder md5Encoder = new Md5PasswordEncoder();
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  FileUtil fileUtil;
+
+  @Autowired
+  LogsearchFileAuthenticationProvider fileAuthenticationProvider;
+
+  private HashMap<String, Object> userInfos = null;
+
+  private ArrayList<HashMap<String, String>> userList = null;
+
+  @SuppressWarnings("unchecked")
+  @PostConstruct
+  public void initialization() {
+    if (fileAuthenticationProvider.isEnable()) {
+      try {
+        String USER_PASS_JSON_FILE_NAME = PropertiesUtil
+          .getProperty("logsearch.login.credentials.file");
+        logger.info("USER PASS JSON  file NAME:" + USER_PASS_JSON_FILE_NAME);
+        File jsonFile = fileUtil
+          .getFileFromClasspath(USER_PASS_JSON_FILE_NAME);
+        if (jsonFile == null || !jsonFile.exists()) {
+          logger.fatal("user_pass json file not found in classpath :"
+            + USER_PASS_JSON_FILE_NAME);
+          System.exit(1);
+        }
+        userInfos = jsonUtil.readJsonFromFile(jsonFile);
+        userList = (ArrayList<HashMap<String, String>>) userInfos
+          .get("users");
+        if (userList != null) {
+          // encrypting password using MD5 algo with salt username
+          boolean isUpdated = this.encryptAllPassword();
+          // updating json
+          userInfos.put("users", userList);
+          if (isUpdated) {
+            String jsonStr = jsonUtil.mapToJSON(userInfos);
+            jsonUtil.writeJSONInFile(jsonStr, jsonFile, true);
+          }
+        } else {
+          userList = new ArrayList<HashMap<String, String>>();
+        }
+
+      } catch (Exception exception) {
+        logger.error("Error while reading user prop file :"
+          + exception.getMessage());
+        userInfos = new HashMap<String, Object>();
+        userList = new ArrayList<HashMap<String, String>>();
+      }
+    } else {
+      logger.info("File auth is disabled.");
+    }
+
+  }
+
+  /**
+   * @param username
+   * @return
+   */
+  public User loadUserByUsername(final String username) {
+    logger.debug(" loadUserByUsername username" + username);
+    HashMap<String, Object> userInfo = this.findByusername(username);
+    User user = new User();
+
+    if (userInfo != null) {
+      user.setFirstName(userInfo.get(UserInfoAttributes.NAME) != null ? (String) userInfo
+        .get(UserInfoAttributes.NAME) : "Unknown");
+      user.setLastName(userInfo.get(UserInfoAttributes.NAME) != null ? (String) userInfo
+        .get(UserInfoAttributes.NAME) : "Unknown");
+      user.setUsername(userInfo.get(UserInfoAttributes.USER_NAME) != null ? (String) userInfo
+        .get(UserInfoAttributes.USER_NAME) : "");
+      user.setPassword(userInfo.get(UserInfoAttributes.ENC_PASSWORD) != null ? (String) userInfo
+        .get(UserInfoAttributes.ENC_PASSWORD) : "");
+    }
+
+    Role r = new Role();
+    r.setName("ROLE_USER");
+    Privilege priv = new Privilege();
+    priv.setName("READ_PRIVILEGE");
+    ArrayList<Privilege> plist = new ArrayList<Privilege>();
+    plist.add(priv);
+    r.setPrivileges(plist);
+    List<GrantedAuthority> roles = new ArrayList<GrantedAuthority>();
+    roles.add(r);
+    user.setAuthorities(roles);
+    return user;
+  }
+
+  /**
+   * @param username
+   * @return
+   */
+  public HashMap<String, Object> findByusername(final String username) {
+    if (this.userList == null) {
+      return null;
+    }
+    @SuppressWarnings("unchecked")
+    HashMap<String, Object> userInfo = (HashMap<String, Object>) CollectionUtils
+      .find(this.userList, new Predicate() {
+        @Override
+        public boolean evaluate(Object args) {
+          HashMap<String, Object> tmpuserInfo = (HashMap<String, Object>) args;
+          String objUsername = (String) tmpuserInfo
+            .get(UserInfoAttributes.USER_NAME);
+          if (objUsername != null && username != null) {
+            return username.equalsIgnoreCase(objUsername);
+          }
+          return false;
+        }
+      });
+    return userInfo;
+  }
+
+  private boolean encryptAllPassword() {
+    boolean isUpdated = false;
+    for (HashMap<String, String> user : userList) {
+      // user
+      String encPassword = user.get(UserInfoAttributes.ENC_PASSWORD);
+      String username = user.get(UserInfoAttributes.USER_NAME);
+      String password = user.get(UserInfoAttributes.PASSWORD);
+      if (!stringUtil.isEmpty(password)) {
+        encPassword = encryptPassword(username, password);
+        user.put(UserInfoAttributes.PASSWORD, "");
+        user.put(UserInfoAttributes.ENC_PASSWORD, encPassword);
+        isUpdated = true;
+      }
+      if (stringUtil.isEmpty(password) && stringUtil.isEmpty(encPassword)) {
+        // log error
+        logger.error("Password is empty or null for username : "
+          + username);
+      }
+    }
+    return isUpdated;
+  }
+
+  /**
+   * @param username
+   * @param password
+   * @return
+   */
+  public String encryptPassword(String username, String password) {
+    String saltEncodedpasswd = md5Encoder
+      .encodePassword(password, username);
+    return saltEncodedpasswd;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserInfoAttributes.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserInfoAttributes.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserInfoAttributes.java
new file mode 100644
index 0000000..7bc3555
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/dao/UserInfoAttributes.java
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.dao;
+
+public interface UserInfoAttributes {
+
+  public static final String USER_NAME = "username";
+  public static final String PASSWORD = "password";
+  public static final String ENC_PASSWORD = "en_password";
+  public static final String NAME = "name";
+
+}


[09/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/js/globalize.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/js/globalize.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/js/globalize.js
new file mode 100644
index 0000000..59ff2b8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/js/globalize.js
@@ -0,0 +1,1586 @@
+/*!
+ * Globalize
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ */
+
+(function( window, undefined ) {
+
+var Globalize,
+	// private variables
+	regexHex,
+	regexInfinity,
+	regexParseFloat,
+	regexTrim,
+	// private JavaScript utility functions
+	arrayIndexOf,
+	endsWith,
+	extend,
+	isArray,
+	isFunction,
+	isObject,
+	startsWith,
+	trim,
+	truncate,
+	zeroPad,
+	// private Globalization utility functions
+	appendPreOrPostMatch,
+	expandFormat,
+	formatDate,
+	formatNumber,
+	getTokenRegExp,
+	getEra,
+	getEraYear,
+	parseExact,
+	parseNegativePattern;
+
+// Global variable (Globalize) or CommonJS module (globalize)
+Globalize = function( cultureSelector ) {
+	return new Globalize.prototype.init( cultureSelector );
+};
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	module.exports = Globalize;
+} else {
+	// Export as global variable
+	window.Globalize = Globalize;
+}
+
+Globalize.cultures = {};
+
+Globalize.prototype = {
+	constructor: Globalize,
+	init: function( cultureSelector ) {
+		this.cultures = Globalize.cultures;
+		this.cultureSelector = cultureSelector;
+
+		return this;
+	}
+};
+Globalize.prototype.init.prototype = Globalize.prototype;
+
+// 1. When defining a culture, all fields are required except the ones stated as optional.
+// 2. Each culture should have a ".calendars" object with at least one calendar named "standard"
+//    which serves as the default calendar in use by that culture.
+// 3. Each culture should have a ".calendar" object which is the current calendar being used,
+//    it may be dynamically changed at any time to one of the calendars in ".calendars".
+Globalize.cultures[ "default" ] = {
+	// A unique name for the culture in the form <language code>-<country/region code>
+	name: "en",
+	// the name of the culture in the english language
+	englishName: "English",
+	// the name of the culture in its own language
+	nativeName: "English",
+	// whether the culture uses right-to-left text
+	isRTL: false,
+	// "language" is used for so-called "specific" cultures.
+	// For example, the culture "es-CL" means "Spanish, in Chili".
+	// It represents the Spanish-speaking culture as it is in Chili,
+	// which might have different formatting rules or even translations
+	// than Spanish in Spain. A "neutral" culture is one that is not
+	// specific to a region. For example, the culture "es" is the generic
+	// Spanish culture, which may be a more generalized version of the language
+	// that may or may not be what a specific culture expects.
+	// For a specific culture like "es-CL", the "language" field refers to the
+	// neutral, generic culture information for the language it is using.
+	// This is not always a simple matter of the string before the dash.
+	// For example, the "zh-Hans" culture is netural (Simplified Chinese).
+	// And the "zh-SG" culture is Simplified Chinese in Singapore, whose lanugage
+	// field is "zh-CHS", not "zh".
+	// This field should be used to navigate from a specific culture to it's
+	// more general, neutral culture. If a culture is already as general as it
+	// can get, the language may refer to itself.
+	language: "en",
+	// numberFormat defines general number formatting rules, like the digits in
+	// each grouping, the group separator, and how negative numbers are displayed.
+	numberFormat: {
+		// [negativePattern]
+		// Note, numberFormat.pattern has no "positivePattern" unlike percent and currency,
+		// but is still defined as an array for consistency with them.
+		//   negativePattern: one of "(n)|-n|- n|n-|n -"
+		pattern: [ "-n" ],
+		// number of decimal places normally shown
+		decimals: 2,
+		// string that separates number groups, as in 1,000,000
+		",": ",",
+		// string that separates a number from the fractional portion, as in 1.99
+		".": ".",
+		// array of numbers indicating the size of each number group.
+		// TODO: more detailed description and example
+		groupSizes: [ 3 ],
+		// symbol used for positive numbers
+		"+": "+",
+		// symbol used for negative numbers
+		"-": "-",
+		// symbol used for NaN (Not-A-Number)
+		"NaN": "NaN",
+		// symbol used for Negative Infinity
+		negativeInfinity: "-Infinity",
+		// symbol used for Positive Infinity
+		positiveInfinity: "Infinity",
+		percent: {
+			// [negativePattern, positivePattern]
+			//   negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
+			//   positivePattern: one of "n %|n%|%n|% n"
+			pattern: [ "-n %", "n %" ],
+			// number of decimal places normally shown
+			decimals: 2,
+			// array of numbers indicating the size of each number group.
+			// TODO: more detailed description and example
+			groupSizes: [ 3 ],
+			// string that separates number groups, as in 1,000,000
+			",": ",",
+			// string that separates a number from the fractional portion, as in 1.99
+			".": ".",
+			// symbol used to represent a percentage
+			symbol: "%"
+		},
+		currency: {
+			// [negativePattern, positivePattern]
+			//   negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
+			//   positivePattern: one of "$n|n$|$ n|n $"
+			pattern: [ "($n)", "$n" ],
+			// number of decimal places normally shown
+			decimals: 2,
+			// array of numbers indicating the size of each number group.
+			// TODO: more detailed description and example
+			groupSizes: [ 3 ],
+			// string that separates number groups, as in 1,000,000
+			",": ",",
+			// string that separates a number from the fractional portion, as in 1.99
+			".": ".",
+			// symbol used to represent currency
+			symbol: "$"
+		}
+	},
+	// calendars defines all the possible calendars used by this culture.
+	// There should be at least one defined with name "standard", and is the default
+	// calendar used by the culture.
+	// A calendar contains information about how dates are formatted, information about
+	// the calendar's eras, a standard set of the date formats,
+	// translations for day and month names, and if the calendar is not based on the Gregorian
+	// calendar, conversion functions to and from the Gregorian calendar.
+	calendars: {
+		standard: {
+			// name that identifies the type of calendar this is
+			name: "Gregorian_USEnglish",
+			// separator of parts of a date (e.g. "/" in 11/05/1955)
+			"/": "/",
+			// separator of parts of a time (e.g. ":" in 05:44 PM)
+			":": ":",
+			// the first day of the week (0 = Sunday, 1 = Monday, etc)
+			firstDay: 0,
+			days: {
+				// full day names
+				names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
+				// abbreviated day names
+				namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
+				// shortest day names
+				namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
+			},
+			months: {
+				// full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
+				names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
+				// abbreviated month names
+				namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
+			},
+			// AM and PM designators in one of these forms:
+			// The usual view, and the upper and lower case versions
+			//   [ standard, lowercase, uppercase ]
+			// The culture does not use AM or PM (likely all standard date formats use 24 hour time)
+			//   null
+			AM: [ "AM", "am", "AM" ],
+			PM: [ "PM", "pm", "PM" ],
+			eras: [
+				// eras in reverse chronological order.
+				// name: the name of the era in this culture (e.g. A.D., C.E.)
+				// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
+				// offset: offset in years from gregorian calendar
+				{
+					"name": "A.D.",
+					"start": null,
+					"offset": 0
+				}
+			],
+			// when a two digit year is given, it will never be parsed as a four digit
+			// year greater than this year (in the appropriate era for the culture)
+			// Set it as a full year (e.g. 2029) or use an offset format starting from
+			// the current year: "+19" would correspond to 2029 if the current year 2010.
+			twoDigitYearMax: 2029,
+			// set of predefined date and time patterns used by the culture
+			// these represent the format someone in this culture would expect
+			// to see given the portions of the date that are shown.
+			patterns: {
+				// short date pattern
+				d: "M/d/yyyy",
+				// long date pattern
+				D: "dddd, MMMM dd, yyyy",
+				// short time pattern
+				t: "h:mm tt",
+				// long time pattern
+				T: "h:mm:ss tt",
+				// long date, short time pattern
+				f: "dddd, MMMM dd, yyyy h:mm tt",
+				// long date, long time pattern
+				F: "dddd, MMMM dd, yyyy h:mm:ss tt",
+				// month/day pattern
+				M: "MMMM dd",
+				// month/year pattern
+				Y: "yyyy MMMM",
+				// S is a sortable format that does not vary by culture
+				S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
+			}
+			// optional fields for each calendar:
+			/*
+			monthsGenitive:
+				Same as months but used when the day preceeds the month.
+				Omit if the culture has no genitive distinction in month names.
+				For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
+			convert:
+				Allows for the support of non-gregorian based calendars. This convert object is used to
+				to convert a date to and from a gregorian calendar date to handle parsing and formatting.
+				The two functions:
+					fromGregorian( date )
+						Given the date as a parameter, return an array with parts [ year, month, day ]
+						corresponding to the non-gregorian based year, month, and day for the calendar.
+					toGregorian( year, month, day )
+						Given the non-gregorian year, month, and day, return a new Date() object
+						set to the corresponding date in the gregorian calendar.
+			*/
+		}
+	},
+	// For localized strings
+	messages: {}
+};
+
+Globalize.cultures[ "default" ].calendar = Globalize.cultures[ "default" ].calendars.standard;
+
+Globalize.cultures.en = Globalize.cultures[ "default" ];
+
+Globalize.cultureSelector = "en";
+
+//
+// private variables
+//
+
+regexHex = /^0x[a-f0-9]+$/i;
+regexInfinity = /^[+\-]?infinity$/i;
+regexParseFloat = /^[+\-]?\d*\.?\d*(e[+\-]?\d+)?$/;
+regexTrim = /^\s+|\s+$/g;
+
+//
+// private JavaScript utility functions
+//
+
+arrayIndexOf = function( array, item ) {
+	if ( array.indexOf ) {
+		return array.indexOf( item );
+	}
+	for ( var i = 0, length = array.length; i < length; i++ ) {
+		if ( array[i] === item ) {
+			return i;
+		}
+	}
+	return -1;
+};
+
+endsWith = function( value, pattern ) {
+	return value.substr( value.length - pattern.length ) === pattern;
+};
+
+extend = function() {
+	var options, name, src, copy, copyIsArray, clone,
+		target = arguments[0] || {},
+		i = 1,
+		length = arguments.length,
+		deep = false;
+
+	// Handle a deep copy situation
+	if ( typeof target === "boolean" ) {
+		deep = target;
+		target = arguments[1] || {};
+		// skip the boolean and the target
+		i = 2;
+	}
+
+	// Handle case when target is a string or something (possible in deep copy)
+	if ( typeof target !== "object" && !isFunction(target) ) {
+		target = {};
+	}
+
+	for ( ; i < length; i++ ) {
+		// Only deal with non-null/undefined values
+		if ( (options = arguments[ i ]) != null ) {
+			// Extend the base object
+			for ( name in options ) {
+				src = target[ name ];
+				copy = options[ name ];
+
+				// Prevent never-ending loop
+				if ( target === copy ) {
+					continue;
+				}
+
+				// Recurse if we're merging plain objects or arrays
+				if ( deep && copy && ( isObject(copy) || (copyIsArray = isArray(copy)) ) ) {
+					if ( copyIsArray ) {
+						copyIsArray = false;
+						clone = src && isArray(src) ? src : [];
+
+					} else {
+						clone = src && isObject(src) ? src : {};
+					}
+
+					// Never move original objects, clone them
+					target[ name ] = extend( deep, clone, copy );
+
+				// Don't bring in undefined values
+				} else if ( copy !== undefined ) {
+					target[ name ] = copy;
+				}
+			}
+		}
+	}
+
+	// Return the modified object
+	return target;
+};
+
+isArray = Array.isArray || function( obj ) {
+	return Object.prototype.toString.call( obj ) === "[object Array]";
+};
+
+isFunction = function( obj ) {
+	return Object.prototype.toString.call( obj ) === "[object Function]";
+};
+
+isObject = function( obj ) {
+	return Object.prototype.toString.call( obj ) === "[object Object]";
+};
+
+startsWith = function( value, pattern ) {
+	return value.indexOf( pattern ) === 0;
+};
+
+trim = function( value ) {
+	return ( value + "" ).replace( regexTrim, "" );
+};
+
+truncate = function( value ) {
+	if ( isNaN( value ) ) {
+		return NaN;
+	}
+	return Math[ value < 0 ? "ceil" : "floor" ]( value );
+};
+
+zeroPad = function( str, count, left ) {
+	var l;
+	for ( l = str.length; l < count; l += 1 ) {
+		str = ( left ? ("0" + str) : (str + "0") );
+	}
+	return str;
+};
+
+//
+// private Globalization utility functions
+//
+
+appendPreOrPostMatch = function( preMatch, strings ) {
+	// appends pre- and post- token match strings while removing escaped characters.
+	// Returns a single quote count which is used to determine if the token occurs
+	// in a string literal.
+	var quoteCount = 0,
+		escaped = false;
+	for ( var i = 0, il = preMatch.length; i < il; i++ ) {
+		var c = preMatch.charAt( i );
+		switch ( c ) {
+			case "\'":
+				if ( escaped ) {
+					strings.push( "\'" );
+				}
+				else {
+					quoteCount++;
+				}
+				escaped = false;
+				break;
+			case "\\":
+				if ( escaped ) {
+					strings.push( "\\" );
+				}
+				escaped = !escaped;
+				break;
+			default:
+				strings.push( c );
+				escaped = false;
+				break;
+		}
+	}
+	return quoteCount;
+};
+
+expandFormat = function( cal, format ) {
+	// expands unspecified or single character date formats into the full pattern.
+	format = format || "F";
+	var pattern,
+		patterns = cal.patterns,
+		len = format.length;
+	if ( len === 1 ) {
+		pattern = patterns[ format ];
+		if ( !pattern ) {
+			throw "Invalid date format string \'" + format + "\'.";
+		}
+		format = pattern;
+	}
+	else if ( len === 2 && format.charAt(0) === "%" ) {
+		// %X escape format -- intended as a custom format string that is only one character, not a built-in format.
+		format = format.charAt( 1 );
+	}
+	return format;
+};
+
+formatDate = function( value, format, culture ) {
+	var cal = culture.calendar,
+		convert = cal.convert,
+		ret;
+
+	if ( !format || !format.length || format === "i" ) {
+		if ( culture && culture.name.length ) {
+			if ( convert ) {
+				// non-gregorian calendar, so we cannot use built-in toLocaleString()
+				ret = formatDate( value, cal.patterns.F, culture );
+			}
+			else {
+				var eraDate = new Date( value.getTime() ),
+					era = getEra( value, cal.eras );
+				eraDate.setFullYear( getEraYear(value, cal, era) );
+				ret = eraDate.toLocaleString();
+			}
+		}
+		else {
+			ret = value.toString();
+		}
+		return ret;
+	}
+
+	var eras = cal.eras,
+		sortable = format === "s";
+	format = expandFormat( cal, format );
+
+	// Start with an empty string
+	ret = [];
+	var hour,
+		zeros = [ "0", "00", "000" ],
+		foundDay,
+		checkedDay,
+		dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g,
+		quoteCount = 0,
+		tokenRegExp = getTokenRegExp(),
+		converted;
+
+	function padZeros( num, c ) {
+		var r, s = num + "";
+		if ( c > 1 && s.length < c ) {
+			r = ( zeros[c - 2] + s);
+			return r.substr( r.length - c, c );
+		}
+		else {
+			r = s;
+		}
+		return r;
+	}
+
+	function hasDay() {
+		if ( foundDay || checkedDay ) {
+			return foundDay;
+		}
+		foundDay = dayPartRegExp.test( format );
+		checkedDay = true;
+		return foundDay;
+	}
+
+	function getPart( date, part ) {
+		if ( converted ) {
+			return converted[ part ];
+		}
+		switch ( part ) {
+			case 0:
+				return date.getFullYear();
+			case 1:
+				return date.getMonth();
+			case 2:
+				return date.getDate();
+			default:
+				throw "Invalid part value " + part;
+		}
+	}
+
+	if ( !sortable && convert ) {
+		converted = convert.fromGregorian( value );
+	}
+
+	for ( ; ; ) {
+		// Save the current index
+		var index = tokenRegExp.lastIndex,
+			// Look for the next pattern
+			ar = tokenRegExp.exec( format );
+
+		// Append the text before the pattern (or the end of the string if not found)
+		var preMatch = format.slice( index, ar ? ar.index : format.length );
+		quoteCount += appendPreOrPostMatch( preMatch, ret );
+
+		if ( !ar ) {
+			break;
+		}
+
+		// do not replace any matches that occur inside a string literal.
+		if ( quoteCount % 2 ) {
+			ret.push( ar[0] );
+			continue;
+		}
+
+		var current = ar[ 0 ],
+			clength = current.length;
+
+		switch ( current ) {
+			case "ddd":
+				//Day of the week, as a three-letter abbreviation
+			case "dddd":
+				// Day of the week, using the full name
+				var names = ( clength === 3 ) ? cal.days.namesAbbr : cal.days.names;
+				ret.push( names[value.getDay()] );
+				break;
+			case "d":
+				// Day of month, without leading zero for single-digit days
+			case "dd":
+				// Day of month, with leading zero for single-digit days
+				foundDay = true;
+				ret.push(
+					padZeros( getPart(value, 2), clength )
+				);
+				break;
+			case "MMM":
+				// Month, as a three-letter abbreviation
+			case "MMMM":
+				// Month, using the full name
+				var part = getPart( value, 1 );
+				ret.push(
+					( cal.monthsGenitive && hasDay() ) ?
+					( cal.monthsGenitive[ clength === 3 ? "namesAbbr" : "names" ][ part ] ) :
+					( cal.months[ clength === 3 ? "namesAbbr" : "names" ][ part ] )
+				);
+				break;
+			case "M":
+				// Month, as digits, with no leading zero for single-digit months
+			case "MM":
+				// Month, as digits, with leading zero for single-digit months
+				ret.push(
+					padZeros( getPart(value, 1) + 1, clength )
+				);
+				break;
+			case "y":
+				// Year, as two digits, but with no leading zero for years less than 10
+			case "yy":
+				// Year, as two digits, with leading zero for years less than 10
+			case "yyyy":
+				// Year represented by four full digits
+				part = converted ? converted[ 0 ] : getEraYear( value, cal, getEra(value, eras), sortable );
+				if ( clength < 4 ) {
+					part = part % 100;
+				}
+				ret.push(
+					padZeros( part, clength )
+				);
+				break;
+			case "h":
+				// Hours with no leading zero for single-digit hours, using 12-hour clock
+			case "hh":
+				// Hours with leading zero for single-digit hours, using 12-hour clock
+				hour = value.getHours() % 12;
+				if ( hour === 0 ) hour = 12;
+				ret.push(
+					padZeros( hour, clength )
+				);
+				break;
+			case "H":
+				// Hours with no leading zero for single-digit hours, using 24-hour clock
+			case "HH":
+				// Hours with leading zero for single-digit hours, using 24-hour clock
+				ret.push(
+					padZeros( value.getHours(), clength )
+				);
+				break;
+			case "m":
+				// Minutes with no leading zero for single-digit minutes
+			case "mm":
+				// Minutes with leading zero for single-digit minutes
+				ret.push(
+					padZeros( value.getMinutes(), clength )
+				);
+				break;
+			case "s":
+				// Seconds with no leading zero for single-digit seconds
+			case "ss":
+				// Seconds with leading zero for single-digit seconds
+				ret.push(
+					padZeros( value.getSeconds(), clength )
+				);
+				break;
+			case "t":
+				// One character am/pm indicator ("a" or "p")
+			case "tt":
+				// Multicharacter am/pm indicator
+				part = value.getHours() < 12 ? ( cal.AM ? cal.AM[0] : " " ) : ( cal.PM ? cal.PM[0] : " " );
+				ret.push( clength === 1 ? part.charAt(0) : part );
+				break;
+			case "f":
+				// Deciseconds
+			case "ff":
+				// Centiseconds
+			case "fff":
+				// Milliseconds
+				ret.push(
+					padZeros( value.getMilliseconds(), 3 ).substr( 0, clength )
+				);
+				break;
+			case "z":
+				// Time zone offset, no leading zero
+			case "zz":
+				// Time zone offset with leading zero
+				hour = value.getTimezoneOffset() / 60;
+				ret.push(
+					( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), clength )
+				);
+				break;
+			case "zzz":
+				// Time zone offset with leading zero
+				hour = value.getTimezoneOffset() / 60;
+				ret.push(
+					( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), 2 ) +
+					// Hard coded ":" separator, rather than using cal.TimeSeparator
+					// Repeated here for consistency, plus ":" was already assumed in date parsing.
+					":" + padZeros( Math.abs(value.getTimezoneOffset() % 60), 2 )
+				);
+				break;
+			case "g":
+			case "gg":
+				if ( cal.eras ) {
+					ret.push(
+						cal.eras[ getEra(value, eras) ].name
+					);
+				}
+				break;
+		case "/":
+			ret.push( cal["/"] );
+			break;
+		default:
+			throw "Invalid date format pattern \'" + current + "\'.";
+		}
+	}
+	return ret.join( "" );
+};
+
+// formatNumber
+(function() {
+	var expandNumber;
+
+	expandNumber = function( number, precision, formatInfo ) {
+		var groupSizes = formatInfo.groupSizes,
+			curSize = groupSizes[ 0 ],
+			curGroupIndex = 1,
+			factor = Math.pow( 10, precision ),
+			rounded = Math.round( number * factor ) / factor;
+
+		if ( !isFinite(rounded) ) {
+			rounded = number;
+		}
+		number = rounded;
+
+		var numberString = number+"",
+			right = "",
+			split = numberString.split( /e/i ),
+			exponent = split.length > 1 ? parseInt( split[1], 10 ) : 0;
+		numberString = split[ 0 ];
+		split = numberString.split( "." );
+		numberString = split[ 0 ];
+		right = split.length > 1 ? split[ 1 ] : "";
+
+		var l;
+		if ( exponent > 0 ) {
+			right = zeroPad( right, exponent, false );
+			numberString += right.slice( 0, exponent );
+			right = right.substr( exponent );
+		}
+		else if ( exponent < 0 ) {
+			exponent = -exponent;
+			numberString = zeroPad( numberString, exponent + 1, true );
+			right = numberString.slice( -exponent, numberString.length ) + right;
+			numberString = numberString.slice( 0, -exponent );
+		}
+
+		if ( precision > 0 ) {
+			right = formatInfo[ "." ] +
+				( (right.length > precision) ? right.slice(0, precision) : zeroPad(right, precision) );
+		}
+		else {
+			right = "";
+		}
+
+		var stringIndex = numberString.length - 1,
+			sep = formatInfo[ "," ],
+			ret = "";
+
+		while ( stringIndex >= 0 ) {
+			if ( curSize === 0 || curSize > stringIndex ) {
+				return numberString.slice( 0, stringIndex + 1 ) + ( ret.length ? (sep + ret + right) : right );
+			}
+			ret = numberString.slice( stringIndex - curSize + 1, stringIndex + 1 ) + ( ret.length ? (sep + ret) : "" );
+
+			stringIndex -= curSize;
+
+			if ( curGroupIndex < groupSizes.length ) {
+				curSize = groupSizes[ curGroupIndex ];
+				curGroupIndex++;
+			}
+		}
+
+		return numberString.slice( 0, stringIndex + 1 ) + sep + ret + right;
+	};
+
+	formatNumber = function( value, format, culture ) {
+		if ( !isFinite(value) ) {
+			if ( value === Infinity ) {
+				return culture.numberFormat.positiveInfinity;
+			}
+			if ( value === -Infinity ) {
+				return culture.numberFormat.negativeInfinity;
+			}
+			return culture.numberFormat[ "NaN" ];
+		}
+		if ( !format || format === "i" ) {
+			return culture.name.length ? value.toLocaleString() : value.toString();
+		}
+		format = format || "D";
+
+		var nf = culture.numberFormat,
+			number = Math.abs( value ),
+			precision = -1,
+			pattern;
+		if ( format.length > 1 ) precision = parseInt( format.slice(1), 10 );
+
+		var current = format.charAt( 0 ).toUpperCase(),
+			formatInfo;
+
+		switch ( current ) {
+			case "D":
+				pattern = "n";
+				number = truncate( number );
+				if ( precision !== -1 ) {
+					number = zeroPad( "" + number, precision, true );
+				}
+				if ( value < 0 ) number = "-" + number;
+				break;
+			case "N":
+				formatInfo = nf;
+				/* falls through */
+			case "C":
+				formatInfo = formatInfo || nf.currency;
+				/* falls through */
+			case "P":
+				formatInfo = formatInfo || nf.percent;
+				pattern = value < 0 ? formatInfo.pattern[ 0 ] : ( formatInfo.pattern[1] || "n" );
+				if ( precision === -1 ) precision = formatInfo.decimals;
+				number = expandNumber( number * (current === "P" ? 100 : 1), precision, formatInfo );
+				break;
+			default:
+				throw "Bad number format specifier: " + current;
+		}
+
+		var patternParts = /n|\$|-|%/g,
+			ret = "";
+		for ( ; ; ) {
+			var index = patternParts.lastIndex,
+				ar = patternParts.exec( pattern );
+
+			ret += pattern.slice( index, ar ? ar.index : pattern.length );
+
+			if ( !ar ) {
+				break;
+			}
+
+			switch ( ar[0] ) {
+				case "n":
+					ret += number;
+					break;
+				case "$":
+					ret += nf.currency.symbol;
+					break;
+				case "-":
+					// don't make 0 negative
+					if ( /[1-9]/.test(number) ) {
+						ret += nf[ "-" ];
+					}
+					break;
+				case "%":
+					ret += nf.percent.symbol;
+					break;
+			}
+		}
+
+		return ret;
+	};
+
+}());
+
+getTokenRegExp = function() {
+	// regular expression for matching date and time tokens in format strings.
+	return (/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g);
+};
+
+getEra = function( date, eras ) {
+	if ( !eras ) return 0;
+	var start, ticks = date.getTime();
+	for ( var i = 0, l = eras.length; i < l; i++ ) {
+		start = eras[ i ].start;
+		if ( start === null || ticks >= start ) {
+			return i;
+		}
+	}
+	return 0;
+};
+
+getEraYear = function( date, cal, era, sortable ) {
+	var year = date.getFullYear();
+	if ( !sortable && cal.eras ) {
+		// convert normal gregorian year to era-shifted gregorian
+		// year by subtracting the era offset
+		year -= cal.eras[ era ].offset;
+	}
+	return year;
+};
+
+// parseExact
+(function() {
+	var expandYear,
+		getDayIndex,
+		getMonthIndex,
+		getParseRegExp,
+		outOfRange,
+		toUpper,
+		toUpperArray;
+
+	expandYear = function( cal, year ) {
+		// expands 2-digit year into 4 digits.
+		if ( year < 100 ) {
+			var now = new Date(),
+				era = getEra( now ),
+				curr = getEraYear( now, cal, era ),
+				twoDigitYearMax = cal.twoDigitYearMax;
+			twoDigitYearMax = typeof twoDigitYearMax === "string" ? new Date().getFullYear() % 100 + parseInt( twoDigitYearMax, 10 ) : twoDigitYearMax;
+			year += curr - ( curr % 100 );
+			if ( year > twoDigitYearMax ) {
+				year -= 100;
+			}
+		}
+		return year;
+	};
+
+	getDayIndex = function	( cal, value, abbr ) {
+		var ret,
+			days = cal.days,
+			upperDays = cal._upperDays;
+		if ( !upperDays ) {
+			cal._upperDays = upperDays = [
+				toUpperArray( days.names ),
+				toUpperArray( days.namesAbbr ),
+				toUpperArray( days.namesShort )
+			];
+		}
+		value = toUpper( value );
+		if ( abbr ) {
+			ret = arrayIndexOf( upperDays[1], value );
+			if ( ret === -1 ) {
+				ret = arrayIndexOf( upperDays[2], value );
+			}
+		}
+		else {
+			ret = arrayIndexOf( upperDays[0], value );
+		}
+		return ret;
+	};
+
+	getMonthIndex = function( cal, value, abbr ) {
+		var months = cal.months,
+			monthsGen = cal.monthsGenitive || cal.months,
+			upperMonths = cal._upperMonths,
+			upperMonthsGen = cal._upperMonthsGen;
+		if ( !upperMonths ) {
+			cal._upperMonths = upperMonths = [
+				toUpperArray( months.names ),
+				toUpperArray( months.namesAbbr )
+			];
+			cal._upperMonthsGen = upperMonthsGen = [
+				toUpperArray( monthsGen.names ),
+				toUpperArray( monthsGen.namesAbbr )
+			];
+		}
+		value = toUpper( value );
+		var i = arrayIndexOf( abbr ? upperMonths[1] : upperMonths[0], value );
+		if ( i < 0 ) {
+			i = arrayIndexOf( abbr ? upperMonthsGen[1] : upperMonthsGen[0], value );
+		}
+		return i;
+	};
+
+	getParseRegExp = function( cal, format ) {
+		// converts a format string into a regular expression with groups that
+		// can be used to extract date fields from a date string.
+		// check for a cached parse regex.
+		var re = cal._parseRegExp;
+		if ( !re ) {
+			cal._parseRegExp = re = {};
+		}
+		else {
+			var reFormat = re[ format ];
+			if ( reFormat ) {
+				return reFormat;
+			}
+		}
+
+		// expand single digit formats, then escape regular expression characters.
+		var expFormat = expandFormat( cal, format ).replace( /([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1" ),
+			regexp = [ "^" ],
+			groups = [],
+			index = 0,
+			quoteCount = 0,
+			tokenRegExp = getTokenRegExp(),
+			match;
+
+		// iterate through each date token found.
+		while ( (match = tokenRegExp.exec(expFormat)) !== null ) {
+			var preMatch = expFormat.slice( index, match.index );
+			index = tokenRegExp.lastIndex;
+
+			// don't replace any matches that occur inside a string literal.
+			quoteCount += appendPreOrPostMatch( preMatch, regexp );
+			if ( quoteCount % 2 ) {
+				regexp.push( match[0] );
+				continue;
+			}
+
+			// add a regex group for the token.
+			var m = match[ 0 ],
+				len = m.length,
+				add;
+			switch ( m ) {
+				case "dddd": case "ddd":
+				case "MMMM": case "MMM":
+				case "gg": case "g":
+					add = "(\\D+)";
+					break;
+				case "tt": case "t":
+					add = "(\\D*)";
+					break;
+				case "yyyy":
+				case "fff":
+				case "ff":
+				case "f":
+					add = "(\\d{" + len + "})";
+					break;
+				case "dd": case "d":
+				case "MM": case "M":
+				case "yy": case "y":
+				case "HH": case "H":
+				case "hh": case "h":
+				case "mm": case "m":
+				case "ss": case "s":
+					add = "(\\d\\d?)";
+					break;
+				case "zzz":
+					add = "([+-]?\\d\\d?:\\d{2})";
+					break;
+				case "zz": case "z":
+					add = "([+-]?\\d\\d?)";
+					break;
+				case "/":
+					add = "(\\/)";
+					break;
+				default:
+					throw "Invalid date format pattern \'" + m + "\'.";
+			}
+			if ( add ) {
+				regexp.push( add );
+			}
+			groups.push( match[0] );
+		}
+		appendPreOrPostMatch( expFormat.slice(index), regexp );
+		regexp.push( "$" );
+
+		// allow whitespace to differ when matching formats.
+		var regexpStr = regexp.join( "" ).replace( /\s+/g, "\\s+" ),
+			parseRegExp = { "regExp": regexpStr, "groups": groups };
+
+		// cache the regex for this format.
+		return re[ format ] = parseRegExp;
+	};
+
+	outOfRange = function( value, low, high ) {
+		return value < low || value > high;
+	};
+
+	toUpper = function( value ) {
+		// "he-IL" has non-breaking space in weekday names.
+		return value.split( "\u00A0" ).join( " " ).toUpperCase();
+	};
+
+	toUpperArray = function( arr ) {
+		var results = [];
+		for ( var i = 0, l = arr.length; i < l; i++ ) {
+			results[ i ] = toUpper( arr[i] );
+		}
+		return results;
+	};
+
+	parseExact = function( value, format, culture ) {
+		// try to parse the date string by matching against the format string
+		// while using the specified culture for date field names.
+		value = trim( value );
+		var cal = culture.calendar,
+			// convert date formats into regular expressions with groupings.
+			// use the regexp to determine the input format and extract the date fields.
+			parseInfo = getParseRegExp( cal, format ),
+			match = new RegExp( parseInfo.regExp ).exec( value );
+		if ( match === null ) {
+			return null;
+		}
+		// found a date format that matches the input.
+		var groups = parseInfo.groups,
+			era = null, year = null, month = null, date = null, weekDay = null,
+			hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
+			pmHour = false;
+		// iterate the format groups to extract and set the date fields.
+		for ( var j = 0, jl = groups.length; j < jl; j++ ) {
+			var matchGroup = match[ j + 1 ];
+			if ( matchGroup ) {
+				var current = groups[ j ],
+					clength = current.length,
+					matchInt = parseInt( matchGroup, 10 );
+				switch ( current ) {
+					case "dd": case "d":
+						// Day of month.
+						date = matchInt;
+						// check that date is generally in valid range, also checking overflow below.
+						if ( outOfRange(date, 1, 31) ) return null;
+						break;
+					case "MMM": case "MMMM":
+						month = getMonthIndex( cal, matchGroup, clength === 3 );
+						if ( outOfRange(month, 0, 11) ) return null;
+						break;
+					case "M": case "MM":
+						// Month.
+						month = matchInt - 1;
+						if ( outOfRange(month, 0, 11) ) return null;
+						break;
+					case "y": case "yy":
+					case "yyyy":
+						year = clength < 4 ? expandYear( cal, matchInt ) : matchInt;
+						if ( outOfRange(year, 0, 9999) ) return null;
+						break;
+					case "h": case "hh":
+						// Hours (12-hour clock).
+						hour = matchInt;
+						if ( hour === 12 ) hour = 0;
+						if ( outOfRange(hour, 0, 11) ) return null;
+						break;
+					case "H": case "HH":
+						// Hours (24-hour clock).
+						hour = matchInt;
+						if ( outOfRange(hour, 0, 23) ) return null;
+						break;
+					case "m": case "mm":
+						// Minutes.
+						min = matchInt;
+						if ( outOfRange(min, 0, 59) ) return null;
+						break;
+					case "s": case "ss":
+						// Seconds.
+						sec = matchInt;
+						if ( outOfRange(sec, 0, 59) ) return null;
+						break;
+					case "tt": case "t":
+						// AM/PM designator.
+						// see if it is standard, upper, or lower case PM. If not, ensure it is at least one of
+						// the AM tokens. If not, fail the parse for this format.
+						pmHour = cal.PM && ( matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2] );
+						if (
+							!pmHour && (
+								!cal.AM || ( matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2] )
+							)
+						) return null;
+						break;
+					case "f":
+						// Deciseconds.
+					case "ff":
+						// Centiseconds.
+					case "fff":
+						// Milliseconds.
+						msec = matchInt * Math.pow( 10, 3 - clength );
+						if ( outOfRange(msec, 0, 999) ) return null;
+						break;
+					case "ddd":
+						// Day of week.
+					case "dddd":
+						// Day of week.
+						weekDay = getDayIndex( cal, matchGroup, clength === 3 );
+						if ( outOfRange(weekDay, 0, 6) ) return null;
+						break;
+					case "zzz":
+						// Time zone offset in +/- hours:min.
+						var offsets = matchGroup.split( /:/ );
+						if ( offsets.length !== 2 ) return null;
+						hourOffset = parseInt( offsets[0], 10 );
+						if ( outOfRange(hourOffset, -12, 13) ) return null;
+						var minOffset = parseInt( offsets[1], 10 );
+						if ( outOfRange(minOffset, 0, 59) ) return null;
+						tzMinOffset = ( hourOffset * 60 ) + ( startsWith(matchGroup, "-") ? -minOffset : minOffset );
+						break;
+					case "z": case "zz":
+						// Time zone offset in +/- hours.
+						hourOffset = matchInt;
+						if ( outOfRange(hourOffset, -12, 13) ) return null;
+						tzMinOffset = hourOffset * 60;
+						break;
+					case "g": case "gg":
+						var eraName = matchGroup;
+						if ( !eraName || !cal.eras ) return null;
+						eraName = trim( eraName.toLowerCase() );
+						for ( var i = 0, l = cal.eras.length; i < l; i++ ) {
+							if ( eraName === cal.eras[i].name.toLowerCase() ) {
+								era = i;
+								break;
+							}
+						}
+						// could not find an era with that name
+						if ( era === null ) return null;
+						break;
+				}
+			}
+		}
+		var result = new Date(), defaultYear, convert = cal.convert;
+		defaultYear = convert ? convert.fromGregorian( result )[ 0 ] : result.getFullYear();
+		if ( year === null ) {
+			year = defaultYear;
+		}
+		else if ( cal.eras ) {
+			// year must be shifted to normal gregorian year
+			// but not if year was not specified, its already normal gregorian
+			// per the main if clause above.
+			year += cal.eras[( era || 0 )].offset;
+		}
+		// set default day and month to 1 and January, so if unspecified, these are the defaults
+		// instead of the current day/month.
+		if ( month === null ) {
+			month = 0;
+		}
+		if ( date === null ) {
+			date = 1;
+		}
+		// now have year, month, and date, but in the culture's calendar.
+		// convert to gregorian if necessary
+		if ( convert ) {
+			result = convert.toGregorian( year, month, date );
+			// conversion failed, must be an invalid match
+			if ( result === null ) return null;
+		}
+		else {
+			// have to set year, month and date together to avoid overflow based on current date.
+			result.setFullYear( year, month, date );
+			// check to see if date overflowed for specified month (only checked 1-31 above).
+			if ( result.getDate() !== date ) return null;
+			// invalid day of week.
+			if ( weekDay !== null && result.getDay() !== weekDay ) {
+				return null;
+			}
+		}
+		// if pm designator token was found make sure the hours fit the 24-hour clock.
+		if ( pmHour && hour < 12 ) {
+			hour += 12;
+		}
+		result.setHours( hour, min, sec, msec );
+		if ( tzMinOffset !== null ) {
+			// adjust timezone to utc before applying local offset.
+			var adjustedMin = result.getMinutes() - ( tzMinOffset + result.getTimezoneOffset() );
+			// Safari limits hours and minutes to the range of -127 to 127.  We need to use setHours
+			// to ensure both these fields will not exceed this range.	adjustedMin will range
+			// somewhere between -1440 and 1500, so we only need to split this into hours.
+			result.setHours( result.getHours() + parseInt(adjustedMin / 60, 10), adjustedMin % 60 );
+		}
+		return result;
+	};
+}());
+
+parseNegativePattern = function( value, nf, negativePattern ) {
+	var neg = nf[ "-" ],
+		pos = nf[ "+" ],
+		ret;
+	switch ( negativePattern ) {
+		case "n -":
+			neg = " " + neg;
+			pos = " " + pos;
+			/* falls through */
+		case "n-":
+			if ( endsWith(value, neg) ) {
+				ret = [ "-", value.substr(0, value.length - neg.length) ];
+			}
+			else if ( endsWith(value, pos) ) {
+				ret = [ "+", value.substr(0, value.length - pos.length) ];
+			}
+			break;
+		case "- n":
+			neg += " ";
+			pos += " ";
+			/* falls through */
+		case "-n":
+			if ( startsWith(value, neg) ) {
+				ret = [ "-", value.substr(neg.length) ];
+			}
+			else if ( startsWith(value, pos) ) {
+				ret = [ "+", value.substr(pos.length) ];
+			}
+			break;
+		case "(n)":
+			if ( startsWith(value, "(") && endsWith(value, ")") ) {
+				ret = [ "-", value.substr(1, value.length - 2) ];
+			}
+			break;
+	}
+	return ret || [ "", value ];
+};
+
+//
+// public instance functions
+//
+
+Globalize.prototype.findClosestCulture = function( cultureSelector ) {
+	return Globalize.findClosestCulture.call( this, cultureSelector );
+};
+
+Globalize.prototype.format = function( value, format, cultureSelector ) {
+	return Globalize.format.call( this, value, format, cultureSelector );
+};
+
+Globalize.prototype.localize = function( key, cultureSelector ) {
+	return Globalize.localize.call( this, key, cultureSelector );
+};
+
+Globalize.prototype.parseInt = function( value, radix, cultureSelector ) {
+	return Globalize.parseInt.call( this, value, radix, cultureSelector );
+};
+
+Globalize.prototype.parseFloat = function( value, radix, cultureSelector ) {
+	return Globalize.parseFloat.call( this, value, radix, cultureSelector );
+};
+
+Globalize.prototype.culture = function( cultureSelector ) {
+	return Globalize.culture.call( this, cultureSelector );
+};
+
+//
+// public singleton functions
+//
+
+Globalize.addCultureInfo = function( cultureName, baseCultureName, info ) {
+
+	var base = {},
+		isNew = false;
+
+	if ( typeof cultureName !== "string" ) {
+		// cultureName argument is optional string. If not specified, assume info is first
+		// and only argument. Specified info deep-extends current culture.
+		info = cultureName;
+		cultureName = this.culture().name;
+		base = this.cultures[ cultureName ];
+	} else if ( typeof baseCultureName !== "string" ) {
+		// baseCultureName argument is optional string. If not specified, assume info is second
+		// argument. Specified info deep-extends specified culture.
+		// If specified culture does not exist, create by deep-extending default
+		info = baseCultureName;
+		isNew = ( this.cultures[ cultureName ] == null );
+		base = this.cultures[ cultureName ] || this.cultures[ "default" ];
+	} else {
+		// cultureName and baseCultureName specified. Assume a new culture is being created
+		// by deep-extending an specified base culture
+		isNew = true;
+		base = this.cultures[ baseCultureName ];
+	}
+
+	this.cultures[ cultureName ] = extend(true, {},
+		base,
+		info
+	);
+	// Make the standard calendar the current culture if it's a new culture
+	if ( isNew ) {
+		this.cultures[ cultureName ].calendar = this.cultures[ cultureName ].calendars.standard;
+	}
+};
+
+Globalize.findClosestCulture = function( name ) {
+	var match;
+	if ( !name ) {
+		return this.findClosestCulture( this.cultureSelector ) || this.cultures[ "default" ];
+	}
+	if ( typeof name === "string" ) {
+		name = name.split( "," );
+	}
+	if ( isArray(name) ) {
+		var lang,
+			cultures = this.cultures,
+			list = name,
+			i, l = list.length,
+			prioritized = [];
+		for ( i = 0; i < l; i++ ) {
+			name = trim( list[i] );
+			var pri, parts = name.split( ";" );
+			lang = trim( parts[0] );
+			if ( parts.length === 1 ) {
+				pri = 1;
+			}
+			else {
+				name = trim( parts[1] );
+				if ( name.indexOf("q=") === 0 ) {
+					name = name.substr( 2 );
+					pri = parseFloat( name );
+					pri = isNaN( pri ) ? 0 : pri;
+				}
+				else {
+					pri = 1;
+				}
+			}
+			prioritized.push({ lang: lang, pri: pri });
+		}
+		prioritized.sort(function( a, b ) {
+			if ( a.pri < b.pri ) {
+				return 1;
+			} else if ( a.pri > b.pri ) {
+				return -1;
+			}
+			return 0;
+		});
+		// exact match
+		for ( i = 0; i < l; i++ ) {
+			lang = prioritized[ i ].lang;
+			match = cultures[ lang ];
+			if ( match ) {
+				return match;
+			}
+		}
+
+		// neutral language match
+		for ( i = 0; i < l; i++ ) {
+			lang = prioritized[ i ].lang;
+			do {
+				var index = lang.lastIndexOf( "-" );
+				if ( index === -1 ) {
+					break;
+				}
+				// strip off the last part. e.g. en-US => en
+				lang = lang.substr( 0, index );
+				match = cultures[ lang ];
+				if ( match ) {
+					return match;
+				}
+			}
+			while ( 1 );
+		}
+
+		// last resort: match first culture using that language
+		for ( i = 0; i < l; i++ ) {
+			lang = prioritized[ i ].lang;
+			for ( var cultureKey in cultures ) {
+				var culture = cultures[ cultureKey ];
+				if ( culture.language == lang ) {
+					return culture;
+				}
+			}
+		}
+	}
+	else if ( typeof name === "object" ) {
+		return name;
+	}
+	return match || null;
+};
+
+Globalize.format = function( value, format, cultureSelector ) {
+	var culture = this.findClosestCulture( cultureSelector );
+	if ( value instanceof Date ) {
+		value = formatDate( value, format, culture );
+	}
+	else if ( typeof value === "number" ) {
+		value = formatNumber( value, format, culture );
+	}
+	return value;
+};
+
+Globalize.localize = function( key, cultureSelector ) {
+	return this.findClosestCulture( cultureSelector ).messages[ key ] ||
+		this.cultures[ "default" ].messages[ key ];
+};
+
+Globalize.parseDate = function( value, formats, culture ) {
+	culture = this.findClosestCulture( culture );
+
+	var date, prop, patterns;
+	if ( formats ) {
+		if ( typeof formats === "string" ) {
+			formats = [ formats ];
+		}
+		if ( formats.length ) {
+			for ( var i = 0, l = formats.length; i < l; i++ ) {
+				var format = formats[ i ];
+				if ( format ) {
+					date = parseExact( value, format, culture );
+					if ( date ) {
+						break;
+					}
+				}
+			}
+		}
+	} else {
+		patterns = culture.calendar.patterns;
+		for ( prop in patterns ) {
+			date = parseExact( value, patterns[prop], culture );
+			if ( date ) {
+				break;
+			}
+		}
+	}
+
+	return date || null;
+};
+
+Globalize.parseInt = function( value, radix, cultureSelector ) {
+	return truncate( Globalize.parseFloat(value, radix, cultureSelector) );
+};
+
+Globalize.parseFloat = function( value, radix, cultureSelector ) {
+	// radix argument is optional
+	if ( typeof radix !== "number" ) {
+		cultureSelector = radix;
+		radix = 10;
+	}
+
+	var culture = this.findClosestCulture( cultureSelector );
+	var ret = NaN,
+		nf = culture.numberFormat;
+
+	if ( value.indexOf(culture.numberFormat.currency.symbol) > -1 ) {
+		// remove currency symbol
+		value = value.replace( culture.numberFormat.currency.symbol, "" );
+		// replace decimal seperator
+		value = value.replace( culture.numberFormat.currency["."], culture.numberFormat["."] );
+	}
+
+	//Remove percentage character from number string before parsing
+	if ( value.indexOf(culture.numberFormat.percent.symbol) > -1){
+		value = value.replace( culture.numberFormat.percent.symbol, "" );
+	}
+
+	// remove spaces: leading, trailing and between - and number. Used for negative currency pt-BR
+	value = value.replace( / /g, "" );
+
+	// allow infinity or hexidecimal
+	if ( regexInfinity.test(value) ) {
+		ret = parseFloat( value );
+	}
+	else if ( !radix && regexHex.test(value) ) {
+		ret = parseInt( value, 16 );
+	}
+	else {
+
+		// determine sign and number
+		var signInfo = parseNegativePattern( value, nf, nf.pattern[0] ),
+			sign = signInfo[ 0 ],
+			num = signInfo[ 1 ];
+
+		// #44 - try parsing as "(n)"
+		if ( sign === "" && nf.pattern[0] !== "(n)" ) {
+			signInfo = parseNegativePattern( value, nf, "(n)" );
+			sign = signInfo[ 0 ];
+			num = signInfo[ 1 ];
+		}
+
+		// try parsing as "-n"
+		if ( sign === "" && nf.pattern[0] !== "-n" ) {
+			signInfo = parseNegativePattern( value, nf, "-n" );
+			sign = signInfo[ 0 ];
+			num = signInfo[ 1 ];
+		}
+
+		sign = sign || "+";
+
+		// determine exponent and number
+		var exponent,
+			intAndFraction,
+			exponentPos = num.indexOf( "e" );
+		if ( exponentPos < 0 ) exponentPos = num.indexOf( "E" );
+		if ( exponentPos < 0 ) {
+			intAndFraction = num;
+			exponent = null;
+		}
+		else {
+			intAndFraction = num.substr( 0, exponentPos );
+			exponent = num.substr( exponentPos + 1 );
+		}
+		// determine decimal position
+		var integer,
+			fraction,
+			decSep = nf[ "." ],
+			decimalPos = intAndFraction.indexOf( decSep );
+		if ( decimalPos < 0 ) {
+			integer = intAndFraction;
+			fraction = null;
+		}
+		else {
+			integer = intAndFraction.substr( 0, decimalPos );
+			fraction = intAndFraction.substr( decimalPos + decSep.length );
+		}
+		// handle groups (e.g. 1,000,000)
+		var groupSep = nf[ "," ];
+		integer = integer.split( groupSep ).join( "" );
+		var altGroupSep = groupSep.replace( /\u00A0/g, " " );
+		if ( groupSep !== altGroupSep ) {
+			integer = integer.split( altGroupSep ).join( "" );
+		}
+		// build a natively parsable number string
+		var p = sign + integer;
+		if ( fraction !== null ) {
+			p += "." + fraction;
+		}
+		if ( exponent !== null ) {
+			// exponent itself may have a number patternd
+			var expSignInfo = parseNegativePattern( exponent, nf, "-n" );
+			p += "e" + ( expSignInfo[0] || "+" ) + expSignInfo[ 1 ];
+		}
+		if ( regexParseFloat.test(p) ) {
+			ret = parseFloat( p );
+		}
+	}
+	return ret;
+};
+
+Globalize.culture = function( cultureSelector ) {
+	// setter
+	if ( typeof cultureSelector !== "undefined" ) {
+		this.cultureSelector = cultureSelector;
+	}
+	// getter
+	return this.findClosestCulture( cultureSelector ) || this.cultures[ "default" ];
+};
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af-ZA.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af-ZA.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af-ZA.js
new file mode 100644
index 0000000..094a81f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af-ZA.js
@@ -0,0 +1,67 @@
+/*
+ * Globalize Culture af-ZA
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "af-ZA", "default", {
+	name: "af-ZA",
+	englishName: "Afrikaans (South Africa)",
+	nativeName: "Afrikaans (Suid Afrika)",
+	language: "af",
+	numberFormat: {
+		percent: {
+			pattern: ["-n%","n%"]
+		},
+		currency: {
+			pattern: ["$-n","$ n"],
+			symbol: "R"
+		}
+	},
+	calendars: {
+		standard: {
+			days: {
+				names: ["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],
+				namesAbbr: ["Son","Maan","Dins","Woen","Dond","Vry","Sat"],
+				namesShort: ["So","Ma","Di","Wo","Do","Vr","Sa"]
+			},
+			months: {
+				names: ["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember",""],
+				namesAbbr: ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des",""]
+			},
+			patterns: {
+				d: "yyyy/MM/dd",
+				D: "dd MMMM yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM yyyy hh:mm tt",
+				F: "dd MMMM yyyy hh:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af.js
new file mode 100644
index 0000000..9ac0407
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.af.js
@@ -0,0 +1,67 @@
+/*
+ * Globalize Culture af
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "af", "default", {
+	name: "af",
+	englishName: "Afrikaans",
+	nativeName: "Afrikaans",
+	language: "af",
+	numberFormat: {
+		percent: {
+			pattern: ["-n%","n%"]
+		},
+		currency: {
+			pattern: ["$-n","$ n"],
+			symbol: "R"
+		}
+	},
+	calendars: {
+		standard: {
+			days: {
+				names: ["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],
+				namesAbbr: ["Son","Maan","Dins","Woen","Dond","Vry","Sat"],
+				namesShort: ["So","Ma","Di","Wo","Do","Vr","Sa"]
+			},
+			months: {
+				names: ["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember",""],
+				namesAbbr: ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des",""]
+			},
+			patterns: {
+				d: "yyyy/MM/dd",
+				D: "dd MMMM yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM yyyy hh:mm tt",
+				F: "dd MMMM yyyy hh:mm:ss tt",
+				M: "dd MMMM",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am-ET.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am-ET.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am-ET.js
new file mode 100644
index 0000000..742c209
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am-ET.js
@@ -0,0 +1,74 @@
+/*
+ * Globalize Culture am-ET
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "am-ET", "default", {
+	name: "am-ET",
+	englishName: "Amharic (Ethiopia)",
+	nativeName: "አማርኛ (ኢትዮጵያ)",
+	language: "am",
+	numberFormat: {
+		decimals: 1,
+		groupSizes: [3,0],
+		"NaN": "NAN",
+		percent: {
+			pattern: ["-n%","n%"],
+			decimals: 1,
+			groupSizes: [3,0]
+		},
+		currency: {
+			pattern: ["-$n","$n"],
+			groupSizes: [3,0],
+			symbol: "ETB"
+		}
+	},
+	calendars: {
+		standard: {
+			days: {
+				names: ["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
+				namesAbbr: ["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
+				namesShort: ["እ","ሰ","ማ","ረ","ሐ","ዓ","ቅ"]
+			},
+			months: {
+				names: ["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር",""],
+				namesAbbr: ["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም",""]
+			},
+			AM: ["ጡዋት","ጡዋት","ጡዋት"],
+			PM: ["ከሰዓት","ከሰዓት","ከሰዓት"],
+			eras: [{"name":"ዓመተ  ምሕረት","start":null,"offset":0}],
+			patterns: {
+				d: "d/M/yyyy",
+				D: "dddd '፣' MMMM d 'ቀን' yyyy",
+				f: "dddd '፣' MMMM d 'ቀን' yyyy h:mm tt",
+				F: "dddd '፣' MMMM d 'ቀን' yyyy h:mm:ss tt",
+				M: "MMMM d ቀን",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am.js
new file mode 100644
index 0000000..ad6f9d4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.am.js
@@ -0,0 +1,74 @@
+/*
+ * Globalize Culture am
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "am", "default", {
+	name: "am",
+	englishName: "Amharic",
+	nativeName: "አማርኛ",
+	language: "am",
+	numberFormat: {
+		decimals: 1,
+		groupSizes: [3,0],
+		"NaN": "NAN",
+		percent: {
+			pattern: ["-n%","n%"],
+			decimals: 1,
+			groupSizes: [3,0]
+		},
+		currency: {
+			pattern: ["-$n","$n"],
+			groupSizes: [3,0],
+			symbol: "ETB"
+		}
+	},
+	calendars: {
+		standard: {
+			days: {
+				names: ["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
+				namesAbbr: ["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
+				namesShort: ["እ","ሰ","ማ","ረ","ሐ","ዓ","ቅ"]
+			},
+			months: {
+				names: ["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር",""],
+				namesAbbr: ["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም",""]
+			},
+			AM: ["ጡዋት","ጡዋት","ጡዋት"],
+			PM: ["ከሰዓት","ከሰዓት","ከሰዓት"],
+			eras: [{"name":"ዓመተ  ምሕረት","start":null,"offset":0}],
+			patterns: {
+				d: "d/M/yyyy",
+				D: "dddd '፣' MMMM d 'ቀን' yyyy",
+				f: "dddd '፣' MMMM d 'ቀን' yyyy h:mm tt",
+				F: "dddd '፣' MMMM d 'ቀን' yyyy h:mm:ss tt",
+				M: "MMMM d ቀን",
+				Y: "MMMM yyyy"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-AE.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-AE.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-AE.js
new file mode 100644
index 0000000..d2a4bb1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-AE.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-AE
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-AE", "default", {
+	name: "ar-AE",
+	englishName: "Arabic (U.A.E.)",
+	nativeName: "العربية (الإمارات العربية المتحدة)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "د.إ.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));


[17/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css.map
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css.map b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css.map
new file mode 100644
index 0000000..4cc41ab
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css.map
@@ -0,0 +1 @@
+{"version":3,"file":"bootstrap-theme.css","sources":["less/theme.less","less/mixins/vendor-prefixes.less","bootstrap-theme.css","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"AAeA;;;;;;EAME,0CAAA;EC+CA,6FAAA;EACQ,qFAAA;EC5DT;AFiBC;;;;;;;;;;;;EC0CA,0DAAA;EACQ,kDAAA;EC7CT;AFqCC;;EAEE,wBAAA;EEnCH;AFwCD;EG/CI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EA+B2C,2BAAA;EAA2B,oBAAA;EE7BvE;AFAC;;EAEE,2BAAA;EACA,8BAAA;EEEH;AFCC;;EAEE,2BAAA;EACA,uBAAA;EECH;AFEC;;EAEE,2BAAA;EACA,wBAAA;EEAH;AFeD;EGhDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EE0BD;AFxBC;;EAEE,2BAAA;EACA,8BAAA;EE0BH;AFvBC;;EAEE,2BAAA;EACA,uBAAA;EEyBH;AFtBC;;EAEE,2BAAA;EACA,wBAAA;EEwBH;AFRD;EGjDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EEkDD;AFhDC;;EAEE,2BAAA;EACA,8BAAA;EEkDH;AF/CC;;EAEE,2BAAA;EACA,uBAAA;EEiDH;AF9CC;;EAEE,2BAAA;EACA,wBAAA;EEgDH;AF/BD;EGlDI,0EAAA;EACA
 ,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EE0ED;AFxEC;;EAEE,2BAAA;EACA,8BAAA;EE0EH;AFvEC;;EAEE,2BAAA;EACA,uBAAA;EEyEH;AFtEC;;EAEE,2BAAA;EACA,wBAAA;EEwEH;AFtDD;EGnDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EEkGD;AFhGC;;EAEE,2BAAA;EACA,8BAAA;EEkGH;AF/FC;;EAEE,2BAAA;EACA,uBAAA;EEiGH;AF9FC;;EAEE,2BAAA;EACA,wBAAA;EEgGH;AF7ED;EGpDI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EAEA,wHAAA;ECnBF,qEAAA;EJ8BA,6BAAA;EACA,uBAAA;EE0HD;AFxHC;;EAEE,2BAAA;EACA,8BAAA;EE0HH;AFvHC;;EAEE,2BAAA;EACA,uBAAA;EEyHH;AFtHC;;EAEE,2BAAA;EACA,wBAAA;EEwHH;AF7FD;;ECbE,oDAAA;EACQ,4CAAA;EC8GT;AFvFD;;EGvEI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EHsEF,2BAAA;EE6FD;AF3FD;;;EG5EI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH4EF,2BAAA;EEiGD;AFvFD;EG1FI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ECnBF,qEAAA;EJ4GA,oBAAA;EC9CA,6FAAA;EACQ,qFAAA;EC4IT;AFlGD;EG1FI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAA
 A;EACA,6BAAA;EACA,wHAAA;EF2CF,0DAAA;EACQ,kDAAA;ECqJT;AF/FD;;EAEE,gDAAA;EEiGD;AF7FD;EG5GI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ECnBF,qEAAA;EFgOD;AFrGD;EG5GI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EF2CF,yDAAA;EACQ,iDAAA;EC0KT;AF9GD;;EAWI,2CAAA;EEuGH;AFlGD;;;EAGE,kBAAA;EEoGD;AF1FD;EACE,+CAAA;EC3FA,4FAAA;EACQ,oFAAA;ECwLT;AFlFD;EGtJI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH8IF,uBAAA;EE8FD;AFzFD;EGvJI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH8IF,uBAAA;EEsGD;AFhGD;EGxJI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH8IF,uBAAA;EE8GD;AFvGD;EGzJI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EH8IF,uBAAA;EEsHD;AFtGD;EGlKI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED2QH;AFnGD;EG5KI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDkRH;AFzGD;EG7KI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDyRH;AF/GD;EG9KI,0EAAA;EACA,qEAAA;EA
 CA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDgSH;AFrHD;EG/KI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDuSH;AF3HD;EGhLI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED8SH;AF9HD;EGnJI,+MAAA;EACA,0MAAA;EACA,uMAAA;EDoRH;AF1HD;EACE,oBAAA;EC/IA,oDAAA;EACQ,4CAAA;EC4QT;AF3HD;;;EAGE,+BAAA;EGpME,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EHkMF,uBAAA;EEiID;AFvHD;ECjKE,mDAAA;EACQ,2CAAA;EC2RT;AFjHD;EG1NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED8UH;AFvHD;EG3NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDqVH;AF7HD;EG5NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED4VH;AFnID;EG7NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDmWH;AFzID;EG9NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;ED0WH;AF/ID;EG/NI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EDiXH;AF9ID;EGvOI,0EAAA;EACA,qEAAA;EACA,+FAAA;EAAA,wEAAA;EACA,6BAAA;EACA,wHAAA;EHqOF,uBAAA;E
 C1LA,2FAAA;EACQ,mFAAA;EC+UT","sourcesContent":["\n//\n// Load core variables and mixins\n// --------------------------------------------------\n\n@import \"variables.less\";\n@import \"mixins.less\";\n\n\n\n//\n// Buttons\n// --------------------------------------------------\n\n// Common styles\n.btn-default,\n.btn-primary,\n.btn-success,\n.btn-info,\n.btn-warning,\n.btn-danger {\n  text-shadow: 0 -1px 0 rgba(0,0,0,.2);\n  @shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);\n  .box-shadow(@shadow);\n\n  // Reset the shadow\n  &:active,\n  &.active {\n    .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));\n  }\n}\n\n// Mixin for generating new styles\n.btn-styles(@btn-color: #555) {\n  #gradient > .vertical(@start-color: @btn-color; @end-color: darken(@btn-color, 12%));\n  .reset-filter(); // Disable gradients for IE9 because filter bleeds through rounded corners\n  background-repeat: repeat-x;\n  border-color: darken(@btn-color, 14%);\n\n  &:hover,\n  &:focus  {\n
     background-color: darken(@btn-color, 12%);\n    background-position: 0 -15px;\n  }\n\n  &:active,\n  &.active {\n    background-color: darken(@btn-color, 12%);\n    border-color: darken(@btn-color, 14%);\n  }\n\n  &:disabled,\n  &[disabled] {\n    background-color: darken(@btn-color, 12%);\n    background-image: none;\n  }\n}\n\n// Common styles\n.btn {\n  // Remove the gradient for the pressed/active state\n  &:active,\n  &.active {\n    background-image: none;\n  }\n}\n\n// Apply the mixin to the buttons\n.btn-default { .btn-styles(@btn-default-bg); text-shadow: 0 1px 0 #fff; border-color: #ccc; }\n.btn-primary { .btn-styles(@btn-primary-bg); }\n.btn-success { .btn-styles(@btn-success-bg); }\n.btn-info    { .btn-styles(@btn-info-bg); }\n.btn-warning { .btn-styles(@btn-warning-bg); }\n.btn-danger  { .btn-styles(@btn-danger-bg); }\n\n\n\n//\n// Images\n// --------------------------------------------------\n\n.thumbnail,\n.img-thumbnail {\n  .box-shadow(0 1px 2px rgba(0,0,0,.075)
 );\n}\n\n\n\n//\n// Dropdowns\n// --------------------------------------------------\n\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n  #gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));\n  background-color: darken(@dropdown-link-hover-bg, 5%);\n}\n.dropdown-menu > .active > a,\n.dropdown-menu > .active > a:hover,\n.dropdown-menu > .active > a:focus {\n  #gradient > .vertical(@start-color: @dropdown-link-active-bg; @end-color: darken(@dropdown-link-active-bg, 5%));\n  background-color: darken(@dropdown-link-active-bg, 5%);\n}\n\n\n\n//\n// Navbar\n// --------------------------------------------------\n\n// Default navbar\n.navbar-default {\n  #gradient > .vertical(@start-color: lighten(@navbar-default-bg, 10%); @end-color: @navbar-default-bg);\n  .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n  border-radius: @navbar-border-radius;\n  @shadow: inset 0 1px 0 rg
 ba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);\n  .box-shadow(@shadow);\n\n  .navbar-nav > .active > a {\n    #gradient > .vertical(@start-color: darken(@navbar-default-bg, 5%); @end-color: darken(@navbar-default-bg, 2%));\n    .box-shadow(inset 0 3px 9px rgba(0,0,0,.075));\n  }\n}\n.navbar-brand,\n.navbar-nav > li > a {\n  text-shadow: 0 1px 0 rgba(255,255,255,.25);\n}\n\n// Inverted navbar\n.navbar-inverse {\n  #gradient > .vertical(@start-color: lighten(@navbar-inverse-bg, 10%); @end-color: @navbar-inverse-bg);\n  .reset-filter(); // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered\n\n  .navbar-nav > .active > a {\n    #gradient > .vertical(@start-color: @navbar-inverse-bg; @end-color: lighten(@navbar-inverse-bg, 2.5%));\n    .box-shadow(inset 0 3px 9px rgba(0,0,0,.25));\n  }\n\n  .navbar-brand,\n  .navbar-nav > li > a {\n    text-shadow: 0 -1px 0 rgba(0,0,0,.25);\n  }\n}\n\n// Undo rounded corners in static and fixed navbars\n.navbar-static-top,\n.navbar
 -fixed-top,\n.navbar-fixed-bottom {\n  border-radius: 0;\n}\n\n\n\n//\n// Alerts\n// --------------------------------------------------\n\n// Common styles\n.alert {\n  text-shadow: 0 1px 0 rgba(255,255,255,.2);\n  @shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.05);\n  .box-shadow(@shadow);\n}\n\n// Mixin for generating new styles\n.alert-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 7.5%));\n  border-color: darken(@color, 15%);\n}\n\n// Apply the mixin to the alerts\n.alert-success    { .alert-styles(@alert-success-bg); }\n.alert-info       { .alert-styles(@alert-info-bg); }\n.alert-warning    { .alert-styles(@alert-warning-bg); }\n.alert-danger     { .alert-styles(@alert-danger-bg); }\n\n\n\n//\n// Progress bars\n// --------------------------------------------------\n\n// Give the progress background some depth\n.progress {\n  #gradient > .vertical(@start-color: darken(@progress-bg, 4%); @end-color: @progress-bg)\n}
 \n\n// Mixin for generating new styles\n.progress-bar-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 10%));\n}\n\n// Apply the mixin to the progress bars\n.progress-bar            { .progress-bar-styles(@progress-bar-bg); }\n.progress-bar-success    { .progress-bar-styles(@progress-bar-success-bg); }\n.progress-bar-info       { .progress-bar-styles(@progress-bar-info-bg); }\n.progress-bar-warning    { .progress-bar-styles(@progress-bar-warning-bg); }\n.progress-bar-danger     { .progress-bar-styles(@progress-bar-danger-bg); }\n\n// Reset the striped class because our mixins don't do multiple gradients and\n// the above custom styles override the new `.progress-bar-striped` in v3.2.0.\n.progress-bar-striped {\n  #gradient > .striped();\n}\n\n\n//\n// List groups\n// --------------------------------------------------\n\n.list-group {\n  border-radius: @border-radius-base;\n  .box-shadow(0 1px 2px rgba(0,0,0,.075));\n}\n.list-group-item.activ
 e,\n.list-group-item.active:hover,\n.list-group-item.active:focus {\n  text-shadow: 0 -1px 0 darken(@list-group-active-bg, 10%);\n  #gradient > .vertical(@start-color: @list-group-active-bg; @end-color: darken(@list-group-active-bg, 7.5%));\n  border-color: darken(@list-group-active-border, 7.5%);\n}\n\n\n\n//\n// Panels\n// --------------------------------------------------\n\n// Common styles\n.panel {\n  .box-shadow(0 1px 2px rgba(0,0,0,.05));\n}\n\n// Mixin for generating new styles\n.panel-heading-styles(@color) {\n  #gradient > .vertical(@start-color: @color; @end-color: darken(@color, 5%));\n}\n\n// Apply the mixin to the panel headings only\n.panel-default > .panel-heading   { .panel-heading-styles(@panel-default-heading-bg); }\n.panel-primary > .panel-heading   { .panel-heading-styles(@panel-primary-heading-bg); }\n.panel-success > .panel-heading   { .panel-heading-styles(@panel-success-heading-bg); }\n.panel-info > .panel-heading      { .panel-heading-styles(@panel-info-he
 ading-bg); }\n.panel-warning > .panel-heading   { .panel-heading-styles(@panel-warning-heading-bg); }\n.panel-danger > .panel-heading    { .panel-heading-styles(@panel-danger-heading-bg); }\n\n\n\n//\n// Wells\n// --------------------------------------------------\n\n.well {\n  #gradient > .vertical(@start-color: darken(@well-bg, 5%); @end-color: @well-bg);\n  border-color: darken(@well-bg, 10%);\n  @shadow: inset 0 1px 3px rgba(0,0,0,.05), 0 1px 0 rgba(255,255,255,.1);\n  .box-shadow(@shadow);\n}\n","// Vendor Prefixes\n//\n// All vendor mixins are deprecated as of v3.2.0 due to the introduction of\n// Autoprefixer in our Gruntfile. They will be removed in v4.\n\n// - Animations\n// - Backface visibility\n// - Box shadow\n// - Box sizing\n// - Content columns\n// - Hyphens\n// - Placeholder text\n// - Transformations\n// - Transitions\n// - User Select\n\n\n// Animations\n.animation(@animation) {\n  -webkit-animation: @animation;\n       -o-animation: @animation;\n          animati
 on: @animation;\n}\n.animation-name(@name) {\n  -webkit-animation-name: @name;\n          animation-name: @name;\n}\n.animation-duration(@duration) {\n  -webkit-animation-duration: @duration;\n          animation-duration: @duration;\n}\n.animation-timing-function(@timing-function) {\n  -webkit-animation-timing-function: @timing-function;\n          animation-timing-function: @timing-function;\n}\n.animation-delay(@delay) {\n  -webkit-animation-delay: @delay;\n          animation-delay: @delay;\n}\n.animation-iteration-count(@iteration-count) {\n  -webkit-animation-iteration-count: @iteration-count;\n          animation-iteration-count: @iteration-count;\n}\n.animation-direction(@direction) {\n  -webkit-animation-direction: @direction;\n          animation-direction: @direction;\n}\n.animation-fill-mode(@fill-mode) {\n  -webkit-animation-fill-mode: @fill-mode;\n          animation-fill-mode: @fill-mode;\n}\n\n// Backface visibility\n// Prevent browsers from flickering when using CSS
  3D transforms.\n// Default value is `visible`, but can be changed to `hidden`\n\n.backface-visibility(@visibility){\n  -webkit-backface-visibility: @visibility;\n     -moz-backface-visibility: @visibility;\n          backface-visibility: @visibility;\n}\n\n// Drop shadows\n//\n// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's\n// supported browsers that have box shadow capabilities now support it.\n\n.box-shadow(@shadow) {\n  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1\n          box-shadow: @shadow;\n}\n\n// Box sizing\n.box-sizing(@boxmodel) {\n  -webkit-box-sizing: @boxmodel;\n     -moz-box-sizing: @boxmodel;\n          box-sizing: @boxmodel;\n}\n\n// CSS3 Content Columns\n.content-columns(@column-count; @column-gap: @grid-gutter-width) {\n  -webkit-column-count: @column-count;\n     -moz-column-count: @column-count;\n          column-count: @column-count;\n  -webkit-column-gap: @column-gap;\n     -moz-column-gap: @column-gap;\n          colum
 n-gap: @column-gap;\n}\n\n// Optional hyphenation\n.hyphens(@mode: auto) {\n  word-wrap: break-word;\n  -webkit-hyphens: @mode;\n     -moz-hyphens: @mode;\n      -ms-hyphens: @mode; // IE10+\n       -o-hyphens: @mode;\n          hyphens: @mode;\n}\n\n// Placeholder text\n.placeholder(@color: @input-color-placeholder) {\n  &::-moz-placeholder           { color: @color;   // Firefox\n                                  opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526\n  &:-ms-input-placeholder       { color: @color; } // Internet Explorer 10+\n  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome\n}\n\n// Transformations\n.scale(@ratio) {\n  -webkit-transform: scale(@ratio);\n      -ms-transform: scale(@ratio); // IE9 only\n       -o-transform: scale(@ratio);\n          transform: scale(@ratio);\n}\n.scale(@ratioX; @ratioY) {\n  -webkit-transform: scale(@ratioX, @ratioY);\n      -ms-transform: scale(@ratioX, @ratioY); // IE9 only\n       -o-transform: 
 scale(@ratioX, @ratioY);\n          transform: scale(@ratioX, @ratioY);\n}\n.scaleX(@ratio) {\n  -webkit-transform: scaleX(@ratio);\n      -ms-transform: scaleX(@ratio); // IE9 only\n       -o-transform: scaleX(@ratio);\n          transform: scaleX(@ratio);\n}\n.scaleY(@ratio) {\n  -webkit-transform: scaleY(@ratio);\n      -ms-transform: scaleY(@ratio); // IE9 only\n       -o-transform: scaleY(@ratio);\n          transform: scaleY(@ratio);\n}\n.skew(@x; @y) {\n  -webkit-transform: skewX(@x) skewY(@y);\n      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+\n       -o-transform: skewX(@x) skewY(@y);\n          transform: skewX(@x) skewY(@y);\n}\n.translate(@x; @y) {\n  -webkit-transform: translate(@x, @y);\n      -ms-transform: translate(@x, @y); // IE9 only\n       -o-transform: translate(@x, @y);\n          transform: translate(@x, @y);\n}\n.translate3d(@x; @y; @z) {\n  -webkit-transform: translate3d(@x, @y, @z);\n          transform: t
 ranslate3d(@x, @y, @z);\n}\n.rotate(@degrees) {\n  -webkit-transform: rotate(@degrees);\n      -ms-transform: rotate(@degrees); // IE9 only\n       -o-transform: rotate(@degrees);\n          transform: rotate(@degrees);\n}\n.rotateX(@degrees) {\n  -webkit-transform: rotateX(@degrees);\n      -ms-transform: rotateX(@degrees); // IE9 only\n       -o-transform: rotateX(@degrees);\n          transform: rotateX(@degrees);\n}\n.rotateY(@degrees) {\n  -webkit-transform: rotateY(@degrees);\n      -ms-transform: rotateY(@degrees); // IE9 only\n       -o-transform: rotateY(@degrees);\n          transform: rotateY(@degrees);\n}\n.perspective(@perspective) {\n  -webkit-perspective: @perspective;\n     -moz-perspective: @perspective;\n          perspective: @perspective;\n}\n.perspective-origin(@perspective) {\n  -webkit-perspective-origin: @perspective;\n     -moz-perspective-origin: @perspective;\n          perspective-origin: @perspective;\n}\n.transform-origin(@origin) {\n  -webkit-transform
 -origin: @origin;\n     -moz-transform-origin: @origin;\n      -ms-transform-origin: @origin; // IE9 only\n          transform-origin: @origin;\n}\n\n\n// Transitions\n\n.transition(@transition) {\n  -webkit-transition: @transition;\n       -o-transition: @transition;\n          transition: @transition;\n}\n.transition-property(@transition-property) {\n  -webkit-transition-property: @transition-property;\n          transition-property: @transition-property;\n}\n.transition-delay(@transition-delay) {\n  -webkit-transition-delay: @transition-delay;\n          transition-delay: @transition-delay;\n}\n.transition-duration(@transition-duration) {\n  -webkit-transition-duration: @transition-duration;\n          transition-duration: @transition-duration;\n}\n.transition-timing-function(@timing-function) {\n  -webkit-transition-timing-function: @timing-function;\n          transition-timing-function: @timing-function;\n}\n.transition-transform(@transition) {\n  -webkit-transition: -webkit-t
 ransform @transition;\n     -moz-transition: -moz-transform @transition;\n       -o-transition: -o-transform @transition;\n          transition: transform @transition;\n}\n\n\n// User select\n// For selecting text on the page\n\n.user-select(@select) {\n  -webkit-user-select: @select;\n     -moz-user-select: @select;\n      -ms-user-select: @select; // IE10+\n          user-select: @select;\n}\n",null,"// Gradients\n\n#gradient {\n\n  // Horizontal gradient, from left to right\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12\n    ba
 ckground-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  // Vertical gradient, from top to bottom\n  //\n  // Creates two color stops, start and end, by specifying a color and position for each color stop.\n  // Color stops are not available in IE9 and below.\n  .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {\n    background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent);  // Opera 12\n    background-image: linear-gradient(to bottom, @start-color @star
 t-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n    background-repeat: repeat-x;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start-color),argb(@end-color))); // IE9 and down\n  }\n\n  .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {\n    background-repeat: repeat-x;\n    background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+\n    background-image: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12\n    background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+\n  }\n  .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-im
 age: -o-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)\",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {\n    background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: -o-linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);\n    background-repeat: no-repeat;\n    filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)\",argb(@start
 -color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback\n  }\n  .radial(@inner-color: #555; @outer-color: #333) {\n    background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);\n    background-image: radial-gradient(circle, @inner-color, @outer-color);\n    background-repeat: no-repeat;\n  }\n  .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {\n    background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: -o-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n    background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);\n  }\n}\n","// Reset filters for IE\n//\n// When you need to remove a gradient background, do not forget to use this to reset\n// the
  IE filter for IE9 and below.\n\n.reset-filter() {\n  filter: e(%(\"progid:DXImageTransform.Microsoft.gradient(enabled = false)\"));\n}\n"]}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.min.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.min.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.min.css
new file mode 100644
index 0000000..2e97597
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.min.css
@@ -0,0 +1,5 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */.btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{text-shadow:0 1px 0 #fff;background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-o-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#e0e0e0));background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsof
 t.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-default:disabled,.btn-default[disabled]{background-color:#e0e0e0;background-image:none}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:-o-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#2d6ca2));background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border
 -color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-primary:disabled,.btn-primary[disabled]{background-color:#2d6ca2;background-image:none}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#419641));background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.bt
 n-success:disabled,.btn-success[disabled]{background-color:#419641;background-image:none}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#2aabd2));background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-info:disabled,.btn-info[disabled]{background-color:#2aabd2;background-image:none}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:-o-linear-gradient(top,#f0ad
 4e 0,#eb9316 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#eb9316));background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-warning:disabled,.btn-warning[disabled]{background-color:#eb9316;background-image:none}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c12e2a));background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImage
 Transform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.btn-danger:disabled,.btn-danger[disabled]{background-color:#c12e2a;background-image:none}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#e8e8e8;background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradien
 t(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-color:#357ebd;background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-o-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#357ebd));background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-repeat:repeat-x}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-o-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f8f8f8));background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColors
 tr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f3f3f3));background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:
 -webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-o-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#3c3c3c),to(#222));background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:-o-linear-gradient(top,#222 0,#282828 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#222),to(#282828));background-image:linear-gradient(to bottom,#222 0,#282828 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset
  0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#c8e5bc));background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);background-repeat:repeat-x;border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:-o-linear-gradient(top,#d9
 edf7 0,#b9def0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#b9def0));background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);background-repeat:repeat-x;border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#f8efc0));background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);background-repeat:repeat-x;border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-o-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:-webkit-gradient(lin
 ear,left top,left bottom,from(#f2dede),to(#e7c3c3));background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);background-repeat:repeat-x;border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#ebebeb),to(#f5f5f5));background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:-o-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#428bca),to(#3071a9));background-image:linear-gradient
 (to bottom,#428bca 0,#3071a9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);background-repeat:repeat-x}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-o-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5cb85c),to(#449d44));background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);background-repeat:repeat-x}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-o-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#5bc0de),to(#31b0d5));background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);filter:progid:DXImageTransform.Microsoft.gradient(sta
 rtColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);background-repeat:repeat-x}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-o-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f0ad4e),to(#ec971f));background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);background-repeat:repeat-x}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-o-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9534f),to(#c9302c));background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);background-repeat:rep
 eat-x}.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:-o-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:-webkit-gradient(linear,left top,left bottom,fr
 om(#428bca),to(#3278b3));background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);background-repeat:repeat-x;border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-o-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#e8e8e8));background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-repeat:repeat-x}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-o-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:-webki
 t-gradient(linear,left top,left bottom,from(#428bca),to(#357ebd));background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-repeat:repeat-x}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-o-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#dff0d8),to(#d0e9c6));background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);background-repeat:repeat-x}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-o-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#d9edf7),to(#c4e3f3));backgr
 ound-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);background-repeat:repeat-x}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-o-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#fcf8e3),to(#faf2cc));background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);background-repeat:repeat-x}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-o-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#ebcccc));background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);filter:pr
 ogid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);background-repeat:repeat-x}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-o-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:-webkit-gradient(linear,left top,left bottom,from(#e8e8e8),to(#f5f5f5));background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);background-repeat:repeat-x;border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
\ No newline at end of file


[31/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh
new file mode 100755
index 0000000..256b227
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh
@@ -0,0 +1,86 @@
+#!/bin/bash
+# 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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+if [ ! -z "$LOGSEARCH_INCLUDE" ]; then
+   source $LOGSEARCH_INCLUDE
+fi
+
+JAVA=java
+if [ -x $JAVA_HOME/bin/java ]; then
+    JAVA=$JAVA_HOME/bin/java
+fi
+
+if [ "$LOGSEARCH_JAVA_MEM" = "" ]; then
+    LOGSEARCH_JAVA_MEM="-Xmx1g"
+fi
+
+if [ "$LOGFILE" = "" ]; then
+    LOGFILE="/var/log/logsearch/logsearch.out"
+    touch $LOGFILE 2> /dev/null
+    if [ $? -ne 0 ]; then
+	LOGFILE=/tmp/${USER}_logsearch.out
+    fi
+fi
+
+
+#Temporarily enabling JMX so we can monitor the memory and CPU utilization of the process
+#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=3098"
+
+if [ "$LOGSEARCH_DEBUG" = "true" ] && [ ! -z "$LOGSEARCH_DEBUG_PORT" ]; then
+  LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_PORT,server=y,suspend=n "
+fi
+
+if [ "$PID_FILE" = "" ]; then
+    LOGSEARCH_PID_DIR=$HOME
+    PID_FILE=$LOGSEARCH_PID_DIR/logsearch-search-$USER.pid
+fi
+
+if [ -f ${PID_FILE} ]; then
+    PID=`cat ${PID_FILE}`
+    if kill -0 $PID 2>/dev/null; then
+	echo "logsearch already running (${PID}) killing..."
+	kill $PID 2>/dev/null
+	sleep 5
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logsearch still running. Will kill process forcefully in another 10 seconds..."
+	    sleep 10
+	    kill -9 $PID 2>/dev/null
+	    sleep 2
+	fi
+    fi
+
+    if kill -0 $PID 2>/dev/null; then
+	echo "ERROR: Even after all efforts to stop logsearch, it is still running. pid=$PID. Please manually kill the service and try again."
+	exit 1
+    fi
+fi
+
+if [ -z "$LOGSEARCH_CONF_DIR" ]; then
+  LOGSEARCH_CONF_DIR="/etc/logsearch/conf"
+  echo "LOGSEARCH_CONF_DIR not found. Use default: $LOGSEARCH_CONF_DIR"
+fi
+
+LOGSEARCH_GC_LOGFILE=`dirname $LOGFILE`/logsearch_gc.log
+LOGSEARCH_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOGSEARCH_GC_LOGFILE"
+
+echo "Starting logsearch. Output file=$LOGFILE pid_file=$PID_FILE"
+#LOGSEARCH_CLI_CLASSPATH=
+#set -x
+nohup $JAVA -cp "$LOGSEARCH_CLI_CLASSPATH:$LOGSEARCH_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGSEARCH_GC_OPTS $LOGSEARCH_JAVA_MEM $LOGSEARCH_JAVA_OPTS $JMX org.apache.ambari.logsearch.LogSearch $* > $LOGFILE 2>&1 &
+echo $! > $PID_FILE

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh.j2
new file mode 100755
index 0000000..cb78c58
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/run.sh.j2
@@ -0,0 +1,86 @@
+#!/bin/bash
+# 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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+if [ ! -z "$LOGSEARCH_INCLUDE" ]; then
+   source $LOGSEARCH_INCLUDE
+fi
+
+JAVA=java
+if [ -x $JAVA_HOME/bin/java ]; then
+    JAVA=$JAVA_HOME/bin/java
+fi
+
+if [ "$LOGSEARCH_JAVA_MEM" = "" ]; then
+    LOGSEARCH_JAVA_MEM="-Xmx1g"
+fi
+
+if [ "$LOGFILE" = "" ]; then
+    LOGFILE="{{logsearch_log_dir}}/logsearch.out"
+    touch $LOGFILE 2> /dev/null
+    if [ $? -ne 0 ]; then
+	LOGFILE=/tmp/${USER}_logsearch.out
+    fi
+fi
+
+
+#Temporarily enabling JMX so we can monitor the memory and CPU utilization of the process
+#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=3098"
+
+if [ "$LOGSEARCH_DEBUG" = "true" ] && [ ! -z "$LOGSEARCH_DEBUG_PORT" ]; then
+  LOGSEARCH_JAVA_OPTS="$LOGSEARCH_JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=$LOGSEARCH_DEBUG_PORT,server=y,suspend=n "
+fi
+
+if [ "$PID_FILE" = "" ]; then
+    LOGSEARCH_PID_DIR=$HOME
+    PID_FILE=$LOGSEARCH_PID_DIR/logsearch-search-$USER.pid
+fi
+
+if [ -f ${PID_FILE} ]; then
+    PID=`cat ${PID_FILE}`
+    if kill -0 $PID 2>/dev/null; then
+	echo "logsearch already running (${PID}) killing..."
+	kill $PID 2>/dev/null
+	sleep 5
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logsearch still running. Will kill process forcefully in another 10 seconds..."
+	    sleep 10
+	    kill -9 $PID 2>/dev/null
+	    sleep 2
+	fi
+    fi
+
+    if kill -0 $PID 2>/dev/null; then
+	echo "ERROR: Even after all efforts to stop logsearch, it is still running. pid=$PID. Please manually kill the service and try again."
+	exit 1
+    fi
+fi
+
+if [ -z "$LOGSEARCH_CONF_DIR" ]; then
+  LOGSEARCH_CONF_DIR="/etc/logsearch/conf"
+  echo "LOGSEARCH_CONF_DIR not found. Use default: $LOGSEARCH_CONF_DIR"
+fi
+
+LOGSEARCH_GC_LOGFILE=`dirname $LOGFILE`/logsearch_gc.log
+LOGSEARCH_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOGSEARCH_GC_LOGFILE"
+
+echo "Starting logsearch. Output file=$LOGFILE pid_file=$PID_FILE"
+#LOGSEARCH_CLI_CLASSPATH=
+#set -x
+nohup $JAVA -cp "$LOGSEARCH_CLI_CLASSPATH:$LOGSEARCH_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGSEARCH_GC_OPTS  $LOGSEARCH_JAVA_MEM $LOGSEARCH_JAVA_OPTS $JMX org.apache.ambari.logsearch.LogSearch $* > $LOGFILE 2>&1 &
+echo $! > $PID_FILE

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/stop.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/stop.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/stop.sh
new file mode 100755
index 0000000..3612f08
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/stop.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# 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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+if [ "$PID_FILE" = "" ]; then
+    LOGSEARCH_PID_DIR=$HOME
+    PID_FILE=$LOGSEARCH_PID_DIR/logsearch-search-$USER.pid
+fi
+
+if [ -f ${PID_FILE} ]; then
+    PID=`cat ${PID_FILE}`
+    if kill -0 $PID 2>/dev/null; then
+	echo "logsearch running with process id (${PID}). Killing..."
+	kill $PID 2>/dev/null
+	sleep 5
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logsearch still running. Will kill process forcefully in another 10 seconds..."
+	    sleep 10
+	    kill -9 $PID 2>/dev/null
+	    sleep 2
+	fi
+    fi
+
+    if kill -0 $PID 2>/dev/null; then
+	echo "ERROR: Even after all efforts to stop logsearch, it is still running. pid=$PID. Please manually kill the service and try again."
+	exit 1
+    fi
+fi
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/404.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/404.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/404.html
new file mode 100644
index 0000000..76ac201
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/404.html
@@ -0,0 +1,170 @@
+<!--
+  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.
+-->
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+    
+        <meta charset="utf-8">
+        <title>Page Not Found :(</title>
+        <style>
+            ::-moz-selection {
+                background: #b3d4fc;
+                text-shadow: none;
+            }
+
+            ::selection {
+                background: #b3d4fc;
+                text-shadow: none;
+            }
+
+            html {
+                padding: 30px 10px;
+                font-size: 20px;
+                line-height: 1.4;
+                color: #737373;
+                background: #f0f0f0;
+                -webkit-text-size-adjust: 100%;
+                -ms-text-size-adjust: 100%;
+            }
+
+            html,
+            input {
+                font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+            }
+
+            body {
+                max-width: 500px;
+                _width: 500px;
+                padding: 30px 20px 50px;
+                border: 1px solid #b3b3b3;
+                border-radius: 4px;
+                margin: 0 auto;
+                box-shadow: 0 1px 10px #a7a7a7, inset 0 1px 0 #fff;
+                background: #fcfcfc;
+            }
+
+            h1 {
+                margin: 0 10px;
+                font-size: 50px;
+                text-align: center;
+            }
+
+            h1 span {
+                color: #bbb;
+            }
+
+            h3 {
+                margin: 1.5em 0 0.5em;
+            }
+
+            p {
+                margin: 1em 0;
+            }
+
+            ul {
+                padding: 0 0 0 40px;
+                margin: 1em 0;
+            }
+
+            .container {
+                max-width: 380px;
+                _width: 380px;
+                margin: 0 auto;
+            }
+
+            /* google search */
+
+            #goog-fixurl ul {
+                list-style: none;
+                padding: 0;
+                margin: 0;
+            }
+
+            #goog-fixurl form {
+                margin: 0;
+            }
+
+            #goog-wm-qt,
+            #goog-wm-sb {
+                border: 1px solid #bbb;
+                font-size: 16px;
+                line-height: normal;
+                vertical-align: top;
+                color: #444;
+                border-radius: 2px;
+            }
+
+            #goog-wm-qt {
+                width: 220px;
+                height: 20px;
+                padding: 5px;
+                margin: 5px 10px 0 0;
+                box-shadow: inset 0 1px 1px #ccc;
+            }
+
+            #goog-wm-sb {
+                display: inline-block;
+                height: 32px;
+                padding: 0 10px;
+                margin: 5px 0 0;
+                white-space: nowrap;
+                cursor: pointer;
+                background-color: #f5f5f5;
+                background-image: -webkit-linear-gradient(rgba(255,255,255,0), #f1f1f1);
+                background-image: -moz-linear-gradient(rgba(255,255,255,0), #f1f1f1);
+                background-image: -ms-linear-gradient(rgba(255,255,255,0), #f1f1f1);
+                background-image: -o-linear-gradient(rgba(255,255,255,0), #f1f1f1);
+                -webkit-appearance: none;
+                -moz-appearance: none;
+                appearance: none;
+                *overflow: visible;
+                *display: inline;
+                *zoom: 1;
+            }
+
+            #goog-wm-sb:hover,
+            #goog-wm-sb:focus {
+                border-color: #aaa;
+                box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
+                background-color: #f8f8f8;
+            }
+
+            #goog-wm-qt:hover,
+            #goog-wm-qt:focus {
+                border-color: #105cb6;
+                outline: 0;
+                color: #222;
+            }
+
+            input::-moz-focus-inner {
+                padding: 0;
+                border: 0;
+            }
+        </style>
+    </head>
+    <body>
+        <div class="container">
+            <h1>Not found <span>:(</span></h1>
+            <p>Sorry, but the page you were trying to view does not exist.</p>
+            <p>It looks like this was the result of either:</p>
+            <ul>
+                <li>a mistyped address</li>
+                <li>an out-of-date link</li>
+            </ul>
+        </div>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/applicationContext.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/applicationContext.xml
new file mode 100644
index 0000000..6a73d60
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/applicationContext.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+xmlns:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee"
+xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
+xmlns:task="http://www.springframework.org/schema/task" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:util="http://www.springframework.org/schema/util"
+xsi:schemaLocation="http://www.springframework.org/schema/aop
+http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
+http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
+http://www.springframework.org/schema/context
+http://www.springframework.org/schema/context/spring-context-4.2.xsd
+http://www.springframework.org/schema/jee
+http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
+http://www.springframework.org/schema/tx
+http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
+http://www.springframework.org/schema/task
+http://www.springframework.org/schema/task/spring-task-4.2.xsd
+http://www.springframework.org/schema/util
+http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<context:component-scan base-package="org.apache.ambari.logsearch" />
+	<bean id="xmlPropertyConfigurer" class="org.apache.ambari.logsearch.util.XMLPropertiesUtil" />
+	
+	<bean id="propertyConfigurer" class="org.apache.ambari.logsearch.util.PropertiesUtil">
+		<property name="locations">
+			<list>
+				<value>classpath:default.properties</value>
+				<value>classpath:logsearch.properties</value>
+				<value>classpath:logsearch-admin-site.xml</value>
+			</list>
+		</property>
+		<property name="propertiesPersister" ref="xmlPropertyConfigurer" />
+	</bean>
+	
+</beans>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
new file mode 100644
index 0000000..468552b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/META-INF/security-applicationContext.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+xmlns:beans="http://www.springframework.org/schema/beans"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:security="http://www.springframework.org/schema/security"
+xsi:schemaLocation="http://www.springframework.org/schema/beans
+http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
+http://www.springframework.org/schema/security
+http://www.springframework.org/schema/security/spring-security-4.0.xsd">
+
+	<security:http pattern="/login.jsp" security="none" />
+	<security:http pattern="/**/*.css" security="none" />
+	<security:http pattern="/**/jquery.*.js" security="none" />
+	<security:http pattern="/**/*.css.map" security="none" />
+	<security:http pattern="/service/public/**" security="none" />
+	
+	<security:http disable-url-rewriting="true" use-expressions="true" create-session="always" entry-point-ref="authenticationProcessingFilterEntryPoint">
+		<csrf disabled="true"/> 
+		<security:session-management session-fixation-protection="newSession" />
+		<intercept-url pattern="/**" access="isAuthenticated()"/>       
+		<security:custom-filter position="FORM_LOGIN_FILTER" ref="logsearchUsernamePasswordAuthenticationFilter"/>
+		<security:custom-filter position="LAST" ref="userContextFormationFilter"/>
+		<security:logout delete-cookies="JSESSIONID" logout-url="/logout.html" success-handler-ref="logsearchLogoutSuccessHandler" />
+		<http-basic entry-point-ref="authenticationProcessingFilterEntryPoint"/>
+	</security:http>
+
+	<beans:bean id="userContextFormationFilter" class="org.apache.ambari.logsearch.web.filters.LogsearchSecurityContextFormationFilter"/>
+
+	<beans:bean id="logsearchUsernamePasswordAuthenticationFilter" class="org.apache.ambari.logsearch.web.filters.LogsearchUsernamePasswordAuthenticationFilter">
+		<beans:property name="authenticationManager" ref="authenticationManager"/>
+		<beans:property name="authenticationSuccessHandler" ref="authSuccessHandler"/>
+		<beans:property name="authenticationFailureHandler"	ref="authFailureHandler"/>
+	</beans:bean>
+
+	<beans:bean id="authenticationProcessingFilterEntryPoint" class="org.apache.ambari.logsearch.web.filters.LogsearchAuthenticationEntryPoint">
+		<beans:constructor-arg index="0" value="/login.jsp"/>
+		<beans:property name="forceHttps" value="false"/>
+	</beans:bean>
+
+	<beans:bean id="authSuccessHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchAuthSuccessHandler">
+	</beans:bean>
+
+	<beans:bean id="authFailureHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchAuthFailureHandler">
+	</beans:bean>
+
+	<beans:bean id="logsearchLogoutSuccessHandler" class="org.apache.ambari.logsearch.web.authenticate.LogsearchLogoutSuccessHandler">
+	</beans:bean>
+	
+	 <beans:bean id="logsearchAuthenticationProvider" class="org.apache.ambari.logsearch.web.security.LogsearchAuthenticationProvider" >
+ 	</beans:bean>
+
+	<security:authentication-manager alias="authenticationManager">
+         <security:authentication-provider ref="logsearchAuthenticationProvider"/>
+	</security:authentication-manager>
+	
+	<beans:bean id="securityEventListener" class ="org.apache.ambari.logsearch.web.listeners.SpringEventListener"/>
+	
+</beans:beans>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
new file mode 100755
index 0000000..2ba4481
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
+  
+ 
+	<display-name>LogSearch</display-name>
+
+	<context-param>
+		<param-name>contextConfigLocation</param-name>
+		<param-value>META-INF/applicationContext.xml
+					META-INF/security-applicationContext.xml
+		</param-value>
+	</context-param>
+
+
+	<listener>
+		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+	</listener>
+
+	<listener>
+		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
+	</listener>
+	<filter>
+		<filter-name>springSecurityFilterChain</filter-name>
+		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+	</filter>
+
+	<filter-mapping>
+		<filter-name>springSecurityFilterChain</filter-name>
+		<url-pattern>/*</url-pattern>
+	</filter-mapping>
+  
+	<!-- Servlet mapping for REST -->
+	<servlet>
+		<servlet-name>REST service</servlet-name>
+		<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
+		<init-param>
+			<param-name>com.sun.jersey.config.property.packages</param-name>
+			<param-value>org.apache.ambari.logsearch.rest</param-value>
+		</init-param>
+		<init-param>
+			<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
+			<param-value>org.apache.ambari.logsearch.common.RESTAPIFilter</param-value>
+		</init-param>
+		<init-param>
+			<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
+			<param-value>org.apache.ambari.logsearch.common.RESTAPIFilter</param-value>
+		</init-param>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+	  <servlet-mapping>
+		<servlet-name>REST service</servlet-name>
+		<url-pattern>/service/*</url-pattern>
+	</servlet-mapping>
+	
+	
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_failure.jsp
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_failure.jsp b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_failure.jsp
new file mode 100644
index 0000000..d00cbfb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_failure.jsp
@@ -0,0 +1,31 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%
+	int ajaxReturnCode = 401;
+	//PropertiesUtil.getIntProperty("xa.ajax.auth.required.code", 401);
+	response.sendError(ajaxReturnCode);
+%>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+Failure
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_success.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_success.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_success.html
new file mode 100644
index 0000000..52023ca
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/ajax_success.html
@@ -0,0 +1,26 @@
+<!--
+  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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+Success
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/favicon.ico
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/favicon.ico b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/favicon.ico
new file mode 100644
index 0000000..62604cb
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/favicon.ico differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/FontAwesome.otf
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/FontAwesome.otf b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/FontAwesome.otf
new file mode 100644
index 0000000..7012545
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/FontAwesome.otf differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.eot
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.eot b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.eot
new file mode 100644
index 0000000..0662cb9
Binary files /dev/null and b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/fonts/fontawesome/fontawesome-webfont.eot differ


[50/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/test/java/org/apache/ambari/logsearch/appender/AppTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/test/java/org/apache/ambari/logsearch/appender/AppTest.java b/ambari-logsearch/ambari-logsearch-appender/src/test/java/org/apache/ambari/logsearch/appender/AppTest.java
new file mode 100644
index 0000000..8152787
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/test/java/org/apache/ambari/logsearch/appender/AppTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.appender;
+
+import org.apache.log4j.Logger;
+
+public class AppTest {
+  private static Logger logger = Logger.getLogger(AppTest.class);
+
+  public static void main(String[] args) {
+
+    try {
+      throwException();
+    } catch (ClassCastException castException) {
+      logger.error("error", castException);
+    }
+
+  }
+
+  public static void throwException() {
+    throw new ClassCastException("test");
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/test/resources/log4j.properties b/ambari-logsearch/ambari-logsearch-appender/src/test/resources/log4j.properties
new file mode 100644
index 0000000..b51e87d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/test/resources/log4j.properties
@@ -0,0 +1,23 @@
+#   Licensed 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.
+
+# log4j configuration used during build and unit tests
+
+# Root logger option
+log4j.rootLogger=ALL, logsearchJson
+
+# Redirect log messages to a logsearch json 
+log4j.appender.logsearchJson=org.apache.ambari.logsearch.appender.LogsearchAppender
+log4j.appender.logsearchJson.File=target/logsearch/log.json
+log4j.appender.logsearchJson.datePattern='.'yyyy-MM-dd
+log4j.appender.allLog.Append=true
+log4j.appender.logsearchJson.layout=org.apache.ambari.logsearch.appender.LogsearchConversion
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/pom.xml b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
new file mode 100644
index 0000000..2db0608
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
@@ -0,0 +1,510 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <name>Ambari Logsearch Assembly</name>
+  <url>http://maven.apache.org</url>
+  <modelVersion>4.0.0</modelVersion>
+  <properties>
+    <mapping.base.path>/usr/lib</mapping.base.path>
+    <solr.tar>http://apache.mirrors.lucidnetworks.net/lucene/solr/${solr.version}/solr-${solr.version}.tgz</solr.tar>
+    <solr.mapping.path>${mapping.base.path}/ambari-logsearch-solr</solr.mapping.path>
+    <solr.package.name>ambari-logsearch-solr</solr.package.name>
+    <logsearch.portal.package.name>ambari-logsearch-portal</logsearch.portal.package.name>
+    <logsearch.portal.mapping.path>${mapping.base.path}/ambari-logsearch-portal</logsearch.portal.mapping.path>
+    <logsearch.portal.dir>${project.basedir}/../ambari-logsearch-portal</logsearch.portal.dir>
+    <logsearch.logfeeder.package.name>ambari-logsearch-logfeeder</logsearch.logfeeder.package.name>
+    <logsearch.logfeeder.mapping.path>${mapping.base.path}/ambari-logsearch-logfeeder</logsearch.logfeeder.mapping.path>
+    <logsearch.logfeeder.dir>${project.basedir}/../ambari-logsearch-logfeeder</logsearch.logfeeder.dir>
+    <logsearch.appender.package.name>ambari-logsearch-appender</logsearch.appender.package.name>
+    <logsearch.appender.mapping.path>${mapping.base.path}/ambari-logsearch-appender</logsearch.appender.mapping.path>
+    <logsearch.appender.dir>${project.basedir}/../ambari-logsearch-appender</logsearch.appender.dir>
+    <logsearch.portal.conf.mapping.path>/etc/${logsearch.portal.package.name}/conf</logsearch.portal.conf.mapping.path>
+    <logsearch.logfeeder.conf.mapping.path>/etc/${logsearch.logfeeder.package.name}/conf
+    </logsearch.logfeeder.conf.mapping.path>
+  </properties>
+  <artifactId>ambari-logsearch-assembly</artifactId>
+  <profiles>
+
+    <profile>
+      <id>rpm</id>
+      <properties>
+        <download.solr>true</download.solr>
+      </properties>
+      <activation>
+        <property>
+          <name>build-rpm</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>rpm-maven-plugin</artifactId>
+            <version>2.1.4</version>
+            <configuration>
+              <copyright>2012, Apache Software Foundation</copyright>
+              <group>Development</group>
+              <description>Maven Recipe: RPM Package.</description>
+              <autoRequires>false</autoRequires>
+              <prefix>/</prefix>
+              <needarch>x86_64</needarch>
+
+              <version>${package-version}</version>
+              <release>${package-release}</release>
+
+              <defaultUsername>root</defaultUsername>
+              <defaultGroupname>root</defaultGroupname>
+            </configuration>
+            <executions>
+              <execution>
+                <id>logsearch-solr</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>rpm</goal>
+                </goals>
+                <configuration>
+                  <group>Development</group>
+                  <name>${solr.package.name}</name>
+                  <mappings>
+                    <mapping>
+                      <directory>${solr.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${project.build.directory}/solr</location>
+                        </source>
+                      </sources>
+                    </mapping>
+                  </mappings>
+                </configuration>
+              </execution>
+              <execution>
+                <id>logsearch-portal</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>rpm</goal>
+                </goals>
+                <configuration>
+                  <group>Development</group>
+                  <name>${logsearch.portal.package.name}</name>
+                  <mappings>
+                    <mapping>
+                      <directory>${logsearch.portal.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.portal.dir}/target/package</location>
+                          <excludes>
+                            <exclude>classes/log4j.xml</exclude>
+                            <exclude>classes/logsearch.properties</exclude>
+                            <exclude>classes/user_pass.json</exclude>
+                            <exclude>solr_configsets/**</exclude>
+                          </excludes>
+                        </source>
+                      </sources>
+                    </mapping>
+                    <mapping>
+                      <directory>${logsearch.portal.conf.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.portal.dir}/target/package/classes</location>
+                          <includes>
+                            <include>log4j.xml</include>
+                            <include>logsearch.properties</include>
+                            <include>user_pass.json</include>
+                          </includes>
+                        </source>
+                      </sources>
+                    </mapping>
+                    <mapping>
+                      <directory>${logsearch.portal.conf.mapping.path}/solr_configsets</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.portal.dir}/target/package/solr_configsets</location>
+                        </source>
+                      </sources>
+                    </mapping>
+                  </mappings>
+                </configuration>
+              </execution>
+              <execution>
+                <id>logsearch-logfeeder</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>rpm</goal>
+                </goals>
+                <configuration>
+                  <group>Development</group>
+                  <name>${logsearch.logfeeder.package.name}</name>
+                  <mappings>
+                    <mapping>
+                      <directory>${logsearch.logfeeder.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.logfeeder.dir}/target/package</location>
+                          <excludes>
+                            <exclude>classes/log4j.xml</exclude>
+                            <exclude>classes/logfeeder.properties</exclude>
+                            <exclude>classes/grok-patterns</exclude>
+                          </excludes>
+                        </source>
+                      </sources>
+                    </mapping>
+                    <mapping>
+                      <directory>${logsearch.logfeeder.conf.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.logfeeder.dir}/target/package/classes</location>
+                          <includes>
+                            <include>log4j.xml</include>
+                            <include>logfeeder.properties</include>
+                            <include>grok-patterns</include>
+                          </includes>
+                        </source>
+                      </sources>
+                    </mapping>
+                  </mappings>
+                </configuration>
+              </execution>
+              <execution>
+                <id>logsearch-appender</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>rpm</goal>
+                </goals>
+                <configuration>
+                  <group>Development</group>
+                  <name>${logsearch.appender.package.name}</name>
+                  <mappings>
+                    <mapping>
+                      <directory>${logsearch.appender.mapping.path}</directory>
+                      <sources>
+                        <source>
+                          <location>${logsearch.appender.dir}/target/package</location>
+                        </source>
+                      </sources>
+                    </mapping>
+                  </mappings>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>generate-resources</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target name="Download Solr">
+                    <get
+                      src="${solr.tar}"
+                      dest="${project.build.directory}/solr.tgz"
+                      usetimestamp="true"
+                    />
+                    <untar
+                      src="${project.build.directory}/solr.tgz"
+                      dest="${project.build.directory}/"
+                      compression="gzip"
+                    />
+                    <move todir="${project.build.directory}/solr">
+                      <fileset dir="${project.build.directory}/solr-${solr.version}"/>
+                    </move>
+                    <chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
+                    <chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <id>deb</id>
+
+      <activation>
+        <property>
+          <name>build-deb</name>
+        </property>
+      </activation>
+
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.7</version>
+
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${project.build.directory}/resources/deb</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>${project.basedir}/src/main/package/deb</directory>
+                      <excludes>
+                        <exclude>solr/postinst</exclude>
+                        <exclude>portal/postinst</exclude>
+                        <exclude>logfeeder/postinst</exclude>
+                        <exclude>appender/postinst</exclude>
+                      </excludes>
+                      <filtering>false</filtering>
+                    </resource>
+                    <resource>
+                      <directory>${project.basedir}/src/main/package/deb</directory>
+                      <includes>
+                        <include>solr/postinst</include>
+                        <include>portal/postinst</include>
+                        <include>logfeeder/postinst</include>
+                        <include>appender/postinst</include>
+                      </includes>
+                      <filtering>true</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.vafer</groupId>
+            <artifactId>jdeb</artifactId>
+            <version>1.4</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <id>jdeb-solr</id>
+                <goals>
+                  <goal>jdeb</goal>
+                </goals>
+                <configuration>
+                  <controlDir>${basedir}/src/main/package/deb/solr</controlDir>
+                  <deb>${basedir}/target/${solr.package.name}_${package-version}-${package-release}.deb</deb>
+                  <skip>false</skip>
+                  <skipPOMs>false</skipPOMs>
+                  <dataSet>
+                    <data>
+                      <src>${project.build.directory}/solr</src>
+                      <type>directory</type>
+                      <mapper>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                        <prefix>${solr.mapping.path}</prefix>
+                      </mapper>
+                    </data>
+                  </dataSet>
+                </configuration>
+              </execution>
+
+              <execution>
+                <id>jdeb-portal</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>jdeb</goal>
+                </goals>
+                <configuration>
+                  <controlDir>${basedir}/src/main/package/deb/portal</controlDir>
+                  <deb>${basedir}/target/${logsearch.portal.package.name}_${package-version}-${package-release}.deb
+                  </deb>
+                  <skip>false</skip>
+                  <skipPOMs>false</skipPOMs>
+                  <dataSet>
+                    <data>
+                      <src>${logsearch.portal.dir}/target/ambari-logsearch-portal.tar.gz</src>
+                      <type>archive</type>
+                      <mapper>
+                        <prefix>${logsearch.portal.mapping.path}</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                      </mapper>
+                      <excludes>
+                        classes/log4j.xml,classes/logsearch.properties,classes/user_pass.json,solr_configsets/**
+                      </excludes>
+                    </data>
+                    <data>
+                      <src>${logsearch.portal.dir}/target/package/classes</src>
+                      <type>directory</type>
+                      <mapper>
+                        <prefix>${logsearch.portal.conf.mapping.path}</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                        <filemode>644</filemode>
+                      </mapper>
+                      <includes>
+                        log4j.xml,logsearch.properties,user_pass.json
+                      </includes>
+                    </data>
+                    <data>
+                      <src>${logsearch.portal.dir}/target/package/solr_configsets</src>
+                      <type>directory</type>
+                      <mapper>
+                        <prefix>${logsearch.portal.conf.mapping.path}/solr_configsets</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                      </mapper>
+                    </data>
+                  </dataSet>
+                </configuration>
+              </execution>
+
+              <execution>
+                <id>jdeb-logfeeder</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>jdeb</goal>
+                </goals>
+                <configuration>
+                  <controlDir>${basedir}/src/main/package/deb/logfeeder</controlDir>
+                  <deb>${basedir}/target/${logsearch.logfeeder.package.name}_${package-version}-${package-release}.deb
+                  </deb>
+                  <skip>false</skip>
+                  <skipPOMs>false</skipPOMs>
+                  <dataSet>
+                    <data>
+                      <src>${logsearch.logfeeder.dir}/target/ambari-logsearch-logfeeder.tgz</src>
+                      <type>archive</type>
+                      <mapper>
+                        <prefix>${logsearch.logfeeder.mapping.path}</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                      </mapper>
+                      <excludes>
+                        classes/log4j.xml,classes/logfeeder.properties,classes/grok-patterns
+                      </excludes>
+                    </data>
+                    <data>
+                      <src>${logsearch.logfeeder.dir}/target/package/classes</src>
+                      <type>directory</type>
+                      <mapper>
+                        <prefix>${logsearch.logfeeder.conf.mapping.path}</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                        <filemode>644</filemode>
+                      </mapper>
+                      <includes>
+                        log4j.xml,logfeeder.properties,grok-patterns
+                      </includes>
+                    </data>
+                  </dataSet>
+                </configuration>
+              </execution>
+
+              <execution>
+                <id>jdeb-appender</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>jdeb</goal>
+                </goals>
+                <configuration>
+                  <controlDir>${basedir}/src/main/package/deb/appender</controlDir>
+                  <deb>${basedir}/target/${logsearch.appender.package.name}_${package-version}-${package-release}.deb
+                  </deb>
+                  <skip>false</skip>
+                  <skipPOMs>false</skipPOMs>
+                  <dataSet>
+                    <data>
+                      <src>${logsearch.appender.dir}/target/ambari-logsearch-appender.tar.gz</src>
+                      <type>archive</type>
+                      <mapper>
+                        <prefix>${logsearch.appender.mapping.path}</prefix>
+                        <type>perm</type>
+                        <user>root</user>
+                        <group>root</group>
+                      </mapper>
+                    </data>
+                  </dataSet>
+                </configuration>
+              </execution>
+
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>generate-resources</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <target name="Download Solr">
+                    <get
+                      src="${solr.tar}"
+                      dest="${project.build.directory}/solr.tgz"
+                      usetimestamp="true"
+                    />
+                    <untar
+                      src="${project.build.directory}/solr.tgz"
+                      dest="${project.build.directory}/"
+                      compression="gzip"
+                    />
+                    <move todir="${project.build.directory}/solr">
+                      <fileset dir="${project.build.directory}/solr-${solr.version}"/>
+                    </move>
+                    <chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
+                    <chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
+                  </target>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>ambari-logsearch-portal</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>ambari-logsearch-logfeeder</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>ambari-logsearch-appender</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/control
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/control b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/control
new file mode 100644
index 0000000..9d07541
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/control
@@ -0,0 +1,21 @@
+# 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
+Package: [[logsearch.logfeeder.package.name]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/postrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/posttrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/posttrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/posttrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/posttrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/preinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/preinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/preinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/preinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/prerm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/prerm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/prerm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/appender/prerm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/control
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/control b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/control
new file mode 100644
index 0000000..9d07541
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/control
@@ -0,0 +1,21 @@
+# 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
+Package: [[logsearch.logfeeder.package.name]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/postrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/posttrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/posttrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/posttrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/posttrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/preinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/preinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/preinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/preinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/prerm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/prerm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/prerm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/logfeeder/prerm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/control
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/control b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/control
new file mode 100644
index 0000000..ed9cb59
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/control
@@ -0,0 +1,22 @@
+# 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
+Package: [[logsearch.portal.package.name]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Depends: [[deb.dependency.list]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/postrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/preinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/preinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/preinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/preinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/prerm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/prerm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/prerm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/portal/prerm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/control
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/control b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/control
new file mode 100644
index 0000000..5087cd0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/control
@@ -0,0 +1,22 @@
+# 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
+Package: [[solr.package.name]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Depends: [[deb.dependency.list]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postrm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/postrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/preinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/preinst b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/preinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/preinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/prerm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/prerm b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/prerm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-assembly/src/main/package/deb/solr/prerm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/README.md b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
new file mode 100644
index 0000000..d00eb57
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/README.md
@@ -0,0 +1,36 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#LogSearch - LogFeeder:
+
+Logfeeder is a tool that reads log, parses it and stores it in Apache Solr for analyising purpose.
+
+#Compilation
+mvn clean compile package
+
+#Deploy
+##Copy to remote
+copy target/logsearch-logfeeder.tgz to host machine
+
+##Setup environment
+```bash
+mkdir /opt/logfeeder
+cd /opt/logfeeder
+tar xfz ~/logsearch-logfeeder.tar.gz 
+```

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/build.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/build.properties b/ambari-logsearch/ambari-logsearch-logfeeder/build.properties
new file mode 100644
index 0000000..46979e5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/build.properties
@@ -0,0 +1,18 @@
+#   Licensed 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.pkg.dir=${app.work.dir}/pkg
+
+app.dev.war.dir=${app.work.dir}/webapps/logsearch
+app.war.name=logsearch.war
+
+app.target.dir=${builddir}/target/classes/webapps/app
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/build.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/build.xml b/ambari-logsearch/ambari-logsearch-logfeeder/build.xml
new file mode 100644
index 0000000..53f893e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/build.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+   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.
+-->
+<project basedir="." default="build" name="logfeeder">
+  <property environment="env"/>
+  <property name="debuglevel" value="source,lines,vars"/>
+  <dirname property="builddir" file="build.xml"/>
+  <property name="target" value="1.7"/>
+  <property name="source" value="1.7"/>
+  <property file="local.properties"/>
+  <property file="build.properties"/>
+  <target name="init">
+  </target>
+  <target name="build"/>
+
+  <target name="package">
+    <delete dir="target/package"/>
+    <copy todir="target/package/libs" includeEmptyDirs="no">
+      <fileset dir="target/libs"/>
+    </copy>
+    <copy todir="target/package/" includeEmptyDirs="no">
+      <fileset file="target/LogFeeder.jar"/>
+    </copy>
+    <copy todir="target/package/classes" includeEmptyDirs="no">
+      <fileset dir="target/classes"/>
+    </copy>
+    <copy todir="target/package" includeEmptyDirs="no">
+      <fileset file="config.json"/>
+    </copy>
+    <copy todir="target/package" includeEmptyDirs="no">
+      <fileset file="grok-patterns"/>
+      <fileset file="src/main/scripts/run.sh"/>
+    </copy>
+    <chmod file="target/package/run.sh" perm="755"/>
+    <tar compression="gzip" destfile="target/ambari-logsearch-logfeeder.tgz">
+      <tarfileset mode="755" dir="target/package">
+        <include name="*.sh"/>
+      </tarfileset>
+      <tarfileset mode="664" dir="target/package">
+        <exclude name="*.sh"/>
+      </tarfileset>
+    </tar>
+  </target>
+  <target description="Build all projects which reference this project. Useful to propagate changes."
+          name="build-refprojects"/>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
new file mode 100644
index 0000000..a1443c9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/pom.xml
@@ -0,0 +1,201 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>ambari-logsearch-logfeeder</artifactId>
+  <groupId>org.apache.ambari</groupId>
+  <version>2.0.0.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Ambari Logsearch Log Feeder</name>
+  <url>http://maven.apache.org</url>
+
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.11</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+    <dependency>
+      <groupId>io.thekraken</groupId>
+      <artifactId>grok</artifactId>
+      <version>0.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-solrj</artifactId>
+      <version>${solr.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-core-asl</artifactId>
+      <version>1.9.13</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-mapper-asl</artifactId>
+      <version>1.9.13</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.google.guava</groupId>
+      <artifactId>guava</artifactId>
+      <version>18.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.7</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.7.10</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-csv</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.kafka</groupId>
+      <artifactId>kafka-clients</artifactId>
+      <version>0.9.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.jackson</groupId>
+      <artifactId>jackson-xc</artifactId>
+      <version>1.9.13</version>
+    </dependency>
+
+  </dependencies>
+  <build>
+    <finalName>LogFeeder</finalName>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.0</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <version>2.8</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.3</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+
+      <!-- Exec main class plugin -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.2.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <mainClass>org.apache.ambari.logfeeder.LogFeeder</mainClass>
+          <!-- <arguments> <argument></argument> </arguments> -->
+        </configuration>
+      </plugin>
+      <!-- copy-dependencies -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <executions>
+          <execution>
+            <id>copy-dependencies</id>
+            <phase>package</phase>
+
+            <goals>
+              <goal>copy-dependencies</goal>
+
+            </goals>
+            <configuration>
+              <artifactItems>*</artifactItems>
+              <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+              <outputDirectory>${basedir}/target/libs</outputDirectory>
+              <overWriteReleases>false</overWriteReleases>
+              <overWriteSnapshots>false</overWriteSnapshots>
+              <overWriteIfNewer>true</overWriteIfNewer>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <!-- ant pacakge -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <ant antfile="build.xml">
+                  <target name="package"/>
+                </ant>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/run.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/run.sh b/ambari-logsearch/ambari-logsearch-logfeeder/run.sh
new file mode 100755
index 0000000..70947ec
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# 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.
+
+echo "LOG FEEDER"
+mvn clean compile
+mvn exec:java

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
new file mode 100644
index 0000000..3836c76
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
@@ -0,0 +1,110 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder;
+
+import java.io.File;
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
+public class AliasUtil {
+
+  private static Logger logger = Logger.getLogger(AliasUtil.class);
+
+  private static AliasUtil instance = null;
+
+  private static String aliasConfigJson = "alias_config.json";
+
+  private HashMap<String, Object> aliasMap = null;
+
+  public static enum ALIAS_TYPE {
+    INPUT, FILTER, MAPPER, OUTPUT
+  }
+
+  public static enum ALIAS_PARAM {
+    KLASS
+  }
+
+  /**
+   *
+   */
+  private AliasUtil() {
+    init();
+  }
+
+  /**
+   * @return
+   */
+  public static AliasUtil getInstance() {
+    if (instance == null) {
+      synchronized (AliasUtil.class) {
+        if (instance == null) {
+          instance = new AliasUtil();
+        }
+      }
+    }
+    return instance;
+  }
+
+  /**
+   */
+  private void init() {
+    File jsonFile = LogFeederUtil.getFileFromClasspath(aliasConfigJson);
+    if (jsonFile != null) {
+      this.aliasMap = LogFeederUtil.readJsonFromFile(jsonFile);
+    }
+
+  }
+
+
+  /**
+   * @param key
+   * @param aliastype
+   * @return
+   */
+  public String readAlias(String key, ALIAS_TYPE aliastype, ALIAS_PARAM aliasParam) {
+    String result = key;// key as a default value;
+    HashMap<String, String> aliasInfo = getAliasInfo(key, aliastype);
+    String value = aliasInfo.get(aliasParam.name().toLowerCase());
+    if (value != null && !value.isEmpty()) {
+      result = value;
+      logger.debug("Alias found for key :" + key + ",  param :" + aliasParam.name().toLowerCase() + ", value :"
+        + value + " aliastype:" + aliastype.name());
+    } else {
+      logger.debug("Alias not found for key :" + key + ", param :" + aliasParam.name().toLowerCase());
+    }
+    return result;
+  }
+
+  @SuppressWarnings("unchecked")
+  public HashMap<String, String> getAliasInfo(String key, ALIAS_TYPE aliastype) {
+    HashMap<String, String> aliasInfo = null;
+    if (aliasMap != null) {
+      String typeKey = aliastype.name().toLowerCase();
+      HashMap<String, Object> typeJson = (HashMap<String, Object>) aliasMap.get(typeKey);
+      if (typeJson != null) {
+        aliasInfo = (HashMap<String, String>) typeJson.get(key);
+      }
+    }
+    if (aliasInfo == null) {
+      aliasInfo = new HashMap<String, String>();
+    }
+    return aliasInfo;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
new file mode 100644
index 0000000..6b78e2a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
@@ -0,0 +1,262 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Priority;
+
+public abstract class ConfigBlock {
+  static private Logger logger = Logger.getLogger(ConfigBlock.class);
+
+  boolean drain = false;
+
+  protected Map<String, Object> configs;
+  protected Map<String, String> contextFields = new HashMap<String, String>();
+  public MetricCount statMetric = new MetricCount();
+
+  /**
+   *
+   */
+  public ConfigBlock() {
+    super();
+  }
+
+  /**
+   * Used while logging. Keep it short and meaningful
+   *
+   * @return
+   */
+  public abstract String getShortDescription();
+
+  /**
+   * Every implementor need to give name to the thread they create
+   *
+   * @return
+   */
+  public String getNameForThread() {
+    return this.getClass().getSimpleName();
+  }
+
+  /**
+   * @param metricsList
+   */
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    metricsList.add(statMetric);
+  }
+
+  /**
+   * This method needs to be overwritten by deriving classes.
+   *
+   * @throws Exception
+   */
+  public void init() throws Exception {
+
+  }
+
+  /**
+   * @param map
+   */
+  public void loadConfig(Map<String, Object> map) {
+    configs = LogFeederUtil.cloneObject(map);
+
+    // Extract fields from config block
+    Map<String, String> nvList = getNVList("add_fields");
+    if (nvList != null) {
+      contextFields.putAll(nvList);
+    }
+  }
+
+  public Map<String, Object> getConfigs() {
+    return configs;
+  }
+
+  @SuppressWarnings("unchecked")
+  public boolean isEnabled() {
+    boolean isEnabled = getBooleanValue("is_enabled", true);
+    if (isEnabled) {
+      // Let's check for static conditions
+      Map<String, Object> conditions = (Map<String, Object>) configs
+        .get("conditions");
+      boolean allow = true;
+      if (conditions != null && conditions.size() > 0) {
+        allow = false;
+        for (String conditionType : conditions.keySet()) {
+          if (conditionType.equalsIgnoreCase("fields")) {
+            Map<String, Object> fields = (Map<String, Object>) conditions
+              .get("fields");
+            for (String fieldName : fields.keySet()) {
+              Object values = fields.get(fieldName);
+              if (values instanceof String) {
+                allow = isFieldConditionMatch(fieldName,
+                  (String) values);
+              } else {
+                List<String> listValues = (List<String>) values;
+                for (String stringValue : listValues) {
+                  allow = isFieldConditionMatch(fieldName,
+                    stringValue);
+                  if (allow) {
+                    break;
+                  }
+                }
+              }
+              if (allow) {
+                break;
+              }
+            }
+          }
+          if (allow) {
+            break;
+          }
+        }
+        isEnabled = allow;
+      }
+    }
+    return isEnabled;
+  }
+
+  public boolean isFieldConditionMatch(String fieldName, String stringValue) {
+    boolean allow = false;
+    String fieldValue = (String) configs.get(fieldName);
+    if (fieldValue != null && fieldValue.equalsIgnoreCase(stringValue)) {
+      allow = true;
+    } else {
+      @SuppressWarnings("unchecked")
+      Map<String, Object> addFields = (Map<String, Object>) configs
+        .get("add_fields");
+      if (addFields != null && addFields.get(fieldName) != null) {
+        String addFieldValue = (String) addFields.get(fieldName);
+        if (stringValue.equalsIgnoreCase(addFieldValue)) {
+          allow = true;
+        }
+      }
+
+    }
+    return allow;
+  }
+
+  /**
+   * @param string
+   * @return
+   */
+  @SuppressWarnings("unchecked")
+  public Map<String, String> getNVList(String key) {
+    return (Map<String, String>) configs.get(key);
+  }
+
+  public String getStringValue(String key) {
+    Object value = configs.get(key);
+    if (value != null && value.toString().equalsIgnoreCase("none")) {
+      value = null;
+    }
+    if (value != null) {
+      return value.toString();
+    }
+    return null;
+  }
+
+  public String getStringValue(String key, String defaultValue) {
+    Object value = configs.get(key);
+    if (value != null && value.toString().equalsIgnoreCase("none")) {
+      value = null;
+    }
+
+    if (value != null) {
+      return value.toString();
+    }
+    return defaultValue;
+  }
+
+  public Object getConfigValue(String key) {
+    return configs.get(key);
+  }
+
+  public boolean getBooleanValue(String key, boolean defaultValue) {
+    String strValue = getStringValue(key);
+    boolean retValue = defaultValue;
+    if (!StringUtils.isEmpty(strValue)) {
+      if (strValue.equalsIgnoreCase("true")
+        || strValue.equalsIgnoreCase("yes")) {
+        retValue = true;
+      } else {
+        retValue = false;
+      }
+    }
+    return retValue;
+  }
+
+  public int getIntValue(String key, int defaultValue) {
+    String strValue = getStringValue(key);
+    int retValue = defaultValue;
+    if (!StringUtils.isEmpty(strValue)) {
+      try {
+        retValue = Integer.parseInt(strValue);
+      } catch (Throwable t) {
+        logger.error("Error parsing integer value. key=" + key
+          + ", value=" + strValue);
+      }
+    }
+    return retValue;
+  }
+
+  public Map<String, String> getContextFields() {
+    return contextFields;
+  }
+
+  public void incrementStat(int count) {
+    statMetric.count += count;
+  }
+
+  public void logStatForMetric(MetricCount metric, String prefixStr) {
+    LogFeederUtil.logStatForMetric(metric, prefixStr, ", key="
+      + getShortDescription());
+  }
+
+  synchronized public void logStat() {
+    logStatForMetric(statMetric, "Stat");
+  }
+
+  public boolean logConfgs(Priority level) {
+    if (level.toInt() == Priority.INFO_INT && !logger.isInfoEnabled()) {
+      return false;
+    }
+    if (level.toInt() == Priority.DEBUG_INT && !logger.isDebugEnabled()) {
+      return false;
+    }
+    logger.log(level, "Printing configuration Block="
+      + getShortDescription());
+    logger.log(level, "configs=" + configs);
+    logger.log(level, "contextFields=" + contextFields);
+    return true;
+  }
+
+  public boolean isDrain() {
+    return drain;
+  }
+
+  public void setDrain(boolean drain) {
+    this.drain = drain;
+  }
+
+}


[04/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SY.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SY.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SY.js
new file mode 100644
index 0000000..d75faa6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-SY.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-SY
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-SY", "default", {
+	name: "ar-SY",
+	englishName: "Arabic (Syria)",
+	nativeName: "العربية (سوريا)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ل.س.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-TN.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-TN.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-TN.js
new file mode 100644
index 0000000..d7614ad
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-TN.js
@@ -0,0 +1,463 @@
+/*
+ * Globalize Culture ar-TN
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-TN", "default", {
+	name: "ar-TN",
+	englishName: "Arabic (Tunisia)",
+	nativeName: "العربية (تونس)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		decimals: 3,
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		percent: {
+			decimals: 3
+		},
+		currency: {
+			pattern: ["$n-","$ n"],
+			decimals: 3,
+			symbol: "د.ت.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			"/": "-",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd-MM-yyyy",
+				D: "dd MMMM, yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd MMMM, yyyy H:mm",
+				F: "dd MMMM, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MM/yyyy H:mm",
+				F: "dd/MM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dd/MMMM/yyyy H:mm",
+				F: "dd/MMMM/yyyy H:mm:ss",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 1,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		},
+		Gregorian_TransliteratedEnglish: {
+			name: "Gregorian_TransliteratedEnglish",
+			firstDay: 1,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["أ","ا","ث","أ","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "H:mm",
+				T: "H:mm:ss",
+				f: "dddd, MMMM dd, yyyy H:mm",
+				F: "dddd, MMMM dd, yyyy H:mm:ss"
+			}
+		}
+	}
+});
+
+}( this ));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-YE.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-YE.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-YE.js
new file mode 100644
index 0000000..9076dce
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/globalize/lib/cultures/globalize.culture.ar-YE.js
@@ -0,0 +1,457 @@
+/*
+ * Globalize Culture ar-YE
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * This file was generated by the Globalize Culture Generator
+ * Translation: bugs found in this file need to be fixed in the generator
+ */
+
+(function( window, undefined ) {
+
+var Globalize;
+
+if ( typeof require !== "undefined" &&
+	typeof exports !== "undefined" &&
+	typeof module !== "undefined" ) {
+	// Assume CommonJS
+	Globalize = require( "globalize" );
+} else {
+	// Global variable
+	Globalize = window.Globalize;
+}
+
+Globalize.addCultureInfo( "ar-YE", "default", {
+	name: "ar-YE",
+	englishName: "Arabic (Yemen)",
+	nativeName: "العربية (اليمن)",
+	language: "ar",
+	isRTL: true,
+	numberFormat: {
+		pattern: ["n-"],
+		"NaN": "ليس برقم",
+		negativeInfinity: "-لا نهاية",
+		positiveInfinity: "+لا نهاية",
+		currency: {
+			pattern: ["$n-","$ n"],
+			symbol: "ر.ي.\u200f"
+		}
+	},
+	calendars: {
+		standard: {
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			patterns: {
+				d: "dd/MM/yyyy",
+				D: "dd MMMM, yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd MMMM, yyyy hh:mm tt",
+				F: "dd MMMM, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		UmAlQura: {
+			name: "UmAlQura",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MMMM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MMMM/yyyy hh:mm tt",
+				F: "dd/MMMM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    _yearInfo: [
+                        // MonthLengthFlags, Gregorian Date
+                        [746, -2198707200000],
+                        [1769, -2168121600000],
+                        [3794, -2137449600000],
+                        [3748, -2106777600000],
+                        [3402, -2076192000000],
+                        [2710, -2045606400000],
+                        [1334, -2015020800000],
+                        [2741, -1984435200000],
+                        [3498, -1953763200000],
+                        [2980, -1923091200000],
+                        [2889, -1892505600000],
+                        [2707, -1861920000000],
+                        [1323, -1831334400000],
+                        [2647, -1800748800000],
+                        [1206, -1770076800000],
+                        [2741, -1739491200000],
+                        [1450, -1708819200000],
+                        [3413, -1678233600000],
+                        [3370, -1647561600000],
+                        [2646, -1616976000000],
+                        [1198, -1586390400000],
+                        [2397, -1555804800000],
+                        [748, -1525132800000],
+                        [1749, -1494547200000],
+                        [1706, -1463875200000],
+                        [1365, -1433289600000],
+                        [1195, -1402704000000],
+                        [2395, -1372118400000],
+                        [698, -1341446400000],
+                        [1397, -1310860800000],
+                        [2994, -1280188800000],
+                        [1892, -1249516800000],
+                        [1865, -1218931200000],
+                        [1621, -1188345600000],
+                        [683, -1157760000000],
+                        [1371, -1127174400000],
+                        [2778, -1096502400000],
+                        [1748, -1065830400000],
+                        [3785, -1035244800000],
+                        [3474, -1004572800000],
+                        [3365, -973987200000],
+                        [2637, -943401600000],
+                        [685, -912816000000],
+                        [1389, -882230400000],
+                        [2922, -851558400000],
+                        [2898, -820886400000],
+                        [2725, -790300800000],
+                        [2635, -759715200000],
+                        [1175, -729129600000],
+                        [2359, -698544000000],
+                        [694, -667872000000],
+                        [1397, -637286400000],
+                        [3434, -606614400000],
+                        [3410, -575942400000],
+                        [2710, -545356800000],
+                        [2349, -514771200000],
+                        [605, -484185600000],
+                        [1245, -453600000000],
+                        [2778, -422928000000],
+                        [1492, -392256000000],
+                        [3497, -361670400000],
+                        [3410, -330998400000],
+                        [2730, -300412800000],
+                        [1238, -269827200000],
+                        [2486, -239241600000],
+                        [884, -208569600000],
+                        [1897, -177984000000],
+                        [1874, -147312000000],
+                        [1701, -116726400000],
+                        [1355, -86140800000],
+                        [2731, -55555200000],
+                        [1370, -24883200000],
+                        [2773, 5702400000],
+                        [3538, 36374400000],
+                        [3492, 67046400000],
+                        [3401, 97632000000],
+                        [2709, 128217600000],
+                        [1325, 158803200000],
+                        [2653, 189388800000],
+                        [1370, 220060800000],
+                        [2773, 250646400000],
+                        [1706, 281318400000],
+                        [1685, 311904000000],
+                        [1323, 342489600000],
+                        [2647, 373075200000],
+                        [1198, 403747200000],
+                        [2422, 434332800000],
+                        [1388, 465004800000],
+                        [2901, 495590400000],
+                        [2730, 526262400000],
+                        [2645, 556848000000],
+                        [1197, 587433600000],
+                        [2397, 618019200000],
+                        [730, 648691200000],
+                        [1497, 679276800000],
+                        [3506, 709948800000],
+                        [2980, 740620800000],
+                        [2890, 771206400000],
+                        [2645, 801792000000],
+                        [693, 832377600000],
+                        [1397, 862963200000],
+                        [2922, 893635200000],
+                        [3026, 924307200000],
+                        [3012, 954979200000],
+                        [2953, 985564800000],
+                        [2709, 1016150400000],
+                        [1325, 1046736000000],
+                        [1453, 1077321600000],
+                        [2922, 1107993600000],
+                        [1748, 1138665600000],
+                        [3529, 1169251200000],
+                        [3474, 1199923200000],
+                        [2726, 1230508800000],
+                        [2390, 1261094400000],
+                        [686, 1291680000000],
+                        [1389, 1322265600000],
+                        [874, 1352937600000],
+                        [2901, 1383523200000],
+                        [2730, 1414195200000],
+                        [2381, 1444780800000],
+                        [1181, 1475366400000],
+                        [2397, 1505952000000],
+                        [698, 1536624000000],
+                        [1461, 1567209600000],
+                        [1450, 1597881600000],
+                        [3413, 1628467200000],
+                        [2714, 1659139200000],
+                        [2350, 1689724800000],
+                        [622, 1720310400000],
+                        [1373, 1750896000000],
+                        [2778, 1781568000000],
+                        [1748, 1812240000000],
+                        [1701, 1842825600000],
+                        [0, 1873411200000]
+                    ],
+                    minDate: -2198707200000,
+                    maxDate: 1873411199999,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var days = hday - 1,
+                            gyear = hyear - 1318;
+                        if (gyear < 0 || gyear >= this._yearInfo.length) return null;
+                        var info = this._yearInfo[gyear],
+                            gdate = new Date(info[1]),
+                            monthLength = info[0];
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the gregorian date in the same timezone,
+                        // not what the gregorian date was at GMT time, so we adjust for the offset.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        for (var i = 0; i < hmonth; i++) {
+                            days += 29 + (monthLength & 1);
+                            monthLength = monthLength >> 1;
+                        }
+                        gdate.setDate(gdate.getDate() + days);
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        // Date's ticks in javascript are always from the GMT time,
+                        // but we are interested in the hijri date in the same timezone,
+                        // not what the hijri date was at GMT time, so we adjust for the offset.
+                        var ticks = gdate - gdate.getTimezoneOffset() * 60000;
+                        if (ticks < this.minDate || ticks > this.maxDate) return null;
+                        var hyear = 0,
+                            hmonth = 1;
+                        // find the earliest gregorian date in the array that is greater than or equal to the given date
+                        while (ticks > this._yearInfo[++hyear][1]) { }
+                        if (ticks !== this._yearInfo[hyear][1]) {
+                            hyear--;
+                        }
+                        var info = this._yearInfo[hyear],
+                            // how many days has it been since the date we found in the array?
+                            // 86400000 = ticks per day
+                            days = Math.floor((ticks - info[1]) / 86400000),
+                            monthLength = info[0];
+                        hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
+                        // now increment day/month based on the total days, considering
+                        // how many days are in each month. We cannot run past the year
+                        // mark since we would have found a different array entry in that case.
+                        var daysInMonth = 29 + (monthLength & 1);
+                        while (days >= daysInMonth) {
+                            days -= daysInMonth;
+                            monthLength = monthLength >> 1;
+                            daysInMonth = 29 + (monthLength & 1);
+                            hmonth++;
+                        }
+                        // remaining days is less than is in one month, thus is the day of the month we landed on
+                        // hmonth-1 because in javascript months are zero based, stay consistent with that.
+                        return [hyear, hmonth - 1, days + 1];
+                    }
+			}
+		},
+		Hijri: {
+			name: "Hijri",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
+				namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
+			twoDigitYearMax: 1451,
+			patterns: {
+				d: "dd/MM/yy",
+				D: "dd/MM/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dd/MM/yyyy hh:mm tt",
+				F: "dd/MM/yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			},
+			convert: {
+                    // Adapted to Script from System.Globalization.HijriCalendar
+                    ticks1970: 62135596800000,
+                    // number of days leading up to each month
+                    monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
+                    minDate: -42521673600000,
+                    maxDate: 253402300799999,
+                    // The number of days to add or subtract from the calendar to accommodate the variances
+                    // in the start and the end of Ramadan and to accommodate the date difference between
+                    // countries/regions. May be dynamically adjusted based on user preference, but should
+                    // remain in the range of -2 to 2, inclusive.
+                    hijriAdjustment: 0,
+                    toGregorian: function(hyear, hmonth, hday) {
+                        var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
+                        // 86400000 = ticks per day
+                        var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
+                        // adjust for timezone, because we are interested in the gregorian date for the same timezone
+                        // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
+                        // date in the current timezone.
+                        gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
+                        return gdate;
+                    },
+                    fromGregorian: function(gdate) {
+                        if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
+                        var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
+                            daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
+                        // very particular formula determined by someone smart, adapted from the server-side implementation.
+                        // it approximates the hijri year.
+                        var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
+                            absDays = this.daysToYear(hyear),
+                            daysInYear = this.isLeapYear(hyear) ? 355 : 354;
+                        // hyear is just approximate, it may need adjustment up or down by 1.
+                        if (daysSinceJan0101 < absDays) {
+                            hyear--;
+                            absDays -= daysInYear;
+                        }
+                        else if (daysSinceJan0101 === absDays) {
+                            hyear--;
+                            absDays = this.daysToYear(hyear);
+                        }
+                        else {
+                            if (daysSinceJan0101 > (absDays + daysInYear)) {
+                                absDays += daysInYear;
+                                hyear++;
+                            }
+                        }
+                        // determine month by looking at how many days into the hyear we are
+                        // monthDays contains the number of days up to each month.
+                        hmonth = 0;
+                        var daysIntoYear = daysSinceJan0101 - absDays;
+                        while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
+                            hmonth++;
+                        }
+                        hmonth--;
+                        hday = daysIntoYear - this.monthDays[hmonth];
+                        return [hyear, hmonth, hday];
+                    },
+                    daysToYear: function(year) {
+                        // calculates how many days since Jan 1, 0001
+                        var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
+                            yearsInto30 = year - yearsToYear30 - 1,
+                            days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
+                        while (yearsInto30 > 0) {
+                            days += (this.isLeapYear(yearsInto30) ? 355 : 354);
+                            yearsInto30--;
+                        }
+                        return days;
+                    },
+                    isLeapYear: function(year) {
+                        return ((((year * 11) + 14) % 30) < 11);
+                    }
+			}
+		},
+		Gregorian_MiddleEastFrench: {
+			name: "Gregorian_MiddleEastFrench",
+			firstDay: 6,
+			days: {
+				names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
+				namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
+				namesShort: ["di","lu","ma","me","je","ve","sa"]
+			},
+			months: {
+				names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
+				namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
+				M: "dd MMMM"
+			}
+		},
+		Gregorian_Arabic: {
+			name: "Gregorian_Arabic",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
+				namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		},
+		Gregorian_TransliteratedFrench: {
+			name: "Gregorian_TransliteratedFrench",
+			firstDay: 6,
+			days: {
+				names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
+				namesShort: ["ح","ن","ث","ر","خ","ج","س"]
+			},
+			months: {
+				names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
+				namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
+			},
+			AM: ["ص","ص","ص"],
+			PM: ["م","م","م"],
+			eras: [{"name":"م","start":null,"offset":0}],
+			patterns: {
+				d: "MM/dd/yyyy",
+				t: "hh:mm tt",
+				T: "hh:mm:ss tt",
+				f: "dddd, MMMM dd, yyyy hh:mm tt",
+				F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
+			}
+		}
+	}
+});
+
+}( this ));


[39/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml.j2
new file mode 100644
index 0000000..0152880
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml.j2
@@ -0,0 +1,1887 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+-->
+<config>
+  <!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    -->
+
+  <!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  -->
+  <luceneMatchVersion>5.0.0</luceneMatchVersion>
+
+  <!-- <lib/> directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that <lib/> directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              <lib dir="./lib" />
+    -->
+
+  <!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    -->
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
+
+  <!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    -->
+  <!--
+     <lib path="../a-jar-that-does-not-exist.jar" /> 
+  -->
+  
+  <!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    -->
+  <dataDir>${solr.data.dir:}</dataDir>
+
+
+  <!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    -->
+  <directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
+    
+         
+    <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. -->      
+    <!-- The root directory that collection data should be written to. -->     
+    <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
+    <!-- The hadoop configuration files to use for the hdfs client. -->    
+    <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
+    <!-- Enable/Disable the hdfs cache. -->    
+    <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
+    <!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. -->    
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
+    
+  </directoryFactory> 
+
+  <!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  -->
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
+  <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: -->
+  
+       <schemaFactory class="ManagedIndexSchemaFactory">
+         <bool name="mutable">true</bool>
+         <str name="managedSchemaResourceName">managed-schema</str>
+       </schemaFactory>
+<!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces <indexDefaults> and <mainIndex> from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <indexConfig>
+    <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
+    -->
+    <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
+    <!-- <writeLockTimeout>1000</writeLockTimeout>  -->
+    <!-- LogSearch customization to avoid timeouts -->
+    <writeLockTimeout>10000</writeLockTimeout>
+
+    <!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. -->
+    <!-- <maxIndexingThreads>8</maxIndexingThreads>  -->
+    <!-- LogSearch customization of increase performance -->
+    <maxIndexingThreads>50</maxIndexingThreads>
+
+    <!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
+    <!-- <useCompoundFile>false</useCompoundFile> -->
+
+    <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  -->
+    <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
+    <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
+
+    <!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      -->
+    <!--
+        <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
+          <int name="maxMergeAtOnce">10</int>
+          <int name="segmentsPerTier">10</int>
+        </mergePolicy>
+      -->
+       
+    <!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      -->
+    <!-- 
+    <mergeFactor>10</mergeFactor>
+      -->
+    <!-- LogSearch customization. Set to 5 to trigger purging of deleted documents more often -->
+    <mergeFactor>5</mergeFactor>
+
+    <!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     -->
+    <!-- 
+       <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
+       -->
+
+    <!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    -->
+    <lockType>${solr.lock.type:native}</lockType>
+
+    <!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     -->
+    <!--
+    <unlockOnStartup>false</unlockOnStartup>
+      -->
+
+    <!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    -->
+    <!-- 
+    <deletionPolicy class="solr.SolrDeletionPolicy">
+    -->
+      <!-- The number of commit points to be kept -->
+      <!-- <str name="maxCommitsToKeep">1</str> -->
+      <!-- The number of optimized commit points to be kept -->
+      <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
+      <!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        -->
+      <!--
+         <str name="maxCommitAge">30MINUTES</str>
+         <str name="maxCommitAge">1DAY</str>
+      -->
+    <!-- 
+    </deletionPolicy>
+    -->
+
+    <!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      -->
+     <infoStream>true</infoStream>
+  </indexConfig>
+
+
+  <!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    -->
+  <jmx />
+  <!-- If you want to connect to a particular server, specify the
+       agentId 
+    -->
+  <!-- <jmx agentId="myAgent" /> -->
+  <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
+  <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
+    -->
+
+  <!-- The default high-performance update handler -->
+  <updateHandler class="solr.DirectUpdateHandler2">
+
+    <!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --> 
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+    </updateLog>
+ 
+    <!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      -->
+     <autoCommit> 
+       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
+       <openSearcher>false</openSearcher> 
+     </autoCommit>
+
+    <!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      -->
+
+     <autoSoftCommit> 
+       <maxTime>${solr.autoSoftCommit.maxTime:5000}</maxTime> 
+     </autoSoftCommit>
+
+    <!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      -->
+    <!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      -->
+    <!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      -->
+    <!--
+       <listener event="postCommit" class="solr.RunExecutableListener">
+         <str name="exe">solr/bin/snapshooter</str>
+         <str name="dir">.</str>
+         <bool name="wait">true</bool>
+         <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
+         <arr name="env"> <str>MYVAR=val1</str> </arr>
+       </listener>
+      -->
+
+  </updateHandler>
+  
+  <!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    -->
+  <!--
+  <indexReaderFactory name="IndexReaderFactory" class="package.class">
+    <str name="someArg">Some Value</str>
+  </indexReaderFactory >
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <query>
+    <!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      -->
+    <maxBooleanClauses>1024</maxBooleanClauses>
+
+
+    <!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (> 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    -->
+
+    <!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      -->
+    <filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/>
+
+    <!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      -->
+    <queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/>
+   
+    <!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      -->
+    <documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/>
+    
+    <!-- custom cache currently used by block join --> 
+    <cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" />
+
+    <!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      -->
+    <!--
+       <fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" />
+      -->
+
+    <!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      -->
+    <!--
+       <cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              />
+      -->
+
+
+    <!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    -->
+    <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+   <!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     -->
+   <!--
+      <useFilterForSortedQuery>true</useFilterForSortedQuery>
+     -->
+
+   <!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     -->
+   <queryResultWindowSize>20</queryResultWindowSize>
+
+   <!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     -->
+   <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+   <!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     -->
+    <!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      -->
+    <listener event="newSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <!--
+           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
+           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
+          -->
+      </arr>
+    </listener>
+    <listener event="firstSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <lst>
+          <str name="q">static firstSearcher warming in solrconfig.xml</str>
+        </lst>
+      </arr>
+    </listener>
+
+    <!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      -->
+    <useColdSearcher>false</useColdSearcher>
+
+    <!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      -->
+    <maxWarmingSearchers>2</maxWarmingSearchers>
+
+  </query>
+
+
+  <!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    -->
+  <requestDispatcher handleSelect="false" >
+    <!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --> 
+    <requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/>
+
+    <!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      -->
+    <httpCaching never304="true" />
+    <!-- If you include a <cacheControl> directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the <cacheControl> option even if you have set
+         never304="true"
+      -->
+    <!--
+       <httpCaching never304="true" >
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+    <!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      -->
+    <!--
+       <httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr">
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+  </requestDispatcher>
+
+  <!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    -->
+
+  <requestHandler name="/dataimport" class="solr.DataImportHandler">
+    <lst name="defaults">
+      <str name="config">solr-data-config.xml</str>
+    </lst>
+  </requestHandler>
+
+  <!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    -->
+  <requestHandler name="/select" class="solr.SearchHandler">
+    <!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      -->
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <int name="rows">10</int>
+       <str name="df">text</str>
+     </lst>
+    <!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      -->
+    <!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="appends">
+         <str name="fq">inStock:true</str>
+       </lst>
+      -->
+    <!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="invariants">
+         <str name="facet.field">cat</str>
+         <str name="facet.field">manu_exact</str>
+         <str name="facet.query">price:[* TO 500]</str>
+         <str name="facet.query">price:[500 TO *]</str>
+       </lst>
+      -->
+    <!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      -->
+    <!--
+       <arr name="components">
+         <str>nameOfCustomComponent1</str>
+         <str>nameOfCustomComponent2</str>
+       </arr>
+      -->
+    </requestHandler>
+
+  <!-- A request handler that returns indented JSON by default -->
+  <requestHandler name="/query" class="solr.SearchHandler">
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+       <str name="df">text</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  -->
+  <requestHandler name="/get" class="solr.RealTimeGetHandler">
+     <lst name="defaults">
+       <str name="omitHeader">true</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    -->
+  <requestHandler name="/browse" class="solr.SearchHandler">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+
+      <!-- VelocityResponseWriter settings -->
+      <str name="wt">velocity</str>
+      <str name="v.template">browse</str>
+      <str name="v.layout">layout</str>
+
+      <!-- Query settings -->
+      <str name="defType">edismax</str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+
+      <!-- Faceting defaults -->
+      <str name="facet">on</str>
+      <str name="facet.mincount">1</str>
+    </lst>
+  </requestHandler>
+
+
+  <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <str name="update.chain">add-unknown-fields-to-the-schema</str>
+    </lst>
+  </initParams>
+
+  <!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    -->
+  <requestHandler name="/update" class="solr.UpdateRequestHandler">
+    <!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      -->
+    <!--
+       <lst name="defaults">
+         <str name="update.chain">dedupe</str>
+       </lst>
+       -->
+  </requestHandler>
+
+  <!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    -->
+  <requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" >
+    <lst name="defaults">
+      <str name="lowernames">true</str>
+      <str name="uprefix">ignored_</str>
+
+      <!-- capture link hrefs but ignore div attributes -->
+      <str name="captureAttr">true</str>
+      <str name="fmap.a">links</str>
+      <str name="fmap.div">ignored_</str>
+    </lst>
+  </requestHandler>
+
+
+  <!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   -->
+  <requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" />
+
+
+  <!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       <docs>
+         <doc>
+           <field name="id">1</field>
+           <field name="name">The Name</field>
+           <field name="text">The Text Value</field>
+         </doc>
+         <doc>...</doc>
+         <doc>...</doc>
+         ...
+       </docs>
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  -->
+  <requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" />
+
+  <!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    -->
+  <requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" />
+  <!-- This single handler is equivalent to the following... -->
+  <!--
+     <requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" />
+     <requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" />
+     <requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" />
+     <requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" />
+     <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
+     <requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" >
+    -->
+  <!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    -->
+  <!--
+     <requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" >
+       <lst name="invariants">
+         <str name="hidden">synonyms.txt</str> 
+         <str name="hidden">anotherfile.txt</str> 
+         <str name="hidden">*</str> 
+       </lst>
+     </requestHandler>
+    -->
+
+  <!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  -->
+  <!--
+  <requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" >
+    <lst name="invariants">
+         <str name="hidden">synonyms.txt</str>
+         <str name="hidden">anotherfile.txt</str>
+    </lst>
+  </requestHandler>
+  -->
+  <!-- ping/healthcheck -->
+  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
+    <lst name="invariants">
+      <str name="q">solrpingquery</str>
+    </lst>
+    <lst name="defaults">
+      <str name="echoParams">all</str>
+    </lst>
+    <!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      -->
+    <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
+  </requestHandler>
+
+  <!-- Echo the request contents back to the client -->
+  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
+    <lst name="defaults">
+     <str name="echoParams">explicit</str> 
+     <str name="echoHandler">true</str>
+    </lst>
+  </requestHandler>
+  
+  <!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    -->
+  <requestHandler name="/replication" class="solr.ReplicationHandler" > 
+    <!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    -->
+    <!--
+       <lst name="master">
+         <str name="replicateAfter">commit</str>
+         <str name="replicateAfter">startup</str>
+         <str name="confFiles">schema.xml,stopwords.txt</str>
+       </lst>
+    -->
+    <!--
+       <lst name="slave">
+         <str name="masterUrl">http://your-master-hostname:8983/solr</str>
+         <str name="pollInterval">00:00:60</str>
+       </lst>
+    -->
+  </requestHandler>
+
+  <!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       <searchComponent name="query"     class="solr.QueryComponent" />
+       <searchComponent name="facet"     class="solr.FacetComponent" />
+       <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
+       <searchComponent name="highlight" class="solr.HighlightComponent" />
+       <searchComponent name="stats"     class="solr.StatsComponent" />
+       <searchComponent name="debug"     class="solr.DebugComponent" />
+   
+       Default configuration in a requestHandler would look like:
+
+       <arr name="components">
+         <str>query</str>
+         <str>facet</str>
+         <str>mlt</str>
+         <str>highlight</str>
+         <str>stats</str>
+         <str>debug</str>
+       </arr>
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       <arr name="first-components">
+         <str>myFirstComponentName</str>
+       </arr>
+    
+       <arr name="last-components">
+         <str>myLastComponentName</str>
+       </arr>
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     -->
+  
+   <!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     -->
+  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
+
+    <str name="queryAnalyzerFieldType">key_lower_case</str>
+
+    <!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      -->
+
+    <!-- a spellchecker built from a field of the main index -->
+    <lst name="spellchecker">
+      <str name="name">default</str>
+      <str name="field">text</str>
+      <str name="classname">solr.DirectSolrSpellChecker</str>
+      <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
+      <str name="distanceMeasure">internal</str>
+      <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
+      <float name="accuracy">0.5</float>
+      <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
+      <int name="maxEdits">2</int>
+      <!-- the minimum shared prefix when enumerating terms -->
+      <int name="minPrefix">1</int>
+      <!-- maximum number of inspections per result. -->
+      <int name="maxInspections">5</int>
+      <!-- minimum length of a query term to be considered for correction -->
+      <int name="minQueryLength">4</int>
+      <!-- maximum threshold of documents a query term can appear to be considered for correction -->
+      <float name="maxQueryFrequency">0.01</float>
+      <!-- uncomment this to require suggestions to occur in 1% of the documents
+      	<float name="thresholdTokenFrequency">.01</float>
+      -->
+    </lst>
+    
+    <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
+    <lst name="spellchecker">
+      <str name="name">wordbreak</str>
+      <str name="classname">solr.WordBreakSolrSpellChecker</str>      
+      <str name="field">name</str>
+      <str name="combineWords">true</str>
+      <str name="breakWords">true</str>
+      <int name="maxChanges">10</int>
+    </lst>
+
+    <!-- a spellchecker that uses a different distance measure -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">jarowinkler</str>
+         <str name="field">spell</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="distanceMeasure">
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         </str>
+       </lst>
+     -->
+
+    <!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">freq</str>
+         <str name="field">lowerfilt</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="comparatorClass">freq</str>
+      -->
+
+    <!-- A spellchecker that reads the list of words from a file -->
+    <!--
+       <lst name="spellchecker">
+         <str name="classname">solr.FileBasedSpellChecker</str>
+         <str name="name">file</str>
+         <str name="sourceLocation">spellings.txt</str>
+         <str name="characterEncoding">UTF-8</str>
+         <str name="spellcheckIndexDir">spellcheckerFile</str>
+       </lst>
+      -->
+  </searchComponent>
+  
+  <!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    -->
+  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers -->
+      <str name="spellcheck.dictionary">default</str>
+      <str name="spellcheck.dictionary">wordbreak</str>
+      <str name="spellcheck">on</str>
+      <str name="spellcheck.extendedResults">true</str>       
+      <str name="spellcheck.count">10</str>
+      <str name="spellcheck.alternativeTermCount">5</str>
+      <str name="spellcheck.maxResultsForSuggest">5</str>       
+      <str name="spellcheck.collate">true</str>
+      <str name="spellcheck.collateExtendedResults">true</str>  
+      <str name="spellcheck.maxCollationTries">10</str>
+      <str name="spellcheck.maxCollations">5</str>         
+    </lst>
+    <arr name="last-components">
+      <str>spellcheck</str>
+    </arr>
+  </requestHandler>
+
+  <searchComponent name="suggest" class="solr.SuggestComponent">
+  	<lst name="suggester">
+      <str name="name">mySuggester</str>
+      <str name="lookupImpl">FuzzyLookupFactory</str>      <!-- org.apache.solr.spelling.suggest.fst -->
+      <str name="dictionaryImpl">DocumentDictionaryFactory</str>     <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --> 
+      <str name="field">cat</str>
+      <str name="weightField">price</str>
+      <str name="suggestAnalyzerFieldType">string</str>
+    </lst>
+  </searchComponent>
+
+  <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="suggest">true</str>
+      <str name="suggest.count">10</str>
+    </lst>
+    <arr name="components">
+      <str>suggest</str>
+    </arr>
+  </requestHandler>
+  <!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    -->
+  <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
+
+  <!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <bool name="tv">true</bool>
+    </lst>
+    <arr name="last-components">
+      <str>tvComponent</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    -->
+  <searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" >
+    <lst name="engine">
+      <str name="name">lingo</str>
+
+      <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        -->
+      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
+
+      <!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       -->
+      <str name="carrot.resourcesDir">clustering/carrot2</str>
+    </lst>
+
+    <!-- An example definition for the STC clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">stc</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
+    </lst>
+
+    <!-- An example definition for the bisecting kmeans clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">kmeans</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
+    </lst>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler">
+    <lst name="defaults">
+      <bool name="clustering">true</bool>
+      <bool name="clustering.results">true</bool>
+      <!-- Field name with the logical "title" of a each document (optional) -->
+      <str name="carrot.title">name</str>
+      <!-- Field name with the logical "URL" of a each document (optional) -->
+      <str name="carrot.url">id</str>
+      <!-- Field name with the logical "content" of a each document (optional) -->
+      <str name="carrot.snippet">features</str>
+      <!-- Apply highlighter to the title/ content and use this for clustering. -->
+      <bool name="carrot.produceSummary">true</bool>
+      <!-- the maximum number of labels per cluster -->
+      <!--<int name="carrot.numDescriptions">5</int>-->
+      <!-- produce sub clusters -->
+      <bool name="carrot.outputSubClusters">false</bool>
+
+      <!-- Configure the remaining request handler parameters. -->
+      <str name="defType">edismax</str>
+      <str name="qf">
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      </str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+    </lst>
+    <arr name="last-components">
+      <str>clustering</str>
+    </arr>
+  </requestHandler>
+  
+  <!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    -->
+  <searchComponent name="terms" class="solr.TermsComponent"/>
+
+  <!-- A request handler for demonstrating the terms component -->
+  <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
+     <lst name="defaults">
+      <bool name="terms">true</bool>
+      <bool name="distrib">false</bool>
+    </lst>     
+    <arr name="components">
+      <str>terms</str>
+    </arr>
+  </requestHandler>
+
+
+  <!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    -->
+  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
+    <!-- pick a fieldType to analyze queries -->
+    <str name="queryFieldType">string</str>
+    <str name="config-file">elevate.xml</str>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the elevator component -->
+  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+      <str name="df">text</str>
+    </lst>
+    <arr name="last-components">
+      <str>elevator</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    -->
+  <searchComponent class="solr.HighlightComponent" name="highlight">
+    <highlighting>
+      <!-- Configure the standard fragmenter -->
+      <!-- This could most likely be commented out in the "default" case -->
+      <fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter">
+        <lst name="defaults">
+          <int name="hl.fragsize">100</int>
+        </lst>
+      </fragmenter>
+
+      <!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        -->
+      <fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter">
+        <lst name="defaults">
+          <!-- slightly smaller fragsizes work better because of slop -->
+          <int name="hl.fragsize">70</int>
+          <!-- allow 50% slop on fragment sizes -->
+          <float name="hl.regex.slop">0.5</float>
+          <!-- a basic sentence pattern -->
+          <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
+        </lst>
+      </fragmenter>
+
+      <!-- Configure the standard formatter -->
+      <formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter">
+        <lst name="defaults">
+          <str name="hl.simple.pre"><![CDATA[<em>]]></str>
+          <str name="hl.simple.post"><![CDATA[</em>]]></str>
+        </lst>
+      </formatter>
+
+      <!-- Configure the standard encoder -->
+      <encoder name="html" 
+               class="solr.highlight.HtmlEncoder" />
+
+      <!-- Configure the standard fragListBuilder -->
+      <fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/>
+      
+      <!-- Configure the single fragListBuilder -->
+      <fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/>
+      
+      <!-- Configure the weighted fragListBuilder -->
+      <fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/>
+      
+      <!-- default tag FragmentsBuilder -->
+      <fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <!-- 
+        <lst name="defaults">
+          <str name="hl.multiValuedSeparatorChar">/</str>
+        </lst>
+        -->
+      </fragmentsBuilder>
+
+      <!-- multi-colored tag FragmentsBuilder -->
+      <fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <lst name="defaults">
+          <str name="hl.tag.pre"><![CDATA[
+               <b style="background:yellow">,<b style="background:lawgreen">,
+               <b style="background:aquamarine">,<b style="background:magenta">,
+               <b style="background:palegreen">,<b style="background:coral">,
+               <b style="background:wheat">,<b style="background:khaki">,
+               <b style="background:lime">,<b style="background:deepskyblue">]]></str>
+          <str name="hl.tag.post"><![CDATA[</b>]]></str>
+        </lst>
+      </fragmentsBuilder>
+      
+      <boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner">
+        <lst name="defaults">
+          <str name="hl.bs.maxScan">10</str>
+          <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
+        </lst>
+      </boundaryScanner>
+      
+      <boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner">
+        <lst name="defaults">
+          <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
+          <str name="hl.bs.type">WORD</str>
+          <!-- language and country are used when constructing Locale object.  -->
+          <!-- And the Locale object will be used when getting instance of BreakIterator -->
+          <str name="hl.bs.language">en</str>
+          <str name="hl.bs.country">US</str>
+        </lst>
+      </boundaryScanner>
+    </highlighting>
+  </searchComponent>
+
+  <!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --> 
+
+  <!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    -->
+  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
+
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+{{logsearch_service_logs_max_retention}}DAYS</str>
+    </processor>
+    <processor class="solr.processor.DocExpirationUpdateProcessorFactory">
+        <int name="autoDeletePeriodSeconds">86400</int>
+        <str name="ttlFieldName">_ttl_</str>
+        <str name="expirationFieldName">_expire_at_</str>
+    </processor>
+    <processor class="solr.FirstFieldValueUpdateProcessorFactory">
+      <str name="fieldName">_expire_at_</str>
+    </processor>
+
+
+    <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseLongFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDateFieldUpdateProcessorFactory">
+      <arr name="format">
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss</str>
+        <str>yyyy-MM-dd'T'HH:mmZ</str>
+        <str>yyyy-MM-dd'T'HH:mm</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd HH:mm:ssZ</str>
+        <str>yyyy-MM-dd HH:mm:ss</str>
+        <str>yyyy-MM-dd HH:mmZ</str>
+        <str>yyyy-MM-dd HH:mm</str>
+        <str>yyyy-MM-dd</str>
+      </arr>
+    </processor>
+    <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
+      <str name="defaultFieldType">key_lower_case</str>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Boolean</str>
+        <str name="fieldType">booleans</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.util.Date</str>
+        <str name="fieldType">tdates</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Long</str>
+        <str name="valueClass">java.lang.Integer</str>
+        <str name="fieldType">tlongs</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Number</str>
+        <str name="fieldType">tdoubles</str>
+      </lst>
+    </processor>
+
+    <processor class="solr.LogUpdateProcessorFactory"/>
+    <processor class="solr.RunUpdateProcessorFactory"/>
+  </updateRequestProcessorChain>
+
+
+  <!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    -->
+  <!--
+     <updateRequestProcessorChain name="dedupe">
+       <processor class="solr.processor.SignatureUpdateProcessorFactory">
+         <bool name="enabled">true</bool>
+         <str name="signatureField">id</str>
+         <bool name="overwriteDupes">false</bool>
+         <str name="fields">name,features,cat</str>
+         <str name="signatureClass">solr.processor.Lookup3Signature</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+  
+  <!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    -->
+    <!--
+     <updateRequestProcessorChain name="langid">
+       <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
+         <str name="langid.fl">text,title,subject,description</str>
+         <str name="langid.langField">language_s</str>
+         <str name="langid.fallback">en</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+
+  <!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  -->
+  <!--
+    <updateRequestProcessorChain name="script">
+      <processor class="solr.StatelessScriptUpdateProcessorFactory">
+        <str name="script">update-script.js</str>
+        <lst name="params">
+          <str name="config_param">example config parameter</str>
+        </lst>
+      </processor>
+      <processor class="solr.RunUpdateProcessorFactory" />
+    </updateRequestProcessorChain>
+  -->
+ 
+  <!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    -->
+  <!-- The following response writers are implicitly configured unless
+       overridden...
+    -->
+  <!--
+     <queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" />
+     <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+     <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+     <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
+     <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
+     <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
+     <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
+     <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
+    -->
+
+  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+     <!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     -->
+    <str name="content-type">text/plain; charset=UTF-8</str>
+  </queryResponseWriter>
+  
+  <!--
+     Custom response writers can be declared as needed...
+    -->
+  <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
+    <str name="template.base.dir">${velocity.template.base.dir:}</str>
+  </queryResponseWriter>
+
+  <!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    -->
+  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
+    <int name="xsltCacheLifetimeSeconds">5</int>
+  </queryResponseWriter>
+
+  <!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    -->
+  <!-- example of registering a query parser -->
+  <!--
+     <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
+    -->
+
+  <!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    -->
+  <!-- example of registering a custom function parser  -->
+  <!--
+     <valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" />
+    -->
+    
+  
+  <!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    -->
+  <!--
+     Could be something like:
+     <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
+       <int name="connection">jdbc://....</int>
+     </transformer>
+     
+     To add a constant value to all docs, use:
+     <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <int name="value">5</int>
+     </transformer>
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <double name="defaultValue">5</double>
+     </transformer>
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
+    -->
+    
+
+  <!-- Legacy config for the admin interface -->
+  <admin>
+    <defaultQuery>*:*</defaultQuery>
+  </admin>
+
+</config>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.html
new file mode 100755
index 0000000..fecab20
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.html
@@ -0,0 +1,24 @@
+<!--
+ 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.
+-->
+
+<!-- The content of this page will be statically included into the top-
+right box of the cores overview page. Uncomment this as an example to 
+see there the content will show up.
+
+<img src="img/ico/construction.png"> This line will appear at the top-
+right box on collection1's Overview
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-bottom.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-bottom.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-bottom.html
new file mode 100755
index 0000000..3359a46
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-bottom.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-bottom.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    LAST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-top.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-top.html b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-top.html
new file mode 100755
index 0000000..0886cee
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/admin-extra.menu-top.html
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+
+<!-- admin-extra.menu-top.html -->
+<!--
+<li>
+  <a href="#" style="background-image: url(img/ico/construction.png);">
+    FIRST ITEM
+  </a>
+</li>
+-->

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/elevate.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/elevate.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/elevate.xml
new file mode 100644
index 0000000..25d5ceb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/elevate.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- If this file is found in the config directory, it will only be
+     loaded once at startup.  If it is found in Solr's data
+     directory, it will be re-loaded every commit.
+
+   See http://wiki.apache.org/solr/QueryElevationComponent for more info
+
+-->
+<elevate>
+ <query text="foo bar">
+  <doc id="1" />
+  <doc id="2" />
+  <doc id="3" />
+ </query>
+ 
+ <query text="ipod">
+   <doc id="MA147LL/A" />  <!-- put the actual ipod at the top -->
+   <doc id="IW-02" exclude="true" /> <!-- exclude this cable -->
+ </query>
+ 
+</elevate>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/schema.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/schema.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/schema.xml
new file mode 100644
index 0000000..2b9515c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/schema.xml
@@ -0,0 +1,49 @@
+<?xml version='1.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.
+-->
+<schema name='history' version='1.1'>
+        <types>
+                <fieldtype name='string' class='solr.StrField' />
+                <fieldtype name='long' class='solr.TrieLongField' />
+
+                <fieldType name="key_lower_case" class="solr.TextField"
+                        sortMissingLast="true" omitNorms="true">
+                         <analyzer>
+                                <tokenizer class="solr.KeywordTokenizerFactory"/>
+                                <filter class="solr.LowerCaseFilterFactory" />
+                         </analyzer>
+                 </fieldType>
+        </types>
+
+        <fields>
+                <field name='id' type='string' required='true' />
+                <field name="_version_" type="long" indexed="true" stored="true"/>
+
+                <field name='username' type='key_lower_case' indexed="true" stored="true" required='true'/>
+                <field name='jsons' type='string'/>
+
+                <field name="rowtype" type='string' required='true'/>
+                <field name='filtername' type='key_lower_case' indexed="true" stored="true" required='true'/>
+
+                <field name='share_username_list' type='string' multiValued='true' />
+                <field name='composite_filtername-username' type='string'/>
+
+                <dynamicField name='*_string' type='string' multiValued='true' indexed='true' stored='true'/>
+        </fields>
+        <uniqueKey>composite_filtername-username</uniqueKey>
+        <solrQueryParser defaultOperator='OR' />
+</schema>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/solrconfig.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/solrconfig.xml
new file mode 100644
index 0000000..6544dff
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/history/conf/solrconfig.xml
@@ -0,0 +1,48 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ 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.
+-->
+<config>
+	<luceneMatchVersion>4.10.2</luceneMatchVersion>
+
+	<updateRequestProcessorChain name="composite-id">
+		<processor class="solr.CloneFieldUpdateProcessorFactory">
+			<str name="source">username</str>
+			<str name="source">filtername</str>
+			<str name="dest">composite_filtername-username</str>
+		</processor>
+		<processor class="solr.ConcatFieldUpdateProcessorFactory">
+			<str name="fieldName">composite_filtername-username</str>
+			<str name="delimiter">-</str>
+		</processor>
+		<processor class="solr.LogUpdateProcessorFactory" />
+		<processor class="solr.RunUpdateProcessorFactory" />
+	</updateRequestProcessorChain>
+
+	<requestHandler name='standard' class='solr.StandardRequestHandler'
+		default='true' />
+	<requestHandler name="/update" class="solr.UpdateRequestHandler">
+		<lst name="defaults">
+			<str name="update.chain">composite-id</str>
+		</lst>
+	</requestHandler>
+	<requestHandler name='/admin/'
+		class='org.apache.solr.handler.admin.AdminHandlers' />
+
+	<admin>
+		<defaultQuery>*:*</defaultQuery>
+	</admin>
+</config>


[35/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionMgr.java
new file mode 100644
index 0000000..dbc14e1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/SessionMgr.java
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.manager;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.ambari.logsearch.common.UserSessionInfo;
+import org.apache.ambari.logsearch.security.context.LogsearchContextHolder;
+import org.apache.ambari.logsearch.security.context.LogsearchSecurityContext;
+import org.apache.ambari.logsearch.web.model.User;
+import org.apache.log4j.Logger;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.authentication.WebAuthenticationDetails;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SessionMgr {
+
+  static final Logger logger = Logger.getLogger(SessionMgr.class);
+
+  public SessionMgr() {
+    logger.debug("SessionManager created");
+  }
+
+  public UserSessionInfo processSuccessLogin(int authType, String userAgent) {
+    return processSuccessLogin(authType, userAgent, null);
+  }
+
+  public UserSessionInfo processSuccessLogin(int authType, String userAgent, HttpServletRequest httpRequest) {
+    boolean newSessionCreation = true;
+    UserSessionInfo userSession = null;
+    LogsearchSecurityContext context = LogsearchContextHolder.getSecurityContext();
+    if (context != null) {
+      userSession = context.getUserSession();
+    }
+    Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
+    WebAuthenticationDetails details = (WebAuthenticationDetails) authentication.getDetails();
+    String currentLoginId = authentication.getName();
+    if (userSession != null) {
+      if (validateUserSession(userSession, currentLoginId)) {
+        newSessionCreation = false;
+      }
+    }
+    //
+    if (newSessionCreation) {
+      // // Need to build the UserSession
+      userSession = new UserSessionInfo();
+      User user = new User();
+      user.setUsername(currentLoginId);
+      userSession.setUser(user);
+      if (details != null) {
+        logger.info("Login Success: loginId=" + currentLoginId + ", sessionId=" + details.getSessionId()
+          + ", requestId=" + details.getRemoteAddress());
+      } else {
+        logger.info("Login Success: loginId=" + currentLoginId + ", msaSessionId=" + ", details is null");
+      }
+
+    }
+
+    return userSession;
+  }
+
+  protected boolean validateUserSession(UserSessionInfo userSession, String currentUsername) {
+    if (currentUsername.equalsIgnoreCase(userSession.getUser().getUsername())) {
+      return true;
+    } else {
+      logger.info("loginId doesn't match loginId from HTTPSession. Will create new session. loginId="
+        + currentUsername + ", userSession=" + userSession, new Exception());
+      return false;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigMgr.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigMgr.java
new file mode 100644
index 0000000..d76a3e7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigMgr.java
@@ -0,0 +1,382 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.manager;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.MessageEnums;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.dao.UserConfigSolrDao;
+import org.apache.ambari.logsearch.query.QueryGeneration;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.view.VLogfeederFilterWrapper;
+import org.apache.ambari.logsearch.view.VUserConfig;
+import org.apache.ambari.logsearch.view.VUserConfigList;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrServerException;
+import org.apache.solr.client.solrj.response.FacetField.Count;
+import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.gson.JsonParseException;
+
+@Component
+public class UserConfigMgr extends MgrBase {
+  static Logger logger = Logger.getLogger(UserConfigMgr.class);
+
+  @Autowired
+  UserConfigSolrDao userConfigSolrDao;
+
+  @Autowired
+  SolrUtil solrUtil;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  QueryGeneration queryGenerator;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  public String saveUserConfig(VUserConfig vHistory) {
+
+    SolrInputDocument solrInputDoc = new SolrInputDocument();
+    if (!isValid(vHistory)) {
+      throw restErrorUtil.createRESTException("No FilterName Specified",
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+    if (isNotUnique(vHistory) && !vHistory.isOverwrite()) {
+      throw restErrorUtil.createRESTException(
+        "Name '" + vHistory.getFilterName() + "' already exists",
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+    solrInputDoc.addField(LogSearchConstants.ID, vHistory.getId());
+    solrInputDoc.addField(LogSearchConstants.USER_NAME,
+      vHistory.getUserName());
+    solrInputDoc.addField(LogSearchConstants.VALUES, vHistory.getValues());
+    solrInputDoc.addField(LogSearchConstants.FILTER_NAME,
+      vHistory.getFilterName());
+    solrInputDoc.addField(LogSearchConstants.ROW_TYPE,
+      vHistory.getRowType());
+    List<String> shareNameList = vHistory.getShareNameList();
+    if (shareNameList != null && !shareNameList.isEmpty())
+      solrInputDoc.addField(LogSearchConstants.SHARE_NAME_LIST, shareNameList);
+
+    try {
+      userConfigSolrDao.addDocs(solrInputDoc);
+      return convertObjToString(solrInputDoc);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  private boolean isNotUnique(VUserConfig vHistory) {
+    String filterName = vHistory.getFilterName();
+    String rowType = vHistory.getRowType();
+
+    if (filterName != null && rowType != null) {
+      SolrQuery solrQuery = new SolrQuery();
+      filterName = solrUtil.makeSearcableString(filterName);
+      solrQuery.setQuery(LogSearchConstants.COMPOSITE_KEY + ":"
+        + filterName + "-" + rowType);
+      queryGenerator.setRowCount(solrQuery, 0);
+      try {
+        Long numFound = userConfigSolrDao.process(solrQuery)
+          .getResults().getNumFound();
+        if (numFound > 0)
+          return true;
+      } catch (SolrException | SolrServerException | IOException e) {
+        logger.error(e);
+      }
+    }
+    return false;
+  }
+
+  private boolean isValid(VUserConfig vHistory) {
+
+    return !stringUtil.isEmpty(vHistory.getFilterName())
+      && !stringUtil.isEmpty(vHistory.getRowType())
+      && !stringUtil.isEmpty(vHistory.getUserName())
+      && !stringUtil.isEmpty(vHistory.getValues());
+  }
+
+  public void deleteUserConfig(String id) {
+    try {
+      userConfigSolrDao.removeDoc("id:" + id);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(),
+        MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  public String getUserConfig(SearchCriteria searchCriteria) {
+
+    SolrDocumentList solrList = new SolrDocumentList();
+    VUserConfigList userConfigList = new VUserConfigList();
+
+    String rowType = (String) searchCriteria
+      .getParamValue(LogSearchConstants.ROW_TYPE);
+    if (stringUtil.isEmpty(rowType)) {
+      throw restErrorUtil.createRESTException(
+        "row type was not specified",
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+
+    String userName = (String) searchCriteria
+      .getParamValue(LogSearchConstants.USER_NAME);
+    if (stringUtil.isEmpty(userName)) {
+      throw restErrorUtil.createRESTException(
+        "user name was not specified",
+        MessageEnums.INVALID_INPUT_DATA);
+    }
+    String filterName = (String) searchCriteria
+      .getParamValue(LogSearchConstants.FILTER_NAME);
+    filterName = stringUtil.isEmpty(filterName) ? "*" : "*" + filterName
+      + "*";
+
+    try {
+
+      SolrQuery userConfigQuery = new SolrQuery();
+      queryGenerator.setMainQuery(userConfigQuery, null);
+      queryGenerator.setPagination(userConfigQuery, searchCriteria);
+      queryGenerator.setSingleIncludeFilter(userConfigQuery,
+        LogSearchConstants.ROW_TYPE, rowType);
+      queryGenerator.setSingleORFilter(userConfigQuery,
+        LogSearchConstants.USER_NAME, userName,
+        LogSearchConstants.SHARE_NAME_LIST, userName);
+      queryGenerator.setSingleIncludeFilter(userConfigQuery,
+        LogSearchConstants.FILTER_NAME, filterName);
+
+      if (stringUtil.isEmpty(searchCriteria.getSortBy())
+        || searchCriteria.getSortBy().equals("historyName"))
+        searchCriteria
+          .setSortBy(LogSearchConstants.FILTER_NAME);
+      if (stringUtil.isEmpty(searchCriteria.getSortType()))
+        searchCriteria.setSortType("" + SolrQuery.ORDER.asc);
+
+      queryGenerator.setSingleSortOrder(userConfigQuery, searchCriteria);
+      solrList = userConfigSolrDao.process(userConfigQuery).getResults();
+
+      Collection<VUserConfig> configList = new ArrayList<VUserConfig>();
+
+      for (SolrDocument solrDoc : solrList) {
+        VUserConfig userConfig = new VUserConfig();
+        userConfig.setFilterName(""
+          + solrDoc.get(LogSearchConstants.FILTER_NAME));
+        userConfig.setId("" + solrDoc.get(LogSearchConstants.ID));
+        userConfig.setValues("" + solrDoc.get(LogSearchConstants.VALUES));
+        userConfig.setRowType(""
+          + solrDoc.get(LogSearchConstants.ROW_TYPE));
+        try {
+          List<String> shareNameList = (List<String>) solrDoc
+            .get(LogSearchConstants.SHARE_NAME_LIST);
+          userConfig.setShareNameList(shareNameList);
+        } catch (Exception e) {
+          // do nothing
+        }
+
+        userConfig.setUserName(""
+          + solrDoc.get(LogSearchConstants.USER_NAME));
+
+        configList.add(userConfig);
+      }
+
+      userConfigList.setName("historyList");
+      userConfigList.setUserConfigList(configList);
+
+      userConfigList.setStartIndex(searchCriteria.getStartIndex());
+      userConfigList.setPageSize((int) searchCriteria.getMaxRows());
+
+      userConfigList.setTotalCount((long) solrList.getNumFound());
+      userConfigList
+        .setResultSize((int) (configList.size() - searchCriteria
+          .getStartIndex()));
+    } catch (SolrException | SolrServerException | IOException e) {
+      // do nothing
+    }
+    try {
+      return convertObjToString(userConfigList);
+    } catch (IOException e) {
+      return "";
+    }
+  }
+
+  public String updateUserConfig(VUserConfig vuserConfig) {
+    String id = "" + vuserConfig.getId();
+    deleteUserConfig(id);
+    return saveUserConfig(vuserConfig);
+  }
+
+  // ////////////////////////////LEVEL
+  // FILTER/////////////////////////////////////
+
+  /**
+   * @return
+   */
+  @SuppressWarnings("unchecked")
+  public String getUserFilter() {
+    String filterName = LogSearchConstants.LOGFEEDER_FILTER_NAME;
+    SolrQuery solrQuery = new SolrQuery();
+    solrQuery.setQuery("*:*");
+    String fq = LogSearchConstants.ROW_TYPE + ":" + filterName;
+    solrQuery.setFilterQueries(fq);
+    try {
+      QueryResponse response = userConfigSolrDao.process(solrQuery);
+      SolrDocumentList documentList = response.getResults();
+      VLogfeederFilterWrapper logfeederFilterWrapper = null;
+      if (documentList != null && documentList.size() > 0) {
+        SolrDocument configDoc = documentList.get(0);
+        String configJson = jsonUtil.objToJson(configDoc);
+        HashMap<String, Object> configMap = (HashMap<String, Object>) jsonUtil.jsonToMapObject(configJson);
+        String json = (String) configMap.get(LogSearchConstants.VALUES);
+        logfeederFilterWrapper = (VLogfeederFilterWrapper) jsonUtil.jsonToObj(json, VLogfeederFilterWrapper.class);
+        logfeederFilterWrapper.setId("" + configDoc.get(LogSearchConstants.ID));
+
+      } else {
+        String hadoopServiceString = getHadoopServiceConfigJSON();
+        try {
+
+          JSONObject componentList = new JSONObject();
+          JSONObject jsonValue = new JSONObject();
+
+          JSONObject hadoopServiceJsonObject = new JSONObject(hadoopServiceString)
+            .getJSONObject("service");
+          Iterator<String> hadoopSerivceKeys = hadoopServiceJsonObject
+            .keys();
+          while (hadoopSerivceKeys.hasNext()) {
+            String key = hadoopSerivceKeys.next();
+            JSONArray componentArray = hadoopServiceJsonObject
+              .getJSONObject(key).getJSONArray("components");
+            for (int i = 0; i < componentArray.length(); i++) {
+              JSONObject compJsonObject = (JSONObject) componentArray
+                .get(i);
+              String componentName = compJsonObject
+                .getString("name");
+              JSONObject innerContent = new JSONObject();
+              innerContent.put("label", componentName);
+              innerContent.put("hosts", new JSONArray());
+              innerContent.put("defaultLevels", new JSONArray());
+              componentList.put(componentName, innerContent);
+            }
+          }
+          jsonValue.put("filter", componentList);
+          return saveUserFiter(jsonValue.toString());
+
+        } catch (JsonParseException | JSONException je) {
+          logger.error(je);
+          logfeederFilterWrapper = new VLogfeederFilterWrapper();
+        }
+      }
+      return convertObjToString(logfeederFilterWrapper);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(), MessageEnums.ERROR_SYSTEM);
+    }
+  }
+
+  /**
+   * Creating filter for logfeeder
+   *
+   * @param String
+   * @return
+   */
+  public String saveUserFiter(String json) {
+    VLogfeederFilterWrapper logfeederFilterWrapper = (VLogfeederFilterWrapper) jsonUtil.jsonToObj(json,
+      VLogfeederFilterWrapper.class);
+    if (logfeederFilterWrapper == null) {
+      logger.error("filter json is not a valid :" + json);
+      throw restErrorUtil.createRESTException("Invalid filter json", MessageEnums.ERROR_SYSTEM);
+    }
+    String id = logfeederFilterWrapper.getId();
+    if (!stringUtil.isEmpty(id)) {
+      deleteUserConfig(id);
+    }
+    String filterName = LogSearchConstants.LOGFEEDER_FILTER_NAME;
+    json = jsonUtil.objToJson(logfeederFilterWrapper);
+    SolrInputDocument conifgDocument = new SolrInputDocument();
+    conifgDocument.addField(LogSearchConstants.ID, new Date().getTime());
+    conifgDocument.addField(LogSearchConstants.ROW_TYPE, filterName);
+    conifgDocument.addField(LogSearchConstants.VALUES, json);
+    conifgDocument.addField(LogSearchConstants.USER_NAME, filterName);
+    conifgDocument.addField(LogSearchConstants.FILTER_NAME, filterName);
+    try {
+      userConfigSolrDao.addDocs(conifgDocument);
+    } catch (SolrException | SolrServerException | IOException e) {
+      logger.error(e);
+      throw restErrorUtil.createRESTException(e.getMessage(), MessageEnums.ERROR_SYSTEM);
+    }
+    return getUserFilter();
+  }
+
+  public String getAllUserName() {
+    List<String> userList = new ArrayList<String>();
+    try {
+      SolrQuery userListQuery = new SolrQuery();
+      queryGenerator.setMainQuery(userListQuery, null);
+      queryGenerator.setFacetField(userListQuery,
+        LogSearchConstants.USER_NAME);
+      QueryResponse queryResponse = userConfigSolrDao
+        .process(userListQuery);
+      if (queryResponse == null)
+        return convertObjToString(userList);
+      List<Count> counList = queryResponse.getFacetField(
+        LogSearchConstants.USER_NAME).getValues();
+      for (Count cnt : counList) {
+        String userName = cnt.getName();
+        userList.add(userName);
+      }
+    } catch (SolrException | SolrServerException | IOException e) {
+      // do nothing
+    }
+
+    try {
+      return convertObjToString(userList);
+    } catch (IOException e) {
+      return "";
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java
new file mode 100644
index 0000000..38a31fb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGeneration.java
@@ -0,0 +1,442 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.query;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.regex.Pattern;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.util.BizUtil;
+import org.apache.ambari.logsearch.util.ConfigUtil;
+import org.apache.ambari.logsearch.util.DateUtil;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class QueryGeneration extends QueryGenerationBase {
+
+  static Logger logger = Logger.getLogger(QueryGeneration.class);
+
+  @Autowired
+  SolrUtil solrUtil;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  BizUtil bizUtil;
+
+  @Autowired
+  DateUtil dateUtil;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  public SolrQuery commonFilterQuery(SearchCriteria searchCriteria) {
+
+    SolrQuery solrQuery = new SolrQuery();
+
+    String jsonHCNames = (String) searchCriteria
+      .getParamValue("treeParams");
+    String givenQuery = (String) searchCriteria.getParamValue("q");
+    String level = (String) searchCriteria.getParamValue("level");
+
+    String startTime = (String) searchCriteria.getParamValue("from");
+    String endTime = (String) searchCriteria.getParamValue("to");
+    String iMessage = (String) searchCriteria.getParamValue("iMessage");
+    String eMessage = (String) searchCriteria.getParamValue("eMessage");
+    String gEmessage = (String) searchCriteria.getParamValue("gEMessage");
+    String selectedComp = (String) searchCriteria
+      .getParamValue("selectComp");
+    String bundleId = (String) searchCriteria
+      .getParamValue(LogSearchConstants.BUNDLE_ID);
+    String globalExcludeComp = (String) searchCriteria
+      .getParamValue("gMustNot");
+    String unselectedComp = (String) searchCriteria
+      .getParamValue("unselectComp");
+    String urlHostName = (String) searchCriteria.getParamValue("host_name");
+    String urlComponents = (String) searchCriteria.getParamValue("components_name");
+
+    String advQuery = (String) searchCriteria.getParamValue("advanceSearch");
+    if (!stringUtil.isEmpty(advQuery)) {
+      String advQueryParameters[] = advQuery.split(Pattern.quote("}{"));
+      SolrQuery advSolrQuery = new SolrQuery();
+
+      for (String queryParam : advQueryParameters) {
+        String params[] = queryParam.split(Pattern.quote("="));
+        advSolrQuery.setParam(params[0], params[1]);
+      }
+
+      // Building and adding levels to filters
+      setFilterClauseWithFieldName(advSolrQuery, level,
+        LogSearchConstants.SOLR_LEVEL, "", "OR");
+
+      // Adding Logtime to filters
+      setSingleRangeFilter(advSolrQuery, LogSearchConstants.LOGTIME,
+        startTime, endTime);
+
+      // Building and adding exlcude components to filters
+      setFilterClauseWithFieldName(advSolrQuery, unselectedComp,
+        LogSearchConstants.SOLR_COMPONENT,
+        LogSearchConstants.MINUS_OPERATOR, "AND");
+
+      // Building and adding exlcude components to filters
+      setFilterClauseWithFieldName(advSolrQuery, selectedComp,
+        LogSearchConstants.SOLR_COMPONENT,
+        LogSearchConstants.NO_OPERATOR, "OR");
+
+      // Set Pagination
+      setPagination(advSolrQuery, searchCriteria);
+
+      return advSolrQuery;
+    }
+
+    setMainQuery(solrQuery, givenQuery);
+
+    // Adding Logtime to filters
+    setSingleRangeFilter(solrQuery, LogSearchConstants.LOGTIME, startTime,
+      endTime);
+
+    String mainFilterQuery = buildQueryFromJSONCompHost(jsonHCNames, selectedComp);
+
+    if (mainFilterQuery != null && !mainFilterQuery.equals(""))
+      solrQuery.addFilterQuery(mainFilterQuery);
+
+    // Building and adding levels to filters
+    setFilterClauseWithFieldName(solrQuery, level, LogSearchConstants.SOLR_LEVEL, "", "OR");
+
+    // Building and adding include string to filters
+    setFilterClauseForSolrSearchableString(solrQuery, iMessage, "OR", "",
+      LogSearchConstants.SOLR_LOG_MESSAGE);
+
+    // Building and adding global exclude string to filters
+    setFilterClauseForSolrSearchableString(solrQuery, gEmessage, "AND",
+      LogSearchConstants.MINUS_OPERATOR,
+      LogSearchConstants.SOLR_LOG_MESSAGE);
+
+    // Building and adding exclude string to filter
+    setFilterClauseForSolrSearchableString(solrQuery, eMessage, "AND",
+      LogSearchConstants.MINUS_OPERATOR,
+      LogSearchConstants.SOLR_LOG_MESSAGE);
+
+    // Building and adding logfile to filters
+    applyLogFileFilter(solrQuery, searchCriteria);
+
+    // Building and adding exclude components to filters
+    setFilterClauseWithFieldName(solrQuery, globalExcludeComp,
+      LogSearchConstants.SOLR_COMPONENT,
+      LogSearchConstants.MINUS_OPERATOR, "AND");
+
+    // Building and adding exlcude components to filters
+    setFilterClauseWithFieldName(solrQuery, unselectedComp,
+      LogSearchConstants.SOLR_COMPONENT,
+      LogSearchConstants.MINUS_OPERATOR, "AND");
+
+    //Building and addding host names given url
+    setFilterClauseWithFieldName(solrQuery, urlHostName,
+      LogSearchConstants.SOLR_HOST,
+      "", "OR");
+
+    //Building and addding component names given url
+    setFilterClauseWithFieldName(solrQuery, urlComponents,
+      LogSearchConstants.SOLR_COMPONENT,
+      "", "OR");
+
+    // Set Pagination
+    setPagination(solrQuery, searchCriteria);
+
+    // SetSort type (by default Descending)
+    setSortOrderDefaultServiceLog(solrQuery, searchCriteria);
+
+    // Set Bundle Id
+    setSingleIncludeFilter(solrQuery, LogSearchConstants.BUNDLE_ID, bundleId);
+
+    this.setUserSpecificFilter(searchCriteria, solrQuery,
+      LogSearchConstants.INCLUDE_QUERY,
+      LogSearchConstants.INCLUDE_QUERY);
+
+    this.setUserSpecificFilter(searchCriteria, solrQuery,
+      LogSearchConstants.EXCLUDE_QUERY,
+      LogSearchConstants.EXCLUDE_QUERY);
+    return solrQuery;
+  }
+
+  public void applyLogFileFilter(SolrQuery solrQuery,
+                                 SearchCriteria searchCriteria) {
+    String hostLogFile = (String) searchCriteria
+      .getParamValue("hostLogFile");
+    String compLogFile = (String) searchCriteria
+      .getParamValue("compLogFile");
+    String givenQuery = (String) searchCriteria.getParamValue("q");
+    String logfileQuery = "";
+    if (hostLogFile != null && !hostLogFile.equals("")
+      && compLogFile != null && !compLogFile.equals("")) {
+      logfileQuery = "host:" + hostLogFile + " AND type:" + compLogFile;
+      if (givenQuery != null && !givenQuery.equals(""))
+        logfileQuery = "(" + givenQuery + ") AND (" + logfileQuery
+          + ")";
+      solrQuery.addFilterQuery(logfileQuery);
+    }
+  }
+
+  public void setUserSpecificFilter(SearchCriteria searchCriteria,
+                                    SolrQuery solrQuery, String paramName, String operation) {
+
+    String queryString = (String) searchCriteria.getParamValue(paramName);
+    String columnQuery = (String) searchCriteria
+      .getParamValue(LogSearchConstants.COLUMN_QUERY);
+    if (!stringUtil.isEmpty(queryString) && "[]".equals(queryString))
+      queryString = null;
+    if (!stringUtil.isEmpty(columnQuery) && stringUtil.isEmpty(queryString)
+      && !paramName.equals(LogSearchConstants.EXCLUDE_QUERY))
+      queryString = columnQuery;
+    List<String> conditionQuries = new ArrayList<String>();
+    List<String> referalConditionQuries = new ArrayList<String>();
+    List<String> elments = new ArrayList<String>();
+    if (!stringUtil.isEmpty(queryString)) {
+      List<HashMap<String, Object>> queryList = jsonUtil
+        .jsonToMapObjectList(queryString);
+      if (!stringUtil.isEmpty(columnQuery)
+        && !columnQuery.equals(queryString) && !paramName.equals(LogSearchConstants.EXCLUDE_QUERY)) {
+        List<HashMap<String, Object>> columnQueryList = jsonUtil
+          .jsonToMapObjectList(columnQuery);
+        queryList.addAll(columnQueryList);
+      }
+
+      for (HashMap<String, Object> columnListMap : queryList) {
+        String orQuery = "";
+        String field = "";
+        for (String key : columnListMap.keySet()) {
+          String originalKey = getOriginalKey(key);
+          String value = getOriginalValue(originalKey, ""
+            + columnListMap.get(key));
+          orQuery = originalKey + ":"
+            + putWildCardByType(value, originalKey);
+
+          boolean isSame = false;
+          for (String temp : elments) {
+            if (key.equals(temp))
+              isSame = true;
+          }
+          if (isSame
+            && !operation
+            .equals(LogSearchConstants.EXCLUDE_QUERY)) {
+            for (String tempCondition : conditionQuries) {
+              if (tempCondition.contains(originalKey)) {
+                String newCondtion = tempCondition + " OR "
+                  + orQuery;
+                referalConditionQuries.remove(tempCondition);
+                referalConditionQuries.add(newCondtion);
+              }
+            }
+            conditionQuries.removeAll(conditionQuries);
+            conditionQuries.addAll(referalConditionQuries);
+          } else {
+            conditionQuries.add(orQuery);
+            referalConditionQuries.add(orQuery);
+          }
+
+          field = key;
+          elments.add(field);
+        }
+
+      }
+    }
+    if (!referalConditionQuries.isEmpty()) {
+      if (operation.equals(LogSearchConstants.INCLUDE_QUERY)
+        || operation.equals(LogSearchConstants.COLUMN_QUERY)) {
+        for (String filter : referalConditionQuries)
+          solrQuery.addFilterQuery(filter);
+      } else if (operation.equals(LogSearchConstants.EXCLUDE_QUERY)) {
+
+        for (String filter : referalConditionQuries) {
+          filter = "-" + filter;
+          solrQuery.addFilterQuery(filter);
+        }
+      }
+    }
+  }
+
+  public SolrQuery commonAuditFilterQuery(SearchCriteria searchCriteria) {
+
+    SolrQuery solrQuery = new SolrQuery();
+    solrQuery.setQuery("*:*");
+
+    String startTime = (String) searchCriteria.getParamValue("startTime");
+    String endTime = (String) searchCriteria.getParamValue("endTime");
+    String selectedComp = (String) searchCriteria
+      .getParamValue("includeString");
+
+    this.setFilterClauseWithFieldName(solrQuery, selectedComp,
+      LogSearchConstants.AUDIT_COMPONENT,
+      LogSearchConstants.NO_OPERATOR, "OR");
+
+    String globalExcludeComp = (String) searchCriteria
+      .getParamValue("gMustNot");
+
+    this.setUserSpecificFilter(searchCriteria, solrQuery,
+      LogSearchConstants.INCLUDE_QUERY,
+      LogSearchConstants.INCLUDE_QUERY);
+
+    this.setUserSpecificFilter(searchCriteria, solrQuery,
+      LogSearchConstants.EXCLUDE_QUERY,
+      LogSearchConstants.EXCLUDE_QUERY);
+
+    String unselectedComp = (String) searchCriteria
+      .getParamValue("unselectComp");
+
+    this.setFilterClauseWithFieldName(solrQuery, globalExcludeComp,
+      LogSearchConstants.AUDIT_COMPONENT,
+      LogSearchConstants.MINUS_OPERATOR, "AND");
+
+    // Building and adding exlcude components to filters
+    this.setFilterClauseWithFieldName(solrQuery, unselectedComp,
+      LogSearchConstants.AUDIT_COMPONENT,
+      LogSearchConstants.MINUS_OPERATOR, "AND");
+
+    // Adding Logtime to filters
+    this.setSingleRangeFilter(solrQuery, LogSearchConstants.AUDIT_EVTTIME,
+      startTime, endTime);
+
+    this.setPagination(solrQuery, searchCriteria);
+    try {
+      if (searchCriteria.getSortBy().isEmpty()) {
+        searchCriteria.setSortBy(LogSearchConstants.AUDIT_EVTTIME);
+        searchCriteria.setSortType(SolrQuery.ORDER.desc.toString());
+      }
+    } catch (Exception e) {
+      searchCriteria.setSortBy(LogSearchConstants.AUDIT_EVTTIME);
+      searchCriteria.setSortType(SolrQuery.ORDER.desc.toString());
+    }
+
+    this.setSortOrderDefaultServiceLog(solrQuery, searchCriteria);
+    return solrQuery;
+  }
+
+  private String putWildCardByType(String str, String key) {
+
+    String auditSuffix = PropertiesUtil
+      .getProperty("auditlog.solr.core.logs");
+    String serviceLogs = PropertiesUtil.getProperty("solr.core.logs");
+
+    String type = ConfigUtil.schemaFieldsName.get(key + auditSuffix);
+    if (type == null)
+      type = ConfigUtil.schemaFieldsName.get(key + serviceLogs);
+    if (type == null)
+      return "*" + str + "*";
+    if ("text_std_token_lower_case".equalsIgnoreCase(type))
+      return giveSplittedStringQuery(str);
+    if ("key_lower_case".equalsIgnoreCase(type)
+      || "string".equalsIgnoreCase(type))
+      //return solrUtil.makeSolrSearchString(str);
+      return solrUtil.makeSolrSearchStringWithoutAsterisk(str);
+    if ("ip_address".equalsIgnoreCase(type))
+      return str;
+    return putEscapeCharacterForNumber(str);
+  }
+
+  private String giveSplittedStringQuery(String str) {
+    try {
+      String splittedString[] = str
+        .split("/|-|@|&|^|%|$|#|!|~|:|;|\\*|\\+");
+      String newStr = "(";
+      int cnt = 0;
+      for (String normalString : splittedString) {
+        cnt++;
+        if (!normalString.isEmpty()) {
+          newStr += "*" + normalString + "*";
+        }
+        if (!normalString.isEmpty() && cnt < splittedString.length)
+          newStr += " AND ";
+      }
+      newStr += ")";
+      return newStr;
+    } catch (Exception e) {
+      return "*" + str + "*";
+    }
+  }
+
+  private String putEscapeCharacterForNumber(String str) {
+    String escapeCharSting = "" + returnDefaultIfValueNotNumber(str);
+    escapeCharSting = str.replace("-", "\\-");
+    return escapeCharSting;
+  }
+
+  private String returnDefaultIfValueNotNumber(String str) {
+    try {
+      return "" + Integer.parseInt(str);
+    } catch (Exception e) {
+      return "0";
+    }
+  }
+
+  private String getOriginalValue(String name, String value) {
+    String solrValue = PropertiesUtil.getProperty(name);
+
+    try {
+      String propertyFieldMappings[] = solrValue.split(",");
+      HashMap<String, String> propertyFieldValue = new HashMap<String, String>();
+      for (String temp : propertyFieldMappings) {
+        String arrayValue[] = temp.split(":");
+        propertyFieldValue.put(arrayValue[0].toLowerCase(Locale.ENGLISH),
+          arrayValue[1].toLowerCase(Locale.ENGLISH));
+      }
+      String originalValue = propertyFieldValue.get(value.toLowerCase(Locale.ENGLISH));
+      if (originalValue != null && !originalValue.isEmpty())
+        return originalValue;
+
+    } catch (Exception e) {
+      // do nothing
+    }
+    return value;
+
+  }
+
+  private String getOriginalKey(String key) {
+    String originalServiceKey = ConfigUtil.serviceLogsColumnMapping.get(key
+      + LogSearchConstants.UI_SUFFIX);
+    String originalAuditKey = ConfigUtil.auditLogsColumnMapping.get(key
+      + LogSearchConstants.UI_SUFFIX);
+    if (originalAuditKey != null && originalServiceKey == null) {
+      return originalAuditKey;
+    }
+    if (originalServiceKey != null && originalAuditKey == null) {
+      return originalServiceKey;
+    }
+    if (originalAuditKey != null && originalServiceKey != null) {
+      return originalServiceKey;
+    }
+    return key;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGenerationBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGenerationBase.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGenerationBase.java
new file mode 100644
index 0000000..e357d02
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/query/QueryGenerationBase.java
@@ -0,0 +1,389 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.query;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.ambari.logsearch.util.QueryBase;
+import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.log4j.Logger;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.client.solrj.SolrQuery.ORDER;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public abstract class QueryGenerationBase extends QueryBase {
+
+  static Logger logger = Logger.getLogger(QueryGenerationBase.class);
+
+  @Autowired
+  SolrUtil solrUtil;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  // SetMethods to apply to the query
+  public void setFilterClauseForSolrSearchableString(SolrQuery solrQuery,
+                                                     String commaSepratedString, String booleanOperator, String opr,
+                                                     String messageField) {
+    String operator = opr;
+    String filterQuery = "";
+    if (commaSepratedString != null && !commaSepratedString.isEmpty()) {
+
+      String queryMsg = "";
+      operator = operator == null ? "" : operator;
+      String[] msgList = commaSepratedString
+        .split(LogSearchConstants.I_E_SEPRATOR);
+      int count = 0;
+      for (String temp : msgList) {
+        count += 1;
+
+        queryMsg = queryMsg + " " + operator + messageField + ":"
+          + solrUtil.makeSolrSearchString(temp);
+        if (msgList.length > count)
+          queryMsg = queryMsg + " " + booleanOperator + " ";
+      }
+      filterQuery = queryMsg;
+      solrQuery.addFilterQuery(filterQuery);
+      logger.debug("Filter added :- " + filterQuery);
+    }
+  }
+
+  public void setFilterClauseWithFieldName(SolrQuery solrQuery,
+                                           String commaSepratedString, String field, String operator,
+                                           String condition) {
+    if (commaSepratedString != null && !commaSepratedString.isEmpty()) {
+      String[] arrayOfSepratedString = commaSepratedString.split(",");
+      String filterQuery;
+      if ("OR".equals(condition))
+        filterQuery = solrUtil.orList(operator + field,
+          arrayOfSepratedString, "");
+      else
+        filterQuery = solrUtil.andList(operator + field,
+          arrayOfSepratedString, "");
+      solrQuery.addFilterQuery(filterQuery);
+      logger.debug("Filter added :- " + filterQuery);
+    }
+  }
+
+  public void setSortOrderDefaultServiceLog(SolrQuery solrQuery,
+                                            SearchCriteria searchCriteria) {
+    List<SolrQuery.SortClause> defaultSort = new ArrayList<SolrQuery.SortClause>();
+    if (searchCriteria.getSortBy() != null
+      && (!searchCriteria.getSortBy().isEmpty())) {
+      ORDER order = SolrQuery.ORDER.asc;
+      if (searchCriteria.getSortType() != null
+        && (!searchCriteria.getSortType().isEmpty())
+        && !searchCriteria.getSortType().equalsIgnoreCase(
+        order.toString())) {
+        order = SolrQuery.ORDER.desc;
+      }
+      SolrQuery.SortClause logtimeSortClause = SolrQuery.SortClause
+        .create(searchCriteria.getSortBy(), order);
+      defaultSort.add(logtimeSortClause);
+    } else {
+      // by default sorting by logtime and sequence number in
+      // Descending order
+      SolrQuery.SortClause logtimeSortClause = SolrQuery.SortClause
+        .create(LogSearchConstants.LOGTIME, SolrQuery.ORDER.desc);
+
+      defaultSort.add(logtimeSortClause);
+
+    }
+    SolrQuery.SortClause sequenceNumberSortClause = SolrQuery.SortClause
+      .create(LogSearchConstants.SEQUNCE_ID, SolrQuery.ORDER.desc);
+    defaultSort.add(sequenceNumberSortClause);
+    solrQuery.setSorts(defaultSort);
+    logger.debug("Sort Order :-" + defaultSort);
+  }
+
+  public void setFilterFacetSort(SolrQuery solrQuery,
+                                 SearchCriteria searchCriteria) {
+    if (searchCriteria.getSortBy() != null
+      && (!searchCriteria.getSortBy().isEmpty())) {
+      solrQuery.setFacetSort(searchCriteria.getSortBy());
+      logger.info("Sorted By :- " + searchCriteria.getSortBy());
+    }
+  }
+
+  public void setSingleSortOrder(SolrQuery solrQuery,
+                                 SearchCriteria searchCriteria) {
+    List<SolrQuery.SortClause> sort = new ArrayList<SolrQuery.SortClause>();
+    if (searchCriteria.getSortBy() != null
+      && (!searchCriteria.getSortBy().isEmpty())) {
+      ORDER order = SolrQuery.ORDER.asc;
+      if (searchCriteria.getSortType() != null
+        && (!searchCriteria.getSortType().isEmpty())
+        && !searchCriteria.getSortType().equalsIgnoreCase(
+        order.toString())) {
+        order = SolrQuery.ORDER.desc;
+      }
+      SolrQuery.SortClause sortOrder = SolrQuery.SortClause.create(
+        searchCriteria.getSortBy(), order);
+      sort.add(sortOrder);
+      solrQuery.setSorts(sort);
+      logger.debug("Sort Order :-" + sort);
+    }
+  }
+
+  // Search Criteria has parameter "sort" from it can get list of Sort Order
+  // Example of list can be [logtime desc,seq_num desc]
+  @SuppressWarnings("unchecked")
+  public void setMultipleSortOrder(SolrQuery solrQuery,
+                                   SearchCriteria searchCriteria) {
+    List<SolrQuery.SortClause> sort = new ArrayList<SolrQuery.SortClause>();
+    List<String> sortList = (List<String>) searchCriteria
+      .getParamValue("sort");
+    for (String sortOrder : sortList) {
+      String sortByAndOrder[] = sortOrder.split(" ");
+      ORDER order = sortByAndOrder[1].contains("asc") ? SolrQuery.ORDER.asc
+        : SolrQuery.ORDER.desc;
+      SolrQuery.SortClause sortOrder2 = SolrQuery.SortClause.create(
+        sortByAndOrder[0], order);
+      sort.add(sortOrder2);
+      logger.debug("Sort Order :-" + sort);
+    }
+    solrQuery.setSorts(sort);
+  }
+
+  public void setSingleIncludeFilter(SolrQuery solrQuery, String filterType,
+                                     String filterValue) {
+    if (filterType != null && !filterType.isEmpty() && filterValue != null
+      && !filterValue.isEmpty()) {
+      String filterQuery = buildFilterQuery(filterType, filterValue);
+      solrQuery.addFilterQuery(filterQuery);
+      logger.debug("Filter added :- " + filterQuery);
+    }
+  }
+
+  public void setSingleExcludeFilter(SolrQuery solrQuery, String filterType,
+                                     String filterValue) {
+    if (filterType != null && !filterType.isEmpty() && filterValue != null
+      && !filterValue.isEmpty()) {
+      String filterQuery = "-"
+        + buildFilterQuery(filterType, filterValue);
+      solrQuery.addFilterQuery(filterQuery);
+      logger.debug("Filter added :- " + filterQuery);
+    }
+  }
+
+  public void setSingleRangeFilter(SolrQuery solrQuery, String filterType,
+                                   String filterFromValue, String filterToValue) {
+    if (filterType != null && !filterType.isEmpty()
+      && filterFromValue != null && !filterFromValue.isEmpty()
+      && filterToValue != null && !filterToValue.isEmpty()) {
+      String filterQuery = buildInclusiveRangeFilterQuery(filterType,
+        filterFromValue, filterToValue);
+      solrQuery.addFilterQuery(filterQuery);
+      logger.debug("Filter added :- " + filterQuery);
+    }
+  }
+
+  public void setPagination(SolrQuery solrQuery, SearchCriteria searchCriteria) {
+    Integer startIndex = null;
+    Integer maxRows = null;
+    try {
+      startIndex = (Integer) searchCriteria.getStartIndex();
+      setStart(solrQuery, startIndex);
+    } catch (ClassCastException e) {
+      setStart(solrQuery, 0);
+    }
+    try {
+      maxRows = (Integer) searchCriteria.getMaxRows();
+      setRowCount(solrQuery, maxRows);
+    } catch (ClassCastException e) {
+      setRowCount(solrQuery, 10);
+    }
+
+    if (startIndex != null && maxRows != null)
+      logger.info("Pagination was set from " + startIndex.intValue()
+        + " to " + maxRows.intValue());
+  }
+
+  public void setSingleORFilter(SolrQuery solrQuery, String filterName1, String value1, String filterName2, String value2) {
+    String filterQuery = filterName1 + ":" + value1 + " OR " + filterName2 + ":" + value2;
+    solrQuery.setFilterQueries(filterQuery);
+  }
+
+  // BuildMethods to prepare a particular format as required for solr
+  public String buildInclusiveRangeFilterQuery(String filterType,
+                                               String filterFromValue, String filterToValue) {
+    String filterQuery = filterType + ":[" + filterFromValue + " TO "
+      + filterToValue + "]";
+    logger.info("Build Filter was :- " + filterQuery);
+    return filterQuery;
+  }
+
+  public String buildExclusiveRangeFilterQuery(String filterType,
+                                               String filterFromValue, String filterToValue) {
+    String filterQuery = filterType + ":{" + filterFromValue + " TO "
+      + filterToValue + "}";
+    logger.info("Build Filter was :- " + filterQuery);
+    return filterQuery;
+  }
+
+  public String buildFilterQuery(String filterType, String filterValue) {
+    String filterQuery = filterType + ":" + filterValue;
+    logger.info("Build Filter Query was :- " + filterQuery);
+    return filterQuery;
+  }
+
+  public String buildQueryFromJSONCompHost(String jsonHCNames,
+                                           String selectedComponent) {
+    String queryHostComponent = "";
+    // Building and adding exclude string to filters
+    String selectedCompQuery = "";
+
+    if (selectedComponent != null && !selectedComponent.equals("")) {
+      String[] selectedComponents = selectedComponent.split(",");
+      selectedCompQuery = solrUtil.orList(LogSearchConstants.SOLR_COMPONENT, selectedComponents);
+
+    }
+
+    // Building Query of Host and Components from given json
+    if (jsonHCNames != null && !jsonHCNames.equals("")
+      && !jsonHCNames.equals("[]")) {
+
+      try {
+        JSONArray jarray = new JSONArray(jsonHCNames);
+        int flagHost = 0;
+        int flagComp;
+        int count;
+        for (int i = 0; i < jarray.length(); i++) {
+          if (flagHost == 1)
+            queryHostComponent = queryHostComponent + " OR ";
+          JSONObject jsonObject = jarray.getJSONObject(i);
+          String host = jsonObject.getString("h");
+          queryHostComponent = queryHostComponent + "( host:" + host;
+          List<String> components = JSONUtil.JSONToList(jsonObject
+            .getJSONArray("c"));
+          if (components.isEmpty())
+            queryHostComponent = queryHostComponent + " AND ";
+
+          flagComp = 0;
+          count = 0;
+          for (String comp : components) {
+            if (flagComp == 0)
+              queryHostComponent = queryHostComponent + " ( ";
+            count += 1;
+            queryHostComponent = queryHostComponent + " "
+              + " type:" + comp;
+            if (components.size() <= count)
+              queryHostComponent = queryHostComponent + " ) ";
+            else
+              queryHostComponent = queryHostComponent + " OR ";
+            flagComp = 1;
+          }
+          queryHostComponent = queryHostComponent + " ) ";
+          flagHost = 1;
+        }
+      } catch (JSONException e) {
+        logger.error(e);
+      }
+    }
+    if (selectedCompQuery != null && !selectedCompQuery.equals("")) {
+      if (queryHostComponent == null || queryHostComponent.equals(""))
+        queryHostComponent = selectedCompQuery;
+      else
+        queryHostComponent = queryHostComponent + " OR "
+          + selectedCompQuery;
+    }
+    return queryHostComponent;
+  }
+
+  // JSON BuildMethods
+
+  /**
+   * @param function , xAxisField
+   * @return jsonString
+   */
+  public String buildJSONFacetAggregatedFuncitonQuery(String function,
+                                                      String xAxisField) {
+    return "{x:'" + function + "(" + xAxisField + ")'}";
+  }
+
+  /**
+   * @param fieldName , fieldTime, from, to, unit
+   * @return jsonString
+   * @hierarchy Term, Time Range
+   */
+  public String buildJSONFacetTermTimeRangeQuery(String fieldName,
+                                                 String fieldTime, String from, String to, String unit) {
+    String query = "{";
+    query += "x" + ":{type:terms,field:" + fieldName
+      + ",facet:{y:{type:range,field:" + fieldTime + ",start:\""
+      + from + "\",end:\"" + to + "\",gap:\"" + unit + "\"}}}";
+    query += "}";
+    logger.info("Build JSONQuery is :- " + query);
+    return query;
+  }
+
+  /**
+   * @param stackField , xAxisField
+   * @return jsonString
+   * @hierarchy Term, Range
+   */
+  public String buildJsonFacetTermsRangeQuery(String stackField,
+                                              String xAxisField) {
+    String jsonQuery = "{ " + stackField + ": { type: terms,field:"
+      + stackField + "," + "facet: {   x: { type: terms, field:"
+      + xAxisField + ",mincount:0,sort:{index:asc}}}}}";
+    logger.info("Build JSONQuery is :- " + jsonQuery);
+    return jsonQuery;
+  }
+
+  /**
+   * @param stackField , xAxisField, function
+   * @return
+   * @hierarchy Term, Range
+   */
+  public String buidlJSONFacetRangeQueryForNumber(String stackField,
+                                                  String xAxisField, String function) {
+    String jsonQuery = "{ " + stackField + ": { type: terms,field:"
+      + stackField + "," + "facet: {   x:'" + function + "("
+      + xAxisField + ")'}}}}";
+    logger.info("Build JSONQuery is :- " + jsonQuery);
+    return jsonQuery;
+  }
+
+  /**
+   * @param stackField , xAxisField, function
+   * @return
+   * @hierarchy Query, T
+   */
+  public String buidlJSONFacetRangeQueryForSuggestion(
+    String originalFieldName, String valueToSuggest) {
+    String jsonQuery = "{y:{type:query,query:\"" + originalFieldName + ":"
+      + valueToSuggest + "\",facet:{x:{type:terms,field:"
+      + originalFieldName + "}}}}";
+    logger.info("Build JSONQuery is :- " + jsonQuery);
+    return jsonQuery;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditREST.java
new file mode 100644
index 0000000..6e47d34
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/AuditREST.java
@@ -0,0 +1,168 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.manager.AuditMgr;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Path("audit")
+@Component
+@Scope("request")
+public class AuditREST {
+
+  @Autowired
+  AuditMgr auditMgr;
+
+  @GET
+  @Path("/getAuditSchemaFieldsName")
+  @Produces({"application/json"})
+  public String getSolrFieldList(@Context HttpServletRequest request) {
+    return auditMgr.getAuditLogsSchemaFieldsName();
+  }
+
+  @GET
+  @Path("/getAuditLogs")
+  @Produces({"application/json"})
+  public String getAuditLogs(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    return auditMgr.getLogs(searchCriteria);
+  }
+
+  @GET
+  @Path("/getAuditComponents")
+  @Produces({"application/json"})
+  public String getAuditComponents(@Context HttpServletRequest request) {
+
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam("q", request.getParameter("q"));
+    return auditMgr.getAuditComponents(searchCriteria);
+  }
+
+  @GET
+  @Path("/getAuditLineGraphData")
+  @Produces({"application/json"})
+  public String getAuditLineGraphData(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return auditMgr.getAuditLineGraphData(searchCriteria);
+  }
+
+  @GET
+  @Path("/getTopAuditUsers")
+  @Produces({"application/json"})
+  public String getTopAuditUsers(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("field", request.getParameter("field"));
+    return auditMgr.topTenUsers(searchCriteria);
+  }
+
+  @GET
+  @Path("/getTopAuditResources")
+  @Produces({"application/json"})
+  public String getTopAuditResources(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("field", request.getParameter("field"));
+    //return auditMgr.getTopAuditFieldCount(searchCriteria);
+    return auditMgr.topTenResources(searchCriteria);
+
+
+  }
+
+  @GET
+  @Path("/getTopAuditComponents")
+  @Produces({"application/json"})
+  public String getTopAuditComponents(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("field", request.getParameter("field"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return auditMgr.getTopAuditFieldCount(searchCriteria);
+  }
+
+  @GET
+  @Path("/getLiveLogsCount")
+  @Produces({"application/json"})
+  public String getLiveLogsCount() {
+    return auditMgr.getLiveLogCounts();
+  }
+
+  @GET
+  @Path("/getRequestUserLineGraph")
+  @Produces({"application/json"})
+  public String getRequestUserLineGraph(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("field", request.getParameter("field"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return auditMgr.getRequestUserLineGraph(searchCriteria);
+  }
+
+  @GET
+  @Path("/getAnyGraphData")
+  @Produces({"application/json"})
+  public String getAnyGraphData(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam("xAxis", request.getParameter("xAxis"));
+    searchCriteria.addParam("yAxis", request.getParameter("yAxis"));
+    searchCriteria.addParam("stackBy", request.getParameter("stackBy"));
+    searchCriteria.addParam("from", request.getParameter("from"));
+    searchCriteria.addParam("to", request.getParameter("to"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return auditMgr.getAnyGraphData(searchCriteria);
+  }
+
+  @GET
+  @Path("/exportUserTableToTextFile")
+  @Produces({"application/json"})
+  public Response exportUserTableToTextFile(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    searchCriteria.addParam("field", request.getParameter("field"));
+    searchCriteria.addParam("format", request.getParameter("format"));
+    return auditMgr.exportUserTableToTextFile(searchCriteria);
+  }
+
+  @GET
+  @Path("/getServiceLoad")
+  @Produces({"application/json"})
+  public String getServiceLoad(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredAuditLogsParams(request);
+    return auditMgr.getServiceLoad(searchCriteria);
+  }
+
+}
+ 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
new file mode 100644
index 0000000..5f56ccb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/DashboardREST.java
@@ -0,0 +1,309 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.manager.LogsMgr;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.view.VCountList;
+import org.apache.ambari.logsearch.view.VNameValueList;
+import org.apache.ambari.logsearch.view.VNodeList;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Path("dashboard")
+@Component
+@Scope("request")
+public class DashboardREST {
+
+  @Autowired
+  LogsMgr logMgr;
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @GET
+  @Path("/solr/logs_search")
+  @Produces({"application/json"})
+  public String searchSolrData(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("keyword", StringEscapeUtils.unescapeXml(request.getParameter("find")));
+    searchCriteria.addParam("sourceLogId", request.getParameter("sourceLogId"));
+    searchCriteria.addParam("keywordType",
+      request.getParameter("keywordType"));
+    searchCriteria.addParam("token",
+      request.getParameter("token"));
+    return logMgr.searchLogs(searchCriteria);
+  }
+
+  @GET
+  @Path("/hosts")
+  @Produces({"application/json"})
+  public String getHosts(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam("q", request.getParameter("q"));
+    return logMgr.getHosts(searchCriteria);
+  }
+
+  @GET
+  @Path("/components")
+  @Produces({"application/json"})
+  public String getComponents(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam("q", request.getParameter("q"));
+    return logMgr.getComponents(searchCriteria);
+  }
+
+  @GET
+  @Path("/aggregatedData")
+  @Produces({"application/json"})
+  public String getAggregatedInfo(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addRequiredServiceLogsParams(request);
+    return logMgr.getAggregatedInfo(searchCriteria);
+  }
+
+  @GET
+  @Path("/levels_count")
+  @Produces({"application/json"})
+  public VCountList getLogLevelsCount(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addParam("q", request.getParameter("q"));
+    searchCriteria
+      .addParam("startDate", request.getParameter("start_time"));
+    searchCriteria.addParam("endDate", request.getParameter("end_time"));
+    return logMgr.getLogLevelCount(searchCriteria);
+  }
+
+  @GET
+  @Path("/components_count")
+  @Produces({"application/json"})
+  public VCountList getComponentsCount(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addParam("q", request.getParameter("q"));
+    searchCriteria
+      .addParam("startDate", request.getParameter("start_time"));
+    searchCriteria.addParam("endDate", request.getParameter("end_time"));
+    return logMgr.getComponenetsCount(searchCriteria);
+  }
+
+  @GET
+  @Path("/hosts_count")
+  @Produces({"application/json"})
+  public VCountList getHostsCount(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addParam("q", request.getParameter("q"));
+    searchCriteria
+      .addParam("startDate", request.getParameter("start_time"));
+    searchCriteria.addParam("endDate", request.getParameter("end_time"));
+    searchCriteria.addParam("excludeQuery", StringEscapeUtils
+      .unescapeXml(request.getParameter("excludeQuery")));
+    searchCriteria.addParam("includeQuery", StringEscapeUtils
+      .unescapeXml(request.getParameter("includeQuery")));
+    return logMgr.getHostsCount(searchCriteria);
+  }
+
+  @GET
+  @Path("/getTreeExtension")
+  @Produces({"application/json"})
+  public VNodeList getTreeExtension(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("hostName", request.getParameter("hostName"));
+    return logMgr.getTreeExtension(searchCriteria);
+  }
+
+  @GET
+  @Path("/getLogLevelCounts")
+  @Produces({"application/json"})
+  public VNameValueList getLogsLevelCount(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    return logMgr.getLogsLevelCount(searchCriteria);
+  }
+
+  @GET
+  @Path("/getHistogramData")
+  @Produces({"application/json"})
+  public String getHistogramData(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return logMgr.getHistogramData(searchCriteria);
+  }
+
+  @GET
+  @Path("/cancelFindRequest")
+  @Produces({"application/json"})
+  public String cancelFindRequest(@Context HttpServletRequest request) {
+    return logMgr.cancelFindRequestByDate(request);
+  }
+
+  @GET
+  @Path("/exportToTextFile")
+  @Produces({"application/json"})
+  public Response exportToTextFile(@Context HttpServletRequest request) {
+
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    searchCriteria.addParam("format", request.getParameter("format"));
+    searchCriteria.addParam("utcOffset", request.getParameter("utcOffset"));
+    return logMgr.exportToTextFile(searchCriteria);
+
+  }
+
+  @GET
+  @Path("/getHostListByComponent")
+  @Produces({"application/json"})
+  public String getHostListByComponent(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("componentName",
+      request.getParameter("componentName"));
+    return logMgr.getHostListByComponent(searchCriteria);
+  }
+
+  @GET
+  @Path("/getComponentListWithLevelCounts")
+  @Produces({"application/json"})
+  public String getComponentListWithLevelCounts(
+    @Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    return logMgr.getComponentListWithLevelCounts(searchCriteria);
+  }
+
+  @GET
+  @Path("/solr/getBundleIdBoundaryDates")
+  @Produces({"application/json"})
+  public String getExtremeDatesForBundelId(@Context HttpServletRequest request) {
+
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam(LogSearchConstants.BUNDLE_ID,
+      request.getParameter("bundle_id"));
+
+    return logMgr.getExtremeDatesForBundelId(searchCriteria);
+
+  }
+
+  @GET
+  @Path("/getServiceLogsFieldsName")
+  @Produces({"application/json"})
+  public String getServiceLogsFieldsName() {
+    return logMgr.getServiceLogsFieldsName();
+  }
+
+  @GET
+  @Path("/getServiceLogsSchemaFieldsName")
+  @Produces({"application/json"})
+  public String getServiceLogsSchemaFieldsName() {
+    return logMgr.getServiceLogsSchemaFieldsName();
+  }
+
+  @GET
+  @Path("/getCurrentPageOfKeywordSearch")
+  @Produces({"application/json"})
+  public String getCurrentPageOfKeywordSearch(@Context HttpServletRequest request) {
+    String requestDate = (String) request.getParameter("requestDate");
+    return logMgr.getCurrentPageOfKeywordSearch(requestDate);
+  }
+
+  @GET
+  @Path("/getAnyGraphData")
+  @Produces({"application/json"})
+  public String getAnyGraphData(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("xAxis", request.getParameter("xAxis"));
+    searchCriteria.addParam("yAxis", request.getParameter("yAxis"));
+    searchCriteria.addParam("stackBy", request.getParameter("stackBy"));
+    searchCriteria.addParam("from", request.getParameter("from"));
+    searchCriteria.addParam("to", request.getParameter("to"));
+    searchCriteria.addParam("unit", request.getParameter("unit"));
+    return logMgr.getAnyGraphData(searchCriteria);
+  }
+
+  @GET
+  @Path("/getAfterBeforeLogs")
+  @Produces({"application/json"})
+  public String getAfterBeforeLogs(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addRequiredServiceLogsParams(request);
+    searchCriteria.addParam("hostLogFile", request.getParameter("host"));
+    searchCriteria.addParam("compLogFile",
+      request.getParameter("component"));
+    searchCriteria.addParam("id", request.getParameter("id"));
+    searchCriteria.addParam("scrollType",
+      request.getParameter("scrollType"));
+    searchCriteria.addParam("numberRows",
+      request.getParameter("numberRows"));
+    return logMgr.getAfterBeforeLogs(searchCriteria);
+  }
+
+  @GET
+  @Path("/getSuggestoins")
+  @Produces({"application/json"})
+  public String getSuggestions(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addParam("fieldName", request.getParameter("fieldName"));
+    searchCriteria.addParam("valueToSuggest",
+      request.getParameter("valueToSuggest"));
+    return logMgr.getSuggestions(searchCriteria);
+  }
+
+  @GET
+  @Path("/getHadoopServiceConfigJSON")
+  @Produces({"application/json"})
+  public String getHadoopServiceConfigJSON() {
+    return logMgr.getHadoopServiceConfigJSON();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
new file mode 100644
index 0000000..ef1bb8f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/LogFileREST.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.manager.LogFileMgr;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Path("logfile")
+@Component
+@Scope("request")
+public class LogFileREST {
+
+  @Autowired
+  LogFileMgr logFileMgr;
+
+  @GET
+  @Produces({"application/json"})
+  public String searchLogFiles(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam("component", request.getParameter("component"));
+    searchCriteria.addParam("host", request.getParameter("host"));
+    searchCriteria.addParam("logType", request.getParameter("logType"));
+    return logFileMgr.searchLogFiles(searchCriteria);
+  }
+
+  @GET
+  @Path("/getLogFileTail")
+  @Produces({"application/json"})
+  public String getLogFileTail(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria();
+    searchCriteria.addParam("host", request.getParameter("host"));
+    searchCriteria.addParam("component", request.getParameter("component"));
+    searchCriteria.addParam("name", request.getParameter("name"));
+    searchCriteria.addParam("tailSize", request.getParameter("tailSize"));
+    return logFileMgr.getLogFileTail(searchCriteria);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
new file mode 100644
index 0000000..7977703
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/PublicREST.java
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.rest;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.apache.ambari.logsearch.manager.PublicMgr;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Path("public")
+@Component
+@Scope("request")
+public class PublicREST {
+
+  @Autowired
+  PublicMgr generalMgr;
+
+  @GET
+  @Path("/getGeneralConfig")
+  public String getGeneralConfig() {
+    return generalMgr.getGeneralConfig();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
new file mode 100644
index 0000000..c459ab7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigREST.java
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.rest;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+
+import org.apache.ambari.logsearch.common.LogSearchConstants;
+import org.apache.ambari.logsearch.common.SearchCriteria;
+import org.apache.ambari.logsearch.manager.UserConfigMgr;
+import org.apache.ambari.logsearch.util.RESTErrorUtil;
+import org.apache.ambari.logsearch.view.VLogfeederFilter;
+import org.apache.ambari.logsearch.view.VLogfeederFilterWrapper;
+import org.apache.ambari.logsearch.view.VUserConfig;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Component;
+
+@Path("userconfig")
+@Component
+@Scope("request")
+public class UserConfigREST {
+
+  @Autowired
+  RESTErrorUtil restErrorUtil;
+
+  @Autowired
+  UserConfigMgr userConfigMgr;
+
+  @POST
+  @Path("/saveUserConfig")
+  @Produces({"application/json"})
+  public String saveUserConfig(VUserConfig vhist) {
+    return userConfigMgr.saveUserConfig(vhist);
+  }
+
+  @PUT
+  @Path("/updateUserConfig")
+  @Produces({"application/json"})
+  public String updateUserConfig(VUserConfig vhist) {
+    return userConfigMgr.updateUserConfig(vhist);
+  }
+
+  @DELETE
+  @Path("/deleteUserConfig/{id}")
+  public void deleteUserConfig(@PathParam("id") String id) {
+    userConfigMgr.deleteUserConfig(id);
+  }
+
+  @GET
+  @Path("/getUserConfig")
+  @Produces({"application/json"})
+  public String getUserConfig(@Context HttpServletRequest request) {
+    SearchCriteria searchCriteria = new SearchCriteria(request);
+    searchCriteria.addParam(LogSearchConstants.USER_NAME,
+      request.getParameter("userId"));
+    searchCriteria.addParam(LogSearchConstants.FILTER_NAME,
+      request.getParameter("filterName"));
+    searchCriteria.addParam(LogSearchConstants.ROW_TYPE,
+      request.getParameter("rowType"));
+    return userConfigMgr.getUserConfig(searchCriteria);
+  }
+
+  @GET
+  @Path("/user_filter")
+  @Produces({"application/json"})
+  public String getUserFilter(@Context HttpServletRequest request) {
+    return userConfigMgr.getUserFilter();
+  }
+
+  @POST
+  @Path("/user_filter")
+  @Produces({"application/json"})
+  public String createUserFilter(String json) {
+    return userConfigMgr.saveUserFiter(json);
+  }
+
+  @PUT
+  @Path("/user_filter/{id}")
+  @Produces({"application/json"})
+  public String updateUserFilter(String json) {
+    return userConfigMgr.saveUserFiter(json);
+  }
+
+  @GET
+  @Path("/getAllUserName")
+  @Produces({"application/json"})
+  public String getAllUserName() {
+    return userConfigMgr.getAllUserName();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchContextHolder.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchContextHolder.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchContextHolder.java
new file mode 100644
index 0000000..fb23cde
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchContextHolder.java
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.security.context;
+
+public class LogsearchContextHolder {
+
+  private static final ThreadLocal<LogsearchSecurityContext> securityContextThreadLocal = new ThreadLocal<LogsearchSecurityContext>();
+
+  private LogsearchContextHolder() {
+
+  }
+
+  public static LogsearchSecurityContext getSecurityContext() {
+    return securityContextThreadLocal.get();
+  }
+
+  public static void setSecurityContext(LogsearchSecurityContext context) {
+    securityContextThreadLocal.set(context);
+  }
+
+  public static void resetSecurityContext() {
+    securityContextThreadLocal.remove();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchSecurityContext.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchSecurityContext.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchSecurityContext.java
new file mode 100644
index 0000000..4a79525
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/security/context/LogsearchSecurityContext.java
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.security.context;
+
+import java.io.Serializable;
+
+import org.apache.ambari.logsearch.common.RequestContext;
+import org.apache.ambari.logsearch.common.UserSessionInfo;
+
+
+public class LogsearchSecurityContext implements Serializable{
+    private static final long serialVersionUID = 1L;
+    private UserSessionInfo userSession;
+    private RequestContext requestContext;
+
+    public UserSessionInfo getUserSession() {
+        return userSession;
+    }
+
+    public void setUserSession(UserSessionInfo userSession) {
+        this.userSession = userSession;
+    }
+
+    /**
+     * @return the requestContext
+     */
+    public RequestContext getRequestContext() {
+        return requestContext;
+    }
+
+    /**
+     * @param requestContext the requestContext to set
+     */
+    public void setRequestContext(RequestContext requestContext) {
+        this.requestContext = requestContext;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/service/UserService.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/service/UserService.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/service/UserService.java
new file mode 100644
index 0000000..4b2b918
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/service/UserService.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.service;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.stereotype.Service;
+import org.apache.ambari.logsearch.dao.UserDao;
+import org.apache.ambari.logsearch.web.model.User;
+import org.apache.log4j.Logger;
+
+
+@Service
+public class UserService implements UserDetailsService {
+  private static final Logger logger = Logger.getLogger(UserService.class);
+
+  @Autowired
+  private UserDao userDao;
+
+  @Override
+  public User loadUserByUsername(final String username) throws UsernameNotFoundException {
+    logger.debug(userDao + " loadUserByUsername " + username);
+    return userDao.loadUserByUsername(username);
+  }
+
+}


[46/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/configuration/Configuration.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/configuration/Configuration.java
new file mode 100644
index 0000000..a0380e1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/timeline/configuration/Configuration.java
@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+
+package org.apache.hadoop.metrics2.sink.timeline.configuration;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class Configuration {
+  public final Log LOG = LogFactory.getLog(this.getClass());
+  private final Properties properties;
+
+  public Configuration(String configFile) {
+    properties = new Properties();
+
+    //Get property file stream from classpath
+    InputStream inputStream = Configuration.class.getResourceAsStream(configFile);
+
+    if (inputStream == null) {
+      throw new IllegalArgumentException(configFile + " not found in classpath");
+    }
+
+    // load the properties
+    try {
+      properties.load(inputStream);
+      inputStream.close();
+    } catch (FileNotFoundException fnf) {
+      LOG.info("No configuration file " + configFile + " found in classpath.", fnf);
+    } catch (IOException ie) {
+      throw new IllegalArgumentException("Can't read configuration file " +
+          configFile, ie);
+    }
+  }
+
+  public String getProperty(String key) {
+    return properties.getProperty(key);
+  }
+
+  public String getProperty(String key, String defaultValue) {
+    return properties.getProperty(key, defaultValue);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/util/Servers.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/util/Servers.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/util/Servers.java
new file mode 100644
index 0000000..b3dc46f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/hadoop/metrics2/sink/util/Servers.java
@@ -0,0 +1,106 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.metrics2.sink.util;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Helpers to handle server addresses
+ */
+public class Servers {
+  /**
+   * This class is not intended to be instantiated
+   */
+  private Servers() {}
+
+  /**
+   * Parses a space and/or comma separated sequence of server specifications
+   * of the form <i>hostname</i> or <i>hostname:port</i>.  If
+   * the specs string is null, defaults to localhost:defaultPort.
+   *
+   * @param specs   server specs (see description)
+   * @param defaultPort the default port if not specified
+   * @return a list of InetSocketAddress objects.
+   */
+  public static List<InetSocketAddress> parse(String specs, int defaultPort) {
+    List<InetSocketAddress> result = new ArrayList<InetSocketAddress>();
+    if (specs == null) {
+      result.add(new InetSocketAddress("localhost", defaultPort));
+    } else {
+      String[] specStrings = specs.split("[ ,]+");
+      for (String specString : specStrings) {
+        result.add(createSocketAddr(specString, defaultPort));
+      }
+    }
+    return result;
+  }
+
+  /**
+   * @param host
+   * @param port
+   * @return a InetSocketAddress created with the specified host and port
+   */
+  private static InetSocketAddress createSocketAddr(String target, int defaultPort) {
+    String helpText = "";
+    if (target == null) {
+      throw new IllegalArgumentException("Target address cannot be null." + helpText);
+    }
+    boolean hasScheme = target.contains("://");
+    URI uri = null;
+    try {
+      uri = hasScheme ? URI.create(target) : URI.create("dummyscheme://" + target);
+    } catch (IllegalArgumentException e) {
+      throw new IllegalArgumentException("Does not contain a valid host:port authority: " + target + helpText);
+    }
+
+    String host = uri.getHost();
+    int port = uri.getPort();
+    if (port == -1) {
+      port = defaultPort;
+    }
+    String path = uri.getPath();
+
+    if ((host == null) || (port < 0) || (!hasScheme && path != null && !path.isEmpty())) {
+      throw new IllegalArgumentException("Does not contain a valid host:port authority: " + target + helpText);
+    }
+    return createSocketAddrForHost(host, port);
+  }
+
+  /**
+   * @param host
+   * @param port
+   * @return a InetSocketAddress created with the specified host and port
+   */
+  private static InetSocketAddress createSocketAddrForHost(String host, int port) {
+    InetSocketAddress addr;
+    try {
+      InetAddress iaddr = InetAddress.getByName(host);
+      iaddr = InetAddress.getByAddress(host, iaddr.getAddress());
+      addr = new InetSocketAddress(iaddr, port);
+    } catch (UnknownHostException e) {
+      addr = InetSocketAddress.createUnresolved(host, port);
+    }
+    return addr;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/control
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/control b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/control
new file mode 100644
index 0000000..40cd855
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/control
@@ -0,0 +1,22 @@
+# 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
+Package: [[artifactId]]
+Version: [[package-version]]-[[package-release]]
+Section: [[deb.section]]
+Priority: [[deb.priority]]
+Depends: [[deb.dependency.list]]
+Architecture: [[deb.architecture]]
+Description: [[description]]
+Maintainer: [[deb.publisher]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postinst b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postrm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postrm b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postrm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/postrm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/preinst
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/preinst b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/preinst
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/preinst
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/prerm
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/prerm b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/prerm
new file mode 100644
index 0000000..21a01fa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/package/deb/control/prerm
@@ -0,0 +1,15 @@
+#!/bin/bash
+# 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

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
new file mode 100644
index 0000000..d8a239a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/alias_config.json
@@ -0,0 +1,42 @@
+{
+	"input": {
+		"file": {
+			"klass": "org.apache.ambari.logfeeder.input.InputFile"
+		}
+
+	},
+	"filter": {
+		"json": {
+			"klass": "org.apache.ambari.logfeeder.filter.JSONFilterCode"
+		},
+		"keyvalue": {
+			"klass": "org.apache.ambari.logfeeder.filter.FilterKeyValue"
+		},
+		"grok": {
+			"klass": "org.apache.ambari.logfeeder.filter.FilterGrok"
+		}
+	},
+	  
+	 "mapper": {
+		"map_date": {
+			"klass": "org.apache.ambari.logfeeder.mapper.MapperDate"
+		},
+		"map_fieldname": {
+			"klass": "org.apache.ambari.logfeeder.mapper.MapperFieldName"
+		},
+		"map_fieldvalue": {
+			"klass": "org.apache.ambari.logfeeder.mapper.MapperFieldValue"
+		}
+	},
+	  "output": {
+		"solr": {
+			"klass": "org.apache.ambari.logfeeder.output.OutputSolr"
+		},
+		"file": {
+			"klass": "org.apache.ambari.logfeeder.output.OutputFile"
+		},
+		"kafka": {
+			"klass": "org.apache.ambari.logfeeder.output.OutputKafka"
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/config.json.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/config.json.j2
new file mode 100644
index 0000000..163ee2b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/config.json.j2
@@ -0,0 +1,995 @@
+{#
+ # 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.
+ #}
+{
+	"global":{
+		"add_fields":{
+			"cluster":"{{cluster_name}}"
+		},
+		"source":"file",
+		"tail":"true",
+		"gen_event_md5":"true",
+		"start_position":"beginning"
+	},
+	"input":[
+		{
+			"type":"accumulo_gc",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/gc_*.log"
+		},
+		{
+			"type":"accumulo_master",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/master_*.log"
+		},
+		{
+			"type":"accumulo_monitor",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/monitor_*.log"
+		},
+		{
+			"type":"accumulo_tracer",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/tracer_*.log"
+		},
+		{
+			"type":"accumulo_tserver",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/tserver_*.log"
+		},
+		{
+			"type":"atlas_app",
+			"rowtype":"service",
+			"path":"{{atlas_log_dir}}/application.log"
+		},
+		{
+			"type":"ambari_agent",
+			"rowtype":"service",
+			"path":"{{ambari_agent_log_dir}}/ambari-agent.log"
+		},
+		{
+			"type":"ambari_server",
+			"rowtype":"service",
+			"path":"{{ambari_server_log_dir}}/ambari-server.log"
+		},
+		{
+			"type":"ams_hbase_master",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/hbase-ams-master-*.log"
+		},
+		{
+			"type":"ams_hbase_regionserver",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/hbase-ams-regionserver-*.log"
+		},
+		{
+			"type":"ams_collector",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/ambari-metrics-collector.log"
+		},
+		{
+			"type":"falcon_app",
+			"rowtype":"service",
+			"path":"{{falcon_log_dir}}/falcon.application.log"
+		},
+		{
+			"type":"hbase_master",
+			"rowtype":"service",
+			"path":"{{hbase_log_dir}}/hbase-hbase-master-*.log"
+		},
+		{
+			"type":"hbase_regionserver",
+			"rowtype":"service",
+			"path":"{{hbase_log_dir}}/hbase-hbase-regionserver-*.log"
+		},
+		{
+			"type":"hdfs_datanode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-datanode-*.log"
+		},
+		{
+			"type":"hdfs_namenode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-namenode-*.log"
+		},
+		{
+			"type":"hdfs_journalnode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-journalnode-*.log"
+		},
+		{
+			"type":"hdfs_secondarynamenode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-secondarynamenode-*.log"
+		},
+		{
+			"type":"hdfs_zkfc",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-zkfc-*.log"
+		},
+		{
+			"type":"hive_hiveserver2",
+			"rowtype":"service",
+			"path":"{{hive_log_dir}}/hiveserver2.log"
+		},
+		{
+			"type":"hive_metastore",
+			"rowtype":"service",
+			"path":"{{hive_log_dir}}/hivemetastore.log"
+		},
+		{
+			"type":"kafka_controller",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/controller.log"
+		},
+		{
+			"type":"kafka_request",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/kafka-request.log"
+		},
+		{
+			"type":"kafka_logcleaner",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/log-cleaner.log"
+		},
+		{
+			"type":"kafka_server",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/server.log"
+		},
+		{
+			"type":"kafka_statechange",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/state-change.log"
+		},
+		{
+			"type":"knox_gateway",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/gateway.log"
+		},
+		{
+			"type":"knox_cli",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/knoxcli.log"
+		},
+		{
+			"type":"knox_ldap",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/ldap.log"
+		},
+		{
+			"type":"mapred_historyserver",
+			"rowtype":"service",
+			"path":"{{mapred_log_dir_prefix}}/mapred/mapred-mapred-historyserver*.log"
+		},
+		{
+			"type":"logsearch_app",
+			"rowtype":"service",
+			"path":"{{logsearch_log_dir}}/logsearch.log"
+		},
+		{
+			"type":"logsearch_feeder",
+			"rowtype":"service",
+			"path":"{{logfeeder_log_dir}}/logfeeder.log"
+		},
+		{
+			"type":"logsearch_perf",
+			"rowtype":"service",
+			"path":"{{logsearch_log_dir}}/logsearch-performance.log"
+		},
+		{
+			"type":"ranger_admin",
+			"rowtype":"service",
+			"path":"{{ranger_admin_log_dir}}/xa_portal.log"
+		},
+		{
+			"type":"ranger_dbpatch",
+			"is_enabled":"true",
+			"path":"{{ranger_admin_log_dir}}/ranger_db_patch.log"
+		},
+		{
+			"type":"ranger_kms",
+			"rowtype":"service",
+			"path":"{{ranger_kms_log_dir}}/kms.log"
+		},
+		{
+			"type":"ranger_usersync",
+			"rowtype":"service",
+			"path":"{{ranger_usersync_log_dir}}/usersync.log"
+		},
+		{
+			"type":"oozie_app",
+			"rowtype":"service",
+			"path":"{{oozie_log_dir}}/oozie.log"
+		},
+		{
+			"type":"yarn_nodemanager",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-nodemanager-*.log"
+		},
+		{
+			"type":"yarn_resourcemanager",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-resourcemanager-*.log"
+		},
+		{
+			"type":"yarn_timelineserver",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-timelineserver-*.log"
+		},
+		{
+			"type":"yarn_historyserver",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-historyserver-*.log"
+		},
+		{
+			"type":"yarn_jobsummary",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/hadoop-mapreduce.jobsummary.log"
+		},
+		{
+			"type":"storm_drpc",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/drpc.log"
+		},
+		{
+			"type":"storm_logviewer",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/logviewer.log"
+		},
+		{
+			"type":"storm_nimbus",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/nimbus.log"
+		},
+		{
+			"type":"storm_supervisor",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/supervisor.log"
+		},
+		{
+			"type":"storm_ui",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/ui.log"
+		},
+		{
+			"type":"storm_worker",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/*worker*.log"
+		},
+		{
+			"type":"zookeeper",
+			"rowtype":"service",
+			"path":"{{zk_log_dir}}/zookeeper/zookeeper*.out"
+		},
+		{
+			"type":"hdfs_audit",
+			"rowtype":"audit",
+			"is_enabled":"true",
+			"add_fields":{
+				"logType":"HDFSAudit",
+				"enforcer":"hadoop-acl",
+				"repoType":"1",
+				"repo":"hdfs"
+			},
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hdfs-audit.log"
+		}
+		
+	],
+	"filter":[
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"accumulo_master"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"comment":"This one has one extra space after LEVEL",
+			"conditions":{
+				"fields":{
+					"type":[
+						"accumulo_gc",
+						"accumulo_monitor",
+						"accumulo_tracer",
+						"accumulo_tserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"atlas_app",
+						"falcon_app"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ams_collector"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %p %c: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ams_hbase_master",
+						"ams_hbase_regionserver",
+						"hbase_master",
+						"hbase_regionserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ambari_agent"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"",
+			"multiline_pattern":"^(%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime} %{JAVAFILE:file}:%{INT:line_number} - %{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				},
+				"level":{
+					"map_fieldvalue":{
+						"pre_value":"WARNING",
+						"post_value":"WARN"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ambari_server"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{DATE} %5p [%t] %c{1}:%L - %m%n",
+			"multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+			"message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"dd MMM yyyy HH:mm:ss"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_datanode",
+						"hdfs_journalnode",
+						"hdfs_secondarynamenode",
+						"hdfs_namenode",
+						"hdfs_zkfc",
+						"knox_gateway",
+						"knox_cli",
+						"knox_ldap",
+						"mapred_historyserver",
+						"yarn_historyserver",
+						"yarn_jobsummary",
+						"yarn_nodemanager",
+						"yarn_resourcemanager",
+						"yarn_timelineserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hive_hiveserver2",
+						"hive_metastore"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p [%t]: %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]:%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"kafka_controller",
+						"kafka_request",
+						"kafka_logcleaner"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"[%d] %p %m (%c)%n",
+			"multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+			"message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"comment":"Suppose to be same log4j pattern as other kafka processes, but some reason thread is not printed",
+			"conditions":{
+				"fields":{
+					"type":[
+						"kafka_server",
+						"kafka_statechange"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"[%d] %p %m (%c)%n",
+			"multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+			"message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"oozie_app"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{DATA:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"logsearch_app",
+						"logsearch_feeder",
+						"logsearch_perf",
+						"ranger_admin",
+						"ranger_dbpatch"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ranger_kms"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{1} - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ranger_usersync"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n",
+			"multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+			"message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"dd MMM yyyy HH:mm:ss"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"storm_drpc",
+						"storm_logviewer",
+						"storm_nimbus",
+						"storm_supervisor",
+						"storm_ui",
+						"storm_worker"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{LOGLEVEL:level}\\]%{SPACE}%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss.SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"zookeeper"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}-%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\@%{INT:line_number}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:evtTime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:evtTime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"evtTime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"keyvalue",
+			"sort_order":1,
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"source_field":"log_message",
+			"value_split":"=",
+			"field_split":"\t",
+			"post_map_values":{
+				"src":{
+					"map_fieldname":{
+						"new_fieldname":"resource"
+					}
+					
+				},
+				"ip":{
+					"map_fieldname":{
+						"new_fieldname":"cliIP"
+					}
+					
+				},
+				"allowed":[
+					{
+						"map_fieldvalue":{
+							"pre_value":"true",
+							"post_value":"1"
+						}
+						
+					},
+					{
+						"map_fieldvalue":{
+							"pre_value":"false",
+							"post_value":"0"
+						}
+						
+					},
+					{
+						"map_fieldname":{
+							"new_fieldname":"result"
+						}
+						
+					}
+					
+				],
+				"cmd":{
+					"map_fieldname":{
+						"new_fieldname":"action"
+					}
+					
+				},
+				"proto":{
+					"map_fieldname":{
+						"new_fieldname":"cliType"
+					}
+					
+				},
+				"callerContext":{
+					"map_fieldname":{
+						"new_fieldname":"req_caller_id"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"sort_order":2,
+			"source_field":"ugi",
+			"remove_source_field":"false",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"message_pattern":"%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+			"post_map_values":{
+				"user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"x_user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"p_user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"k_user":{
+					"map_fieldname":{
+						"new_fieldname":"proxyUsers"
+					}
+					
+				},
+				"p_authType":{
+					"map_fieldname":{
+						"new_fieldname":"authType"
+					}
+					
+				},
+				"k_authType":{
+					"map_fieldname":{
+						"new_fieldname":"proxyAuthType"
+					}
+					
+				}
+				
+			}
+			
+		}
+		
+	],
+	"output":[
+		{
+			"is_enabled":"{{solr_service_logs_enable}}",
+			"comment":"Output to solr for service logs",
+			"destination":"solr",
+			"zk_hosts":"{{zookeeper_quorum}}{{solr_znode}}",
+			"collection":"{{solr_collection_service_logs}}",
+			"number_of_shards": "{{logsearch_numshards}}",
+			"splits_interval_mins": "{{service_logs_collection_splits_interval_mins}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"service"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"comment":"Output to solr for audit records",
+			"is_enabled":"{{solr_audit_logs_enable}}",
+			"destination":"solr",
+			"zk_hosts":"{{zookeeper_quorum}}{{solr_znode}}",
+			"collection":"{{solr_collection_audit_logs}}",
+			"number_of_shards": "{{logsearch_numshards}}",
+			"splits_interval_mins": "{{audit_logs_collection_splits_interval_mins}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"audit"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"is_enabled":"{{kafka_service_logs_enable}}",
+			"destination":"kafka",
+			"broker_list":"{{kafka_broker_list}}",
+			"topic":"{{kafka_topic_service_logs}}",
+			"kafka.security.protocol":"{{kafka_security_protocol}}",
+			"kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"service"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"is_enabled":"{{kafka_topic_service_logs}}",
+			"destination":"kafka",
+			"broker_list":"{{kafka_broker_list}}",
+			"topic":"{{kafka_topic_audit_logs}}",
+			"kafka.security.protocol":"{{kafka_security_protocol}}",
+			"kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"audit"
+					]
+					
+				}
+				
+			}
+			
+		}
+		
+	]
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/filters.config.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/filters.config.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/filters.config.json
new file mode 100644
index 0000000..9493c6c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/filters.config.json
@@ -0,0 +1,626 @@
+{
+	"filter":[
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"accumulo_master"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"comment":"This one has one extra space after LEVEL",
+			"conditions":{
+				"fields":{
+					"type":[
+						"accumulo_gc",
+						"accumulo_monitor",
+						"accumulo_tracer",
+						"accumulo_tserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} [%-8c{2}] %-5p: %X{application} %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{JAVACLASS:logger_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"atlas_app",
+						"falcon_app"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d %-5p - [%t:%x] ~ %m (%c{1}:%L)%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{SPACE}-%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}~%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ams_collector"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %p %c: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ams_hbase_master",
+						"ams_hbase_regionserver",
+						"hbase_master",
+						"hbase_regionserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p [%t] %c{2}: %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ambari_agent"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"",
+			"multiline_pattern":"^(%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{LOGLEVEL:level} %{TIMESTAMP_ISO8601:logtime} %{JAVAFILE:file}:%{INT:line_number} - %{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				},
+				"level":{
+					"map_fieldvalue":{
+						"pre_value":"WARNING",
+						"post_value":"WARN"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ambari_server"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{DATE} %5p [%t] %c{1}:%L - %m%n",
+			"multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+			"message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{JAVACLASS:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"dd MMM yyyy HH:mm:ss"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_datanode",
+						"hdfs_journalnode",
+						"hdfs_secondarynamenode",
+						"hdfs_namenode",
+						"hdfs_zkfc",
+						"knox_gateway",
+						"knox_cli",
+						"knox_ldap",
+						"mapred_historyserver",
+						"yarn_historyserver",
+						"yarn_jobsummary",
+						"yarn_nodemanager",
+						"yarn_resourcemanager",
+						"yarn_timelineserver"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hive_hiveserver2",
+						"hive_metastore"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p [%t]: %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]:%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"kafka_controller",
+						"kafka_request",
+						"kafka_logcleaner"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"[%d] %p %m (%c)%n",
+			"multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+			"message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"comment":"Suppose to be same log4j pattern as other kafka processes, but some reason thread is not printed",
+			"conditions":{
+				"fields":{
+					"type":[
+						"kafka_server",
+						"kafka_statechange"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"[%d] %p %m (%c)%n",
+			"multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+			"message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"oozie_app"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{DATA:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"logsearch_app",
+						"logsearch_feeder",
+					    	"logsearch_perf",
+						"ranger_admin",
+						"ranger_dbpatch"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ranger_kms"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{1} - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"ranger_usersync"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n",
+			"multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+			"message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"dd MMM yyyy HH:mm:ss"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"storm_drpc",
+						"storm_logviewer",
+						"storm_nimbus",
+						"storm_supervisor",
+						"storm_ui",
+						"storm_worker"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{LOGLEVEL:level}\\]%{SPACE}%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss.SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"zookeeper"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}-%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\@%{INT:line_number}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"logtime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+			"multiline_pattern":"^(%{TIMESTAMP_ISO8601:evtTime})",
+			"message_pattern":"(?m)^%{TIMESTAMP_ISO8601:evtTime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}:%{SPACE}%{GREEDYDATA:log_message}",
+			"post_map_values":{
+				"evtTime":{
+					"map_date":{
+						"date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"keyvalue",
+			"sort_order":1,
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"source_field":"log_message",
+			"value_split":"=",
+			"field_split":"\t",
+			"post_map_values":{
+				"src":{
+					"map_fieldname":{
+						"new_fieldname":"resource"
+					}
+					
+				},
+				"ip":{
+					"map_fieldname":{
+						"new_fieldname":"cliIP"
+					}
+					
+				},
+				"allowed":[
+					{
+						"map_fieldvalue":{
+							"pre_value":"true",
+							"post_value":"1"
+						}
+						
+					},
+					{
+						"map_fieldvalue":{
+							"pre_value":"false",
+							"post_value":"0"
+						}
+						
+					},
+					{
+						"map_fieldname":{
+							"new_fieldname":"result"
+						}
+						
+					}
+					
+				],
+				"cmd":{
+					"map_fieldname":{
+						"new_fieldname":"action"
+					}
+					
+				},
+				"proto":{
+					"map_fieldname":{
+						"new_fieldname":"cliType"
+					}
+					
+				},
+				"callerContext":{
+					"map_fieldname":{
+						"new_fieldname":"req_caller_id"
+					}
+					
+				}
+				
+			}
+			
+		},
+		{
+			"filter":"grok",
+			"sort_order":2,
+			"source_field":"ugi",
+			"remove_source_field":"false",
+			"conditions":{
+				"fields":{
+					"type":[
+						"hdfs_audit"
+					]
+					
+				}
+				
+			},
+			"message_pattern":"%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+			"post_map_values":{
+				"user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"x_user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"p_user":{
+					"map_fieldname":{
+						"new_fieldname":"reqUser"
+					}
+					
+				},
+				"k_user":{
+					"map_fieldname":{
+						"new_fieldname":"proxyUsers"
+					}
+					
+				},
+				"p_authType":{
+					"map_fieldname":{
+						"new_fieldname":"authType"
+					}
+					
+				},
+				"k_authType":{
+					"map_fieldname":{
+						"new_fieldname":"proxyAuthType"
+					}
+					
+				}
+				
+			}
+			
+		}
+		
+	]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/global.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/global.config.json.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/global.config.json.j2
new file mode 100644
index 0000000..cd51118
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/global.config.json.j2
@@ -0,0 +1,28 @@
+{#
+ # 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.
+ #}
+{
+	"global":{
+		"add_fields":{
+			"cluster":"{{cluster_name}}"
+		},
+		"source":"file",
+		"tail":"true",
+		"gen_event_md5":"true",
+		"start_position":"beginning"
+	}	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/grok-patterns
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/grok-patterns b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/grok-patterns
new file mode 100644
index 0000000..d25a78b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/grok-patterns
@@ -0,0 +1,145 @@
+# 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.
+
+#Updated JAVACLASS to be same as JAVAFILE. Because if class doesn't have package, then it doesn't work.
+JAVACLASS (?:[A-Za-z$0-9_. -]+)
+#JAVACLASS (?:[a-zA-Z$_][a-zA-Z$_0-9]*\.)*[a-zA-Z$_][a-zA-Z$_0-9]*
+#JAVACLASS (?:[a-zA-Z0-9-]+\.)+[A-Za-z0-9$]+
+
+#Space is an allowed character to match special cases like 'Native Method' or 'Unknown Source'
+JAVAFILE (?:[A-Za-z0-9_. -]+)
+#Allow special <init> or <clinit> method
+JAVAMETHOD (?:(<init>)|(<clinit>)|[a-zA-Z$_][a-zA-Z$_0-9]*)
+#Line number is optional in special cases 'Native method' or 'Unknown source'
+JAVASTACKTRACEPART %{SPACE}at %{JAVACLASS:class}\.%{JAVAMETHOD:method}\(%{JAVAFILE:file}(?::%{NUMBER:line})?\)
+# Java Logs
+JAVATHREAD (?:[A-Z]{2}-Processor[\d]+)
+
+JAVASTACKTRACEPART at %{JAVACLASS:class}\.%{WORD:method}\(%{JAVAFILE:file}:%{NUMBER:line}\)
+JAVALOGMESSAGE (.*)
+# MMM dd, yyyy HH:mm:ss eg: Jan 9, 2014 7:13:13 AM
+CATALINA_DATESTAMP %{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM)
+# yyyy-MM-dd HH:mm:ss,SSS ZZZ eg: 2014-01-09 17:32:25,527 -0800
+TOMCAT_DATESTAMP 20%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) %{ISO8601_TIMEZONE}
+CATALINALOG %{CATALINA_DATESTAMP:timestamp} %{JAVACLASS:class} %{JAVALOGMESSAGE:logmessage}
+# 2014-01-09 20:03:28,269 -0800 | ERROR | com.example.service.ExampleService - something compeletely unexpected happened...
+TOMCATLOG %{TOMCAT_DATESTAMP:timestamp} \| %{LOGLEVEL:level} \| %{JAVACLASS:class} - %{JAVALOGMESSAGE:logmessage}
+
+USERNAME [a-zA-Z0-9._-]+
+USER %{USERNAME}
+EMAILLOCALPART [a-zA-Z][a-zA-Z0-9_.+-=:]+
+EMAILADDRESS %{EMAILLOCALPART}@%{HOSTNAME}
+HTTPDUSER %{EMAILADDRESS}|%{USER}
+INT (?:[+-]?(?:[0-9]+))
+BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)))
+NUMBER (?:%{BASE10NUM})
+BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+))
+BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b
+
+POSINT \b(?:[1-9][0-9]*)\b
+NONNEGINT \b(?:[0-9]+)\b
+WORD \b\w+\b
+NOTSPACE \S+
+SPACE \s*
+DATA .*?
+GREEDYDATA .*
+QUOTEDSTRING (?>(?<!\\)(?>"(?>\\.|[^\\"]+)+"|""|(?>'(?>\\.|[^\\']+)+')|''|(?>`(?>\\.|[^\\`]+)+`)|``))
+UUID [A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}
+
+# Networking
+MAC (?:%{CISCOMAC}|%{WINDOWSMAC}|%{COMMONMAC})
+CISCOMAC (?:(?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4})
+WINDOWSMAC (?:(?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2})
+COMMONMAC (?:(?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2})
+IPV6 ((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5
 ]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?
+IPV4 (?<![0-9])(?:(?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])[.](?:[0-1]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]))(?![0-9])
+IP (?:%{IPV6}|%{IPV4})
+HOSTNAME \b(?:[0-9A-Za-z][0-9A-Za-z-]{0,62})(?:\.(?:[0-9A-Za-z][0-9A-Za-z-]{0,62}))*(\.?|\b)
+IPORHOST (?:%{IP}|%{HOSTNAME})
+HOSTPORT %{IPORHOST}:%{POSINT}
+
+# paths
+PATH (?:%{UNIXPATH}|%{WINPATH})
+UNIXPATH (/([\w_%!$@:.,~-]+|\\.)*)+
+TTY (?:/dev/(pts|tty([pq])?)(\w+)?/?(?:[0-9]+))
+WINPATH (?>[A-Za-z]+:|\\)(?:\\[^\\?*]*)+
+URIPROTO [A-Za-z]+(\+[A-Za-z+]+)?
+URIHOST %{IPORHOST}(?::%{POSINT:port})?
+# uripath comes loosely from RFC1738, but mostly from what Firefox
+# doesn't turn into %XX
+URIPATH (?:/[A-Za-z0-9$.+!*'(){},~:;=@#%_\-]*)+
+#URIPARAM \?(?:[A-Za-z0-9]+(?:=(?:[^&]*))?(?:&(?:[A-Za-z0-9]+(?:=(?:[^&]*))?)?)*)?
+URIPARAM \?[A-Za-z0-9$.+!*'|(){},~@#%&/=:;_?\-\[\]<>]*
+URIPATHPARAM %{URIPATH}(?:%{URIPARAM})?
+URI %{URIPROTO}://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})?
+
+# Months: January, Feb, 3, 03, 12, December
+MONTH \b(?:Jan(?:uary|uar)?|Feb(?:ruary|ruar)?|M(?:a|ä)?r(?:ch|z)?|Apr(?:il)?|Ma(?:y|i)?|Jun(?:e|i)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|O(?:c|k)?t(?:ober)?|Nov(?:ember)?|De(?:c|z)(?:ember)?)\b
+MONTHNUM (?:0?[1-9]|1[0-2])
+MONTHNUM2 (?:0[1-9]|1[0-2])
+MONTHDAY (?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9])
+
+# Days: Monday, Tue, Thu, etc...
+DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)
+
+# Years?
+YEAR (?>\d\d){1,2}
+HOUR (?:2[0123]|[01]?[0-9])
+MINUTE (?:[0-5][0-9])
+# '60' is a leap second in most time standards and thus is valid.
+SECOND (?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?)
+TIME (?!<[0-9])%{HOUR}:%{MINUTE}(?::%{SECOND})(?![0-9])
+# datestamp is YYYY/MM/DD-HH:MM:SS.UUUU (or something like it)
+DATE_US %{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR}
+DATE_EU %{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR}
+ISO8601_TIMEZONE (?:Z|[+-]%{HOUR}(?::?%{MINUTE}))
+ISO8601_SECOND (?:%{SECOND}|60)
+TIMESTAMP_ISO8601 %{YEAR}-%{MONTHNUM}-%{MONTHDAY}[T ]%{HOUR}:?%{MINUTE}(?::?%{SECOND})?%{ISO8601_TIMEZONE}?
+DATE %{DATE_US}|%{DATE_EU}
+DATESTAMP %{DATE}[- ]%{TIME}
+TZ (?:[PMCE][SD]T|UTC)
+DATESTAMP_RFC822 %{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ}
+DATESTAMP_RFC2822 %{DAY}, %{MONTHDAY} %{MONTH} %{YEAR} %{TIME} %{ISO8601_TIMEZONE}
+DATESTAMP_OTHER %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{TZ} %{YEAR}
+DATESTAMP_EVENTLOG %{YEAR}%{MONTHNUM2}%{MONTHDAY}%{HOUR}%{MINUTE}%{SECOND}
+HTTPDERROR_DATE %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}
+
+# Syslog Dates: Month Day HH:MM:SS
+SYSLOGTIMESTAMP %{MONTH} +%{MONTHDAY} %{TIME}
+PROG [\x21-\x5a\x5c\x5e-\x7e]+
+SYSLOGPROG %{PROG:program}(?:\[%{POSINT:pid}\])?
+SYSLOGHOST %{IPORHOST}
+SYSLOGFACILITY <%{NONNEGINT:facility}.%{NONNEGINT:priority}>
+HTTPDATE %{MONTHDAY}/%{MONTH}/%{YEAR}:%{TIME} %{INT}
+
+# Shortcuts
+QS %{QUOTEDSTRING}
+
+# Log formats
+SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}:
+COMMONAPACHELOG %{IPORHOST:clientip} %{HTTPDUSER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-)
+COMBINEDAPACHELOG %{COMMONAPACHELOG} %{QS:referrer} %{QS:agent}
+HTTPD20_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IPORHOST:clientip}\] ){0,1}%{GREEDYDATA:errormsg}
+HTTPD24_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{WORD:module}:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}:tid %{NUMBER:tid}\]( \(%{POSINT:proxy_errorcode}\)%{DATA:proxy_errormessage}:)?( \[client %{IPORHOST:client}:%{POSINT:clientport}\])? %{DATA:errorcode}: %{GREEDYDATA:message}
+HTTPD_ERRORLOG %{HTTPD20_ERRORLOG}|%{HTTPD24_ERRORLOG}
+
+
+# Log Levels
+LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo|INFO|[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
+
+
+# Custom
+USER_SYNC_DATE %{MONTHDAY} %{MONTH} %{YEAR} %{TIME}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/input.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/input.config.json.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/input.config.json.j2
new file mode 100644
index 0000000..bc48503
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/input.config.json.j2
@@ -0,0 +1,284 @@
+{#
+ # 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.
+ #}
+{
+	"input":[
+		{
+			"type":"accumulo_gc",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/gc_*.log"
+		},
+		{
+			"type":"accumulo_master",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/master_*.log"
+		},
+		{
+			"type":"accumulo_monitor",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/monitor_*.log"
+		},
+		{
+			"type":"accumulo_tracer",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/tracer_*.log"
+		},
+		{
+			"type":"accumulo_tserver",
+			"rowtype":"service",
+			"path":"{{accumulo_log_dir}}/tserver_*.log"
+		},
+		{
+			"type":"atlas_app",
+			"rowtype":"service",
+			"path":"{{atlas_log_dir}}/application.log"
+		},
+		{
+			"type":"ambari_agent",
+			"rowtype":"service",
+			"path":"{{ambari_agent_log_dir}}/ambari-agent.log"
+		},
+		{
+			"type":"ambari_server",
+			"rowtype":"service",
+			"path":"{{ambari_server_log_dir}}/ambari-server.log"
+		},
+		{
+			"type":"ams_hbase_master",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/hbase-ams-master-*.log"
+		},
+		{
+			"type":"ams_hbase_regionserver",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/hbase-ams-regionserver-*.log"
+		},
+		{
+			"type":"ams_collector",
+			"rowtype":"service",
+			"path":"{{metrics_collector_log_dir}}/ambari-metrics-collector.log"
+		},
+		{
+			"type":"falcon_app",
+			"rowtype":"service",
+			"path":"{{falcon_log_dir}}/falcon.application.log"
+		},
+		{
+			"type":"hbase_master",
+			"rowtype":"service",
+			"path":"{{hbase_log_dir}}/hbase-hbase-master-*.log"
+		},
+		{
+			"type":"hbase_regionserver",
+			"rowtype":"service",
+			"path":"{{hbase_log_dir}}/hbase-hbase-regionserver-*.log"
+		},
+		{
+			"type":"hdfs_datanode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-datanode-*.log"
+		},
+		{
+			"type":"hdfs_namenode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-namenode-*.log"
+		},
+		{
+			"type":"hdfs_journalnode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-journalnode-*.log"
+		},
+		{
+			"type":"hdfs_secondarynamenode",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-secondarynamenode-*.log"
+		},
+		{
+			"type":"hdfs_zkfc",
+			"rowtype":"service",
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hadoop-hdfs-zkfc-*.log"
+		},
+		{
+			"type":"hive_hiveserver2",
+			"rowtype":"service",
+			"path":"{{hive_log_dir}}/hiveserver2.log"
+		},
+		{
+			"type":"hive_metastore",
+			"rowtype":"service",
+			"path":"{{hive_log_dir}}/hivemetastore.log"
+		},
+		{
+			"type":"kafka_controller",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/controller.log"
+		},
+		{
+			"type":"kafka_request",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/kafka-request.log"
+		},
+		{
+			"type":"kafka_logcleaner",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/log-cleaner.log"
+		},
+		{
+			"type":"kafka_server",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/server.log"
+		},
+		{
+			"type":"kafka_statechange",
+			"rowtype":"service",
+			"path":"{{kafka_log_dir}}/state-change.log"
+		},
+		{
+			"type":"knox_gateway",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/gateway.log"
+		},
+		{
+			"type":"knox_cli",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/knoxcli.log"
+		},
+		{
+			"type":"knox_ldap",
+			"rowtype":"service",
+			"path":"{{knox_log_dir}}/ldap.log"
+		},
+		{
+			"type":"mapred_historyserver",
+			"rowtype":"service",
+			"path":"{{mapred_log_dir_prefix}}/mapred/mapred-mapred-historyserver*.log"
+		},
+		{
+			"type":"logsearch_app",
+			"rowtype":"service",
+			"path":"{{logsearch_log_dir}}/logsearch.log"
+		},
+		{
+			"type":"logsearch_feeder",
+			"rowtype":"service",
+			"path":"{{logfeeder_log_dir}}/logfeeder.log"
+		},
+		{
+			"type":"logsearch_perf",
+			"rowtype":"service",
+			"path":"{{logsearch_log_dir}}/logsearch-performance.log"
+		},
+		{
+			"type":"ranger_admin",
+			"rowtype":"service",
+			"path":"{{ranger_admin_log_dir}}/xa_portal.log"
+		},
+		{
+			"type":"ranger_dbpatch",
+			"is_enabled":"true",
+			"path":"{{ranger_admin_log_dir}}/ranger_db_patch.log"
+		},
+		{
+			"type":"ranger_kms",
+			"rowtype":"service",
+			"path":"{{ranger_kms_log_dir}}/kms.log"
+		},
+		{
+			"type":"ranger_usersync",
+			"rowtype":"service",
+			"path":"{{ranger_usersync_log_dir}}/usersync.log"
+		},
+		{
+			"type":"oozie_app",
+			"rowtype":"service",
+			"path":"{{oozie_log_dir}}/oozie.log"
+		},
+		{
+			"type":"yarn_nodemanager",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-nodemanager-*.log"
+		},
+		{
+			"type":"yarn_resourcemanager",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-resourcemanager-*.log"
+		},
+		{
+			"type":"yarn_timelineserver",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-timelineserver-*.log"
+		},
+		{
+			"type":"yarn_historyserver",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-historyserver-*.log"
+		},
+		{
+			"type":"yarn_jobsummary",
+			"rowtype":"service",
+			"path":"{{yarn_log_dir_prefix}}/yarn/hadoop-mapreduce.jobsummary.log"
+		},
+		{
+			"type":"storm_drpc",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/drpc.log"
+		},
+		{
+			"type":"storm_logviewer",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/logviewer.log"
+		},
+		{
+			"type":"storm_nimbus",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/nimbus.log"
+		},
+		{
+			"type":"storm_supervisor",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/supervisor.log"
+		},
+		{
+			"type":"storm_ui",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/ui.log"
+		},
+		{
+			"type":"storm_worker",
+			"rowtype":"service",
+			"path":"{{storm_log_dir}}/*worker*.log"
+		},
+		{
+			"type":"zookeeper",
+			"rowtype":"service",
+			"path":"{{zk_log_dir}}/zookeeper/zookeeper*.out"
+		},
+		{
+			"type":"hdfs_audit",
+			"rowtype":"audit",
+			"is_enabled":"true",
+			"add_fields":{
+				"logType":"HDFSAudit",
+				"enforcer":"hadoop-acl",
+				"repoType":"1",
+				"repo":"hdfs"
+			},
+			"path":"{{hdfs_log_dir_prefix}}/hdfs/hdfs-audit.log"
+		}
+		
+	]	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
new file mode 100644
index 0000000..0717477
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  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.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+  <appender name="console" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+      <!-- <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/> -->
+    </layout>
+  </appender>
+
+  <appender name="daily_rolling_file" class="org.apache.log4j.DailyRollingFileAppender"> 
+    <param name="file" value="logs/logsearch-logfeeder.log" /> 
+    <param name="datePattern"  value="'.'yyyy-MM-dd" /> 
+    <param name="append" value="true" /> 
+    <layout class="org.apache.log4j.PatternLayout"> 
+      <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/> 
+    </layout> 
+  </appender> 
+
+  <!-- Logs to suppress BEGIN -->
+  <category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
+    <priority value="error" />
+    <appender-ref ref="rolling_file" />
+  </category>
+
+  <category name="apache.solr.client.solrj.impl.CloudSolrClient" additivity="false">
+    <priority value="fatal" />
+    <appender-ref ref="rolling_file" />
+  </category>
+  <!-- Logs to suppress END -->
+
+  <category name="org.apache.ambari.logfeeder" additivity="false">
+    <priority value="info" />
+    <appender-ref ref="console" /> 
+    <!-- <appender-ref ref="daily_rolling_file" /> -->
+  </category>
+
+  <root>
+    <priority value="warn" />
+    <!-- <appender-ref ref="console" /> -->
+    <!-- <appender-ref ref="daily_rolling_file" /> -->
+  </root>
+ 
+</log4j:configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml.j2
new file mode 100644
index 0000000..4338ee3
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/log4j.xml.j2
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  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.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+  <appender name="console" class="org.apache.log4j.ConsoleAppender">
+    <param name="Target" value="System.out" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+      <!-- <param name="ConversionPattern" value="%d [%t] %-5p %c %x - %m%n"/> -->
+    </layout>
+  </appender>
+
+  <appender name="rolling_file" class="org.apache.log4j.RollingFileAppender">
+    <param name="file" value="{{logfeeder_log_dir}}/logfeeder.log" />
+    <param name="append" value="true" />
+    <layout class="org.apache.log4j.PatternLayout">
+      <param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n"/>
+    </layout>
+  </appender>
+
+  <!-- Logs to suppress BEGIN -->
+  <category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
+    <priority value="error" />
+    <appender-ref ref="rolling_file" />
+  </category>
+
+  <category name="apache.solr.client.solrj.impl.CloudSolrClient" additivity="false">
+    <priority value="fatal" />
+    <appender-ref ref="rolling_file" />
+  </category>
+
+  <!-- Logs to suppress END -->
+
+  <category name="org.apache.ambari.logfeeder" additivity="false">
+    <priority value="{{logfeeder_log_level}}" />
+    <appender-ref ref="rolling_file" />
+  </category>
+
+  <root>
+    <level value="warn" />
+    <!-- <appender-ref ref="console" /> -->
+    <appender-ref ref="rolling_file" />
+  </root>
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/logfeeder.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/logfeeder.properties b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/logfeeder.properties
new file mode 100644
index 0000000..22f3b78
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/logfeeder.properties
@@ -0,0 +1,25 @@
+# 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.
+
+logfeeder.checkpoint.folder=
+metrics.collector.hosts=
+
+#filter config
+logfeeder.solr.url=
+logfeeder.solr.zkhosts=
+logfeeder.solr.core.history=history
+logfeeder.log.filter.enable=true
+#Internal to fetch filter config from solr in sec
+logfeeder.solr.config.internal=5
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/output.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/output.config.json.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/output.config.json.j2
new file mode 100644
index 0000000..d0aea47
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/resources/output.config.json.j2
@@ -0,0 +1,97 @@
+{#
+ # 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.
+ #}
+{
+	"output":[
+		{
+			"is_enabled":"{{solr_service_logs_enable}}",
+			"comment":"Output to solr for service logs",
+			"destination":"solr",
+			"zk_hosts":"{{zookeeper_quorum}}{{solr_znode}}",
+			"collection":"{{solr_collection_service_logs}}",
+			"number_of_shards": "{{logsearch_numshards}}",
+			"splits_interval_mins": "{{service_logs_collection_splits_interval_mins}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"service"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"comment":"Output to solr for audit records",
+			"is_enabled":"{{solr_audit_logs_enable}}",
+			"destination":"solr",
+			"zk_hosts":"{{zookeeper_quorum}}{{solr_znode}}",
+			"collection":"{{solr_collection_audit_logs}}",
+			"number_of_shards": "{{logsearch_numshards}}",
+			"splits_interval_mins": "{{audit_logs_collection_splits_interval_mins}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"audit"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"is_enabled":"{{kafka_service_logs_enable}}",
+			"destination":"kafka",
+			"broker_list":"{{kafka_broker_list}}",
+			"topic":"{{kafka_topic_service_logs}}",
+			"kafka.security.protocol":"{{kafka_security_protocol}}",
+			"kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"service"
+					]
+					
+				}
+				
+			}
+			
+		},
+		{
+			"is_enabled":"{{kafka_topic_service_logs}}",
+			"destination":"kafka",
+			"broker_list":"{{kafka_broker_list}}",
+			"topic":"{{kafka_topic_audit_logs}}",
+			"kafka.security.protocol":"{{kafka_security_protocol}}",
+			"kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+			"conditions":{
+				"fields":{
+					"rowtype":[
+						"audit"
+					]
+					
+				}
+				
+			}
+			
+		}
+		
+	]
+	
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh
new file mode 100644
index 0000000..1e7185a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+# 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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+foreground=0
+if [ "$1" = "-foreground" ]; then
+    foreground=1
+    shift
+fi
+
+if [ ! -z "$LOGFEEDER_INCLUDE" ]; then
+   source $LOGFEEDER_INCLUDE
+fi
+
+JAVA=java
+if [ -x $JAVA_HOME/bin/java ]; then
+    JAVA=$JAVA_HOME/bin/java
+fi
+
+if [ "$LOGFEEDER_JAVA_MEM" = "" ]; then
+    LOGFEEDER_JAVA_MEM="-Xmx512m"
+fi
+
+if [ "$LOGFILE" = "" ]; then
+    LOGFILE="/var/log/logfeeder/logfeeder.out"
+fi
+
+if [ "$PID_FILE" = "" ]; then
+    LOGFEEDER_PID_DIR=$HOME
+    PID_FILE=$LOGFEEDER_PID_DIR/logsearch-logfeeder-$USER.pid
+fi
+
+if [ "$LOGFEEDER_CONF_DIR" = "" ]; then
+    LOGFEEDER_CONF_DIR="/etc/logfeeder/conf"
+fi
+
+LOGFEEDER_GC_LOGFILE=`dirname $LOGFILE`/logfeeder_gc.log
+LOGFEEDER_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOGFEEDER_GC_LOGFILE"
+
+#LOGFEEDER_JAVA_OPTS=
+#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=2098"
+
+if [ $foreground -eq 0 ]; then
+    if [ -f ${PID_FILE} ]; then
+	PID=`cat ${PID_FILE}`
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logfeeder already running (${PID}) killing..."
+	    kill $PID 2>/dev/null
+	    sleep 5
+	    if kill -0 $PID 2>/dev/null; then
+		echo "logfeeder still running. Will kill process forcefully in another 10 seconds..."
+		sleep 10
+		kill -9 $PID 2>/dev/null
+		sleep 2
+	    fi
+	fi
+
+	if kill -0 $PID 2>/dev/null; then
+	    echo "ERROR: Even after all efforts to stop logfeeder, it is still running. pid=$PID. Please manually kill the service and try again."
+	    exit 1
+	fi
+    fi
+
+    echo "Starting logfeeder. Output file=$LOGFILE pid_file=$PID_FILE"
+    #LOGFEEDER_CLI_CLASSPATH=
+    #set -x
+    nohup $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:$LOGFEEDER_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_GC_OPTS $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $* > $LOGFILE 2>&1 &
+    echo $! > $PID_FILE
+else
+    $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:$LOGFEEDER_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $*
+fi
+


[32/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/User.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/User.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/User.java
new file mode 100644
index 0000000..2bd0ed2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/model/User.java
@@ -0,0 +1,167 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.model;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+public class User implements UserDetails {
+  private static final long serialVersionUID = 1L;
+
+  private String username;
+  private String password;
+  private String email;
+  private String firstName;
+  private String lastName;
+
+  /* Spring Security fields*/
+  private List<GrantedAuthority> authorities;
+  private boolean accountNonExpired = true;
+  private boolean accountNonLocked = true;
+  private boolean credentialsNonExpired = true;
+  private boolean enabled = true;
+
+  public User(String userName2, String userPassword, List<GrantedAuthority> grantedAuths) {
+    this.username = userName2;
+    this.password = userPassword;
+    this.authorities = grantedAuths;
+
+  }
+
+  public User() {
+    // TODO Auto-generated constructor stub
+  }
+
+  @Override
+  public String getUsername() {
+    return username;
+  }
+
+  public void setUsername(String username) {
+    this.username = username;
+  }
+
+  @Override
+  public String getPassword() {
+    return password;
+  }
+
+  public void setPassword(String password) {
+    this.password = password;
+  }
+
+  public String getFirstName() {
+    return firstName;
+  }
+
+  public void setFirstName(String firstName) {
+    this.firstName = firstName;
+  }
+
+  public String getLastName() {
+    return lastName;
+  }
+
+  public void setLastName(String lastName) {
+    this.lastName = lastName;
+  }
+
+  public String getEmail() {
+    return email;
+  }
+
+  public void setEmail(String email) {
+    this.email = email;
+  }
+
+  @Override
+  public Collection<? extends GrantedAuthority> getAuthorities() {
+    return this.authorities;
+  }
+
+  public void setAuthorities(List<GrantedAuthority> authorities) {
+    this.authorities = authorities;
+  }
+
+
+  @Override
+  public boolean isAccountNonExpired() {
+    return this.accountNonExpired;
+  }
+
+  public void setAccountNonExpired(boolean accountNonExpired) {
+    this.accountNonExpired = accountNonExpired;
+  }
+
+  @Override
+  public boolean isAccountNonLocked() {
+    return this.accountNonLocked;
+  }
+
+  public void setAccountNonLocked(boolean accountNonLocked) {
+    this.accountNonLocked = accountNonLocked;
+  }
+
+  @Override
+  public boolean isCredentialsNonExpired() {
+    return this.credentialsNonExpired;
+  }
+
+  public void setCredentialsNonExpired(boolean credentialsNonExpired) {
+    this.credentialsNonExpired = credentialsNonExpired;
+  }
+
+  @Override
+  public boolean isEnabled() {
+    return this.enabled;
+  }
+
+  public void setEnabled(boolean enabled) {
+    this.enabled = enabled;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("User [username=");
+    builder.append(username);
+    builder.append(", email=");
+    builder.append(email);
+    builder.append(", firstName=");
+    builder.append(firstName);
+    builder.append(", lastName=");
+    builder.append(lastName);
+    builder.append(", authorities=");
+    builder.append(authorities);
+    builder.append(", accountNonExpired=");
+    builder.append(accountNonExpired);
+    builder.append(", accountNonLocked=");
+    builder.append(accountNonLocked);
+    builder.append(", credentialsNonExpired=");
+    builder.append(credentialsNonExpired);
+    builder.append(", enabled=");
+    builder.append(enabled);
+    builder.append("]");
+    return builder.toString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapProperties.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapProperties.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapProperties.java
new file mode 100644
index 0000000..2a1b4ee
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapProperties.java
@@ -0,0 +1,365 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import org.apache.commons.lang.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Describes LDAP Server connection parameters
+ */
+public class LdapProperties {
+  private String primaryUrl;
+  private String secondaryUrl;
+  private boolean useSsl;
+  private boolean anonymousBind;
+  private String managerDn;
+  private String managerPassword;
+  private String baseDN;
+  private String dnAttribute;
+  private String referralMethod;
+
+  // LDAP group properties
+  private String groupBase;
+  private String groupObjectClass;
+  private String groupMembershipAttr;
+  private String groupNamingAttr;
+  private String adminGroupMappingRules;
+  private boolean groupMappingEnabled;
+
+  // LDAP user properties
+  private String userBase;
+  private String userObjectClass;
+  private String usernameAttribute;
+  private String userSearchBase = "";
+
+  private String groupSearchFilter;
+  private static final String userSearchFilter = "({attribute}={0})";
+
+  public List<String> getLdapUrls() {
+    String protocol = useSsl ? "ldaps://" : "ldap://";
+
+    if (StringUtils.isEmpty(primaryUrl) || primaryUrl.equalsIgnoreCase("none")) {
+      return Collections.emptyList();
+    } else {
+      List<String> list = new ArrayList<String>();
+      list.add(protocol + primaryUrl);
+      if (!StringUtils.isEmpty(secondaryUrl)) {
+        list.add(protocol + secondaryUrl);
+      }
+      return list;
+    }
+  }
+
+  public String getPrimaryUrl() {
+    return primaryUrl;
+  }
+
+  public void setPrimaryUrl(String primaryUrl) {
+    this.primaryUrl = primaryUrl;
+  }
+
+  public String getSecondaryUrl() {
+    return secondaryUrl;
+  }
+
+  public void setSecondaryUrl(String secondaryUrl) {
+    this.secondaryUrl = secondaryUrl;
+  }
+
+  public boolean isUseSsl() {
+    return useSsl;
+  }
+
+  public void setUseSsl(boolean useSsl) {
+    this.useSsl = useSsl;
+  }
+
+  public boolean isAnonymousBind() {
+    return anonymousBind;
+  }
+
+  public void setAnonymousBind(boolean anonymousBind) {
+    this.anonymousBind = anonymousBind;
+  }
+
+  public String getManagerDn() {
+    return managerDn;
+  }
+
+  public void setManagerDn(String managerDn) {
+    this.managerDn = managerDn;
+  }
+
+  public String getManagerPassword() {
+    return managerPassword;
+  }
+
+  public void setManagerPassword(String managerPassword) {
+    this.managerPassword = managerPassword;
+  }
+
+  public String getBaseDN() {
+    return baseDN;
+  }
+
+  public void setBaseDN(String baseDN) {
+    this.baseDN = baseDN;
+  }
+
+  public String getUserSearchBase() {
+    return userSearchBase;
+  }
+
+  public void setUserSearchBase(String userSearchBase) {
+    this.userSearchBase = userSearchBase;
+  }
+
+  public String getUserSearchFilter() {
+    return userSearchFilter.replace("{attribute}", usernameAttribute);
+  }
+
+  public String getUsernameAttribute() {
+    return usernameAttribute;
+  }
+
+  public void setUsernameAttribute(String usernameAttribute) {
+    this.usernameAttribute = usernameAttribute;
+  }
+
+  public String getGroupBase() {
+    return groupBase;
+  }
+
+  public void setGroupBase(String groupBase) {
+    this.groupBase = groupBase;
+  }
+
+  public String getGroupObjectClass() {
+    return groupObjectClass;
+  }
+
+  public void setGroupObjectClass(String groupObjectClass) {
+    this.groupObjectClass = groupObjectClass;
+  }
+
+  public String getGroupMembershipAttr() {
+    return groupMembershipAttr;
+  }
+
+  public void setGroupMembershipAttr(String groupMembershipAttr) {
+    this.groupMembershipAttr = groupMembershipAttr;
+  }
+
+  public String getGroupNamingAttr() {
+    return groupNamingAttr;
+  }
+
+  public void setGroupNamingAttr(String groupNamingAttr) {
+    this.groupNamingAttr = groupNamingAttr;
+  }
+
+  public String getAdminGroupMappingRules() {
+    return adminGroupMappingRules;
+  }
+
+  public void setAdminGroupMappingRules(String adminGroupMappingRules) {
+    this.adminGroupMappingRules = adminGroupMappingRules;
+  }
+
+  public String getGroupSearchFilter() {
+    return groupSearchFilter;
+  }
+
+  public void setGroupSearchFilter(String groupSearchFilter) {
+    this.groupSearchFilter = groupSearchFilter;
+  }
+
+  public boolean isGroupMappingEnabled() {
+    return groupMappingEnabled;
+  }
+
+  public void setGroupMappingEnabled(boolean groupMappingEnabled) {
+    this.groupMappingEnabled = groupMappingEnabled;
+  }
+
+  public void setUserBase(String userBase) {
+    this.userBase = userBase;
+  }
+
+  public void setUserObjectClass(String userObjectClass) {
+    this.userObjectClass = userObjectClass;
+  }
+
+  public String getUserBase() {
+    return userBase;
+  }
+
+  public String getUserObjectClass() {
+    return userObjectClass;
+  }
+
+  public String getDnAttribute() {
+    return dnAttribute;
+  }
+
+  public void setDnAttribute(String dnAttribute) {
+    this.dnAttribute = dnAttribute;
+  }
+
+  public void setReferralMethod(String referralMethod) {
+    this.referralMethod = referralMethod;
+  }
+
+  public String getReferralMethod() {
+    return referralMethod;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+      return true;
+    if (obj == null || getClass() != obj.getClass())
+      return false;
+
+    LdapProperties that = (LdapProperties) obj;
+
+    if (primaryUrl != null ? !primaryUrl.equals(that.primaryUrl)
+      : that.primaryUrl != null)
+      return false;
+    if (secondaryUrl != null ? !secondaryUrl.equals(that.secondaryUrl)
+      : that.secondaryUrl != null)
+      return false;
+    if (useSsl != that.useSsl)
+      return false;
+    if (anonymousBind != that.anonymousBind)
+      return false;
+    if (managerDn != null ? !managerDn.equals(that.managerDn)
+      : that.managerDn != null)
+      return false;
+    if (managerPassword != null ? !managerPassword
+      .equals(that.managerPassword) : that.managerPassword != null)
+      return false;
+    if (baseDN != null ? !baseDN.equals(that.baseDN) : that.baseDN != null)
+      return false;
+    if (userBase != null ? !userBase.equals(that.userBase)
+      : that.userBase != null)
+      return false;
+    if (userObjectClass != null ? !userObjectClass
+      .equals(that.userObjectClass) : that.userObjectClass != null)
+      return false;
+    if (usernameAttribute != null ? !usernameAttribute
+      .equals(that.usernameAttribute)
+      : that.usernameAttribute != null)
+      return false;
+    if (groupBase != null ? !groupBase.equals(that.groupBase)
+      : that.groupBase != null)
+      return false;
+    if (groupObjectClass != null ? !groupObjectClass
+      .equals(that.groupObjectClass) : that.groupObjectClass != null)
+      return false;
+    if (groupMembershipAttr != null ? !groupMembershipAttr
+      .equals(that.groupMembershipAttr)
+      : that.groupMembershipAttr != null)
+      return false;
+    if (groupNamingAttr != null ? !groupNamingAttr
+      .equals(that.groupNamingAttr) : that.groupNamingAttr != null)
+      return false;
+    if (adminGroupMappingRules != null ? !adminGroupMappingRules
+      .equals(that.adminGroupMappingRules)
+      : that.adminGroupMappingRules != null)
+      return false;
+    if (groupSearchFilter != null ? !groupSearchFilter
+      .equals(that.groupSearchFilter)
+      : that.groupSearchFilter != null)
+      return false;
+    if (dnAttribute != null ? !dnAttribute.equals(that.dnAttribute)
+      : that.dnAttribute != null)
+      return false;
+    if (referralMethod != null ? !referralMethod
+      .equals(that.referralMethod) : that.referralMethod != null)
+      return false;
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int result = primaryUrl != null ? primaryUrl.hashCode() : 0;
+    result = 31 * result
+      + (secondaryUrl != null ? secondaryUrl.hashCode() : 0);
+    result = 31 * result + (useSsl ? 1 : 0);
+    result = 31 * result + (anonymousBind ? 1 : 0);
+    result = 31 * result + (managerDn != null ? managerDn.hashCode() : 0);
+    result = 31 * result
+      + (managerPassword != null ? managerPassword.hashCode() : 0);
+    result = 31 * result + (baseDN != null ? baseDN.hashCode() : 0);
+    result = 31 * result + (userBase != null ? userBase.hashCode() : 0);
+    result = 31 * result
+      + (userObjectClass != null ? userObjectClass.hashCode() : 0);
+    result = 31
+      * result
+      + (usernameAttribute != null ? usernameAttribute.hashCode() : 0);
+    result = 31 * result + (groupBase != null ? groupBase.hashCode() : 0);
+    result = 31 * result
+      + (groupObjectClass != null ? groupObjectClass.hashCode() : 0);
+    result = 31
+      * result
+      + (groupMembershipAttr != null ? groupMembershipAttr.hashCode()
+      : 0);
+    result = 31 * result
+      + (groupNamingAttr != null ? groupNamingAttr.hashCode() : 0);
+    result = 31
+      * result
+      + (adminGroupMappingRules != null ? adminGroupMappingRules
+      .hashCode() : 0);
+    result = 31
+      * result
+      + (groupSearchFilter != null ? groupSearchFilter.hashCode() : 0);
+    result = 31 * result
+      + (dnAttribute != null ? dnAttribute.hashCode() : 0);
+    result = 31 * result
+      + (referralMethod != null ? referralMethod.hashCode() : 0);
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return "LdapProperties [primaryUrl=" + primaryUrl + ", secondaryUrl="
+      + secondaryUrl + ", useSsl=" + useSsl + ", anonymousBind="
+      + anonymousBind + ", managerDn=" + managerDn
+      + ", managerPassword=" + managerPassword == null ? "null"
+      : "****" + ", baseDN=" + baseDN + ", dnAttribute="
+      + dnAttribute + ", referralMethod=" + referralMethod
+      + ", groupBase=" + groupBase + ", groupObjectClass="
+      + groupObjectClass + ", groupMembershipAttr="
+      + groupMembershipAttr + ", groupNamingAttr="
+      + groupNamingAttr + ", adminGroupMappingRules="
+      + adminGroupMappingRules + ", groupMappingEnabled="
+      + groupMappingEnabled + ", userBase=" + userBase
+      + ", userObjectClass=" + userObjectClass
+      + ", usernameAttribute=" + usernameAttribute
+      + ", userSearchBase=" + userSearchBase
+      + ", groupSearchFilter=" + groupSearchFilter + "]";
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapPropertyName.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapPropertyName.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapPropertyName.java
new file mode 100644
index 0000000..370c94b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapPropertyName.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+public class LdapPropertyName {
+
+  public static final String LDAP_USE_SSL_KEY = "authentication.ldap.useSSL";
+  public static final String LDAP_PRIMARY_URL_KEY = "authentication.ldap.primaryUrl";
+  public static final String LDAP_SECONDARY_URL_KEY = "authentication.ldap.secondaryUrl";
+  public static final String LDAP_BASE_DN_KEY = "authentication.ldap.baseDn";
+  public static final String LDAP_BIND_ANONYMOUSLY_KEY = "authentication.ldap.bindAnonymously";
+  public static final String LDAP_MANAGER_DN_KEY = "authentication.ldap.managerDn";
+  public static final String LDAP_MANAGER_PASSWORD_KEY = "authentication.ldap.managerPassword";
+  public static final String LDAP_DN_ATTRIBUTE_KEY = "authentication.ldap.dnAttribute";
+  public static final String LDAP_USERNAME_ATTRIBUTE_KEY = "authentication.ldap.usernameAttribute";
+  public static final String LDAP_USER_BASE_KEY = "authentication.ldap.userBase";
+  public static final String LDAP_USER_OBJECT_CLASS_KEY = "authentication.ldap.userObjectClass";
+  public static final String LDAP_GROUP_BASE_KEY = "authentication.ldap.groupBase";
+  public static final String LDAP_GROUP_OBJECT_CLASS_KEY = "authentication.ldap.groupObjectClass";
+  public static final String LDAP_GROUP_NAMING_ATTR_KEY = "authentication.ldap.groupNamingAttr";
+  public static final String LDAP_GROUP_MEMEBERSHIP_ATTR_KEY = "authentication.ldap.groupMembershipAttr";
+  public static final String LDAP_ADMIN_GROUP_MAPPING_RULES_KEY = "authorization.ldap.adminGroupMappingRules";
+  public static final String LDAP_GROUP_SEARCH_FILTER_KEY = "authorization.ldap.groupSearchFilter";
+  public static final String LDAP_REFERRAL_KEY = "authentication.ldap.referral";
+
+  // default
+  public static final String LDAP_BIND_ANONYMOUSLY_DEFAULT = "true";
+  public static final String LDAP_PRIMARY_URL_DEFAULT = "localhost:389";
+  public static final String LDAP_BASE_DN_DEFAULT = "dc=example,dc=com";
+  public static final String LDAP_USERNAME_ATTRIBUTE_DEFAULT = "uid";
+  public static final String LDAP_DN_ATTRIBUTE_DEFAULT = "dn";
+  public static final String LDAP_USER_BASE_DEFAULT = "ou=people,dc=example,dc=com";
+  public static final String LDAP_USER_OBJECT_CLASS_DEFAULT = "person";
+  public static final String LDAP_GROUP_BASE_DEFAULT = "ou=groups,dc=example,dc=com";
+  public static final String LDAP_GROUP_OBJECT_CLASS_DEFAULT = "group";
+  public static final String LDAP_GROUP_NAMING_ATTR_DEFAULT = "cn";
+  public static final String LDAP_GROUP_MEMBERSHIP_ATTR_DEFAULT = "member";
+  public static final String LDAP_ADMIN_GROUP_MAPPING_RULES_DEFAULT = "Logsearch Administrators";
+  public static final String LDAP_GROUP_SEARCH_FILTER_DEFAULT = "";
+  public static final String LDAP_REFERRAL_DEFAULT = "ignore";
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapUtil.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapUtil.java
new file mode 100644
index 0000000..99940df
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LdapUtil.java
@@ -0,0 +1,115 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.apache.ambari.logsearch.util.XMLPropertiesUtil;
+import org.apache.log4j.Logger;
+import org.springframework.core.io.ClassPathResource;
+
+public class LdapUtil {
+
+  private static Logger logger = Logger.getLogger(LdapUtil.class);
+
+  /**
+   * Gets parameters of LDAP server to connect to
+   *
+   * @return LdapServerProperties object representing connection parameters
+   */
+  public static LdapProperties getLdapServerProperties(Properties properties) {
+    LdapProperties ldapServerProperties = new LdapProperties();
+
+    ldapServerProperties.setPrimaryUrl(properties.getProperty(LdapPropertyName.LDAP_PRIMARY_URL_KEY,
+      LdapPropertyName.LDAP_PRIMARY_URL_DEFAULT));
+    ldapServerProperties.setSecondaryUrl(properties.getProperty(LdapPropertyName.LDAP_SECONDARY_URL_KEY));
+    ldapServerProperties.setUseSsl("true".equalsIgnoreCase(properties
+      .getProperty(LdapPropertyName.LDAP_USE_SSL_KEY)));
+    ldapServerProperties.setAnonymousBind("true".equalsIgnoreCase(properties.getProperty(
+      LdapPropertyName.LDAP_BIND_ANONYMOUSLY_KEY, LdapPropertyName.LDAP_BIND_ANONYMOUSLY_DEFAULT)));
+    ldapServerProperties.setManagerDn(properties.getProperty(LdapPropertyName.LDAP_MANAGER_DN_KEY));
+    String ldapPasswordProperty = properties.getProperty(LdapPropertyName.LDAP_MANAGER_PASSWORD_KEY);
+    // TODO read password from password file
+    ldapServerProperties.setManagerPassword(ldapPasswordProperty);
+    ldapServerProperties.setBaseDN(properties.getProperty(LdapPropertyName.LDAP_BASE_DN_KEY,
+      LdapPropertyName.LDAP_BASE_DN_DEFAULT));
+    ldapServerProperties.setUsernameAttribute(properties.getProperty(LdapPropertyName.LDAP_USERNAME_ATTRIBUTE_KEY,
+      LdapPropertyName.LDAP_USERNAME_ATTRIBUTE_DEFAULT));
+
+    ldapServerProperties.setUserBase(properties.getProperty(LdapPropertyName.LDAP_USER_BASE_KEY,
+      LdapPropertyName.LDAP_USER_BASE_DEFAULT));
+    ldapServerProperties.setUserObjectClass(properties.getProperty(LdapPropertyName.LDAP_USER_OBJECT_CLASS_KEY,
+      LdapPropertyName.LDAP_USER_OBJECT_CLASS_DEFAULT));
+    ldapServerProperties.setDnAttribute(properties.getProperty(LdapPropertyName.LDAP_DN_ATTRIBUTE_KEY,
+      LdapPropertyName.LDAP_DN_ATTRIBUTE_DEFAULT));
+
+    ldapServerProperties.setGroupBase(properties.getProperty(LdapPropertyName.LDAP_GROUP_BASE_KEY,
+      LdapPropertyName.LDAP_GROUP_BASE_DEFAULT));
+    ldapServerProperties.setGroupObjectClass(properties.getProperty(LdapPropertyName.LDAP_GROUP_OBJECT_CLASS_KEY,
+      LdapPropertyName.LDAP_GROUP_OBJECT_CLASS_DEFAULT));
+    ldapServerProperties.setGroupMembershipAttr(properties.getProperty(
+      LdapPropertyName.LDAP_GROUP_MEMEBERSHIP_ATTR_KEY, LdapPropertyName.LDAP_GROUP_MEMBERSHIP_ATTR_DEFAULT));
+    ldapServerProperties.setGroupNamingAttr(properties.getProperty(LdapPropertyName.LDAP_GROUP_NAMING_ATTR_KEY,
+      LdapPropertyName.LDAP_GROUP_NAMING_ATTR_DEFAULT));
+    ldapServerProperties.setAdminGroupMappingRules(properties.getProperty(
+      LdapPropertyName.LDAP_ADMIN_GROUP_MAPPING_RULES_KEY,
+      LdapPropertyName.LDAP_ADMIN_GROUP_MAPPING_RULES_DEFAULT));
+    ldapServerProperties.setGroupSearchFilter(properties.getProperty(LdapPropertyName.LDAP_GROUP_SEARCH_FILTER_KEY,
+      LdapPropertyName.LDAP_GROUP_SEARCH_FILTER_DEFAULT));
+    ldapServerProperties.setReferralMethod(properties.getProperty(LdapPropertyName.LDAP_REFERRAL_KEY,
+      LdapPropertyName.LDAP_REFERRAL_DEFAULT));
+
+    if (properties.containsKey(LdapPropertyName.LDAP_GROUP_BASE_KEY)
+      || properties.containsKey(LdapPropertyName.LDAP_GROUP_OBJECT_CLASS_KEY)
+      || properties.containsKey(LdapPropertyName.LDAP_GROUP_MEMEBERSHIP_ATTR_KEY)
+      || properties.containsKey(LdapPropertyName.LDAP_GROUP_NAMING_ATTR_KEY)
+      || properties.containsKey(LdapPropertyName.LDAP_ADMIN_GROUP_MAPPING_RULES_KEY)
+      || properties.containsKey(LdapPropertyName.LDAP_GROUP_SEARCH_FILTER_KEY)) {
+      ldapServerProperties.setGroupMappingEnabled(true);
+    }
+
+    return ldapServerProperties;
+  }
+
+  /**
+   * @return
+   */
+  public static LdapProperties loadLdapProperties() {
+    LdapProperties ldapServerProperties = null;
+    String ldapConfigFileName = PropertiesUtil.getProperty("logsearch.login.ldap.config", "logsearch-admin-site.xml");
+    Properties props = null;
+    ClassPathResource resource = new ClassPathResource(ldapConfigFileName);
+    if (resource != null) {
+      try {
+        props = new Properties();
+        new XMLPropertiesUtil().loadFromXml(props, resource.getInputStream());
+        ldapServerProperties = getLdapServerProperties(props);
+      } catch (IOException e) {
+        logger.error("Ldap configudation file loading failed : " + e.getMessage());
+      }
+    }
+    if (ldapServerProperties == null) {
+      logger.error("ldapServerProperties object is not created.");
+    }
+    return ldapServerProperties;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
new file mode 100644
index 0000000..cc04821
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAbstractAuthenticationProvider.java
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.ambari.logsearch.util.PropertiesUtil;
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
+
+public abstract class LogsearchAbstractAuthenticationProvider implements AuthenticationProvider {
+
+  private static String AUTH_METHOD_PROP_START_WITH = "logsearch.auth.";
+
+  protected enum AUTH_METHOD {
+    LDAP, FILE, SIMPLE
+  }
+
+  ;
+
+
+  @Override
+  public boolean supports(Class<?> authentication) {
+    return UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication);
+  }
+
+  /**
+   * @param authentication
+   * @return
+   */
+  public Authentication getAuthenticationWithGrantedAuthority(Authentication authentication) {
+    UsernamePasswordAuthenticationToken result = null;
+    if (authentication != null && authentication.isAuthenticated()) {
+      final List<GrantedAuthority> grantedAuths = getAuthorities(authentication.getName().toString());
+      final UserDetails userDetails = new User(authentication.getName().toString(), authentication
+        .getCredentials().toString(), grantedAuths);
+      result = new UsernamePasswordAuthenticationToken(userDetails, authentication.getCredentials(), grantedAuths);
+      result.setDetails(authentication.getDetails());
+      return result;
+    }
+    return authentication;
+  }
+
+  /**
+   * @param username
+   * @return
+   */
+  protected List<GrantedAuthority> getAuthorities(String username) {
+    final List<GrantedAuthority> grantedAuths = new ArrayList<>();
+    grantedAuths.add(new SimpleGrantedAuthority("ROLE_USER"));
+    return grantedAuths;
+  }
+
+  public boolean isEnable(AUTH_METHOD method) {
+    String methodName = method.name().toLowerCase();
+    String property = AUTH_METHOD_PROP_START_WITH + methodName + ".enable";
+    boolean isEnable = PropertiesUtil.getBooleanProperty(property, false);
+    return isEnable;
+  }
+
+  public boolean isEnable() {
+    //default is disabled 
+    return false;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
new file mode 100644
index 0000000..453db61
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchAuthenticationProvider.java
@@ -0,0 +1,141 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import java.util.HashMap;
+
+import org.apache.ambari.logsearch.dao.UserDao;
+import org.apache.ambari.logsearch.util.JSONUtil;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.web.authentication.WebAuthenticationDetails;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogsearchAuthenticationProvider extends
+  LogsearchAbstractAuthenticationProvider {
+  private static final Logger logger = Logger
+    .getLogger(LogsearchAuthenticationProvider.class);
+  private static Logger auditLogger = Logger
+    .getLogger("org.apache.ambari.logsearch.audit");
+
+  @Autowired
+  UserDao userDao;
+
+  @Autowired
+  LogsearchLdapAuthenticationProvider ldapAuthenticationProvider;
+
+  @Autowired
+  LogsearchFileAuthenticationProvider fileAuthenticationProvider;
+
+  @Autowired
+  LogsearchSimpleAuthenticationProvider simpleAuthenticationProvider;
+
+  @Autowired
+  JSONUtil jsonUtil;
+
+  @Autowired
+  private UserDetailsService userService;
+
+  @Override
+  public Authentication authenticate(Authentication authentication)
+    throws AuthenticationException {
+    logger.info("Authenticating user:" + authentication.getName()
+      + ", userDetail=" + authentication.toString());
+    Authentication inAuthentication = authentication;
+    AuthenticationException authException = null;
+    HashMap<String, Object> auditRecord = new HashMap<String, Object>();
+    auditRecord.put("user", authentication.getName());
+    auditRecord.put("principal", authentication.getPrincipal().toString());
+    auditRecord.put("auth_class", authentication.getClass().getName());
+    logger.info("authentication.class="
+      + authentication.getClass().getName());
+    if (inAuthentication instanceof UsernamePasswordAuthenticationToken) {
+      UsernamePasswordAuthenticationToken authClass = (UsernamePasswordAuthenticationToken) inAuthentication;
+      Object details = authClass.getDetails();
+      if (details instanceof WebAuthenticationDetails) {
+        WebAuthenticationDetails webAuthentication = (WebAuthenticationDetails) details;
+        auditRecord.put("remote_ip",
+          webAuthentication.getRemoteAddress());
+        auditRecord.put("session", webAuthentication.getSessionId());
+      }
+    }
+    boolean isSuccess = false;
+    try {
+      for (AUTH_METHOD authMethod : AUTH_METHOD.values()) {
+        try {
+          authentication = doAuth(authentication, authMethod);
+          if (authentication != null
+            && authentication.isAuthenticated()) {
+            logger.info("Authenticated using method="
+              + authMethod.name() + ", user="
+              + authentication.getName());
+            auditRecord.put("result", "allowed");
+            isSuccess = true;
+            auditRecord.put("authType", authMethod.name());
+            return authentication;
+          }
+        } catch (AuthenticationException ex) {
+          if (authException == null) {
+            // Let's save the first one
+            authException = ex;
+          }
+        }
+      }
+      auditRecord.put("result", "denied");
+      logger.warn("Authentication failed for user="
+        + inAuthentication.getName() + ", userDetail="
+        + inAuthentication.toString());
+      if (authException != null) {
+        auditRecord.put("reason", authException.getMessage());
+        throw authException;
+      }
+      return authentication;
+    } finally {
+      String jsonStr = jsonUtil.mapToJSON(auditRecord);
+      if (isSuccess) {
+        auditLogger.info(jsonStr);
+      } else {
+        auditLogger.warn(jsonStr);
+      }
+    }
+  }
+
+  /**
+   * @param authentication
+   * @param authMethod
+   * @return
+   */
+  public Authentication doAuth(Authentication authentication, AUTH_METHOD authMethod) {
+    if (authMethod.equals(AUTH_METHOD.LDAP) && ldapAuthenticationProvider.isEnable()) {
+      authentication = ldapAuthenticationProvider.authenticate(authentication);
+    } else if (authMethod.equals(AUTH_METHOD.FILE) && fileAuthenticationProvider.isEnable()) {
+      authentication = fileAuthenticationProvider.authenticate(authentication);
+    } else if (authMethod.equals(AUTH_METHOD.SIMPLE) && simpleAuthenticationProvider.isEnable()) {
+      authentication = simpleAuthenticationProvider.authenticate(authentication);
+    } else {
+      logger.error("Invalid authentication method :" + authMethod.name());
+    }
+    return authentication;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
new file mode 100644
index 0000000..91cc556
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchFileAuthenticationProvider.java
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import java.util.Collection;
+
+import org.apache.ambari.logsearch.dao.UserDao;
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogsearchFileAuthenticationProvider extends LogsearchAbstractAuthenticationProvider {
+
+  private static Logger logger = Logger.getLogger(LogsearchFileAuthenticationProvider.class);
+
+  @Autowired
+  UserDao userDao;
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Autowired
+  private UserDetailsService userDetailsService;
+
+  @Override
+  public Authentication authenticate(Authentication authentication) throws AuthenticationException {
+    String username = authentication.getName();
+    String password = (String) authentication.getCredentials();
+    if (stringUtil.isEmpty(username)) {
+      throw new BadCredentialsException("Username can't be null or empty.");
+    }
+    if (stringUtil.isEmpty(password)) {
+      throw new BadCredentialsException("Password can't be null or empty.");
+    }
+    // html unescape
+    password = StringEscapeUtils.unescapeHtml(password);
+    username = StringEscapeUtils.unescapeHtml(username);
+
+    UserDetails user = userDetailsService.loadUserByUsername(username);
+    if (user == null) {
+      logger.error("Username not found.");
+      throw new BadCredentialsException("User not found.");
+    }
+    if (password == null || password.isEmpty()) {
+      logger.error("Password can't be null or empty.");
+      throw new BadCredentialsException("Password can't be null or empty.");
+    }
+
+    String encPassword = userDao.encryptPassword(username, password);
+    if (!encPassword.equals(user.getPassword())) {
+      logger.error("Wrong password for user=" + username);
+      throw new BadCredentialsException("Wrong password");
+    }
+    Collection<? extends GrantedAuthority> authorities = user.getAuthorities();
+    authentication = new UsernamePasswordAuthenticationToken(username, encPassword, authorities);
+    return authentication;
+  }
+
+  @Override
+  public boolean isEnable() {
+    return isEnable(AUTH_METHOD.FILE);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
new file mode 100644
index 0000000..9d9f7e4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapAuthenticationProvider.java
@@ -0,0 +1,175 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.springframework.ldap.CommunicationException;
+import org.springframework.ldap.core.support.LdapContextSource;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.security.ldap.authentication.LdapAuthenticationProvider;
+import org.springframework.security.ldap.search.FilterBasedLdapUserSearch;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogsearchLdapAuthenticationProvider extends
+  LogsearchAbstractAuthenticationProvider {
+
+  private static Logger logger = Logger
+    .getLogger(LogsearchLdapAuthenticationProvider.class);
+
+  private static LdapProperties ldapServerProperties = null;
+  private static LdapAuthenticationProvider ldapAuthProvider = null;
+  private String logStatement = "";
+
+  public LogsearchLdapAuthenticationProvider() {
+    logger.debug("Creating object of ldap auth provider ");
+    if (this.isEnable()) {
+      ldapAuthProvider = loadLdapAuthenticationProvider();
+    } else {
+      logger.info("Ldap auth is disabled");
+    }
+  }
+
+  @Override
+  public Authentication authenticate(Authentication authentication)
+    throws AuthenticationException {
+    try {
+      LdapAuthenticationProvider authProvider = loadLdapAuthenticationProvider();
+      if (authProvider != null) {
+        return authProvider.authenticate(authentication);
+      } else {
+        return authentication;
+      }
+    } catch (AuthenticationException e) {
+      logger.info("Got exception during LDAP authentication attempt", e);
+      // Try to help in troubleshooting
+      Throwable cause = e.getCause();
+      if (cause != null) {
+        if ((cause != e)
+          && (cause instanceof org.springframework.ldap.AuthenticationException)) {
+          logger.warn(
+            "Looks like LDAP manager credentials (that are used for "
+              + "connecting to LDAP server) are invalid.",
+            e);
+        }
+      }
+    } catch (CommunicationException e) {
+      logger.error(e);
+    } catch (Exception e) {
+      logger.error(e, e.getCause());
+    }
+    if (authentication != null && !authentication.isAuthenticated()) {
+      logger.warn("Ldap authentication failed. username="
+        + authentication.getName() + ", details="
+        + authentication.getDetails());
+    }
+    return authentication;
+  }
+
+  /**
+   * Reloads LDAP Context Source and depending objects if properties were
+   * changed
+   *
+   * @return corresponding LDAP authentication provider
+   */
+  LdapAuthenticationProvider loadLdapAuthenticationProvider() {
+    if (reloadLdapServerProperties()) {
+      logger.info("LDAP Properties changed - rebuilding Context");
+      LdapContextSource springSecurityContextSource = new LdapContextSource();
+      List<String> ldapUrls = ldapServerProperties.getLdapUrls();
+      logStatement = "ldapUrls=" + ldapUrls;
+      if (ldapUrls == null || ldapUrls.size() == 0) {
+        logger.info("LDAP URL is empty. So won't initialize LDAP provider");
+        return null;
+      }
+
+      springSecurityContextSource.setUrls(ldapUrls
+        .toArray(new String[ldapUrls.size()]));
+      springSecurityContextSource.setBase(ldapServerProperties
+        .getBaseDN());
+      logStatement = logStatement + ", baseDN="
+        + ldapServerProperties.getBaseDN();
+
+      if (!ldapServerProperties.isAnonymousBind()) {
+        springSecurityContextSource.setUserDn(ldapServerProperties
+          .getManagerDn());
+        logStatement = logStatement + ", managerDN="
+          + ldapServerProperties.getManagerDn();
+        springSecurityContextSource.setPassword(ldapServerProperties
+          .getManagerPassword());
+      }
+
+      try {
+        springSecurityContextSource.afterPropertiesSet();
+      } catch (Exception e) {
+        logger.error("LDAP Context Source not loaded ", e);
+        throw new UsernameNotFoundException(
+          "LDAP Context Source not loaded. ldapDetails="
+            + logStatement, e);
+      }
+
+      String userSearchBase = ldapServerProperties.getUserSearchBase();
+      logStatement = logStatement + ", userSearchBase=" + userSearchBase;
+      String userSearchFilter = ldapServerProperties
+        .getUserSearchFilter();
+      logStatement = logStatement + ", userSearchFilter="
+        + userSearchFilter;
+
+      logger.info("LDAP properties=" + logStatement);
+      FilterBasedLdapUserSearch userSearch = new FilterBasedLdapUserSearch(
+        userSearchBase, userSearchFilter,
+        springSecurityContextSource);
+
+      LogsearchLdapBindAuthenticator bindAuthenticator = new LogsearchLdapBindAuthenticator(
+        springSecurityContextSource, ldapServerProperties);
+      bindAuthenticator.setUserSearch(userSearch);
+
+      LdapAuthenticationProvider authenticationProvider = new LdapAuthenticationProvider(
+        bindAuthenticator);
+      ldapAuthProvider = authenticationProvider;
+
+    }
+    return ldapAuthProvider;
+  }
+
+  /**
+   * Reloads LDAP Server properties from configuration
+   *
+   * @return true if properties were reloaded
+   */
+  private boolean reloadLdapServerProperties() {
+    LdapProperties properties = LdapUtil.loadLdapProperties();
+    if (!properties.equals(ldapServerProperties)) {
+      logger.info("Reloading properties");
+      ldapServerProperties = properties;
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public boolean isEnable() {
+    return isEnable(AUTH_METHOD.LDAP);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
new file mode 100644
index 0000000..f9207b1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchLdapBindAuthenticator.java
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import org.apache.log4j.Logger;
+import org.springframework.ldap.core.DirContextOperations;
+import org.springframework.ldap.core.support.BaseLdapPathContextSource;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.ldap.authentication.BindAuthenticator;
+
+public class LogsearchLdapBindAuthenticator extends BindAuthenticator {
+  private static Logger logger = Logger
+    .getLogger(LogsearchLdapBindAuthenticator.class);
+
+  LdapProperties ldapServerProperties;
+
+  public LogsearchLdapBindAuthenticator(
+    BaseLdapPathContextSource contextSource,
+    LdapProperties ldapServerProperties) {
+    super(contextSource);
+    this.ldapServerProperties = ldapServerProperties;
+    logger.info("LDAP properties=" + ldapServerProperties);
+  }
+
+  @Override
+  public DirContextOperations authenticate(Authentication authentication) {
+
+    DirContextOperations user = super.authenticate(authentication);
+
+    return setAmbariAdminAttr(user);
+  }
+
+  /**
+   * Checks whether user is a member of ambari administrators group in LDAP.
+   * If yes, sets user's ambari_admin attribute to true
+   *
+   * @param user
+   * @return
+   */
+  private DirContextOperations setAmbariAdminAttr(DirContextOperations user) {
+    String baseDn = ldapServerProperties.getBaseDN().toLowerCase();
+    String groupBase = ldapServerProperties.getGroupBase().toLowerCase();
+    String groupObjectClass = ldapServerProperties.getGroupObjectClass();
+    String groupMembershipAttr = ldapServerProperties
+      .getGroupMembershipAttr();
+    String adminGroupMappingRules = ldapServerProperties
+      .getAdminGroupMappingRules();
+    final String groupNamingAttribute = ldapServerProperties
+      .getGroupNamingAttr();
+    String groupSearchFilter = ldapServerProperties.getGroupSearchFilter();
+
+    // If groupBase is set incorrectly or isn't set - search in BaseDn
+    int indexOfBaseDn = groupBase.indexOf(baseDn);
+    groupBase = indexOfBaseDn <= 0 ? "" : groupBase.substring(0,
+      indexOfBaseDn - 1);
+
+    StringBuilder filterBuilder = new StringBuilder();
+
+    filterBuilder.append("(&(");
+    filterBuilder.append(groupMembershipAttr);
+    filterBuilder.append("=");
+    filterBuilder.append(user.getNameInNamespace());// DN
+
+    if ((groupSearchFilter == null) || groupSearchFilter.equals("")) {
+      // If groupSearchFilter is not specified, build it from other
+      // authorization
+      // group properties
+      filterBuilder.append(")(objectclass=");
+      filterBuilder.append(groupObjectClass);
+      filterBuilder.append(")(|");
+      String[] adminGroupMappingRegexs = adminGroupMappingRules
+        .split(",");
+      for (String adminGroupMappingRegex : adminGroupMappingRegexs) {
+        filterBuilder.append("(");
+        filterBuilder.append(groupNamingAttribute);
+        filterBuilder.append("=");
+        filterBuilder.append(adminGroupMappingRegex);
+        filterBuilder.append(")");
+      }
+      filterBuilder.append(")");
+    } else {
+      filterBuilder.append(")");
+      filterBuilder.append(groupSearchFilter);
+    }
+    filterBuilder.append(")");
+
+    logger.info("filter=" + filterBuilder);
+    // TODO: Filter is not used anywhere
+    return user;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
new file mode 100644
index 0000000..88e41d2
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/web/security/LogsearchSimpleAuthenticationProvider.java
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logsearch.web.security;
+
+import org.apache.ambari.logsearch.util.StringUtil;
+import org.apache.ambari.logsearch.web.model.User;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LogsearchSimpleAuthenticationProvider extends LogsearchAbstractAuthenticationProvider {
+
+  private static Logger logger = Logger.getLogger(LogsearchSimpleAuthenticationProvider.class);
+
+  @Autowired
+  StringUtil stringUtil;
+
+  @Override
+  public Authentication authenticate(Authentication authentication) throws AuthenticationException {
+    String username = authentication.getName();
+    String password = (String) authentication.getCredentials();
+    username = StringEscapeUtils.unescapeHtml(username);
+    if (stringUtil.isEmpty(username)) {
+      throw new BadCredentialsException("Username can't be null or empty.");
+    }
+    User user = new User();
+    user.setUsername(username);
+    authentication = new UsernamePasswordAuthenticationToken(username, password, getAuthorities(username));
+    return authentication;
+  }
+
+  @Override
+  public boolean isEnable(AUTH_METHOD method) {
+    boolean ldapEnabled = super.isEnable(AUTH_METHOD.LDAP);
+    boolean fileEnabled = super.isEnable(AUTH_METHOD.FILE);
+    boolean simpleEnabled = super.isEnable(method);
+    if (!ldapEnabled && !fileEnabled && simpleEnabled) {
+      // simple is enabled only when rest two are disabled and simple is enable
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  @Override
+  public boolean isEnable() {
+    return this.isEnable(AUTH_METHOD.SIMPLE);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/HadoopServiceConfig.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/HadoopServiceConfig.json b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/HadoopServiceConfig.json
new file mode 100644
index 0000000..829839f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/HadoopServiceConfig.json
@@ -0,0 +1,407 @@
+{
+	"service":{
+		"accumulo":{
+			"label":"Accumulo",
+			"components":[
+				{
+					"name":"accumulo_gc"
+				},
+				{
+					"name":"accumulo_master"
+				},
+				{
+					"name":"accumulo_monitor"
+				},
+				{
+					"name":"accumulo_tracer"
+				},
+				{
+					"name":"accumulo_tserver"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"atlas":{
+			"label":"Atlas",
+			"components":[
+				{
+					"name":"atlas_app"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"ambari":{
+			"label":"Ambari",
+			"components":[
+				{
+					"name":"ambari_agent"
+				},
+				{
+					"name":"ambari_server"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"ams":{
+			"label":"AMS",
+			"components":[
+				{
+					"name":"ams_hbase_master"
+				},
+				{
+					"name":"ams_hbase_regionserver"
+				},
+				{
+					"name":"ams_collector"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"falcon":{
+			"label":"Falcon",
+			"components":[
+				{
+					"name":"falcon_app"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"hbase":{
+			"label":"HBase",
+			"components":[
+				{
+					"name":"hbase_master"
+				},
+				{
+					"name":"hbase_regionserver"
+				}
+				
+			],
+			"dependencies":[
+				{
+					"service":"hdfs",
+					"components":[
+						"hdfs_namenode"
+					]
+					
+				}
+				
+			]
+			
+		},
+		"hdfs":{
+			"label":"HDFS",
+			"components":[
+				{
+					"name":"hdfs_datanode"
+				},
+				{
+					"name":"hdfs_namenode"
+				},
+				{
+					"name":"hdfs_journalnode"
+				},
+				{
+					"name":"hdfs_secondarynamenode"
+				},
+				{
+					"name":"hdfs_zkfc"
+				},
+				{
+					"name":"hdfs_audit",
+					"rowtype":"audit"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"hive":{
+			"label":"Hive",
+			"components":[
+				{
+					"name":"hive_hiveserver2"
+				},
+				{
+					"name":"hive_metastore"
+				}
+				
+			],
+			"dependencies":[
+				{
+					"service":"hdfs",
+					"components":[
+						"hdfs_namenode"
+					]
+					
+				}
+				
+			]
+			
+		},
+		"kafka":{
+			"label":"Kafka",
+			"components":[
+				{
+					"name":"kafka_controller"
+				},
+				{
+					"name":"kafka_request"
+				},
+				{
+					"name":"kafka_logcleaner"
+				},
+				{
+					"name":"kafka_server"
+				},
+				{
+					"name":"kafka_statechange"
+				}
+				
+			],
+			"dependencies":[
+				{
+					"service":"zookeeper",
+					"components":[
+						"zookeeper"
+					]
+					
+				}
+				
+			]
+			
+		},
+		"knox":{
+			"label":"Knox",
+			"components":[
+				{
+					"name":"knox_gateway"
+				},
+				{
+					"name":"knox_cli"
+				},
+				{
+					"name":"knox_ldap"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"mapred":{
+			"label":"MapReduce",
+			"components":[
+				{
+					"name":"mapred_historyserver"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"logsearch":{
+			"label":"Logsearch",
+			"components":[
+				{
+					"name":"logsearch_app"
+				},
+				{
+					"name":"logsearch_feeder"
+				},
+				{
+					"name":"logsearch_perf"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"ranger":{
+			"label":"Ranger",
+			"components":[
+				{
+					"name":"ranger_admin"
+				},
+				{
+					"name":"ranger_dbpatch"
+				},
+				{
+					"name":"ranger_kms"
+				},
+				{
+					"name":"ranger_usersync"
+				}
+				
+			],
+			"dependencies":[
+				{
+					"service":"hdfs",
+					"required":"optional",
+					"components":[
+						"hdfs_namenode"
+					]
+					
+				},
+				{
+					"service":"hbase",
+					"required":"optional",
+					"components":[
+						"hbase_master",
+						"hbase_regionserver"
+					]
+					
+				},
+				{
+					"service":"hive",
+					"required":"optional",
+					"components":[
+						"hive_hiveserver2"
+					]
+					
+				},
+				{
+					"service":"kafka",
+					"required":"optional",
+					"components":[
+						"kafka_ranger"
+					]
+					
+				},
+				{
+					"service":"knox",
+					"required":"optional",
+					"components":[
+						"knox_gateway"
+					]
+					
+				},
+				{
+					"service":"storm",
+					"required":"optional",
+					"components":[
+						"storm_supervisor"
+					]
+					
+				},
+				{
+					"service":"yarn",
+					"required":"optional",
+					"components":[
+						"yarn_resourcemanager"
+					]
+					
+				}
+				
+			]
+			
+		},
+		"oozie":{
+			"label":"Oozie",
+			"components":[
+				{
+					"name":"oozie_app"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"yarn":{
+			"label":"YARN",
+			"components":[
+				{
+					"name":"yarn_nodemanager"
+				},
+				{
+					"name":"yarn_resourcemanager"
+				},
+				{
+					"name":"yarn_timelineserver"
+				},
+				{
+					"name":"yarn_historyserver"
+				},
+				{
+					"name":"yarn_jobsummary"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"storm":{
+			"label":"Storm",
+			"components":[
+				{
+					"name":"storm_drpc"
+				},
+				{
+					"name":"storm_logviewer"
+				},
+				{
+					"name":"storm_nimbus"
+				},
+				{
+					"name":"storm_supervisor"
+				},
+				{
+					"name":"storm_ui"
+				},
+				{
+					"name":"storm_worker"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		},
+		"zookeeper":{
+			"label":"ZooKeeper",
+			"components":[
+				{
+					"name":"zookeeper"
+				}
+				
+			],
+			"dependencies":[
+				
+			]
+			
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/default.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/default.properties b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/default.properties
new file mode 100644
index 0000000..7ce120e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/default.properties
@@ -0,0 +1,44 @@
+# 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.
+
+#Service Logs Field Names
+solr.servicelogs.fields=logtime,level,event_count,ip,type,path,file,line_number,host,log_message,method,id
+
+#Exclude Column List for Service Logs
+servicelogs.exclude.columnlist=tags,text,message,seq_num
+
+#Exclude Column List for Ranger Audits
+auditlog.exclude.columnlist=tags,tags_str
+
+#Value Mapping for Audit Fields
+#Example FieldName=ValueOfUI:ValueOfSolr
+result=Allowed:1,Denied:0
+
+#Column Mapping
+#Example  CoulumnInSolr:ColumnInUI
+#For Service Logs
+servicelog.column.mapping=bundle_id:Bundle Id,thread_name:Thread,log_emessage:message
+
+#For Audit Logs
+auditlog.column.mapping=access:Access Type,reqUser:User,enforcer:Access Enfocer,ip:Client IP
+
+#login method
+logsearch.auth.file.enable=true
+logsearch.auth.ldap.enable=false
+logsearch.auth.simple.enable=false
+
+#login config
+logsearch.login.credentials.file=user_pass.json
+logsearch.login.ldap.config=logsearch-admin-site.xml

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
new file mode 100644
index 0000000..02207df
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- 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. -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+	<appender name="console" class="org.apache.log4j.ConsoleAppender">
+		<param name="Target" value="System.out" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="rolling_file" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="logs/logsearch-app.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="logs/logsearch-audit.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="logs/logsearch-performance.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<!-- Logs to suppress BEGIN -->
+	<category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
+	  <priority value="error" />
+	  <appender-ref ref="console" />
+	</category>
+	<!-- Logs to suppress END -->
+
+	<logger name="org.apache.ambari.logsearch.audit"
+		additivity="true">
+		<priority value="info" />
+		<appender-ref ref="audit_rolling_file" />
+	</logger>
+
+	<logger name="org.apache.ambari.logsearch.performance"
+		additivity="false">
+	  	<priority value="info" />
+		<appender-ref ref="performance_analyzer" />
+	</logger>
+
+	<logger name="org.apache.ambari.logsearch" additivity="false">
+	  	<priority value="info" />
+		<!-- <appender-ref ref="console" /> -->
+		<appender-ref ref="rolling_file" />
+	</logger>
+
+	<root>
+		<level value="warn" />
+		<!-- <appender-ref ref="console" /> -->
+		<appender-ref ref="rolling_file" />
+	</root>
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml.j2
new file mode 100644
index 0000000..3b6eac9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/log4j.xml.j2
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!-- 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. -->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+	<appender name="console" class="org.apache.log4j.ConsoleAppender">
+		<param name="Target" value="System.out" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="rolling_file" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="{{logsearch_log_dir}}/logsearch.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="audit_rolling_file" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="{{logsearch_log_dir}}/logsearch-audit.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<appender name="performance_analyzer" class="org.apache.log4j.RollingFileAppender">
+		<param name="file" value="{{logsearch_log_dir}}/logsearch-performance.log" />
+		<param name="Threshold" value="info" />
+		<param name="append" value="true" />
+		<param name="maxFileSize" value="10MB" />
+		<param name="maxBackupIndex" value="10" />
+
+		<layout class="org.apache.log4j.PatternLayout">
+			<param name="ConversionPattern" value="%d [%t] %-5p %C{6} (%F:%L) - %m%n" />
+		</layout>
+	</appender>
+
+	<!-- Logs to suppress BEGIN -->
+	<category name="org.apache.solr.common.cloud.ZkStateReader" additivity="false">
+	  <priority value="error" />
+	</category>
+	<!-- Logs to suppress END -->
+
+	<logger name="org.apache.ambari.logsearch.audit"
+		additivity="true">
+		<priority value="info" />
+		<appender-ref ref="audit_rolling_file" />
+	</logger>
+
+	<logger name="org.apache.ambari.logsearch.performance"
+		additivity="false">
+		<appender-ref ref="performance_analyzer" />
+	</logger>
+
+	<logger name="org.apache.ambari.logsearch" additivity="false">
+		<!-- <appender-ref ref="console" /> -->
+		<appender-ref ref="rolling_file" />
+	</logger>
+
+	<root>
+		<level value="info" />
+		<!-- <appender-ref ref="console" /> -->
+		<appender-ref ref="rolling_file" />
+	</root>
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch-admin-site.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch-admin-site.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch-admin-site.xml
new file mode 100644
index 0000000..049172a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch-admin-site.xml
@@ -0,0 +1,116 @@
+<!-- Licensed 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. 
+	See accompanying LICENSE file. -->
+
+
+<configuration>
+	<property>
+		<name>authentication.ldap.primaryUrl</name>
+		<value></value>
+		<display-name></display-name>
+		<description>The hostname and port for the LDAP or AD server. Example: my.ldap.server:389</description>		
+	</property>
+	<property>
+		<name>authentication.ldap.useSSL</name>
+		<value>false</value>
+		<display-name></display-name>
+		<description>If true, use SSL when connecting to the LDAP or AD server.</description>
+	</property>
+	<property>
+		<name>authentication.ldap.baseDn</name>
+		<value>dc=example,dc=com</value>
+		<display-name></display-name>
+		<description>The root Distinguished Name to search in the directory for users. Example: ou=people,dc=hadoop,dc=apache,dc=org</description>
+	</property>
+	<property>
+		<name>authentication.ldap.bindAnonymously</name>
+		<value>false</value>
+		<display-name></display-name>
+		<description>If true, bind to the LDAP or AD server anonymously</description>
+	</property>
+	<property>
+		<name>authentication.ldap.managerDn</name>
+		<value>cn=Manager,dc=example,dc=com</value>
+		<display-name></display-name>
+		<description>If Bind anonymous is set to false, the Distinguished Name (“DN”) for the manager.
+		 Example: uid=hdfs,ou=people,dc=hadoop,dc=apache,dc=org</description>
+	</property>
+	<property>
+		<name>authentication.ldap.managerPassword</name>
+		<value></value>
+		<display-name></display-name>
+		<property-type>PASSWORD</property-type>
+		<description>If Bind anonymous is set to false, the password for the manager</description>
+	</property>
+	<property>
+		<name>authentication.ldap.dnAttribute</name>
+		<value>dn</value>
+		<display-name></display-name>
+		<description></description>
+	</property>
+	<property>
+		<name>authentication.ldap.usernameAttribute</name>
+		<value>uid</value>
+		<display-name></display-name>
+		<description>The attribute for username. Example: uid</description>
+	</property>
+	<property>
+		<name>authentication.ldap.userBase</name>
+		<value>ou=people,dc=example,dc=com</value>
+		<display-name></display-name>
+		<description></description>
+	</property>
+	<property>
+		<name>authentication.ldap.userObjectClass</name>
+		<value>person</value>
+		<display-name></display-name>
+		<description>The object class that is used for users. Example: organizationalPerson</description>
+	</property>
+	<property>
+		<name>authentication.ldap.groupBase</name>
+		<value>ou=groups,dc=example,dc=com"</value>
+		<display-name></display-name>
+		<description></description>
+	</property>
+	<property>
+		<name>authentication.ldap.groupObjectClass</name>
+		<value>group</value>
+		<display-name></display-name>
+		<description>The object class that is used for groups. Example: groupOfUniqueNames</description>
+	</property>
+	<property>
+		<name>authentication.ldap.groupNamingAttr</name>
+		<value>cn</value>
+		<display-name></display-name>
+		<description>The attribute for group name.</description>
+	</property>
+	<property>
+		<name>authentication.ldap.groupMembershipAttr</name>
+		<value>member</value>
+		<display-name></display-name>
+		<description>The attribute for group membership. Example: uniqueMember</description>
+	</property>
+	<property>
+		<name>authorization.ldap.adminGroupMappingRules</name>
+		<value>Logsearch Administrators</value>
+		<display-name></display-name>
+		<description></description>
+	</property>
+	<property>
+		<name>authorization.ldap.groupSearchFilter</name>
+		<value></value>
+		<display-name></display-name>
+		<description></description>
+	</property>
+	<property>
+		<name>authentication.ldap.referral</name>
+		<value>ignore</value>
+		<display-name></display-name>
+		<description>Determines if LDAP referrals should be followed, or ignored.</description>
+	</property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
new file mode 100755
index 0000000..44f3bfd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties
@@ -0,0 +1,36 @@
+# 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.
+
+solr.url=
+
+#Solr Core
+solr.core.logs=hadoop_logs
+#solr.core.logs=ranger_audits
+solr.core.history=history
+solr.service_logs.split_interval_mins=none
+solr.service_logs.shards=1
+solr.service_logs.replication_factor=1
+	
+#If set, metrics will be sent to Ambari
+#metrics.collector.hosts=example.com
+metrics.collector.hosts=
+
+#Audit log solr url
+auditlog.solr.url=
+#auditlog.solr.core.logs=ranger_audits
+auditlog.solr.core.logs=ranger_audits
+solr.audit_logs.split_interval_mins=none
+solr.audit_logs.shards=1
+solr.audit_logs.replication_factor=1

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties.j2 b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties.j2
new file mode 100755
index 0000000..ffe9e0c
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/logsearch.properties.j2
@@ -0,0 +1,33 @@
+# 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.
+
+solr.zkhosts={{zookeeper_quorum}}{{logsearch_solr_znode}}
+solr.core.logs={{logsearch_collection_service_logs}}
+
+solr.service_logs.split_interval_mins={{service_logs_collection_splits_interval_mins}}
+solr.service_logs.shards={{logsearch_numshards}}
+solr.service_logs.replication_factor={{logsearch_repfactor}}
+
+solr.core.history={{solr_collection_history}}
+
+#Audit logs
+auditlog.solr.zkhosts={{solr_audit_logs_zk_quorum}}{{solr_audit_logs_zk_node}}
+auditlog.solr.core.logs={{logsearch_solr_collection_audit_logs}}
+auditlog.solr.url={{solr_audit_logs_url}}
+
+solr.audit_logs.split_interval_mins={{audit_logs_collection_splits_interval_mins}}
+solr.audit_logs.shards={{logsearch_numshards}}
+solr.audit_logs.replication_factor={{logsearch_repfactor}}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/resources/user_pass.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/resources/user_pass.json b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/user_pass.json
new file mode 100644
index 0000000..97a7f45
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/resources/user_pass.json
@@ -0,0 +1,8 @@
+{
+	"users": [{
+		"name": "Logsearch Admin",
+		"username": "admin",
+		"password": "admin",
+		"en_password": ""
+	}]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/add_config_set.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/add_config_set.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/add_config_set.sh
new file mode 100755
index 0000000..e9d3106
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/add_config_set.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# 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.
+
+if [ $# -ne 4 ]; then
+    echo "Usage: $0 <solr_home> <zk_host_with_path> <config_name> <config_folder>"
+    echo "Example: $0 /opt/solr MY_ZKHOST/solr hadoop_logs `dirname $0`/configsets/hadoop_logs"
+    exit 1
+fi
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+
+solr_home=$1
+zk_host=$2
+config_name=$3
+config_folder=$4
+
+tmp_folder=/tmp/solr_config_${config_name}_$USER
+rm -rf $tmp_folder
+
+$solr_home/server/scripts/cloud-scripts/zkcli.sh -zkhost $zk_host -cmd downconfig -confdir $tmp_folder -confname $config_name > /dev/null 2>&1 
+
+if [ -d $tmp_folder ]; then
+    echo "Config $config_name already existing. Will not add to zookeeper"
+else
+    echo "Adding config to $config_name to $zk_host"
+    $solr_home/server/scripts/cloud-scripts/zkcli.sh  -zkhost $zk_host -cmd upconfig -confdir $config_folder -confname $config_name
+    echo "Added config to $config_name to $zk_host"
+fi

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/create_collections.sh
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/create_collections.sh b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/create_collections.sh
new file mode 100755
index 0000000..be728aa
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/scripts/create_collections.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# 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.
+
+if [ $# -ne 4 ]; then
+    echo "Usage: $0 <solr_home> <number of shards> <number of replications> [configset folder]"
+    exit 1
+fi
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+
+solr_home=$1
+shards=$2
+replications=$3
+
+configsets_folder=$4
+if [ "$configsets_folder" = "" ]; then
+    configsets_folder=${script_dir}/solr_configsets
+fi
+
+${solr_home}/bin/solr create -c hadoop_logs -d ${configsets_folder}/hadoop_logs/conf -s ${shards} -rf ${replications}
+${solr_home}/bin/solr create -c history -d ${configsets_folder}/history/conf -s 1 -rf ${shards}
+${solr_home}/bin/solr create -c audit_logs -d ${configsets_folder}/audit_logs/conf -s ${shards} -rf ${replications}


[42/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml
new file mode 100644
index 0000000..7af91df
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/audit_logs/conf/solrconfig.xml
@@ -0,0 +1,1887 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+-->
+<config>
+  <!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    -->
+
+  <!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  -->
+  <luceneMatchVersion>5.0.0</luceneMatchVersion>
+
+  <!-- <lib/> directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that <lib/> directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              <lib dir="./lib" />
+    -->
+
+  <!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    -->
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
+
+  <!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    -->
+  <!--
+     <lib path="../a-jar-that-does-not-exist.jar" /> 
+  -->
+  
+  <!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    -->
+  <dataDir>${solr.data.dir:}</dataDir>
+
+
+  <!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    -->
+  <directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
+    
+         
+    <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. -->      
+    <!-- The root directory that collection data should be written to. -->     
+    <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
+    <!-- The hadoop configuration files to use for the hdfs client. -->    
+    <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
+    <!-- Enable/Disable the hdfs cache. -->    
+    <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
+    <!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. -->    
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
+    
+  </directoryFactory> 
+
+  <!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  -->
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
+  <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: -->
+  
+       <schemaFactory class="ManagedIndexSchemaFactory">
+         <bool name="mutable">true</bool>
+         <str name="managedSchemaResourceName">managed-schema</str>
+       </schemaFactory>
+<!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces <indexDefaults> and <mainIndex> from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <indexConfig>
+    <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
+    -->
+    <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
+    <!-- <writeLockTimeout>1000</writeLockTimeout>  -->
+    <!-- LogSearch customization to avoid timeouts -->
+    <writeLockTimeout>10000</writeLockTimeout>
+
+    <!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. -->
+    <!-- <maxIndexingThreads>8</maxIndexingThreads>  -->
+    <!-- LogSearch customization of increase performance -->
+    <maxIndexingThreads>50</maxIndexingThreads>
+
+    <!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
+    <!-- <useCompoundFile>false</useCompoundFile> -->
+
+    <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  -->
+    <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
+    <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
+
+    <!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      -->
+    <!--
+        <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
+          <int name="maxMergeAtOnce">10</int>
+          <int name="segmentsPerTier">10</int>
+        </mergePolicy>
+      -->
+       
+    <!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      -->
+    <!-- 
+    <mergeFactor>10</mergeFactor>
+      -->
+    <!-- LogSearch customization. Set to 5 to trigger purging of deleted documents more often -->
+    <mergeFactor>5</mergeFactor>
+
+    <!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     -->
+    <!-- 
+       <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
+       -->
+
+    <!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    -->
+    <lockType>${solr.lock.type:native}</lockType>
+
+    <!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     -->
+    <!--
+    <unlockOnStartup>false</unlockOnStartup>
+      -->
+
+    <!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    -->
+    <!-- 
+    <deletionPolicy class="solr.SolrDeletionPolicy">
+    -->
+      <!-- The number of commit points to be kept -->
+      <!-- <str name="maxCommitsToKeep">1</str> -->
+      <!-- The number of optimized commit points to be kept -->
+      <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
+      <!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        -->
+      <!--
+         <str name="maxCommitAge">30MINUTES</str>
+         <str name="maxCommitAge">1DAY</str>
+      -->
+    <!-- 
+    </deletionPolicy>
+    -->
+
+    <!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      -->
+     <infoStream>true</infoStream>
+  </indexConfig>
+
+
+  <!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    -->
+  <jmx />
+  <!-- If you want to connect to a particular server, specify the
+       agentId 
+    -->
+  <!-- <jmx agentId="myAgent" /> -->
+  <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
+  <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
+    -->
+
+  <!-- The default high-performance update handler -->
+  <updateHandler class="solr.DirectUpdateHandler2">
+
+    <!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --> 
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+    </updateLog>
+ 
+    <!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      -->
+     <autoCommit> 
+       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
+       <openSearcher>false</openSearcher> 
+     </autoCommit>
+
+    <!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      -->
+
+     <autoSoftCommit> 
+       <maxTime>${solr.autoSoftCommit.maxTime:5000}</maxTime> 
+     </autoSoftCommit>
+
+    <!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      -->
+    <!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      -->
+    <!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      -->
+    <!--
+       <listener event="postCommit" class="solr.RunExecutableListener">
+         <str name="exe">solr/bin/snapshooter</str>
+         <str name="dir">.</str>
+         <bool name="wait">true</bool>
+         <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
+         <arr name="env"> <str>MYVAR=val1</str> </arr>
+       </listener>
+      -->
+
+  </updateHandler>
+  
+  <!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    -->
+  <!--
+  <indexReaderFactory name="IndexReaderFactory" class="package.class">
+    <str name="someArg">Some Value</str>
+  </indexReaderFactory >
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <query>
+    <!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      -->
+    <maxBooleanClauses>1024</maxBooleanClauses>
+
+
+    <!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (> 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    -->
+
+    <!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      -->
+    <filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/>
+
+    <!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      -->
+    <queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/>
+   
+    <!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      -->
+    <documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/>
+    
+    <!-- custom cache currently used by block join --> 
+    <cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" />
+
+    <!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      -->
+    <!--
+       <fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" />
+      -->
+
+    <!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      -->
+    <!--
+       <cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              />
+      -->
+
+
+    <!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    -->
+    <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+   <!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     -->
+   <!--
+      <useFilterForSortedQuery>true</useFilterForSortedQuery>
+     -->
+
+   <!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     -->
+   <queryResultWindowSize>20</queryResultWindowSize>
+
+   <!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     -->
+   <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+   <!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     -->
+    <!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      -->
+    <listener event="newSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <!--
+           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
+           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
+          -->
+      </arr>
+    </listener>
+    <listener event="firstSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <lst>
+          <str name="q">static firstSearcher warming in solrconfig.xml</str>
+        </lst>
+      </arr>
+    </listener>
+
+    <!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      -->
+    <useColdSearcher>false</useColdSearcher>
+
+    <!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      -->
+    <maxWarmingSearchers>2</maxWarmingSearchers>
+
+  </query>
+
+
+  <!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    -->
+  <requestDispatcher handleSelect="false" >
+    <!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --> 
+    <requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/>
+
+    <!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      -->
+    <httpCaching never304="true" />
+    <!-- If you include a <cacheControl> directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the <cacheControl> option even if you have set
+         never304="true"
+      -->
+    <!--
+       <httpCaching never304="true" >
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+    <!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      -->
+    <!--
+       <httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr">
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+  </requestDispatcher>
+
+  <!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    -->
+
+  <requestHandler name="/dataimport" class="solr.DataImportHandler">
+    <lst name="defaults">
+      <str name="config">solr-data-config.xml</str>
+    </lst>
+  </requestHandler>
+
+  <!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    -->
+  <requestHandler name="/select" class="solr.SearchHandler">
+    <!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      -->
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <int name="rows">10</int>
+       <str name="df">text</str>
+     </lst>
+    <!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      -->
+    <!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="appends">
+         <str name="fq">inStock:true</str>
+       </lst>
+      -->
+    <!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="invariants">
+         <str name="facet.field">cat</str>
+         <str name="facet.field">manu_exact</str>
+         <str name="facet.query">price:[* TO 500]</str>
+         <str name="facet.query">price:[500 TO *]</str>
+       </lst>
+      -->
+    <!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      -->
+    <!--
+       <arr name="components">
+         <str>nameOfCustomComponent1</str>
+         <str>nameOfCustomComponent2</str>
+       </arr>
+      -->
+    </requestHandler>
+
+  <!-- A request handler that returns indented JSON by default -->
+  <requestHandler name="/query" class="solr.SearchHandler">
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+       <str name="df">text</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  -->
+  <requestHandler name="/get" class="solr.RealTimeGetHandler">
+     <lst name="defaults">
+       <str name="omitHeader">true</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    -->
+  <requestHandler name="/browse" class="solr.SearchHandler">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+
+      <!-- VelocityResponseWriter settings -->
+      <str name="wt">velocity</str>
+      <str name="v.template">browse</str>
+      <str name="v.layout">layout</str>
+
+      <!-- Query settings -->
+      <str name="defType">edismax</str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+
+      <!-- Faceting defaults -->
+      <str name="facet">on</str>
+      <str name="facet.mincount">1</str>
+    </lst>
+  </requestHandler>
+
+
+  <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <str name="update.chain">add-unknown-fields-to-the-schema</str>
+    </lst>
+  </initParams>
+
+  <!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    -->
+  <requestHandler name="/update" class="solr.UpdateRequestHandler">
+    <!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      -->
+    <!--
+       <lst name="defaults">
+         <str name="update.chain">dedupe</str>
+       </lst>
+       -->
+  </requestHandler>
+
+  <!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    -->
+  <requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" >
+    <lst name="defaults">
+      <str name="lowernames">true</str>
+      <str name="uprefix">ignored_</str>
+
+      <!-- capture link hrefs but ignore div attributes -->
+      <str name="captureAttr">true</str>
+      <str name="fmap.a">links</str>
+      <str name="fmap.div">ignored_</str>
+    </lst>
+  </requestHandler>
+
+
+  <!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   -->
+  <requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" />
+
+
+  <!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       <docs>
+         <doc>
+           <field name="id">1</field>
+           <field name="name">The Name</field>
+           <field name="text">The Text Value</field>
+         </doc>
+         <doc>...</doc>
+         <doc>...</doc>
+         ...
+       </docs>
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  -->
+  <requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" />
+
+  <!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    -->
+  <requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" />
+  <!-- This single handler is equivalent to the following... -->
+  <!--
+     <requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" />
+     <requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" />
+     <requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" />
+     <requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" />
+     <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
+     <requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" >
+    -->
+  <!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    -->
+  <!--
+     <requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" >
+       <lst name="invariants">
+         <str name="hidden">synonyms.txt</str> 
+         <str name="hidden">anotherfile.txt</str> 
+         <str name="hidden">*</str> 
+       </lst>
+     </requestHandler>
+    -->
+
+  <!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  -->
+  <!--
+  <requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" >
+    <lst name="invariants">
+         <str name="hidden">synonyms.txt</str>
+         <str name="hidden">anotherfile.txt</str>
+    </lst>
+  </requestHandler>
+  -->
+  <!-- ping/healthcheck -->
+  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
+    <lst name="invariants">
+      <str name="q">solrpingquery</str>
+    </lst>
+    <lst name="defaults">
+      <str name="echoParams">all</str>
+    </lst>
+    <!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      -->
+    <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
+  </requestHandler>
+
+  <!-- Echo the request contents back to the client -->
+  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
+    <lst name="defaults">
+     <str name="echoParams">explicit</str> 
+     <str name="echoHandler">true</str>
+    </lst>
+  </requestHandler>
+  
+  <!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    -->
+  <requestHandler name="/replication" class="solr.ReplicationHandler" > 
+    <!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    -->
+    <!--
+       <lst name="master">
+         <str name="replicateAfter">commit</str>
+         <str name="replicateAfter">startup</str>
+         <str name="confFiles">schema.xml,stopwords.txt</str>
+       </lst>
+    -->
+    <!--
+       <lst name="slave">
+         <str name="masterUrl">http://your-master-hostname:8983/solr</str>
+         <str name="pollInterval">00:00:60</str>
+       </lst>
+    -->
+  </requestHandler>
+
+  <!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       <searchComponent name="query"     class="solr.QueryComponent" />
+       <searchComponent name="facet"     class="solr.FacetComponent" />
+       <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
+       <searchComponent name="highlight" class="solr.HighlightComponent" />
+       <searchComponent name="stats"     class="solr.StatsComponent" />
+       <searchComponent name="debug"     class="solr.DebugComponent" />
+   
+       Default configuration in a requestHandler would look like:
+
+       <arr name="components">
+         <str>query</str>
+         <str>facet</str>
+         <str>mlt</str>
+         <str>highlight</str>
+         <str>stats</str>
+         <str>debug</str>
+       </arr>
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       <arr name="first-components">
+         <str>myFirstComponentName</str>
+       </arr>
+    
+       <arr name="last-components">
+         <str>myLastComponentName</str>
+       </arr>
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     -->
+  
+   <!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     -->
+  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
+
+    <str name="queryAnalyzerFieldType">key_lower_case</str>
+
+    <!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      -->
+
+    <!-- a spellchecker built from a field of the main index -->
+    <lst name="spellchecker">
+      <str name="name">default</str>
+      <str name="field">text</str>
+      <str name="classname">solr.DirectSolrSpellChecker</str>
+      <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
+      <str name="distanceMeasure">internal</str>
+      <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
+      <float name="accuracy">0.5</float>
+      <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
+      <int name="maxEdits">2</int>
+      <!-- the minimum shared prefix when enumerating terms -->
+      <int name="minPrefix">1</int>
+      <!-- maximum number of inspections per result. -->
+      <int name="maxInspections">5</int>
+      <!-- minimum length of a query term to be considered for correction -->
+      <int name="minQueryLength">4</int>
+      <!-- maximum threshold of documents a query term can appear to be considered for correction -->
+      <float name="maxQueryFrequency">0.01</float>
+      <!-- uncomment this to require suggestions to occur in 1% of the documents
+      	<float name="thresholdTokenFrequency">.01</float>
+      -->
+    </lst>
+    
+    <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
+    <lst name="spellchecker">
+      <str name="name">wordbreak</str>
+      <str name="classname">solr.WordBreakSolrSpellChecker</str>      
+      <str name="field">name</str>
+      <str name="combineWords">true</str>
+      <str name="breakWords">true</str>
+      <int name="maxChanges">10</int>
+    </lst>
+
+    <!-- a spellchecker that uses a different distance measure -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">jarowinkler</str>
+         <str name="field">spell</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="distanceMeasure">
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         </str>
+       </lst>
+     -->
+
+    <!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">freq</str>
+         <str name="field">lowerfilt</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="comparatorClass">freq</str>
+      -->
+
+    <!-- A spellchecker that reads the list of words from a file -->
+    <!--
+       <lst name="spellchecker">
+         <str name="classname">solr.FileBasedSpellChecker</str>
+         <str name="name">file</str>
+         <str name="sourceLocation">spellings.txt</str>
+         <str name="characterEncoding">UTF-8</str>
+         <str name="spellcheckIndexDir">spellcheckerFile</str>
+       </lst>
+      -->
+  </searchComponent>
+  
+  <!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    -->
+  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers -->
+      <str name="spellcheck.dictionary">default</str>
+      <str name="spellcheck.dictionary">wordbreak</str>
+      <str name="spellcheck">on</str>
+      <str name="spellcheck.extendedResults">true</str>       
+      <str name="spellcheck.count">10</str>
+      <str name="spellcheck.alternativeTermCount">5</str>
+      <str name="spellcheck.maxResultsForSuggest">5</str>       
+      <str name="spellcheck.collate">true</str>
+      <str name="spellcheck.collateExtendedResults">true</str>  
+      <str name="spellcheck.maxCollationTries">10</str>
+      <str name="spellcheck.maxCollations">5</str>         
+    </lst>
+    <arr name="last-components">
+      <str>spellcheck</str>
+    </arr>
+  </requestHandler>
+
+  <searchComponent name="suggest" class="solr.SuggestComponent">
+  	<lst name="suggester">
+      <str name="name">mySuggester</str>
+      <str name="lookupImpl">FuzzyLookupFactory</str>      <!-- org.apache.solr.spelling.suggest.fst -->
+      <str name="dictionaryImpl">DocumentDictionaryFactory</str>     <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --> 
+      <str name="field">cat</str>
+      <str name="weightField">price</str>
+      <str name="suggestAnalyzerFieldType">string</str>
+    </lst>
+  </searchComponent>
+
+  <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="suggest">true</str>
+      <str name="suggest.count">10</str>
+    </lst>
+    <arr name="components">
+      <str>suggest</str>
+    </arr>
+  </requestHandler>
+  <!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    -->
+  <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
+
+  <!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <bool name="tv">true</bool>
+    </lst>
+    <arr name="last-components">
+      <str>tvComponent</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    -->
+  <searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" >
+    <lst name="engine">
+      <str name="name">lingo</str>
+
+      <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        -->
+      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
+
+      <!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       -->
+      <str name="carrot.resourcesDir">clustering/carrot2</str>
+    </lst>
+
+    <!-- An example definition for the STC clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">stc</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
+    </lst>
+
+    <!-- An example definition for the bisecting kmeans clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">kmeans</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
+    </lst>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler">
+    <lst name="defaults">
+      <bool name="clustering">true</bool>
+      <bool name="clustering.results">true</bool>
+      <!-- Field name with the logical "title" of a each document (optional) -->
+      <str name="carrot.title">name</str>
+      <!-- Field name with the logical "URL" of a each document (optional) -->
+      <str name="carrot.url">id</str>
+      <!-- Field name with the logical "content" of a each document (optional) -->
+      <str name="carrot.snippet">features</str>
+      <!-- Apply highlighter to the title/ content and use this for clustering. -->
+      <bool name="carrot.produceSummary">true</bool>
+      <!-- the maximum number of labels per cluster -->
+      <!--<int name="carrot.numDescriptions">5</int>-->
+      <!-- produce sub clusters -->
+      <bool name="carrot.outputSubClusters">false</bool>
+
+      <!-- Configure the remaining request handler parameters. -->
+      <str name="defType">edismax</str>
+      <str name="qf">
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      </str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+    </lst>
+    <arr name="last-components">
+      <str>clustering</str>
+    </arr>
+  </requestHandler>
+  
+  <!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    -->
+  <searchComponent name="terms" class="solr.TermsComponent"/>
+
+  <!-- A request handler for demonstrating the terms component -->
+  <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
+     <lst name="defaults">
+      <bool name="terms">true</bool>
+      <bool name="distrib">false</bool>
+    </lst>     
+    <arr name="components">
+      <str>terms</str>
+    </arr>
+  </requestHandler>
+
+
+  <!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    -->
+  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
+    <!-- pick a fieldType to analyze queries -->
+    <str name="queryFieldType">string</str>
+    <str name="config-file">elevate.xml</str>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the elevator component -->
+  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+      <str name="df">text</str>
+    </lst>
+    <arr name="last-components">
+      <str>elevator</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    -->
+  <searchComponent class="solr.HighlightComponent" name="highlight">
+    <highlighting>
+      <!-- Configure the standard fragmenter -->
+      <!-- This could most likely be commented out in the "default" case -->
+      <fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter">
+        <lst name="defaults">
+          <int name="hl.fragsize">100</int>
+        </lst>
+      </fragmenter>
+
+      <!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        -->
+      <fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter">
+        <lst name="defaults">
+          <!-- slightly smaller fragsizes work better because of slop -->
+          <int name="hl.fragsize">70</int>
+          <!-- allow 50% slop on fragment sizes -->
+          <float name="hl.regex.slop">0.5</float>
+          <!-- a basic sentence pattern -->
+          <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
+        </lst>
+      </fragmenter>
+
+      <!-- Configure the standard formatter -->
+      <formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter">
+        <lst name="defaults">
+          <str name="hl.simple.pre"><![CDATA[<em>]]></str>
+          <str name="hl.simple.post"><![CDATA[</em>]]></str>
+        </lst>
+      </formatter>
+
+      <!-- Configure the standard encoder -->
+      <encoder name="html" 
+               class="solr.highlight.HtmlEncoder" />
+
+      <!-- Configure the standard fragListBuilder -->
+      <fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/>
+      
+      <!-- Configure the single fragListBuilder -->
+      <fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/>
+      
+      <!-- Configure the weighted fragListBuilder -->
+      <fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/>
+      
+      <!-- default tag FragmentsBuilder -->
+      <fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <!-- 
+        <lst name="defaults">
+          <str name="hl.multiValuedSeparatorChar">/</str>
+        </lst>
+        -->
+      </fragmentsBuilder>
+
+      <!-- multi-colored tag FragmentsBuilder -->
+      <fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <lst name="defaults">
+          <str name="hl.tag.pre"><![CDATA[
+               <b style="background:yellow">,<b style="background:lawgreen">,
+               <b style="background:aquamarine">,<b style="background:magenta">,
+               <b style="background:palegreen">,<b style="background:coral">,
+               <b style="background:wheat">,<b style="background:khaki">,
+               <b style="background:lime">,<b style="background:deepskyblue">]]></str>
+          <str name="hl.tag.post"><![CDATA[</b>]]></str>
+        </lst>
+      </fragmentsBuilder>
+      
+      <boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner">
+        <lst name="defaults">
+          <str name="hl.bs.maxScan">10</str>
+          <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
+        </lst>
+      </boundaryScanner>
+      
+      <boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner">
+        <lst name="defaults">
+          <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
+          <str name="hl.bs.type">WORD</str>
+          <!-- language and country are used when constructing Locale object.  -->
+          <!-- And the Locale object will be used when getting instance of BreakIterator -->
+          <str name="hl.bs.language">en</str>
+          <str name="hl.bs.country">US</str>
+        </lst>
+      </boundaryScanner>
+    </highlighting>
+  </searchComponent>
+
+  <!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --> 
+
+  <!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    -->
+  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
+
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+7DAYS</str>
+    </processor>
+    <processor class="solr.processor.DocExpirationUpdateProcessorFactory">
+        <int name="autoDeletePeriodSeconds">86400</int>
+        <str name="ttlFieldName">_ttl_</str>
+        <str name="expirationFieldName">_expire_at_</str>
+    </processor>
+    <processor class="solr.FirstFieldValueUpdateProcessorFactory">
+      <str name="fieldName">_expire_at_</str>
+    </processor>
+
+
+    <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseLongFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDateFieldUpdateProcessorFactory">
+      <arr name="format">
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss</str>
+        <str>yyyy-MM-dd'T'HH:mmZ</str>
+        <str>yyyy-MM-dd'T'HH:mm</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd HH:mm:ssZ</str>
+        <str>yyyy-MM-dd HH:mm:ss</str>
+        <str>yyyy-MM-dd HH:mmZ</str>
+        <str>yyyy-MM-dd HH:mm</str>
+        <str>yyyy-MM-dd</str>
+      </arr>
+    </processor>
+    <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
+      <str name="defaultFieldType">key_lower_case</str>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Boolean</str>
+        <str name="fieldType">boolean</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.util.Date</str>
+        <str name="fieldType">tdate</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Long</str>
+        <str name="valueClass">java.lang.Integer</str>
+        <str name="fieldType">tlong</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Number</str>
+        <str name="fieldType">tdouble</str>
+      </lst>
+    </processor>
+
+    <processor class="solr.LogUpdateProcessorFactory"/>
+    <processor class="solr.RunUpdateProcessorFactory"/>
+  </updateRequestProcessorChain>
+
+
+  <!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    -->
+  <!--
+     <updateRequestProcessorChain name="dedupe">
+       <processor class="solr.processor.SignatureUpdateProcessorFactory">
+         <bool name="enabled">true</bool>
+         <str name="signatureField">id</str>
+         <bool name="overwriteDupes">false</bool>
+         <str name="fields">name,features,cat</str>
+         <str name="signatureClass">solr.processor.Lookup3Signature</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+  
+  <!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    -->
+    <!--
+     <updateRequestProcessorChain name="langid">
+       <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
+         <str name="langid.fl">text,title,subject,description</str>
+         <str name="langid.langField">language_s</str>
+         <str name="langid.fallback">en</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+
+  <!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  -->
+  <!--
+    <updateRequestProcessorChain name="script">
+      <processor class="solr.StatelessScriptUpdateProcessorFactory">
+        <str name="script">update-script.js</str>
+        <lst name="params">
+          <str name="config_param">example config parameter</str>
+        </lst>
+      </processor>
+      <processor class="solr.RunUpdateProcessorFactory" />
+    </updateRequestProcessorChain>
+  -->
+ 
+  <!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    -->
+  <!-- The following response writers are implicitly configured unless
+       overridden...
+    -->
+  <!--
+     <queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" />
+     <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+     <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+     <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
+     <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
+     <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
+     <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
+     <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
+    -->
+
+  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+     <!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     -->
+    <str name="content-type">text/plain; charset=UTF-8</str>
+  </queryResponseWriter>
+  
+  <!--
+     Custom response writers can be declared as needed...
+    -->
+  <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
+    <str name="template.base.dir">${velocity.template.base.dir:}</str>
+  </queryResponseWriter>
+
+  <!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    -->
+  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
+    <int name="xsltCacheLifetimeSeconds">5</int>
+  </queryResponseWriter>
+
+  <!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    -->
+  <!-- example of registering a query parser -->
+  <!--
+     <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
+    -->
+
+  <!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    -->
+  <!-- example of registering a custom function parser  -->
+  <!--
+     <valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" />
+    -->
+    
+  
+  <!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    -->
+  <!--
+     Could be something like:
+     <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
+       <int name="connection">jdbc://....</int>
+     </transformer>
+     
+     To add a constant value to all docs, use:
+     <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <int name="value">5</int>
+     </transformer>
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <double name="defaultValue">5</double>
+     </transformer>
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
+    -->
+    
+
+  <!-- Legacy config for the admin interface -->
+  <admin>
+    <defaultQuery>*:*</defaultQuery>
+  </admin>
+
+</config>


[18/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.min.js
new file mode 100644
index 0000000..4938964
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid/js/backgrid.min.js
@@ -0,0 +1,8 @@
+/*!
+  backgrid
+  http://github.com/wyuenho/backgrid
+
+  Copyright (c) 2014 Jimmy Yuen Ho Wong and contributors <wy...@gmail.com>
+  Licensed under the MIT license.
+*/
+!function(a){"object"==typeof exports?module.exports=a(module.exports,require("underscore"),require("backbone")):a(this,this._,this.Backbone)}(function(a,b,c){"use strict";function d(a,b,c){var d=b-(a+"").length;d=0>d?0:d;for(var e="",f=0;d>f;f++)e+=c;return e+a}var e="	\n\f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||e.trim()){e="["+e+"]";var f=new RegExp("^"+e+e+"*"),g=new RegExp(e+e+"*$");String.prototype.trim=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(f,"").replace(g,"")}}var h=c.$,i=a.Backgrid={Extension:{},resolveNameToClass:function(a,c){if(b.isString(a)){var d=b.map(a.split("-"),function(a){return a.slice(0,1).toUpperCase()+a.slice(1)}).join("")+c,e=i[d]||i.Extension[d];if(b.isUndefined(e))throw new ReferenceError("Class '"+d+"' not found");return e}return a},callByNeed:function(){var a=arguments[0];if(!b.isFunction(a))return a;var c=argument
 s[1],d=[].slice.call(arguments,2);return a.apply(c,d+""?d:[])}};b.extend(i,c.Events);var j=i.Command=function(a){b.extend(this,{altKey:!!a.altKey,"char":a["char"],charCode:a.charCode,ctrlKey:!!a.ctrlKey,key:a.key,keyCode:a.keyCode,locale:a.locale,location:a.location,metaKey:!!a.metaKey,repeat:!!a.repeat,shiftKey:!!a.shiftKey,which:a.which})};b.extend(j.prototype,{moveUp:function(){return 38==this.keyCode},moveDown:function(){return 40===this.keyCode},moveLeft:function(){return this.shiftKey&&9===this.keyCode},moveRight:function(){return!this.shiftKey&&9===this.keyCode},save:function(){return 13===this.keyCode},cancel:function(){return 27===this.keyCode},passThru:function(){return!(this.moveUp()||this.moveDown()||this.moveLeft()||this.moveRight()||this.save()||this.cancel())}});var k=i.CellFormatter=function(){};b.extend(k.prototype,{fromRaw:function(a){return a},toRaw:function(a){return a}});var l=i.NumberFormatter=function(a){if(b.extend(this,this.defaults,a||{}),this.decimals<0||t
 his.decimals>20)throw new RangeError("decimals must be between 0 and 20")};l.prototype=new k,b.extend(l.prototype,{defaults:{decimals:2,decimalSeparator:".",orderSeparator:","},HUMANIZED_NUM_RE:/(\d)(?=(?:\d{3})+$)/g,fromRaw:function(a){if(b.isNull(a)||b.isUndefined(a))return"";a=a.toFixed(~~this.decimals);var c=a.split("."),d=c[0],e=c[1]?(this.decimalSeparator||".")+c[1]:"";return d.replace(this.HUMANIZED_NUM_RE,"$1"+this.orderSeparator)+e},toRaw:function(a){if(a=a.trim(),""===a)return null;for(var c="",d=a.split(this.orderSeparator),e=0;e<d.length;e++)c+=d[e];var f=c.split(this.decimalSeparator);c="";for(var e=0;e<f.length;e++)c=c+f[e]+".";"."===c[c.length-1]&&(c=c.slice(0,c.length-1));var g=1*(1*c).toFixed(~~this.decimals);return b.isNumber(g)&&!b.isNaN(g)?g:void 0}});var m=i.PercentFormatter=function(){i.NumberFormatter.apply(this,arguments)};m.prototype=new i.NumberFormatter,b.extend(m.prototype,{defaults:b.extend({},l.prototype.defaults,{multiplier:1,symbol:"%"}),fromRaw:funct
 ion(a){var b=[].slice.call(arguments,1);return b.unshift(a*this.multiplier),(l.prototype.fromRaw.apply(this,b)||"0")+this.symbol},toRaw:function(a){var c=a.split(this.symbol);if(c&&c[0]&&""===c[1]||null==c[1]){var d=l.prototype.toRaw.call(this,c[0]);return b.isUndefined(d)?d:d/this.multiplier}}});var n=i.DatetimeFormatter=function(a){if(b.extend(this,this.defaults,a||{}),!this.includeDate&&!this.includeTime)throw new Error("Either includeDate or includeTime must be true")};n.prototype=new k,b.extend(n.prototype,{defaults:{includeDate:!0,includeTime:!0,includeMilli:!1},DATE_RE:/^([+\-]?\d{4})-(\d{2})-(\d{2})$/,TIME_RE:/^(\d{2}):(\d{2}):(\d{2})(\.(\d{3}))?$/,ISO_SPLITTER_RE:/T|Z| +/,_convert:function(a,c){if(""===(a+"").trim())return null;var e,f=null;if(b.isNumber(a)){var g=new Date(a);e=d(g.getUTCFullYear(),4,0)+"-"+d(g.getUTCMonth()+1,2,0)+"-"+d(g.getUTCDate(),2,0),f=d(g.getUTCHours(),2,0)+":"+d(g.getUTCMinutes(),2,0)+":"+d(g.getUTCSeconds(),2,0)}else{a=a.trim();var h=a.split(this.
 ISO_SPLITTER_RE)||[];e=this.DATE_RE.test(h[0])?h[0]:"",f=e&&h[1]?h[1]:this.TIME_RE.test(h[0])?h[0]:""}var i=this.DATE_RE.exec(e)||[],j=this.TIME_RE.exec(f)||[];if(c){if(this.includeDate&&b.isUndefined(i[0]))return;if(this.includeTime&&b.isUndefined(j[0]))return;if(!this.includeDate&&e)return;if(!this.includeTime&&f)return}var g=new Date(Date.UTC(1*i[1]||0,1*i[2]-1||0,1*i[3]||0,1*j[1]||null,1*j[2]||null,1*j[3]||null,1*j[5]||null)),k="";return this.includeDate&&(k=d(g.getUTCFullYear(),4,0)+"-"+d(g.getUTCMonth()+1,2,0)+"-"+d(g.getUTCDate(),2,0)),this.includeTime&&(k=k+(this.includeDate?"T":"")+d(g.getUTCHours(),2,0)+":"+d(g.getUTCMinutes(),2,0)+":"+d(g.getUTCSeconds(),2,0),this.includeMilli&&(k=k+"."+d(g.getUTCMilliseconds(),3,0))),this.includeDate&&this.includeTime&&(k+="Z"),k},fromRaw:function(a){return b.isNull(a)||b.isUndefined(a)?"":this._convert(a)},toRaw:function(a){return this._convert(a,!0)}});var o=i.StringFormatter=function(){};o.prototype=new k,b.extend(o.prototype,{fromRaw
 :function(a){return b.isUndefined(a)||b.isNull(a)?"":a+""}});var p=i.EmailFormatter=function(){};p.prototype=new k,b.extend(p.prototype,{toRaw:function(a){var c=a.trim().split("@");return 2===c.length&&b.all(c)?a:void 0}});var q=i.SelectFormatter=function(){};q.prototype=new k,b.extend(q.prototype,{fromRaw:function(a){return b.isArray(a)?a:null!=a?[a]:[]}});var r=i.CellEditor=c.View.extend({initialize:function(a){this.formatter=a.formatter,this.column=a.column,this.column instanceof C||(this.column=new C(this.column)),this.listenTo(this.model,"backgrid:editing",this.postRender)},postRender:function(a,b){return(null==b||b.get("name")==this.column.get("name"))&&this.$el.focus(),this}}),s=i.InputCellEditor=r.extend({tagName:"input",attributes:{type:"text"},events:{blur:"saveOrCancel",keydown:"saveOrCancel"},initialize:function(a){s.__super__.initialize.apply(this,arguments),a.placeholder&&this.$el.attr("placeholder",a.placeholder)},render:function(){var a=this.model;return this.$el.val
 (this.formatter.fromRaw(a.get(this.column.get("name")),a)),this},saveOrCancel:function(a){var c=this.formatter,d=this.model,e=this.column,f=new j(a),g="blur"===a.type;if(f.moveUp()||f.moveDown()||f.moveLeft()||f.moveRight()||f.save()||g){a.preventDefault(),a.stopPropagation();var h=this.$el.val(),i=c.toRaw(h,d);b.isUndefined(i)?d.trigger("backgrid:error",d,e,h):(d.set(e.get("name"),i),d.trigger("backgrid:edited",d,e,f))}else f.cancel()&&(a.stopPropagation(),d.trigger("backgrid:edited",d,e,f))},postRender:function(a,b){if(null==b||b.get("name")==this.column.get("name"))if("right"===this.$el.css("text-align")){var c=this.$el.val();this.$el.focus().val(null).val(c)}else this.$el.focus();return this}}),t=i.Cell=c.View.extend({tagName:"td",formatter:k,editor:s,events:{click:"enterEditMode"},initialize:function(a){this.column=a.column,this.column instanceof C||(this.column=new C(this.column));var c=this.column,d=this.model,e=this.$el,f=i.resolveNameToClass(c.get("formatter")||this.formatt
 er,"Formatter");b.isFunction(f.fromRaw)||b.isFunction(f.toRaw)||(f=new f),this.formatter=f,this.editor=i.resolveNameToClass(this.editor,"CellEditor"),this.listenTo(d,"change:"+c.get("name"),function(){e.hasClass("editor")||this.render()}),this.listenTo(d,"backgrid:error",this.renderError),this.listenTo(c,"change:editable change:sortable change:renderable",function(a){var b=a.changedAttributes();for(var c in b)b.hasOwnProperty(c)&&e.toggleClass(c,b[c])}),i.callByNeed(c.editable(),c,d)&&e.addClass("editable"),i.callByNeed(c.sortable(),c,d)&&e.addClass("sortable"),i.callByNeed(c.renderable(),c,d)&&e.addClass("renderable")},render:function(){this.$el.empty();var a=this.model;return this.$el.text(this.formatter.fromRaw(a.get(this.column.get("name")),a)),this.delegateEvents(),this},enterEditMode:function(){var a=this.model,b=this.column,c=i.callByNeed(b.editable(),b,a);c&&(this.currentEditor=new this.editor({column:this.column,model:this.model,formatter:this.formatter}),a.trigger("backgri
 d:edit",a,b,this,this.currentEditor),this.undelegateEvents(),this.$el.empty(),this.$el.append(this.currentEditor.$el),this.currentEditor.render(),this.$el.addClass("editor"),a.trigger("backgrid:editing",a,b,this,this.currentEditor))},renderError:function(a,b){(null==b||b.get("name")==this.column.get("name"))&&this.$el.addClass("error")},exitEditMode:function(){this.$el.removeClass("error"),this.currentEditor.remove(),this.stopListening(this.currentEditor),delete this.currentEditor,this.$el.removeClass("editor"),this.render()},remove:function(){return this.currentEditor&&(this.currentEditor.remove.apply(this.currentEditor,arguments),delete this.currentEditor),t.__super__.remove.apply(this,arguments)}}),u=i.StringCell=t.extend({className:"string-cell",formatter:o}),v=i.UriCell=t.extend({className:"uri-cell",title:null,target:"_blank",initialize:function(a){v.__super__.initialize.apply(this,arguments),this.title=a.title||this.title,this.target=a.target||this.target},render:function(){t
 his.$el.empty();var a=this.model.get(this.column.get("name")),b=this.formatter.fromRaw(a,this.model);return this.$el.append(h("<a>",{tabIndex:-1,href:a,title:this.title||b,target:this.target}).text(b)),this.delegateEvents(),this}}),w=(i.EmailCell=u.extend({className:"email-cell",formatter:p,render:function(){this.$el.empty();var a=this.model,b=this.formatter.fromRaw(a.get(this.column.get("name")),a);return this.$el.append(h("<a>",{tabIndex:-1,href:"mailto:"+b,title:b}).text(b)),this.delegateEvents(),this}}),i.NumberCell=t.extend({className:"number-cell",decimals:l.prototype.defaults.decimals,decimalSeparator:l.prototype.defaults.decimalSeparator,orderSeparator:l.prototype.defaults.orderSeparator,formatter:l,initialize:function(){w.__super__.initialize.apply(this,arguments);var a=this.formatter;a.decimals=this.decimals,a.decimalSeparator=this.decimalSeparator,a.orderSeparator=this.orderSeparator}})),x=(i.IntegerCell=w.extend({className:"integer-cell",decimals:0}),i.PercentCell=w.exte
 nd({className:"percent-cell",multiplier:m.prototype.defaults.multiplier,symbol:m.prototype.defaults.symbol,formatter:m,initialize:function(){x.__super__.initialize.apply(this,arguments);var a=this.formatter;a.multiplier=this.multiplier,a.symbol=this.symbol}})),y=i.DatetimeCell=t.extend({className:"datetime-cell",includeDate:n.prototype.defaults.includeDate,includeTime:n.prototype.defaults.includeTime,includeMilli:n.prototype.defaults.includeMilli,formatter:n,initialize:function(){y.__super__.initialize.apply(this,arguments);var a=this.formatter;a.includeDate=this.includeDate,a.includeTime=this.includeTime,a.includeMilli=this.includeMilli;var c=this.includeDate?"YYYY-MM-DD":"";c+=this.includeDate&&this.includeTime?"T":"",c+=this.includeTime?"HH:mm:ss":"",c+=this.includeTime&&this.includeMilli?".SSS":"",this.editor=this.editor.extend({attributes:b.extend({},this.editor.prototype.attributes,this.editor.attributes,{placeholder:c})})}}),z=(i.DateCell=y.extend({className:"date-cell",inclu
 deTime:!1}),i.TimeCell=y.extend({className:"time-cell",includeDate:!1}),i.BooleanCellEditor=r.extend({tagName:"input",attributes:{tabIndex:-1,type:"checkbox"},events:{mousedown:function(){this.mouseDown=!0},blur:"enterOrExitEditMode",mouseup:function(){this.mouseDown=!1},change:"saveOrCancel",keydown:"saveOrCancel"},render:function(){var a=this.model,b=this.formatter.fromRaw(a.get(this.column.get("name")),a);return this.$el.prop("checked",b),this},enterOrExitEditMode:function(a){if(!this.mouseDown){var b=this.model;b.trigger("backgrid:edited",b,this.column,new j(a))}},saveOrCancel:function(a){var b=this.model,c=this.column,d=this.formatter,e=new j(a);if(e.passThru()&&"change"!=a.type)return!0;e.cancel()&&(a.stopPropagation(),b.trigger("backgrid:edited",b,c,e));var f=this.$el;if(e.save()||e.moveLeft()||e.moveRight()||e.moveUp()||e.moveDown()){a.preventDefault(),a.stopPropagation();var g=d.toRaw(f.prop("checked"),b);b.set(c.get("name"),g),b.trigger("backgrid:edited",b,c,e)}else if("ch
 ange"==a.type){var g=d.toRaw(f.prop("checked"),b);b.set(c.get("name"),g),f.focus()}}})),A=(i.BooleanCell=t.extend({className:"boolean-cell",editor:z,events:{click:"enterEditMode"},render:function(){this.$el.empty();var a=this.model,b=this.column,c=i.callByNeed(b.editable(),b,a);return this.$el.append(h("<input>",{tabIndex:-1,type:"checkbox",checked:this.formatter.fromRaw(a.get(b.get("name")),a),disabled:!c})),this.delegateEvents(),this}}),i.SelectCellEditor=r.extend({tagName:"select",events:{change:"save",blur:"close",keydown:"close"},template:b.template('<option value="<%- value %>" <%= selected ? \'selected="selected"\' : "" %>><%- text %></option>',null,{variable:null}),setOptionValues:function(a){this.optionValues=a,this.optionValues=b.result(this,"optionValues")},setMultiple:function(a){this.multiple=a,this.$el.prop("multiple",a)},_renderOptions:function(a,c){for(var d="",e=0;e<a.length;e++)d+=this.template({text:a[e][0],value:a[e][1],selected:b.indexOf(c,a[e][1])>-1});return d
 },render:function(){this.$el.empty();var a=b.result(this,"optionValues"),c=this.model,d=this.formatter.fromRaw(c.get(this.column.get("name")),c);if(!b.isArray(a))throw new TypeError("optionValues must be an array");for(var e=null,f=null,e=null,g=null,i=null,j=0;j<a.length;j++){var e=a[j];if(b.isArray(e))f=e[0],e=e[1],this.$el.append(this.template({text:f,value:e,selected:b.indexOf(d,e)>-1}));else{if(!b.isObject(e))throw new TypeError("optionValues elements must be a name-value pair or an object hash of { name: 'optgroup label', value: [option name-value pairs] }");g=e.name,i=h("<optgroup></optgroup>",{label:g}),i.append(this._renderOptions.call(this,e.values,d)),this.$el.append(i)}}return this.delegateEvents(),this},save:function(){var a=this.model,b=this.column;a.set(b.get("name"),this.formatter.toRaw(this.$el.val(),a))},close:function(a){var b=this.model,c=this.column,d=new j(a);d.cancel()?(a.stopPropagation(),b.trigger("backgrid:edited",b,c,new j(a))):(d.save()||d.moveLeft()||d.m
 oveRight()||d.moveUp()||d.moveDown()||"blur"==a.type)&&(a.preventDefault(),a.stopPropagation(),this.save(a),b.trigger("backgrid:edited",b,c,new j(a)))}})),B=i.SelectCell=t.extend({className:"select-cell",editor:A,multiple:!1,formatter:q,optionValues:void 0,delimiter:", ",initialize:function(){B.__super__.initialize.apply(this,arguments),this.listenTo(this.model,"backgrid:edit",function(a,b,c,d){b.get("name")==this.column.get("name")&&(d.setOptionValues(this.optionValues),d.setMultiple(this.multiple))})},render:function(){this.$el.empty();var a=b.result(this,"optionValues"),c=this.model,d=this.formatter.fromRaw(c.get(this.column.get("name")),c),e=[];try{if(!b.isArray(a)||b.isEmpty(a))throw new TypeError;for(var f=0;f<d.length;f++)for(var g=d[f],h=0;h<a.length;h++){var i=a[h];if(b.isArray(i)){var j=i[0],i=i[1];i==g&&e.push(j)}else{if(!b.isObject(i))throw new TypeError;for(var k=i.values,l=0;l<k.length;l++){var m=k[l];m[1]==g&&e.push(m[0])}}}this.$el.append(e.join(this.delimiter))}catc
 h(n){if(n instanceof TypeError)throw new TypeError("'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}");throw n}return this.delegateEvents(),this}}),C=i.Column=c.Model.extend({defaults:{name:void 0,label:void 0,sortable:!0,editable:!0,renderable:!0,formatter:void 0,sortType:"cycle",sortValue:void 0,direction:null,cell:void 0,headerCell:void 0},initialize:function(){this.has("label")||this.set({label:this.get("name")},{silent:!0});var a=i.resolveNameToClass(this.get("headerCell"),"HeaderCell"),b=i.resolveNameToClass(this.get("cell"),"Cell");this.set({cell:b,headerCell:a},{silent:!0})},sortValue:function(){var a=this.get("sortValue");return b.isString(a)?this[a]:b.isFunction(a)?a:function(a,b){return a.get(b)}}});b.each(["sortable","renderable","editable"],function(a){C.prototype[a]=function(){var c=this.get(a);return b.isString(c)?this[c]:b.isFunction(c)?c:!!c}});{var D=i.Columns=c.Collection.extend({model:C}),E=i.Row=c.View.extend({tagName:
 "tr",initialize:function(a){var b=this.columns=a.columns;b instanceof c.Collection||(b=this.columns=new D(b));for(var d=this.cells=[],e=0;e<b.length;e++)d.push(this.makeCell(b.at(e),a));this.listenTo(b,"add",function(b,c){var e=c.indexOf(b),f=this.makeCell(b,a);d.splice(e,0,f);var g=this.$el;0===e?g.prepend(f.render().$el):e===c.length-1?g.append(f.render().$el):g.children().eq(e).before(f.render().$el)}),this.listenTo(b,"remove",function(a,b,c){d[c.index].remove(),d.splice(c.index,1)})},makeCell:function(a){return new(a.get("cell"))({column:a,model:this.model})},render:function(){this.$el.empty();for(var a=document.createDocumentFragment(),b=0;b<this.cells.length;b++)a.appendChild(this.cells[b].render().el);return this.el.appendChild(a),this.delegateEvents(),this},remove:function(){for(var a=0;a<this.cells.length;a++){var b=this.cells[a];b.remove.apply(b,arguments)}return c.View.prototype.remove.apply(this,arguments)}}),F=i.EmptyRow=c.View.extend({tagName:"tr",emptyText:null,initia
 lize:function(a){this.emptyText=a.emptyText,this.columns=a.columns},render:function(){this.$el.empty();var a=document.createElement("td");return a.setAttribute("colspan",this.columns.length),a.appendChild(document.createTextNode(b.result(this,"emptyText"))),this.el.className="empty",this.el.appendChild(a),this}}),G=i.HeaderCell=c.View.extend({tagName:"th",events:{"click a":"onClick"},initialize:function(a){this.column=a.column,this.column instanceof C||(this.column=new C(this.column));var b=this.column,c=this.collection,d=this.$el;this.listenTo(b,"change:editable change:sortable change:renderable",function(a){var b=a.changedAttributes();for(var c in b)b.hasOwnProperty(c)&&d.toggleClass(c,b[c])}),this.listenTo(b,"change:direction",this.setCellDirection),this.listenTo(b,"change:name change:label",this.render),i.callByNeed(b.editable(),b,c)&&d.addClass("editable"),i.callByNeed(b.sortable(),b,c)&&d.addClass("sortable"),i.callByNeed(b.renderable(),b,c)&&d.addClass("renderable"),this.list
 enTo(c.fullCollection||c,"sort",this.removeCellDirection)},removeCellDirection:function(){this.$el.removeClass("ascending").removeClass("descending"),this.column.set("direction",null)},setCellDirection:function(a,b){this.$el.removeClass("ascending").removeClass("descending"),a.cid==this.column.cid&&this.$el.addClass(b)},onClick:function(a){function b(a,b){"ascending"===d.get("direction")?e.trigger(f,b,"descending"):"descending"===d.get("direction")?e.trigger(f,b,null):e.trigger(f,b,"ascending")}function c(a,b){"ascending"===d.get("direction")?e.trigger(f,b,"descending"):e.trigger(f,b,"ascending")}a.preventDefault();var d=this.column,e=this.collection,f="backgrid:sort",g=i.callByNeed(d.sortable(),d,this.collection);if(g){var h=d.get("sortType");"toggle"===h?c(this,d):b(this,d)}},render:function(){this.$el.empty();var a,b=this.column,c=i.callByNeed(b.sortable(),b,this.collection);return a=c?h("<a>").text(b.get("label")).append("<b class='sort-caret'></b>"):document.createTextNode(b.ge
 t("label")),this.$el.append(a),this.$el.addClass(b.get("name")),this.$el.addClass(b.get("direction")),this.delegateEvents(),this}}),H=(i.HeaderRow=i.Row.extend({requiredOptions:["columns","collection"],initialize:function(){i.Row.prototype.initialize.apply(this,arguments)},makeCell:function(a,b){var c=a.get("headerCell")||b.headerCell||G;return c=new c({column:a,collection:this.collection})}}),i.Header=c.View.extend({tagName:"thead",initialize:function(a){this.columns=a.columns,this.columns instanceof c.Collection||(this.columns=new D(this.columns)),this.row=new i.HeaderRow({columns:this.columns,collection:this.collection})},render:function(){return this.$el.append(this.row.render().$el),this.delegateEvents(),this},remove:function(){return this.row.remove.apply(this.row,arguments),c.View.prototype.remove.apply(this,arguments)}})),I=i.Body=c.View.extend({tagName:"tbody",initialize:function(a){this.columns=a.columns,this.columns instanceof c.Collection||(this.columns=new D(this.column
 s)),this.row=a.row||E,this.rows=this.collection.map(function(a){var b=new this.row({columns:this.columns,model:a});return b},this),this.emptyText=a.emptyText,this._unshiftEmptyRowMayBe();var b=this.collection;this.listenTo(b,"add",this.insertRow),this.listenTo(b,"remove",this.removeRow),this.listenTo(b,"sort",this.refresh),this.listenTo(b,"reset",this.refresh),this.listenTo(b,"backgrid:sort",this.sort),this.listenTo(b,"backgrid:edited",this.moveToNextCell)},_unshiftEmptyRowMayBe:function(){0===this.rows.length&&null!=this.emptyText&&this.rows.unshift(new F({emptyText:this.emptyText,columns:this.columns}))},insertRow:function(a,b,d){if(this.rows[0]instanceof F&&this.rows.pop().remove(),!(b instanceof c.Collection||d))return void this.collection.add(a,d=b);var e=new this.row({columns:this.columns,model:a}),f=b.indexOf(a);this.rows.splice(f,0,e);var g=this.$el,h=g.children(),i=e.render().$el;return f>=h.length?g.append(i):h.eq(f).before(i),this},removeRow:function(a,c,d){return d?((b.i
 sUndefined(d.render)||d.render)&&this.rows[d.index].remove(),this.rows.splice(d.index,1),this._unshiftEmptyRowMayBe(),this):(this.collection.remove(a,d=c),void this._unshiftEmptyRowMayBe())},refresh:function(){for(var a=0;a<this.rows.length;a++)this.rows[a].remove();return this.rows=this.collection.map(function(a){var b=new this.row({columns:this.columns,model:a});return b},this),this._unshiftEmptyRowMayBe(),this.render(),this.collection.trigger("backgrid:refresh",this),this},render:function(){this.$el.empty();for(var a=document.createDocumentFragment(),b=0;b<this.rows.length;b++){var c=this.rows[b];a.appendChild(c.render().el)}return this.el.appendChild(a),this.delegateEvents(),this},remove:function(){for(var a=0;a<this.rows.length;a++){var b=this.rows[a];b.remove.apply(b,arguments)}return c.View.prototype.remove.apply(this,arguments)},sort:function(a,d){if(!b.contains(["ascending","descending",null],d))throw new RangeError('direction must be one of "ascending", "descending" or `nu
 ll`');b.isString(a)&&(a=this.columns.findWhere({name:a}));var e,f=this.collection;e="ascending"===d?-1:"descending"===d?1:null;var g=this.makeComparator(a.get("name"),e,e?a.sortValue():function(a){return 1*a.cid.replace("c","")});return c.PageableCollection&&f instanceof c.PageableCollection?(f.setSorting(e&&a.get("name"),e,{sortValue:a.sortValue()}),f.fullCollection?(null==f.fullCollection.comparator&&(f.fullCollection.comparator=g),f.fullCollection.sort(),f.trigger("backgrid:sorted",a,d,f)):f.fetch({reset:!0,success:function(){f.trigger("backgrid:sorted",a,d,f)}})):(f.comparator=g,f.sort(),f.trigger("backgrid:sorted",a,d,f)),a.set("direction",d),this},makeComparator:function(a,b,c){return function(d,e){var f,g=c(d,a),h=c(e,a);return 1===b&&(f=g,g=h,h=f),g===h?0:h>g?-1:1}},moveToNextCell:function(a,b,c){var d,e,f,g,h,j=this.collection.indexOf(a),k=this.columns.indexOf(b);if(this.rows[j].cells[k].exitEditMode(),c.moveUp()||c.moveDown()||c.moveLeft()||c.moveRight()||c.save()){var l=t
 his.columns.length,m=l*this.collection.length;if(c.moveUp()||c.moveDown()){g=j+(c.moveUp()?-1:1);var n=this.rows[g];n?(d=n.cells[k],i.callByNeed(d.column.editable(),d.column,a)&&(d.enterEditMode(),a.trigger("backgrid:next",g,k,!1))):a.trigger("backgrid:next",g,k,!0)}else if(c.moveLeft()||c.moveRight()){for(var o=c.moveRight(),p=j*l+k+(o?1:-1);p>=0&&m>p;o?p++:p--)if(g=~~(p/l),h=p-g*l,d=this.rows[g].cells[h],e=i.callByNeed(d.column.renderable(),d.column,d.model),f=i.callByNeed(d.column.editable(),d.column,a),e&&f){d.enterEditMode(),a.trigger("backgrid:next",g,h,!1);break}p==m&&a.trigger("backgrid:next",~~(p/l),p-g*l,!0)}}return this}});i.Footer=c.View.extend({tagName:"tfoot",initialize:function(a){this.columns=a.columns,this.columns instanceof c.Collection||(this.columns=new i.Columns(this.columns))}}),i.Grid=c.View.extend({tagName:"table",className:"backgrid",header:H,body:I,footer:null,initialize:function(a){a.columns instanceof c.Collection||(a.columns=new D(a.columns)),this.column
 s=a.columns;var d=b.omit(a,["el","id","attributes","className","tagName","events"]);this.body=a.body||this.body,this.body=new this.body(d),this.header=a.header||this.header,this.header&&(this.header=new this.header(d)),this.footer=a.footer||this.footer,this.footer&&(this.footer=new this.footer(d)),this.listenTo(this.columns,"reset",function(){this.header&&(this.header=new(this.header.remove().constructor)(d)),this.body=new(this.body.remove().constructor)(d),this.footer&&(this.footer=new(this.footer.remove().constructor)(d)),this.render()})},insertRow:function(){return this.body.insertRow.apply(this.body,arguments),this},removeRow:function(){return this.body.removeRow.apply(this.body,arguments),this},insertColumn:function(){return this.columns.add.apply(this.columns,arguments),this},removeColumn:function(){return this.columns.remove.apply(this.columns,arguments),this},sort:function(){return this.body.sort.apply(this.body,arguments),this},render:function(){return this.$el.empty(),this
 .header&&this.$el.append(this.header.render().$el),this.footer&&this.$el.append(this.footer.render().$el),this.$el.append(this.body.render().$el),this.delegateEvents(),this.trigger("backgrid:rendered",this),this},remove:function(){return this.header&&this.header.remove.apply(this.header,arguments),this.body.remove.apply(this.body,arguments),this.footer&&this.footer.remove.apply(this.footer,arguments),c.View.prototype.remove.apply(this,arguments)}})}return i});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.js
new file mode 100644
index 0000000..f6c6661
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.js
@@ -0,0 +1,660 @@
+/**
+ * bootbox.js v3.3.0
+ *
+ * http://bootboxjs.com/license.txt
+ */
+var bootbox = window.bootbox || (function(document, $) {
+    /*jshint scripturl:true sub:true */
+
+    var _locale        = 'en',
+        _defaultLocale = 'en',
+        _animate       = true,
+        _backdrop      = 'static',
+        _defaultHref   = 'javascript:;',
+        _classes       = '',
+        _btnClasses    = {},
+        _icons         = {},
+        /* last var should always be the public object we'll return */
+        that           = {};
+
+
+    /**
+     * public API
+     */
+    that.setLocale = function(locale) {
+        for (var i in _locales) {
+            if (i == locale) {
+                _locale = locale;
+                return;
+            }
+        }
+        throw new Error('Invalid locale: '+locale);
+    };
+
+    that.addLocale = function(locale, translations) {
+        if (typeof _locales[locale] === 'undefined') {
+            _locales[locale] = {};
+        }
+        for (var str in translations) {
+            _locales[locale][str] = translations[str];
+        }
+    };
+
+    that.setIcons = function(icons) {
+        _icons = icons;
+        if (typeof _icons !== 'object' || _icons === null) {
+            _icons = {};
+        }
+    };
+
+    that.setBtnClasses = function(btnClasses) {
+        _btnClasses = btnClasses;
+        if (typeof _btnClasses !== 'object' || _btnClasses === null) {
+            _btnClasses = {};
+        }
+    };
+
+    that.alert = function(/*str, label, cb*/) {
+        var str   = "",
+            label = _translate('OK'),
+            cb    = null;
+
+        switch (arguments.length) {
+            case 1:
+                // no callback, default button label
+                str = arguments[0];
+                break;
+            case 2:
+                // callback *or* custom button label dependent on type
+                str = arguments[0];
+                if (typeof arguments[1] == 'function') {
+                    cb = arguments[1];
+                } else {
+                    label = arguments[1];
+                }
+                break;
+            case 3:
+                // callback and custom button label
+                str   = arguments[0];
+                label = arguments[1];
+                cb    = arguments[2];
+                break;
+            default:
+                throw new Error("Incorrect number of arguments: expected 1-3");
+        }
+
+        return that.dialog(str, {
+            // only button (ok)
+            "label"   : label,
+            "icon"    : _icons.OK,
+            "class"   : _btnClasses.OK,
+            "callback": cb
+        }, {
+            // ensure that the escape key works; either invoking the user's
+            // callback or true to just close the dialog
+            "onEscape": cb || true
+        });
+    };
+
+    that.confirm = function(/*str, labelCancel, labelOk, cb*/) {
+        var str         = "",
+            labelCancel = _translate('CANCEL'),
+            labelOk     = _translate('CONFIRM'),
+            cb          = null;
+
+        switch (arguments.length) {
+            case 1:
+                str = arguments[0];
+                break;
+            case 2:
+                str = arguments[0];
+                if (typeof arguments[1] == 'function') {
+                    cb = arguments[1];
+                } else {
+                    labelCancel = arguments[1];
+                }
+                break;
+            case 3:
+                str         = arguments[0];
+                labelCancel = arguments[1];
+                if (typeof arguments[2] == 'function') {
+                    cb = arguments[2];
+                } else {
+                    labelOk = arguments[2];
+                }
+                break;
+            case 4:
+                str         = arguments[0];
+                labelCancel = arguments[1];
+                labelOk     = arguments[2];
+                cb          = arguments[3];
+                break;
+            default:
+                throw new Error("Incorrect number of arguments: expected 1-4");
+        }
+
+        var cancelCallback = function() {
+            if (typeof cb === 'function') {
+                return cb(false);
+            }
+        };
+
+        var confirmCallback = function() {
+            if (typeof cb === 'function') {
+                return cb(true);
+            }
+        };
+
+        return that.dialog(str, [{
+            // first button (cancel)
+            "label"   : labelCancel,
+            "icon"    : _icons.CANCEL,
+            "class"   : _btnClasses.CANCEL,
+            "callback": cancelCallback
+        }, {
+            // second button (confirm)
+            "label"   : labelOk,
+            "icon"    : _icons.CONFIRM,
+            "class"   : _btnClasses.CONFIRM,
+            "callback": confirmCallback
+        }], {
+            // escape key bindings
+            "onEscape": cancelCallback
+        });
+    };
+
+    that.prompt = function(/*str, labelCancel, labelOk, cb, defaultVal*/) {
+        var str         = "",
+            labelCancel = _translate('CANCEL'),
+            labelOk     = _translate('CONFIRM'),
+            cb          = null,
+            defaultVal  = "";
+
+        switch (arguments.length) {
+            case 1:
+                str = arguments[0];
+                break;
+            case 2:
+                str = arguments[0];
+                if (typeof arguments[1] == 'function') {
+                    cb = arguments[1];
+                } else {
+                    labelCancel = arguments[1];
+                }
+                break;
+            case 3:
+                str         = arguments[0];
+                labelCancel = arguments[1];
+                if (typeof arguments[2] == 'function') {
+                    cb = arguments[2];
+                } else {
+                    labelOk = arguments[2];
+                }
+                break;
+            case 4:
+                str         = arguments[0];
+                labelCancel = arguments[1];
+                labelOk     = arguments[2];
+                cb          = arguments[3];
+                break;
+            case 5:
+                str         = arguments[0];
+                labelCancel = arguments[1];
+                labelOk     = arguments[2];
+                cb          = arguments[3];
+                defaultVal  = arguments[4];
+                break;
+            default:
+                throw new Error("Incorrect number of arguments: expected 1-5");
+        }
+
+        var header = str;
+
+        // let's keep a reference to the form object for later
+        var form = $("<form></form>");
+        form.append("<input class='input-block-level' autocomplete=off type=text value='" + defaultVal + "' />");
+
+        var cancelCallback = function() {
+            if (typeof cb === 'function') {
+                // yep, native prompts dismiss with null, whereas native
+                // confirms dismiss with false...
+                return cb(null);
+            }
+        };
+
+        var confirmCallback = function() {
+            if (typeof cb === 'function') {
+                return cb(form.find("input[type=text]").val());
+            }
+        };
+
+        var div = that.dialog(form, [{
+            // first button (cancel)
+            "label"   : labelCancel,
+            "icon"    : _icons.CANCEL,
+            "class"   : _btnClasses.CANCEL,
+            "callback":  cancelCallback
+        }, {
+            // second button (confirm)
+            "label"   : labelOk,
+            "icon"    : _icons.CONFIRM,
+            "class"   : _btnClasses.CONFIRM,
+            "callback": confirmCallback
+        }], {
+            // prompts need a few extra options
+            "header"  : header,
+            // explicitly tell dialog NOT to show the dialog...
+            "show"    : false,
+            "onEscape": cancelCallback
+        });
+
+        // ... the reason the prompt needs to be hidden is because we need
+        // to bind our own "shown" handler, after creating the modal but
+        // before any show(n) events are triggered
+        // @see https://github.com/makeusabrew/bootbox/issues/69
+
+        div.on("shown", function() {
+            form.find("input[type=text]").focus();
+
+            // ensure that submitting the form (e.g. with the enter key)
+            // replicates the behaviour of a normal prompt()
+            form.on("submit", function(e) {
+                e.preventDefault();
+                div.find(".btn-primary").click();
+            });
+        });
+
+        div.modal("show");
+
+        return div;
+    };
+
+    that.dialog = function(str, handlers, options) {
+        var buttons    = "",
+            callbacks  = [];
+
+        if (!options) {
+            options = {};
+        }
+
+        // check for single object and convert to array if necessary
+        if (typeof handlers === 'undefined') {
+            handlers = [];
+        } else if (typeof handlers.length == 'undefined') {
+            handlers = [handlers];
+        }
+
+        var i = handlers.length;
+        while (i--) {
+            var label    = null,
+                href     = null,
+                _class   = null,
+                icon     = '',
+                callback = null;
+
+            if (typeof handlers[i]['label']    == 'undefined' &&
+                typeof handlers[i]['class']    == 'undefined' &&
+                typeof handlers[i]['callback'] == 'undefined') {
+                // if we've got nothing we expect, check for condensed format
+
+                var propCount = 0,      // condensed will only match if this == 1
+                    property  = null;   // save the last property we found
+
+                // be nicer to count the properties without this, but don't think it's possible...
+                for (var j in handlers[i]) {
+                    property = j;
+                    if (++propCount > 1) {
+                        // forget it, too many properties
+                        break;
+                    }
+                }
+
+                if (propCount == 1 && typeof handlers[i][j] == 'function') {
+                    // matches condensed format of label -> function
+                    handlers[i]['label']    = property;
+                    handlers[i]['callback'] = handlers[i][j];
+                }
+            }
+
+            if (typeof handlers[i]['callback']== 'function') {
+                callback = handlers[i]['callback'];
+            }
+
+            if (handlers[i]['class']) {
+                _class = handlers[i]['class'];
+            } else if (i == handlers.length -1 && handlers.length <= 2) {
+                // always add a primary to the main option in a two-button dialog
+                _class = 'btn-primary';
+            }
+
+            if (handlers[i]['link'] !== true) {
+                _class = 'btn ' + _class;
+            }
+
+            if (handlers[i]['label']) {
+                label = handlers[i]['label'];
+            } else {
+                label = "Option "+(i+1);
+            }
+
+            if (handlers[i]['icon']) {
+                icon = "<i class='"+handlers[i]['icon']+"'></i> ";
+            }
+
+            if (handlers[i]['href']) {
+                href = handlers[i]['href'];
+            }
+            else {
+                href = _defaultHref;
+            }
+
+            buttons = "<a data-handler='"+i+"' class='"+_class+"' href='" + href + "'>"+icon+""+label+"</a>" + buttons;
+
+            callbacks[i] = callback;
+        }
+
+        // @see https://github.com/makeusabrew/bootbox/issues/46#issuecomment-8235302
+        // and https://github.com/twitter/bootstrap/issues/4474
+        // for an explanation of the inline overflow: hidden
+        // @see https://github.com/twitter/bootstrap/issues/4854
+        // for an explanation of tabIndex=-1
+
+        var parts = ["<div class='bootbox modal' tabindex='-1' style='overflow:hidden;'>"];
+
+        if (options['header']) {
+            var closeButton = '';
+            if (typeof options['headerCloseButton'] == 'undefined' || options['headerCloseButton']) {
+                closeButton = "<a href='"+_defaultHref+"' class='close'>&times;</a>";
+            }
+
+            parts.push("<div class='modal-header'>"+closeButton+"<h3>"+options['header']+"</h3></div>");
+        }
+
+        // push an empty body into which we'll inject the proper content later
+        parts.push("<div class='modal-body'></div>");
+
+        if (buttons) {
+            parts.push("<div class='modal-footer'>"+buttons+"</div>");
+        }
+
+        parts.push("</div>");
+
+        var div = $(parts.join("\n"));
+
+        // check whether we should fade in/out
+        var shouldFade = (typeof options.animate === 'undefined') ? _animate : options.animate;
+
+        if (shouldFade) {
+            div.addClass("fade");
+        }
+
+        var optionalClasses = (typeof options.classes === 'undefined') ? _classes : options.classes;
+        if (optionalClasses) {
+            div.addClass(optionalClasses);
+        }
+
+        // now we've built up the div properly we can inject the content whether it was a string or a jQuery object
+        div.find(".modal-body").html(str);
+
+        function onCancel(source) {
+            // for now source is unused, but it will be in future
+            var hideModal = null;
+            if (typeof options.onEscape === 'function') {
+                // @see https://github.com/makeusabrew/bootbox/issues/91
+                hideModal = options.onEscape();
+            }
+
+            if (hideModal !== false) {
+                div.modal('hide');
+            }
+        }
+
+        // hook into the modal's keyup trigger to check for the escape key
+        div.on('keyup.dismiss.modal', function(e) {
+            // any truthy value passed to onEscape will dismiss the dialog
+            // as long as the onEscape function (if defined) doesn't prevent it
+            if (e.which === 27 && options.onEscape) {
+                onCancel('escape');
+            }
+        });
+
+        // handle close buttons too
+        div.on('click', 'a.close', function(e) {
+            e.preventDefault();
+            onCancel('close');
+        });
+
+        // well, *if* we have a primary - give the first dom element focus
+        div.on('shown', function() {
+            div.find("a.btn-primary:first").focus();
+        });
+
+        div.on('hidden', function(e) {
+            // @see https://github.com/makeusabrew/bootbox/issues/115
+            // allow for the fact hidden events can propagate up from
+            // child elements like tooltips
+            if (e.target === this) {
+                div.remove();
+            }
+        });
+
+        // wire up button handlers
+        div.on('click', '.modal-footer a', function(e) {
+
+            var handler   = $(this).data("handler"),
+                cb        = callbacks[handler],
+                hideModal = null;
+
+            // sort of @see https://github.com/makeusabrew/bootbox/pull/68 - heavily adapted
+            // if we've got a custom href attribute, all bets are off
+            if (typeof handler                   !== 'undefined' &&
+                typeof handlers[handler]['href'] !== 'undefined') {
+
+                return;
+            }
+
+            e.preventDefault();
+
+            if (typeof cb === 'function') {
+                hideModal = cb(e);
+            }
+
+            // the only way hideModal *will* be false is if a callback exists and
+            // returns it as a value. in those situations, don't hide the dialog
+            // @see https://github.com/makeusabrew/bootbox/pull/25
+            if (hideModal !== false) {
+                div.modal("hide");
+            }
+        });
+
+        // stick the modal right at the bottom of the main body out of the way
+        $("body").append(div);
+
+        div.modal({
+            // unless explicitly overridden take whatever our default backdrop value is
+            backdrop : (typeof options.backdrop  === 'undefined') ? _backdrop : options.backdrop,
+            // ignore bootstrap's keyboard options; we'll handle this ourselves (more fine-grained control)
+            keyboard : false,
+            // @ see https://github.com/makeusabrew/bootbox/issues/69
+            // we *never* want the modal to be shown before we can bind stuff to it
+            // this method can also take a 'show' option, but we'll only use that
+            // later if we need to
+            show     : false
+        });
+
+        // @see https://github.com/makeusabrew/bootbox/issues/64
+        // @see https://github.com/makeusabrew/bootbox/issues/60
+        // ...caused by...
+        // @see https://github.com/twitter/bootstrap/issues/4781
+        div.on("show", function(e) {
+            $(document).off("focusin.modal");
+        });
+
+        if (typeof options.show === 'undefined' || options.show === true) {
+            div.modal("show");
+        }
+
+        return div;
+    };
+
+    /**
+     * #modal is deprecated in v3; it can still be used but no guarantees are
+     * made - have never been truly convinced of its merit but perhaps just
+     * needs a tidyup and some TLC
+     */
+    that.modal = function(/*str, label, options*/) {
+        var str;
+        var label;
+        var options;
+
+        var defaultOptions = {
+            "onEscape": null,
+            "keyboard": true,
+            "backdrop": _backdrop
+        };
+
+        switch (arguments.length) {
+            case 1:
+                str = arguments[0];
+                break;
+            case 2:
+                str = arguments[0];
+                if (typeof arguments[1] == 'object') {
+                    options = arguments[1];
+                } else {
+                    label = arguments[1];
+                }
+                break;
+            case 3:
+                str     = arguments[0];
+                label   = arguments[1];
+                options = arguments[2];
+                break;
+            default:
+                throw new Error("Incorrect number of arguments: expected 1-3");
+        }
+
+        defaultOptions['header'] = label;
+
+        if (typeof options == 'object') {
+            options = $.extend(defaultOptions, options);
+        } else {
+            options = defaultOptions;
+        }
+
+        return that.dialog(str, [], options);
+    };
+
+
+    that.hideAll = function() {
+        $(".bootbox").modal("hide");
+    };
+
+    that.animate = function(animate) {
+        _animate = animate;
+    };
+
+    that.backdrop = function(backdrop) {
+        _backdrop = backdrop;
+    };
+
+    that.classes = function(classes) {
+        _classes = classes;
+    };
+
+    /**
+     * private API
+     */
+
+    /**
+     * standard locales. Please add more according to ISO 639-1 standard. Multiple language variants are
+     * unlikely to be required. If this gets too large it can be split out into separate JS files.
+     */
+    var _locales = {
+        'br' : {
+            OK      : 'OK',
+            CANCEL  : 'Cancelar',
+            CONFIRM : 'Sim'
+        },
+        'da' : {
+            OK      : 'OK',
+            CANCEL  : 'Annuller',
+            CONFIRM : 'Accepter'
+        },
+        'de' : {
+            OK      : 'OK',
+            CANCEL  : 'Abbrechen',
+            CONFIRM : 'Akzeptieren'
+        },
+        'en' : {
+            OK      : 'OK',
+            CANCEL  : 'Cancel',
+            CONFIRM : 'OK'
+        },
+        'es' : {
+            OK      : 'OK',
+            CANCEL  : 'Cancelar',
+            CONFIRM : 'Aceptar'
+        },
+        'fr' : {
+            OK      : 'OK',
+            CANCEL  : 'Annuler',
+            CONFIRM : 'D\'accord'
+        },
+        'it' : {
+            OK      : 'OK',
+            CANCEL  : 'Annulla',
+            CONFIRM : 'Conferma'
+        },
+        'nl' : {
+            OK      : 'OK',
+            CANCEL  : 'Annuleren',
+            CONFIRM : 'Accepteren'
+        },
+        'pl' : {
+            OK      : 'OK',
+            CANCEL  : 'Anuluj',
+            CONFIRM : 'Potwierdź'
+        },
+        'ru' : {
+            OK      : 'OK',
+            CANCEL  : 'Отмена',
+            CONFIRM : 'Применить'
+        },
+        'zh_CN' : {
+            OK      : 'OK',
+            CANCEL  : '取消',
+            CONFIRM : '确认'
+        },
+        'zh_TW' : {
+            OK      : 'OK',
+            CANCEL  : '取消',
+            CONFIRM : '確認'
+        }
+    };
+
+    function _translate(str, locale) {
+        // we assume if no target locale is probided then we should take it from current setting
+        if (typeof locale === 'undefined') {
+            locale = _locale;
+        }
+        if (typeof _locales[locale][str] === 'string') {
+            return _locales[locale][str];
+        }
+
+        // if we couldn't find a lookup then try and fallback to a default translation
+
+        if (locale != _defaultLocale) {
+            return _translate(str, _defaultLocale);
+        }
+
+        // if we can't do anything then bail out with whatever string was passed in - last resort
+        return str;
+    }
+
+    return that;
+
+}(document, window.jQuery));
+
+// @see https://github.com/makeusabrew/bootbox/issues/71
+window.bootbox = bootbox;

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.min.js
new file mode 100644
index 0000000..0dc0cbd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootbox/js/bootbox.min.js
@@ -0,0 +1,6 @@
+/**
+ * bootbox.js v4.4.0
+ *
+ * http://bootboxjs.com/license.txt
+ */
+!function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d.call(c,a)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function h(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},o,a),a.buttons||(a.buttons={}),c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}function i(a,b){var c=a.length,d={};if(1>c||c>2)thr
 ow new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(a,c,d){return b.extend(!0,{},a,i(c,d))}function k(a,b,c,d){var e={className:"bootbox-"+a,buttons:l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hi
 dden='true'>&times;</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password'
  />"}},o={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},p={};p.alert=function(){var a;if(a=k("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback.call(this):!0},p.dialog(a)},p.confirm=function(){var a;if(a=k("confirm",["cancel","confirm"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,!1)},a.buttons.confirm.callback=function(){return a.callback.call(this,!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return p.dialog(a)},p.prompt=function(){var a,d,e,f,h,i,k;if(f=b(n.form),d={className:"bootbox-prompt",buttons:l("cancel","confirm"),value:"",inputType:"text"},a=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0
 :a.show,a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(a,d){c.push(b(d).val())})}return a.callback.call(this,c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!n.inputs[a.inputType])throw new Error("invalid prompt type");switch(h=b(n.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(a.value);break;case"select":var o={};if(k=a.inputOptions||[],!b.isArray(k))throw new Error("Please pass an array of input options");if(!k.length)throw new Error("prompt with select requires options");g(k,function(a,d){var e=h;if(d.value===c||d.text=
 ==c)throw new Error("given options in wrong format");d.group&&(o[d.group]||(o[d.group]=b("<optgroup/>").attr("label",d.group)),e=o[d.group]),e.append("<option value='"+d.value+"'>"+d.text+"</option>")}),g(o,function(a,b){h.append(b)}),h.val(a.value);break;case"checkbox":var q=b.isArray(a.value)?a.value:[a.value];if(k=a.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=b("<div/>"),g(k,function(c,d){var e=b(n.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(q,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return a.placeholder&&h.attr("placeholder",a.placeholder),a.pattern&&h.attr("pattern",a.pattern),a.maxlength&&h.attr("maxlength",a.maxlength),f.append(h),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=p.dialog(a),e.off("shown.bs.modal"),e.on("shown.
 bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(a){a=h(a);var d=b(n.dialog),f=d.find(".modal-dialog"),i=d.find(".modal-body"),j=a.buttons,k="",l={onEscape:a.onEscape};if(b.fn.modal===c)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(g(j,function(a,b){k+="<button data-bb-handler='"+a+"' type='button' class='btn "+b.className+"'>"+b.label+"</button>",l[a]=b.callback}),i.find(".bootbox-body").html(a.message),a.animate===!0&&d.addClass("fade"),a.className&&d.addClass(a.className),"large"===a.size?f.addClass("modal-lg"):"small"===a.size&&f.addClass("modal-sm"),a.title&&i.before(n.header),a.closeButton){var m=b(n.closeButton);a.title?d.find(".modal-header").prepend(m):m.css("margin-top","-10px").prependTo(i)}return a.title&&d.find(".modal-title").html(a.title),k.length&&(i.after(n.footer),d.find(".modal-footer").html(k)),d.on("hid
 den.bs.modal",function(a){a.target===this&&d.remove()}),d.on("shown.bs.modal",function(){d.find(".btn-primary:first").focus()}),"static"!==a.backdrop&&d.on("click.dismiss.bs.modal",function(a){d.children(".modal-backdrop").length&&(a.currentTarget=d.children(".modal-backdrop").get(0)),a.target===a.currentTarget&&d.trigger("escape.close.bb")}),d.on("escape.close.bb",function(a){l.onEscape&&e(a,d,l.onEscape)}),d.on("click",".modal-footer button",function(a){var c=b(this).data("bb-handler");e(a,d,l[c])}),d.on("click",".bootbox-close-button",function(a){e(a,d,l.onEscape)}),d.on("keyup",function(a){27===a.which&&d.trigger("escape.close.bb")}),b(a.container).append(d),d.modal({backdrop:a.backdrop?"static":!1,keyboard:!1,show:!1}),a.show&&d.modal("show"),d},p.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(o,a)},p.hideAll=function(){return b(".bootbox").modal("hide"),p};var q={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвъ
 рждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"
 },nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return p.addLocale=function(a,c){return b.each(["OK","CANCEL","CONFIRM"],function(a,b){if(!c[b])throw new Error("Please supply a translation for '"+b+"'")}),q[a]={OK:c.OK,CANCEL:c.CANCEL,CONFIRM:c.CONFIRM},p},p.removeLocale=function(a){return delete q[a],p},p.setLocale=function(a){return p.setDefaults("locale",a)},p.init=function(c){return a(c||b)},p});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/css/bootstrap-notify.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/css/bootstrap-notify.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/css/bootstrap-notify.css
new file mode 100644
index 0000000..7473f78
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/css/bootstrap-notify.css
@@ -0,0 +1,31 @@
+.notifications {
+  position: fixed;
+  z-index: 9999;
+}
+
+/* Positioning */ 
+.notifications.top-right {
+  right: 10px;
+  top: 25px;
+}
+
+.notifications.top-left {
+  left: 10px;
+  top: 25px;
+}
+
+.notifications.bottom-left {
+  left: 10px;
+  bottom: 25px;
+}
+
+.notifications.bottom-right {
+  right: 10px;
+  bottom: 25px;
+}
+
+/* Notification Element */
+.notifications > div {
+  position: relative;
+  margin: 5px 0px;
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/js/bootstrap-notify.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/js/bootstrap-notify.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/js/bootstrap-notify.js
new file mode 100644
index 0000000..e58c6c5
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap-notify/js/bootstrap-notify.js
@@ -0,0 +1,97 @@
+/**
+ * bootstrap-notify.js v1.0
+ * --
+  * Copyright 2012 Goodybag, Inc.
+ * --
+ * Licensed 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.
+ */
+
+(function ($) {
+  var Notification = function (element, options) {
+    // Element collection
+    this.$element = $(element);
+    this.$note    = $('<div class="alert"></div>');
+    this.options  = $.extend(true, {}, $.fn.notify.defaults, options);
+
+    // Setup from options
+    if(this.options.transition) {
+      if(this.options.transition == 'fade')
+        this.$note.addClass('in').addClass(this.options.transition);
+      else
+        this.$note.addClass(this.options.transition);
+    } else
+      this.$note.addClass('fade').addClass('in');
+
+    if(this.options.type)
+      this.$note.addClass('alert-' + this.options.type);
+    else
+      this.$note.addClass('alert-success');
+
+    if(!this.options.message && this.$element.data("message") !== '') // dom text
+      this.$note.html(this.$element.data("message"));
+    else
+      if(typeof this.options.message === 'object') {
+        if(this.options.message.html)
+          this.$note.html(this.options.message.html);
+        else if(this.options.message.text)
+          this.$note.text(this.options.message.text);
+      } else
+        this.$note.html(this.options.message);
+
+    if(this.options.closable) {
+      var link = $('<a class="close pull-right" href="#">&times;</a>');
+      $(link).on('click', $.proxy(onClose, this));
+      this.$note.prepend(link);
+    }
+
+    return this;
+  };
+
+  var onClose = function() {
+    this.options.onClose();
+    $(this.$note).remove();
+    this.options.onClosed();
+    return false;
+  };
+
+  Notification.prototype.show = function () {
+    if(this.options.fadeOut.enabled)
+      this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(onClose, this));
+
+    this.$element.append(this.$note);
+    this.$note.alert();
+  };
+
+  Notification.prototype.hide = function () {
+    if(this.options.fadeOut.enabled)
+      this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(onClose, this));
+    else onClose.call(this);
+  };
+
+  $.fn.notify = function (options) {
+    return new Notification(this, options);
+  };
+
+  $.fn.notify.defaults = {
+    type: 'success',
+    closable: true,
+    transition: 'fade',
+    fadeOut: {
+      enabled: true,
+      delay: 3000
+    },
+    message: null,
+    onClose: function () {},
+    onClosed: function () {}
+  }
+})(window.jQuery);

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css
new file mode 100644
index 0000000..f860bbc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/bootstrap/bootstrap-theme.css
@@ -0,0 +1,442 @@
+/*!
+ * Bootstrap v3.2.0 (http://getbootstrap.com)
+ * Copyright 2011-2014 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+.btn-default,
+.btn-primary,
+.btn-success,
+.btn-info,
+.btn-warning,
+.btn-danger {
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
+}
+.btn-default:active,
+.btn-primary:active,
+.btn-success:active,
+.btn-info:active,
+.btn-warning:active,
+.btn-danger:active,
+.btn-default.active,
+.btn-primary.active,
+.btn-success.active,
+.btn-info.active,
+.btn-warning.active,
+.btn-danger.active {
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+          box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
+}
+.btn:active,
+.btn.active {
+  background-image: none;
+}
+.btn-default {
+  text-shadow: 0 1px 0 #fff;
+  background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
+  background-image:      -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
+  background-image:         linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #dbdbdb;
+  border-color: #ccc;
+}
+.btn-default:hover,
+.btn-default:focus {
+  background-color: #e0e0e0;
+  background-position: 0 -15px;
+}
+.btn-default:active,
+.btn-default.active {
+  background-color: #e0e0e0;
+  border-color: #dbdbdb;
+}
+.btn-default:disabled,
+.btn-default[disabled] {
+  background-color: #e0e0e0;
+  background-image: none;
+}
+.btn-primary {
+  background-image: -webkit-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
+  background-image:      -o-linear-gradient(top, #428bca 0%, #2d6ca2 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#2d6ca2));
+  background-image:         linear-gradient(to bottom, #428bca 0%, #2d6ca2 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #2b669a;
+}
+.btn-primary:hover,
+.btn-primary:focus {
+  background-color: #2d6ca2;
+  background-position: 0 -15px;
+}
+.btn-primary:active,
+.btn-primary.active {
+  background-color: #2d6ca2;
+  border-color: #2b669a;
+}
+.btn-primary:disabled,
+.btn-primary[disabled] {
+  background-color: #2d6ca2;
+  background-image: none;
+}
+.btn-success {
+  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
+  background-image:      -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
+  background-image:         linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #3e8f3e;
+}
+.btn-success:hover,
+.btn-success:focus {
+  background-color: #419641;
+  background-position: 0 -15px;
+}
+.btn-success:active,
+.btn-success.active {
+  background-color: #419641;
+  border-color: #3e8f3e;
+}
+.btn-success:disabled,
+.btn-success[disabled] {
+  background-color: #419641;
+  background-image: none;
+}
+.btn-info {
+  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+  background-image:      -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
+  background-image:         linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #28a4c9;
+}
+.btn-info:hover,
+.btn-info:focus {
+  background-color: #2aabd2;
+  background-position: 0 -15px;
+}
+.btn-info:active,
+.btn-info.active {
+  background-color: #2aabd2;
+  border-color: #28a4c9;
+}
+.btn-info:disabled,
+.btn-info[disabled] {
+  background-color: #2aabd2;
+  background-image: none;
+}
+.btn-warning {
+  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
+  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #e38d13;
+}
+.btn-warning:hover,
+.btn-warning:focus {
+  background-color: #eb9316;
+  background-position: 0 -15px;
+}
+.btn-warning:active,
+.btn-warning.active {
+  background-color: #eb9316;
+  border-color: #e38d13;
+}
+.btn-warning:disabled,
+.btn-warning[disabled] {
+  background-color: #eb9316;
+  background-image: none;
+}
+.btn-danger {
+  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+  background-image:      -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
+  background-image:         linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-color: #b92c28;
+}
+.btn-danger:hover,
+.btn-danger:focus {
+  background-color: #c12e2a;
+  background-position: 0 -15px;
+}
+.btn-danger:active,
+.btn-danger.active {
+  background-color: #c12e2a;
+  border-color: #b92c28;
+}
+.btn-danger:disabled,
+.btn-danger[disabled] {
+  background-color: #c12e2a;
+  background-image: none;
+}
+.thumbnail,
+.img-thumbnail {
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+}
+.dropdown-menu > li > a:hover,
+.dropdown-menu > li > a:focus {
+  background-color: #e8e8e8;
+  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+  background-repeat: repeat-x;
+}
+.dropdown-menu > .active > a,
+.dropdown-menu > .active > a:hover,
+.dropdown-menu > .active > a:focus {
+  background-color: #357ebd;
+  background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
+  background-image:      -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
+  background-image:         linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
+  background-repeat: repeat-x;
+}
+.navbar-default {
+  background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
+  background-image:      -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
+  background-image:         linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+  border-radius: 4px;
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
+}
+.navbar-default .navbar-nav > .active > a {
+  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
+  background-image:      -o-linear-gradient(top, #ebebeb 0%, #f3f3f3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f3f3f3));
+  background-image:         linear-gradient(to bottom, #ebebeb 0%, #f3f3f3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);
+  background-repeat: repeat-x;
+  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
+          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
+}
+.navbar-brand,
+.navbar-nav > li > a {
+  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
+}
+.navbar-inverse {
+  background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
+  background-image:      -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
+  background-image:         linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
+  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+  background-repeat: repeat-x;
+}
+.navbar-inverse .navbar-nav > .active > a {
+  background-image: -webkit-linear-gradient(top, #222 0%, #282828 100%);
+  background-image:      -o-linear-gradient(top, #222 0%, #282828 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#222), to(#282828));
+  background-image:         linear-gradient(to bottom, #222 0%, #282828 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);
+  background-repeat: repeat-x;
+  -webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
+          box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
+}
+.navbar-inverse .navbar-brand,
+.navbar-inverse .navbar-nav > li > a {
+  text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
+}
+.navbar-static-top,
+.navbar-fixed-top,
+.navbar-fixed-bottom {
+  border-radius: 0;
+}
+.alert {
+  text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
+  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
+          box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
+}
+.alert-success {
+  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+  background-image:      -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
+  background-image:         linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #b2dba1;
+}
+.alert-info {
+  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+  background-image:      -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
+  background-image:         linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #9acfea;
+}
+.alert-warning {
+  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
+  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #f5e79e;
+}
+.alert-danger {
+  background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+  background-image:      -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
+  background-image:         linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #dca7a7;
+}
+.progress {
+  background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+  background-image:      -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
+  background-image:         linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar {
+  background-image: -webkit-linear-gradient(top, #428bca 0%, #3071a9 100%);
+  background-image:      -o-linear-gradient(top, #428bca 0%, #3071a9 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3071a9));
+  background-image:         linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-success {
+  background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+  background-image:      -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
+  background-image:         linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-info {
+  background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+  background-image:      -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
+  background-image:         linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-warning {
+  background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+  background-image:      -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
+  background-image:         linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-danger {
+  background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+  background-image:      -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
+  background-image:         linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
+  background-repeat: repeat-x;
+}
+.progress-bar-striped {
+  background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+  background-image:      -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+  background-image:         linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
+}
+.list-group {
+  border-radius: 4px;
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
+}
+.list-group-item.active,
+.list-group-item.active:hover,
+.list-group-item.active:focus {
+  text-shadow: 0 -1px 0 #3071a9;
+  background-image: -webkit-linear-gradient(top, #428bca 0%, #3278b3 100%);
+  background-image:      -o-linear-gradient(top, #428bca 0%, #3278b3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#3278b3));
+  background-image:         linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #3278b3;
+}
+.panel {
+  -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
+          box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
+}
+.panel-default > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image:      -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
+  background-image:         linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-primary > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #428bca 0%, #357ebd 100%);
+  background-image:      -o-linear-gradient(top, #428bca 0%, #357ebd 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#428bca), to(#357ebd));
+  background-image:         linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-success > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+  background-image:      -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
+  background-image:         linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-info > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+  background-image:      -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
+  background-image:         linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-warning > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+  background-image:      -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
+  background-image:         linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
+  background-repeat: repeat-x;
+}
+.panel-danger > .panel-heading {
+  background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+  background-image:      -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
+  background-image:         linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
+  background-repeat: repeat-x;
+}
+.well {
+  background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+  background-image:      -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
+  background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
+  background-image:         linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
+  background-repeat: repeat-x;
+  border-color: #dcdcdc;
+  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
+          box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
+}
+/*# sourceMappingURL=bootstrap-theme.css.map */


[22/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone.js
new file mode 100644
index 0000000..24a550a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone/js/backbone.js
@@ -0,0 +1,1608 @@
+//     Backbone.js 1.1.2
+
+//     (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Backbone may be freely distributed under the MIT license.
+//     For all details and documentation:
+//     http://backbonejs.org
+
+(function(root, factory) {
+
+  // Set up Backbone appropriately for the environment. Start with AMD.
+  if (typeof define === 'function' && define.amd) {
+    define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
+      // Export global even in AMD case in case this script is loaded with
+      // others that may still expect a global Backbone.
+      root.Backbone = factory(root, exports, _, $);
+    });
+
+  // Next for Node.js or CommonJS. jQuery may not be needed as a module.
+  } else if (typeof exports !== 'undefined') {
+    var _ = require('underscore');
+    factory(root, exports, _);
+
+  // Finally, as a browser global.
+  } else {
+    root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
+  }
+
+}(this, function(root, Backbone, _, $) {
+
+  // Initial Setup
+  // -------------
+
+  // Save the previous value of the `Backbone` variable, so that it can be
+  // restored later on, if `noConflict` is used.
+  var previousBackbone = root.Backbone;
+
+  // Create local references to array methods we'll want to use later.
+  var array = [];
+  var push = array.push;
+  var slice = array.slice;
+  var splice = array.splice;
+
+  // Current version of the library. Keep in sync with `package.json`.
+  Backbone.VERSION = '1.1.2';
+
+  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
+  // the `$` variable.
+  Backbone.$ = $;
+
+  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
+  // to its previous owner. Returns a reference to this Backbone object.
+  Backbone.noConflict = function() {
+    root.Backbone = previousBackbone;
+    return this;
+  };
+
+  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
+  // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
+  // set a `X-Http-Method-Override` header.
+  Backbone.emulateHTTP = false;
+
+  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
+  // `application/json` requests ... will encode the body as
+  // `application/x-www-form-urlencoded` instead and will send the model in a
+  // form param named `model`.
+  Backbone.emulateJSON = false;
+
+  // Backbone.Events
+  // ---------------
+
+  // A module that can be mixed in to *any object* in order to provide it with
+  // custom events. You may bind with `on` or remove with `off` callback
+  // functions to an event; `trigger`-ing an event fires all callbacks in
+  // succession.
+  //
+  //     var object = {};
+  //     _.extend(object, Backbone.Events);
+  //     object.on('expand', function(){ alert('expanded'); });
+  //     object.trigger('expand');
+  //
+  var Events = Backbone.Events = {
+
+    // Bind an event to a `callback` function. Passing `"all"` will bind
+    // the callback to all events fired.
+    on: function(name, callback, context) {
+      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
+      this._events || (this._events = {});
+      var events = this._events[name] || (this._events[name] = []);
+      events.push({callback: callback, context: context, ctx: context || this});
+      return this;
+    },
+
+    // Bind an event to only be triggered a single time. After the first time
+    // the callback is invoked, it will be removed.
+    once: function(name, callback, context) {
+      if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
+      var self = this;
+      var once = _.once(function() {
+        self.off(name, once);
+        callback.apply(this, arguments);
+      });
+      once._callback = callback;
+      return this.on(name, once, context);
+    },
+
+    // Remove one or many callbacks. If `context` is null, removes all
+    // callbacks with that function. If `callback` is null, removes all
+    // callbacks for the event. If `name` is null, removes all bound
+    // callbacks for all events.
+    off: function(name, callback, context) {
+      var retain, ev, events, names, i, l, j, k;
+      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
+      if (!name && !callback && !context) {
+        this._events = void 0;
+        return this;
+      }
+      names = name ? [name] : _.keys(this._events);
+      for (i = 0, l = names.length; i < l; i++) {
+        name = names[i];
+        if (events = this._events[name]) {
+          this._events[name] = retain = [];
+          if (callback || context) {
+            for (j = 0, k = events.length; j < k; j++) {
+              ev = events[j];
+              if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
+                  (context && context !== ev.context)) {
+                retain.push(ev);
+              }
+            }
+          }
+          if (!retain.length) delete this._events[name];
+        }
+      }
+
+      return this;
+    },
+
+    // Trigger one or many events, firing all bound callbacks. Callbacks are
+    // passed the same arguments as `trigger` is, apart from the event name
+    // (unless you're listening on `"all"`, which will cause your callback to
+    // receive the true name of the event as the first argument).
+    trigger: function(name) {
+      if (!this._events) return this;
+      var args = slice.call(arguments, 1);
+      if (!eventsApi(this, 'trigger', name, args)) return this;
+      var events = this._events[name];
+      var allEvents = this._events.all;
+      if (events) triggerEvents(events, args);
+      if (allEvents) triggerEvents(allEvents, arguments);
+      return this;
+    },
+
+    // Tell this object to stop listening to either specific events ... or
+    // to every object it's currently listening to.
+    stopListening: function(obj, name, callback) {
+      var listeningTo = this._listeningTo;
+      if (!listeningTo) return this;
+      var remove = !name && !callback;
+      if (!callback && typeof name === 'object') callback = this;
+      if (obj) (listeningTo = {})[obj._listenId] = obj;
+      for (var id in listeningTo) {
+        obj = listeningTo[id];
+        obj.off(name, callback, this);
+        if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];
+      }
+      return this;
+    }
+
+  };
+
+  // Regular expression used to split event strings.
+  var eventSplitter = /\s+/;
+
+  // Implement fancy features of the Events API such as multiple event
+  // names `"change blur"` and jQuery-style event maps `{change: action}`
+  // in terms of the existing API.
+  var eventsApi = function(obj, action, name, rest) {
+    if (!name) return true;
+
+    // Handle event maps.
+    if (typeof name === 'object') {
+      for (var key in name) {
+        obj[action].apply(obj, [key, name[key]].concat(rest));
+      }
+      return false;
+    }
+
+    // Handle space separated event names.
+    if (eventSplitter.test(name)) {
+      var names = name.split(eventSplitter);
+      for (var i = 0, l = names.length; i < l; i++) {
+        obj[action].apply(obj, [names[i]].concat(rest));
+      }
+      return false;
+    }
+
+    return true;
+  };
+
+  // A difficult-to-believe, but optimized internal dispatch function for
+  // triggering events. Tries to keep the usual cases speedy (most internal
+  // Backbone events have 3 arguments).
+  var triggerEvents = function(events, args) {
+    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
+    switch (args.length) {
+      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
+      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
+      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
+      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
+      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
+    }
+  };
+
+  var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
+
+  // Inversion-of-control versions of `on` and `once`. Tell *this* object to
+  // listen to an event in another object ... keeping track of what it's
+  // listening to.
+  _.each(listenMethods, function(implementation, method) {
+    Events[method] = function(obj, name, callback) {
+      var listeningTo = this._listeningTo || (this._listeningTo = {});
+      var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
+      listeningTo[id] = obj;
+      if (!callback && typeof name === 'object') callback = this;
+      obj[implementation](name, callback, this);
+      return this;
+    };
+  });
+
+  // Aliases for backwards compatibility.
+  Events.bind   = Events.on;
+  Events.unbind = Events.off;
+
+  // Allow the `Backbone` object to serve as a global event bus, for folks who
+  // want global "pubsub" in a convenient place.
+  _.extend(Backbone, Events);
+
+  // Backbone.Model
+  // --------------
+
+  // Backbone **Models** are the basic data object in the framework --
+  // frequently representing a row in a table in a database on your server.
+  // A discrete chunk of data and a bunch of useful, related methods for
+  // performing computations and transformations on that data.
+
+  // Create a new model with the specified attributes. A client id (`cid`)
+  // is automatically generated and assigned for you.
+  var Model = Backbone.Model = function(attributes, options) {
+    var attrs = attributes || {};
+    options || (options = {});
+    this.cid = _.uniqueId('c');
+    this.attributes = {};
+    if (options.collection) this.collection = options.collection;
+    if (options.parse) attrs = this.parse(attrs, options) || {};
+    attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
+    this.set(attrs, options);
+    this.changed = {};
+    this.initialize.apply(this, arguments);
+  };
+
+  // Attach all inheritable methods to the Model prototype.
+  _.extend(Model.prototype, Events, {
+
+    // A hash of attributes whose current and previous value differ.
+    changed: null,
+
+    // The value returned during the last failed validation.
+    validationError: null,
+
+    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
+    // CouchDB users may want to set this to `"_id"`.
+    idAttribute: 'id',
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Return a copy of the model's `attributes` object.
+    toJSON: function(options) {
+      return _.clone(this.attributes);
+    },
+
+    // Proxy `Backbone.sync` by default -- but override this if you need
+    // custom syncing semantics for *this* particular model.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Get the value of an attribute.
+    get: function(attr) {
+      return this.attributes[attr];
+    },
+
+    // Get the HTML-escaped value of an attribute.
+    escape: function(attr) {
+      return _.escape(this.get(attr));
+    },
+
+    // Returns `true` if the attribute contains a value that is not null
+    // or undefined.
+    has: function(attr) {
+      return this.get(attr) != null;
+    },
+
+    // Set a hash of model attributes on the object, firing `"change"`. This is
+    // the core primitive operation of a model, updating the data and notifying
+    // anyone who needs to know about the change in state. The heart of the beast.
+    set: function(key, val, options) {
+      var attr, attrs, unset, changes, silent, changing, prev, current;
+      if (key == null) return this;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      options || (options = {});
+
+      // Run validation.
+      if (!this._validate(attrs, options)) return false;
+
+      // Extract attributes and options.
+      unset           = options.unset;
+      silent          = options.silent;
+      changes         = [];
+      changing        = this._changing;
+      this._changing  = true;
+
+      if (!changing) {
+        this._previousAttributes = _.clone(this.attributes);
+        this.changed = {};
+      }
+      current = this.attributes, prev = this._previousAttributes;
+
+      // Check for changes of `id`.
+      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
+
+      // For each `set` attribute, update or delete the current value.
+      for (attr in attrs) {
+        val = attrs[attr];
+        if (!_.isEqual(current[attr], val)) changes.push(attr);
+        if (!_.isEqual(prev[attr], val)) {
+          this.changed[attr] = val;
+        } else {
+          delete this.changed[attr];
+        }
+        unset ? delete current[attr] : current[attr] = val;
+      }
+
+      // Trigger all relevant attribute changes.
+      if (!silent) {
+        if (changes.length) this._pending = options;
+        for (var i = 0, l = changes.length; i < l; i++) {
+          this.trigger('change:' + changes[i], this, current[changes[i]], options);
+        }
+      }
+
+      // You might be wondering why there's a `while` loop here. Changes can
+      // be recursively nested within `"change"` events.
+      if (changing) return this;
+      if (!silent) {
+        while (this._pending) {
+          options = this._pending;
+          this._pending = false;
+          this.trigger('change', this, options);
+        }
+      }
+      this._pending = false;
+      this._changing = false;
+      return this;
+    },
+
+    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
+    // if the attribute doesn't exist.
+    unset: function(attr, options) {
+      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
+    },
+
+    // Clear all attributes on the model, firing `"change"`.
+    clear: function(options) {
+      var attrs = {};
+      for (var key in this.attributes) attrs[key] = void 0;
+      return this.set(attrs, _.extend({}, options, {unset: true}));
+    },
+
+    // Determine if the model has changed since the last `"change"` event.
+    // If you specify an attribute name, determine if that attribute has changed.
+    hasChanged: function(attr) {
+      if (attr == null) return !_.isEmpty(this.changed);
+      return _.has(this.changed, attr);
+    },
+
+    // Return an object containing all the attributes that have changed, or
+    // false if there are no changed attributes. Useful for determining what
+    // parts of a view need to be updated and/or what attributes need to be
+    // persisted to the server. Unset attributes will be set to undefined.
+    // You can also pass an attributes object to diff against the model,
+    // determining if there *would be* a change.
+    changedAttributes: function(diff) {
+      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
+      var val, changed = false;
+      var old = this._changing ? this._previousAttributes : this.attributes;
+      for (var attr in diff) {
+        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
+        (changed || (changed = {}))[attr] = val;
+      }
+      return changed;
+    },
+
+    // Get the previous value of an attribute, recorded at the time the last
+    // `"change"` event was fired.
+    previous: function(attr) {
+      if (attr == null || !this._previousAttributes) return null;
+      return this._previousAttributes[attr];
+    },
+
+    // Get all of the attributes of the model at the time of the previous
+    // `"change"` event.
+    previousAttributes: function() {
+      return _.clone(this._previousAttributes);
+    },
+
+    // Fetch the model from the server. If the server's representation of the
+    // model differs from its current attributes, they will be overridden,
+    // triggering a `"change"` event.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        if (!model.set(model.parse(resp, options), options)) return false;
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Set a hash of model attributes, and sync the model to the server.
+    // If the server returns an attributes hash that differs, the model's
+    // state will be `set` again.
+    save: function(key, val, options) {
+      var attrs, method, xhr, attributes = this.attributes;
+
+      // Handle both `"key", value` and `{key: value}` -style arguments.
+      if (key == null || typeof key === 'object') {
+        attrs = key;
+        options = val;
+      } else {
+        (attrs = {})[key] = val;
+      }
+
+      options = _.extend({validate: true}, options);
+
+      // If we're not waiting and attributes exist, save acts as
+      // `set(attr).save(null, opts)` with validation. Otherwise, check if
+      // the model will be valid when the attributes, if any, are set.
+      if (attrs && !options.wait) {
+        if (!this.set(attrs, options)) return false;
+      } else {
+        if (!this._validate(attrs, options)) return false;
+      }
+
+      // Set temporary attributes if `{wait: true}`.
+      if (attrs && options.wait) {
+        this.attributes = _.extend({}, attributes, attrs);
+      }
+
+      // After a successful server-side save, the client is (optionally)
+      // updated with the server-side state.
+      if (options.parse === void 0) options.parse = true;
+      var model = this;
+      var success = options.success;
+      options.success = function(resp) {
+        // Ensure attributes are restored during synchronous saves.
+        model.attributes = attributes;
+        var serverAttrs = model.parse(resp, options);
+        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
+        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
+          return false;
+        }
+        if (success) success(model, resp, options);
+        model.trigger('sync', model, resp, options);
+      };
+      wrapError(this, options);
+
+      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
+      if (method === 'patch') options.attrs = attrs;
+      xhr = this.sync(method, this, options);
+
+      // Restore attributes.
+      if (attrs && options.wait) this.attributes = attributes;
+
+      return xhr;
+    },
+
+    // Destroy this model on the server if it was already persisted.
+    // Optimistically removes the model from its collection, if it has one.
+    // If `wait: true` is passed, waits for the server to respond before removal.
+    destroy: function(options) {
+      options = options ? _.clone(options) : {};
+      var model = this;
+      var success = options.success;
+
+      var destroy = function() {
+        model.trigger('destroy', model, model.collection, options);
+      };
+
+      options.success = function(resp) {
+        if (options.wait || model.isNew()) destroy();
+        if (success) success(model, resp, options);
+        if (!model.isNew()) model.trigger('sync', model, resp, options);
+      };
+
+      if (this.isNew()) {
+        options.success();
+        return false;
+      }
+      wrapError(this, options);
+
+      var xhr = this.sync('delete', this, options);
+      if (!options.wait) destroy();
+      return xhr;
+    },
+
+    // Default URL for the model's representation on the server -- if you're
+    // using Backbone's restful methods, override this to change the endpoint
+    // that will be called.
+    url: function() {
+      var base =
+        _.result(this, 'urlRoot') ||
+        _.result(this.collection, 'url') ||
+        urlError();
+      if (this.isNew()) return base;
+      return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(this.id);
+    },
+
+    // **parse** converts a response into the hash of attributes to be `set` on
+    // the model. The default implementation is just to pass the response along.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new model with identical attributes to this one.
+    clone: function() {
+      return new this.constructor(this.attributes);
+    },
+
+    // A model is new if it has never been saved to the server, and lacks an id.
+    isNew: function() {
+      return !this.has(this.idAttribute);
+    },
+
+    // Check if the model is currently in a valid state.
+    isValid: function(options) {
+      return this._validate({}, _.extend(options || {}, { validate: true }));
+    },
+
+    // Run validation against the next complete set of model attributes,
+    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
+    _validate: function(attrs, options) {
+      if (!options.validate || !this.validate) return true;
+      attrs = _.extend({}, this.attributes, attrs);
+      var error = this.validationError = this.validate(attrs, options) || null;
+      if (!error) return true;
+      this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
+      return false;
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Model.
+  var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];
+
+  // Mix in each Underscore method as a proxy to `Model#attributes`.
+  _.each(modelMethods, function(method) {
+    Model.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.attributes);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Backbone.Collection
+  // -------------------
+
+  // If models tend to represent a single row of data, a Backbone Collection is
+  // more analagous to a table full of data ... or a small slice or page of that
+  // table, or a collection of rows that belong together for a particular reason
+  // -- all of the messages in this particular folder, all of the documents
+  // belonging to this particular author, and so on. Collections maintain
+  // indexes of their models, both in order, and for lookup by `id`.
+
+  // Create a new **Collection**, perhaps to contain a specific type of `model`.
+  // If a `comparator` is specified, the Collection will maintain
+  // its models in sort order, as they're added and removed.
+  var Collection = Backbone.Collection = function(models, options) {
+    options || (options = {});
+    if (options.model) this.model = options.model;
+    if (options.comparator !== void 0) this.comparator = options.comparator;
+    this._reset();
+    this.initialize.apply(this, arguments);
+    if (models) this.reset(models, _.extend({silent: true}, options));
+  };
+
+  // Default options for `Collection#set`.
+  var setOptions = {add: true, remove: true, merge: true};
+  var addOptions = {add: true, remove: false};
+
+  // Define the Collection's inheritable methods.
+  _.extend(Collection.prototype, Events, {
+
+    // The default model for a collection is just a **Backbone.Model**.
+    // This should be overridden in most cases.
+    model: Model,
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // The JSON representation of a Collection is an array of the
+    // models' attributes.
+    toJSON: function(options) {
+      return this.map(function(model){ return model.toJSON(options); });
+    },
+
+    // Proxy `Backbone.sync` by default.
+    sync: function() {
+      return Backbone.sync.apply(this, arguments);
+    },
+
+    // Add a model, or list of models to the set.
+    add: function(models, options) {
+      return this.set(models, _.extend({merge: false}, options, addOptions));
+    },
+
+    // Remove a model, or a list of models from the set.
+    remove: function(models, options) {
+      var singular = !_.isArray(models);
+      models = singular ? [models] : _.clone(models);
+      options || (options = {});
+      var i, l, index, model;
+      for (i = 0, l = models.length; i < l; i++) {
+        model = models[i] = this.get(models[i]);
+        if (!model) continue;
+        delete this._byId[model.id];
+        delete this._byId[model.cid];
+        index = this.indexOf(model);
+        this.models.splice(index, 1);
+        this.length--;
+        if (!options.silent) {
+          options.index = index;
+          model.trigger('remove', model, this, options);
+        }
+        this._removeReference(model, options);
+      }
+      return singular ? models[0] : models;
+    },
+
+    // Update a collection by `set`-ing a new list of models, adding new ones,
+    // removing models that are no longer present, and merging models that
+    // already exist in the collection, as necessary. Similar to **Model#set**,
+    // the core operation for updating the data contained by the collection.
+    set: function(models, options) {
+      options = _.defaults({}, options, setOptions);
+      if (options.parse) models = this.parse(models, options);
+      var singular = !_.isArray(models);
+      models = singular ? (models ? [models] : []) : _.clone(models);
+      var i, l, id, model, attrs, existing, sort;
+      var at = options.at;
+      var targetModel = this.model;
+      var sortable = this.comparator && (at == null) && options.sort !== false;
+      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
+      var toAdd = [], toRemove = [], modelMap = {};
+      var add = options.add, merge = options.merge, remove = options.remove;
+      var order = !sortable && add && remove ? [] : false;
+
+      // Turn bare objects into model references, and prevent invalid models
+      // from being added.
+      for (i = 0, l = models.length; i < l; i++) {
+        attrs = models[i] || {};
+        if (attrs instanceof Model) {
+          id = model = attrs;
+        } else {
+          id = attrs[targetModel.prototype.idAttribute || 'id'];
+        }
+
+        // If a duplicate is found, prevent it from being added and
+        // optionally merge it into the existing model.
+        if (existing = this.get(id)) {
+          if (remove) modelMap[existing.cid] = true;
+          if (merge) {
+            attrs = attrs === model ? model.attributes : attrs;
+            if (options.parse) attrs = existing.parse(attrs, options);
+            existing.set(attrs, options);
+            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
+          }
+          models[i] = existing;
+
+        // If this is a new, valid model, push it to the `toAdd` list.
+        } else if (add) {
+          model = models[i] = this._prepareModel(attrs, options);
+          if (!model) continue;
+          toAdd.push(model);
+          this._addReference(model, options);
+        }
+
+        // Do not add multiple models with the same `id`.
+        model = existing || model;
+        if (order && (model.isNew() || !modelMap[model.id])) order.push(model);
+        modelMap[model.id] = true;
+      }
+
+      // Remove nonexistent models if appropriate.
+      if (remove) {
+        for (i = 0, l = this.length; i < l; ++i) {
+          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
+        }
+        if (toRemove.length) this.remove(toRemove, options);
+      }
+
+      // See if sorting is needed, update `length` and splice in new models.
+      if (toAdd.length || (order && order.length)) {
+        if (sortable) sort = true;
+        this.length += toAdd.length;
+        if (at != null) {
+          for (i = 0, l = toAdd.length; i < l; i++) {
+            this.models.splice(at + i, 0, toAdd[i]);
+          }
+        } else {
+          if (order) this.models.length = 0;
+          var orderedModels = order || toAdd;
+          for (i = 0, l = orderedModels.length; i < l; i++) {
+            this.models.push(orderedModels[i]);
+          }
+        }
+      }
+
+      // Silently sort the collection if appropriate.
+      if (sort) this.sort({silent: true});
+
+      // Unless silenced, it's time to fire all appropriate add/sort events.
+      if (!options.silent) {
+        for (i = 0, l = toAdd.length; i < l; i++) {
+          (model = toAdd[i]).trigger('add', model, this, options);
+        }
+        if (sort || (order && order.length)) this.trigger('sort', this, options);
+      }
+
+      // Return the added (or merged) model (or models).
+      return singular ? models[0] : models;
+    },
+
+    // When you have more items than you want to add or remove individually,
+    // you can reset the entire set with a new list of models, without firing
+    // any granular `add` or `remove` events. Fires `reset` when finished.
+    // Useful for bulk operations and optimizations.
+    reset: function(models, options) {
+      options || (options = {});
+      for (var i = 0, l = this.models.length; i < l; i++) {
+        this._removeReference(this.models[i], options);
+      }
+      options.previousModels = this.models;
+      this._reset();
+      models = this.add(models, _.extend({silent: true}, options));
+      if (!options.silent) this.trigger('reset', this, options);
+      return models;
+    },
+
+    // Add a model to the end of the collection.
+    push: function(model, options) {
+      return this.add(model, _.extend({at: this.length}, options));
+    },
+
+    // Remove a model from the end of the collection.
+    pop: function(options) {
+      var model = this.at(this.length - 1);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Add a model to the beginning of the collection.
+    unshift: function(model, options) {
+      return this.add(model, _.extend({at: 0}, options));
+    },
+
+    // Remove a model from the beginning of the collection.
+    shift: function(options) {
+      var model = this.at(0);
+      this.remove(model, options);
+      return model;
+    },
+
+    // Slice out a sub-array of models from the collection.
+    slice: function() {
+      return slice.apply(this.models, arguments);
+    },
+
+    // Get a model from the set by id.
+    get: function(obj) {
+      if (obj == null) return void 0;
+      return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid];
+    },
+
+    // Get the model at the given index.
+    at: function(index) {
+      return this.models[index];
+    },
+
+    // Return models with matching attributes. Useful for simple cases of
+    // `filter`.
+    where: function(attrs, first) {
+      if (_.isEmpty(attrs)) return first ? void 0 : [];
+      return this[first ? 'find' : 'filter'](function(model) {
+        for (var key in attrs) {
+          if (attrs[key] !== model.get(key)) return false;
+        }
+        return true;
+      });
+    },
+
+    // Return the first model with matching attributes. Useful for simple cases
+    // of `find`.
+    findWhere: function(attrs) {
+      return this.where(attrs, true);
+    },
+
+    // Force the collection to re-sort itself. You don't need to call this under
+    // normal circumstances, as the set will maintain sort order as each item
+    // is added.
+    sort: function(options) {
+      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
+      options || (options = {});
+
+      // Run sort based on type of `comparator`.
+      if (_.isString(this.comparator) || this.comparator.length === 1) {
+        this.models = this.sortBy(this.comparator, this);
+      } else {
+        this.models.sort(_.bind(this.comparator, this));
+      }
+
+      if (!options.silent) this.trigger('sort', this, options);
+      return this;
+    },
+
+    // Pluck an attribute from each model in the collection.
+    pluck: function(attr) {
+      return _.invoke(this.models, 'get', attr);
+    },
+
+    // Fetch the default set of models for this collection, resetting the
+    // collection when they arrive. If `reset: true` is passed, the response
+    // data will be passed through the `reset` method instead of `set`.
+    fetch: function(options) {
+      options = options ? _.clone(options) : {};
+      if (options.parse === void 0) options.parse = true;
+      var success = options.success;
+      var collection = this;
+      options.success = function(resp) {
+        var method = options.reset ? 'reset' : 'set';
+        collection[method](resp, options);
+        if (success) success(collection, resp, options);
+        collection.trigger('sync', collection, resp, options);
+      };
+      wrapError(this, options);
+      return this.sync('read', this, options);
+    },
+
+    // Create a new instance of a model in this collection. Add the model to the
+    // collection immediately, unless `wait: true` is passed, in which case we
+    // wait for the server to agree.
+    create: function(model, options) {
+      options = options ? _.clone(options) : {};
+      if (!(model = this._prepareModel(model, options))) return false;
+      if (!options.wait) this.add(model, options);
+      var collection = this;
+      var success = options.success;
+      options.success = function(model, resp) {
+        if (options.wait) collection.add(model, options);
+        if (success) success(model, resp, options);
+      };
+      model.save(null, options);
+      return model;
+    },
+
+    // **parse** converts a response into a list of models to be added to the
+    // collection. The default implementation is just to pass it through.
+    parse: function(resp, options) {
+      return resp;
+    },
+
+    // Create a new collection with an identical list of models as this one.
+    clone: function() {
+      return new this.constructor(this.models);
+    },
+
+    // Private method to reset all internal state. Called when the collection
+    // is first initialized or reset.
+    _reset: function() {
+      this.length = 0;
+      this.models = [];
+      this._byId  = {};
+    },
+
+    // Prepare a hash of attributes (or other model) to be added to this
+    // collection.
+    _prepareModel: function(attrs, options) {
+      if (attrs instanceof Model) return attrs;
+      options = options ? _.clone(options) : {};
+      options.collection = this;
+      var model = new this.model(attrs, options);
+      if (!model.validationError) return model;
+      this.trigger('invalid', this, model.validationError, options);
+      return false;
+    },
+
+    // Internal method to create a model's ties to a collection.
+    _addReference: function(model, options) {
+      this._byId[model.cid] = model;
+      if (model.id != null) this._byId[model.id] = model;
+      if (!model.collection) model.collection = this;
+      model.on('all', this._onModelEvent, this);
+    },
+
+    // Internal method to sever a model's ties to a collection.
+    _removeReference: function(model, options) {
+      if (this === model.collection) delete model.collection;
+      model.off('all', this._onModelEvent, this);
+    },
+
+    // Internal method called every time a model in the set fires an event.
+    // Sets need to update their indexes when models change ids. All other
+    // events simply proxy through. "add" and "remove" events that originate
+    // in other collections are ignored.
+    _onModelEvent: function(event, model, collection, options) {
+      if ((event === 'add' || event === 'remove') && collection !== this) return;
+      if (event === 'destroy') this.remove(model, options);
+      if (model && event === 'change:' + model.idAttribute) {
+        delete this._byId[model.previous(model.idAttribute)];
+        if (model.id != null) this._byId[model.id] = model;
+      }
+      this.trigger.apply(this, arguments);
+    }
+
+  });
+
+  // Underscore methods that we want to implement on the Collection.
+  // 90% of the core usefulness of Backbone Collections is actually implemented
+  // right here:
+  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
+    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
+    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
+    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
+    'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',
+    'lastIndexOf', 'isEmpty', 'chain', 'sample'];
+
+  // Mix in each Underscore method as a proxy to `Collection#models`.
+  _.each(methods, function(method) {
+    Collection.prototype[method] = function() {
+      var args = slice.call(arguments);
+      args.unshift(this.models);
+      return _[method].apply(_, args);
+    };
+  });
+
+  // Underscore methods that take a property name as an argument.
+  var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy'];
+
+  // Use attributes instead of properties.
+  _.each(attributeMethods, function(method) {
+    Collection.prototype[method] = function(value, context) {
+      var iterator = _.isFunction(value) ? value : function(model) {
+        return model.get(value);
+      };
+      return _[method](this.models, iterator, context);
+    };
+  });
+
+  // Backbone.View
+  // -------------
+
+  // Backbone Views are almost more convention than they are actual code. A View
+  // is simply a JavaScript object that represents a logical chunk of UI in the
+  // DOM. This might be a single item, an entire list, a sidebar or panel, or
+  // even the surrounding frame which wraps your whole app. Defining a chunk of
+  // UI as a **View** allows you to define your DOM events declaratively, without
+  // having to worry about render order ... and makes it easy for the view to
+  // react to specific changes in the state of your models.
+
+  // Creating a Backbone.View creates its initial element outside of the DOM,
+  // if an existing element is not provided...
+  var View = Backbone.View = function(options) {
+    this.cid = _.uniqueId('view');
+    options || (options = {});
+    _.extend(this, _.pick(options, viewOptions));
+    this._ensureElement();
+    this.initialize.apply(this, arguments);
+    this.delegateEvents();
+  };
+
+  // Cached regex to split keys for `delegate`.
+  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
+
+  // List of view options to be merged as properties.
+  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
+
+  // Set up all inheritable **Backbone.View** properties and methods.
+  _.extend(View.prototype, Events, {
+
+    // The default `tagName` of a View's element is `"div"`.
+    tagName: 'div',
+
+    // jQuery delegate for element lookup, scoped to DOM elements within the
+    // current view. This should be preferred to global lookups where possible.
+    $: function(selector) {
+      return this.$el.find(selector);
+    },
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // **render** is the core function that your view should override, in order
+    // to populate its element (`this.el`), with the appropriate HTML. The
+    // convention is for **render** to always return `this`.
+    render: function() {
+      return this;
+    },
+
+    // Remove this view by taking the element out of the DOM, and removing any
+    // applicable Backbone.Events listeners.
+    remove: function() {
+      this.$el.remove();
+      this.stopListening();
+      return this;
+    },
+
+    // Change the view's element (`this.el` property), including event
+    // re-delegation.
+    setElement: function(element, delegate) {
+      if (this.$el) this.undelegateEvents();
+      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
+      this.el = this.$el[0];
+      if (delegate !== false) this.delegateEvents();
+      return this;
+    },
+
+    // Set callbacks, where `this.events` is a hash of
+    //
+    // *{"event selector": "callback"}*
+    //
+    //     {
+    //       'mousedown .title':  'edit',
+    //       'click .button':     'save',
+    //       'click .open':       function(e) { ... }
+    //     }
+    //
+    // pairs. Callbacks will be bound to the view, with `this` set properly.
+    // Uses event delegation for efficiency.
+    // Omitting the selector binds the event to `this.el`.
+    // This only works for delegate-able events: not `focus`, `blur`, and
+    // not `change`, `submit`, and `reset` in Internet Explorer.
+    delegateEvents: function(events) {
+      if (!(events || (events = _.result(this, 'events')))) return this;
+      this.undelegateEvents();
+      for (var key in events) {
+        var method = events[key];
+        if (!_.isFunction(method)) method = this[events[key]];
+        if (!method) continue;
+
+        var match = key.match(delegateEventSplitter);
+        var eventName = match[1], selector = match[2];
+        method = _.bind(method, this);
+        eventName += '.delegateEvents' + this.cid;
+        if (selector === '') {
+          this.$el.on(eventName, method);
+        } else {
+          this.$el.on(eventName, selector, method);
+        }
+      }
+      return this;
+    },
+
+    // Clears all callbacks previously bound to the view with `delegateEvents`.
+    // You usually don't need to use this, but may wish to if you have multiple
+    // Backbone views attached to the same DOM element.
+    undelegateEvents: function() {
+      this.$el.off('.delegateEvents' + this.cid);
+      return this;
+    },
+
+    // Ensure that the View has a DOM element to render into.
+    // If `this.el` is a string, pass it through `$()`, take the first
+    // matching element, and re-assign it to `el`. Otherwise, create
+    // an element from the `id`, `className` and `tagName` properties.
+    _ensureElement: function() {
+      if (!this.el) {
+        var attrs = _.extend({}, _.result(this, 'attributes'));
+        if (this.id) attrs.id = _.result(this, 'id');
+        if (this.className) attrs['class'] = _.result(this, 'className');
+        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
+        this.setElement($el, false);
+      } else {
+        this.setElement(_.result(this, 'el'), false);
+      }
+    }
+
+  });
+
+  // Backbone.sync
+  // -------------
+
+  // Override this function to change the manner in which Backbone persists
+  // models to the server. You will be passed the type of request, and the
+  // model in question. By default, makes a RESTful Ajax request
+  // to the model's `url()`. Some possible customizations could be:
+  //
+  // * Use `setTimeout` to batch rapid-fire updates into a single request.
+  // * Send up the models as XML instead of JSON.
+  // * Persist models via WebSockets instead of Ajax.
+  //
+  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
+  // as `POST`, with a `_method` parameter containing the true HTTP method,
+  // as well as all requests with the body as `application/x-www-form-urlencoded`
+  // instead of `application/json` with the model in a param named `model`.
+  // Useful when interfacing with server-side languages like **PHP** that make
+  // it difficult to read the body of `PUT` requests.
+  Backbone.sync = function(method, model, options) {
+    var type = methodMap[method];
+
+    // Default options, unless specified.
+    _.defaults(options || (options = {}), {
+      emulateHTTP: Backbone.emulateHTTP,
+      emulateJSON: Backbone.emulateJSON
+    });
+
+    // Default JSON-request options.
+    var params = {type: type, dataType: 'json'};
+
+    // Ensure that we have a URL.
+    if (!options.url) {
+      params.url = _.result(model, 'url') || urlError();
+    }
+
+    // Ensure that we have the appropriate request data.
+    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
+      params.contentType = 'application/json';
+      params.data = JSON.stringify(options.attrs || model.toJSON(options));
+    }
+
+    // For older servers, emulate JSON by encoding the request into an HTML-form.
+    if (options.emulateJSON) {
+      params.contentType = 'application/x-www-form-urlencoded';
+      params.data = params.data ? {model: params.data} : {};
+    }
+
+    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
+    // And an `X-HTTP-Method-Override` header.
+    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
+      params.type = 'POST';
+      if (options.emulateJSON) params.data._method = type;
+      var beforeSend = options.beforeSend;
+      options.beforeSend = function(xhr) {
+        xhr.setRequestHeader('X-HTTP-Method-Override', type);
+        if (beforeSend) return beforeSend.apply(this, arguments);
+      };
+    }
+
+    // Don't process data on a non-GET request.
+    if (params.type !== 'GET' && !options.emulateJSON) {
+      params.processData = false;
+    }
+
+    // If we're sending a `PATCH` request, and we're in an old Internet Explorer
+    // that still has ActiveX enabled by default, override jQuery to use that
+    // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.
+    if (params.type === 'PATCH' && noXhrPatch) {
+      params.xhr = function() {
+        return new ActiveXObject("Microsoft.XMLHTTP");
+      };
+    }
+
+    // Make the request, allowing the user to override any Ajax options.
+    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
+    model.trigger('request', model, xhr, options);
+    return xhr;
+  };
+
+  var noXhrPatch =
+    typeof window !== 'undefined' && !!window.ActiveXObject &&
+      !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);
+
+  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
+  var methodMap = {
+    'create': 'POST',
+    'update': 'PUT',
+    'patch':  'PATCH',
+    'delete': 'DELETE',
+    'read':   'GET'
+  };
+
+  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
+  // Override this if you'd like to use a different library.
+  Backbone.ajax = function() {
+    return Backbone.$.ajax.apply(Backbone.$, arguments);
+  };
+
+  // Backbone.Router
+  // ---------------
+
+  // Routers map faux-URLs to actions, and fire events when routes are
+  // matched. Creating a new one sets its `routes` hash, if not set statically.
+  var Router = Backbone.Router = function(options) {
+    options || (options = {});
+    if (options.routes) this.routes = options.routes;
+    this._bindRoutes();
+    this.initialize.apply(this, arguments);
+  };
+
+  // Cached regular expressions for matching named param parts and splatted
+  // parts of route strings.
+  var optionalParam = /\((.*?)\)/g;
+  var namedParam    = /(\(\?)?:\w+/g;
+  var splatParam    = /\*\w+/g;
+  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
+
+  // Set up all inheritable **Backbone.Router** properties and methods.
+  _.extend(Router.prototype, Events, {
+
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic.
+    initialize: function(){},
+
+    // Manually bind a single named route to a callback. For example:
+    //
+    //     this.route('search/:query/p:num', 'search', function(query, num) {
+    //       ...
+    //     });
+    //
+    route: function(route, name, callback) {
+      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
+      if (_.isFunction(name)) {
+        callback = name;
+        name = '';
+      }
+      if (!callback) callback = this[name];
+      var router = this;
+      Backbone.history.route(route, function(fragment) {
+        var args = router._extractParameters(route, fragment);
+        router.execute(callback, args);
+        router.trigger.apply(router, ['route:' + name].concat(args));
+        router.trigger('route', name, args);
+        Backbone.history.trigger('route', router, name, args);
+      });
+      return this;
+    },
+
+    // Execute a route handler with the provided parameters.  This is an
+    // excellent place to do pre-route setup or post-route cleanup.
+    execute: function(callback, args) {
+      if (callback) callback.apply(this, args);
+    },
+
+    // Simple proxy to `Backbone.history` to save a fragment into the history.
+    navigate: function(fragment, options) {
+      Backbone.history.navigate(fragment, options);
+      return this;
+    },
+
+    // Bind all defined routes to `Backbone.history`. We have to reverse the
+    // order of the routes here to support behavior where the most general
+    // routes can be defined at the bottom of the route map.
+    _bindRoutes: function() {
+      if (!this.routes) return;
+      this.routes = _.result(this, 'routes');
+      var route, routes = _.keys(this.routes);
+      while ((route = routes.pop()) != null) {
+        this.route(route, this.routes[route]);
+      }
+    },
+
+    // Convert a route string into a regular expression, suitable for matching
+    // against the current location hash.
+    _routeToRegExp: function(route) {
+      route = route.replace(escapeRegExp, '\\$&')
+                   .replace(optionalParam, '(?:$1)?')
+                   .replace(namedParam, function(match, optional) {
+                     return optional ? match : '([^/?]+)';
+                   })
+                   .replace(splatParam, '([^?]*?)');
+      return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
+    },
+
+    // Given a route, and a URL fragment that it matches, return the array of
+    // extracted decoded parameters. Empty or unmatched parameters will be
+    // treated as `null` to normalize cross-browser behavior.
+    _extractParameters: function(route, fragment) {
+      var params = route.exec(fragment).slice(1);
+      return _.map(params, function(param, i) {
+        // Don't decode the search params.
+        if (i === params.length - 1) return param || null;
+        return param ? decodeURIComponent(param) : null;
+      });
+    }
+
+  });
+
+  // Backbone.History
+  // ----------------
+
+  // Handles cross-browser history management, based on either
+  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
+  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
+  // and URL fragments. If the browser supports neither (old IE, natch),
+  // falls back to polling.
+  var History = Backbone.History = function() {
+    this.handlers = [];
+    _.bindAll(this, 'checkUrl');
+
+    // Ensure that `History` can be used outside of the browser.
+    if (typeof window !== 'undefined') {
+      this.location = window.location;
+      this.history = window.history;
+    }
+  };
+
+  // Cached regex for stripping a leading hash/slash and trailing space.
+  var routeStripper = /^[#\/]|\s+$/g;
+
+  // Cached regex for stripping leading and trailing slashes.
+  var rootStripper = /^\/+|\/+$/g;
+
+  // Cached regex for detecting MSIE.
+  var isExplorer = /msie [\w.]+/;
+
+  // Cached regex for removing a trailing slash.
+  var trailingSlash = /\/$/;
+
+  // Cached regex for stripping urls of hash.
+  var pathStripper = /#.*$/;
+
+  // Has the history handling already been started?
+  History.started = false;
+
+  // Set up all inheritable **Backbone.History** properties and methods.
+  _.extend(History.prototype, Events, {
+
+    // The default interval to poll for hash changes, if necessary, is
+    // twenty times a second.
+    interval: 50,
+
+    // Are we at the app root?
+    atRoot: function() {
+      return this.location.pathname.replace(/[^\/]$/, '$&/') === this.root;
+    },
+
+    // Gets the true hash value. Cannot use location.hash directly due to bug
+    // in Firefox where location.hash will always be decoded.
+    getHash: function(window) {
+      var match = (window || this).location.href.match(/#(.*)$/);
+      return match ? match[1] : '';
+    },
+
+    // Get the cross-browser normalized URL fragment, either from the URL,
+    // the hash, or the override.
+    getFragment: function(fragment, forcePushState) {
+      if (fragment == null) {
+        if (this._hasPushState || !this._wantsHashChange || forcePushState) {
+          fragment = decodeURI(this.location.pathname + this.location.search);
+          var root = this.root.replace(trailingSlash, '');
+          if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);
+        } else {
+          fragment = this.getHash();
+        }
+      }
+      return fragment.replace(routeStripper, '');
+    },
+
+    // Start the hash change handling, returning `true` if the current URL matches
+    // an existing route, and `false` otherwise.
+    start: function(options) {
+      if (History.started) throw new Error("Backbone.history has already been started");
+      History.started = true;
+
+      // Figure out the initial configuration. Do we need an iframe?
+      // Is pushState desired ... is it available?
+      this.options          = _.extend({root: '/'}, this.options, options);
+      this.root             = this.options.root;
+      this._wantsHashChange = this.options.hashChange !== false;
+      this._wantsPushState  = !!this.options.pushState;
+      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);
+      var fragment          = this.getFragment();
+      var docMode           = document.documentMode;
+      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));
+
+      // Normalize root to always include a leading and trailing slash.
+      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
+
+      if (oldIE && this._wantsHashChange) {
+        var frame = Backbone.$('<iframe src="javascript:0" tabindex="-1">');
+        this.iframe = frame.hide().appendTo('body')[0].contentWindow;
+        this.navigate(fragment);
+      }
+
+      // Depending on whether we're using pushState or hashes, and whether
+      // 'onhashchange' is supported, determine how we check the URL state.
+      if (this._hasPushState) {
+        Backbone.$(window).on('popstate', this.checkUrl);
+      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
+        Backbone.$(window).on('hashchange', this.checkUrl);
+      } else if (this._wantsHashChange) {
+        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
+      }
+
+      // Determine if we need to change the base url, for a pushState link
+      // opened by a non-pushState browser.
+      this.fragment = fragment;
+      var loc = this.location;
+
+      // Transition from hashChange to pushState or vice versa if both are
+      // requested.
+      if (this._wantsHashChange && this._wantsPushState) {
+
+        // If we've started off with a route from a `pushState`-enabled
+        // browser, but we're currently in a browser that doesn't support it...
+        if (!this._hasPushState && !this.atRoot()) {
+          this.fragment = this.getFragment(null, true);
+          this.location.replace(this.root + '#' + this.fragment);
+          // Return immediately as browser will do redirect to new url
+          return true;
+
+        // Or if we've started out with a hash-based route, but we're currently
+        // in a browser where it could be `pushState`-based instead...
+        } else if (this._hasPushState && this.atRoot() && loc.hash) {
+          this.fragment = this.getHash().replace(routeStripper, '');
+          this.history.replaceState({}, document.title, this.root + this.fragment);
+        }
+
+      }
+
+      if (!this.options.silent) return this.loadUrl();
+    },
+
+    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
+    // but possibly useful for unit testing Routers.
+    stop: function() {
+      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
+      if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
+      History.started = false;
+    },
+
+    // Add a route to be tested when the fragment changes. Routes added later
+    // may override previous routes.
+    route: function(route, callback) {
+      this.handlers.unshift({route: route, callback: callback});
+    },
+
+    // Checks the current URL to see if it has changed, and if it has,
+    // calls `loadUrl`, normalizing across the hidden iframe.
+    checkUrl: function(e) {
+      var current = this.getFragment();
+      if (current === this.fragment && this.iframe) {
+        current = this.getFragment(this.getHash(this.iframe));
+      }
+      if (current === this.fragment) return false;
+      if (this.iframe) this.navigate(current);
+      this.loadUrl();
+    },
+
+    // Attempt to load the current URL fragment. If a route succeeds with a
+    // match, returns `true`. If no defined routes matches the fragment,
+    // returns `false`.
+    loadUrl: function(fragment) {
+      fragment = this.fragment = this.getFragment(fragment);
+      return _.any(this.handlers, function(handler) {
+        if (handler.route.test(fragment)) {
+          handler.callback(fragment);
+          return true;
+        }
+      });
+    },
+
+    // Save a fragment into the hash history, or replace the URL state if the
+    // 'replace' option is passed. You are responsible for properly URL-encoding
+    // the fragment in advance.
+    //
+    // The options object can contain `trigger: true` if you wish to have the
+    // route callback be fired (not usually desirable), or `replace: true`, if
+    // you wish to modify the current URL without adding an entry to the history.
+    navigate: function(fragment, options) {
+      if (!History.started) return false;
+      if (!options || options === true) options = {trigger: !!options};
+
+      var url = this.root + (fragment = this.getFragment(fragment || ''));
+
+      // Strip the hash for matching.
+      fragment = fragment.replace(pathStripper, '');
+
+      if (this.fragment === fragment) return;
+      this.fragment = fragment;
+
+      // Don't include a trailing slash on the root.
+      if (fragment === '' && url !== '/') url = url.slice(0, -1);
+
+      // If pushState is available, we use it to set the fragment as a real URL.
+      if (this._hasPushState) {
+        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
+
+      // If hash changes haven't been explicitly disabled, update the hash
+      // fragment to store history.
+      } else if (this._wantsHashChange) {
+        this._updateHash(this.location, fragment, options.replace);
+        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
+          // Opening and closing the iframe tricks IE7 and earlier to push a
+          // history entry on hash-tag change.  When replace is true, we don't
+          // want this.
+          if(!options.replace) this.iframe.document.open().close();
+          this._updateHash(this.iframe.location, fragment, options.replace);
+        }
+
+      // If you've told us that you explicitly don't want fallback hashchange-
+      // based history, then `navigate` becomes a page refresh.
+      } else {
+        return this.location.assign(url);
+      }
+      if (options.trigger) return this.loadUrl(fragment);
+    },
+
+    // Update the hash location, either replacing the current entry, or adding
+    // a new one to the browser history.
+    _updateHash: function(location, fragment, replace) {
+      if (replace) {
+        var href = location.href.replace(/(javascript:|#).*$/, '');
+        location.replace(href + '#' + fragment);
+      } else {
+        // Some browsers require that `hash` contains a leading #.
+        location.hash = '#' + fragment;
+      }
+    }
+
+  });
+
+  // Create the default Backbone.history.
+  Backbone.history = new History;
+
+  // Helpers
+  // -------
+
+  // Helper function to correctly set up the prototype chain, for subclasses.
+  // Similar to `goog.inherits`, but uses a hash of prototype properties and
+  // class properties to be extended.
+  var extend = function(protoProps, staticProps) {
+    var parent = this;
+    var child;
+
+    // The constructor function for the new subclass is either defined by you
+    // (the "constructor" property in your `extend` definition), or defaulted
+    // by us to simply call the parent's constructor.
+    if (protoProps && _.has(protoProps, 'constructor')) {
+      child = protoProps.constructor;
+    } else {
+      child = function(){ return parent.apply(this, arguments); };
+    }
+
+    // Add static properties to the constructor function, if supplied.
+    _.extend(child, parent, staticProps);
+
+    // Set the prototype chain to inherit from `parent`, without calling
+    // `parent`'s constructor function.
+    var Surrogate = function(){ this.constructor = child; };
+    Surrogate.prototype = parent.prototype;
+    child.prototype = new Surrogate;
+
+    // Add prototype properties (instance properties) to the subclass,
+    // if supplied.
+    if (protoProps) _.extend(child.prototype, protoProps);
+
+    // Set a convenience property in case the parent's prototype is needed
+    // later.
+    child.__super__ = parent.prototype;
+
+    return child;
+  };
+
+  // Set up inheritance for the model, collection, router, view and history.
+  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
+
+  // Throw an error when a URL is needed, and none is supplied.
+  var urlError = function() {
+    throw new Error('A "url" property or function must be specified');
+  };
+
+  // Wrap an optional error callback with a fallback error event.
+  var wrapError = function(model, options) {
+    var error = options.error;
+    options.error = function(resp) {
+      if (error) error(model, resp, options);
+      model.trigger('error', model, resp, options);
+    };
+  };
+
+  return Backbone;
+
+}));

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css
new file mode 100644
index 0000000..d39bc8b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css
@@ -0,0 +1,115 @@
+#control {
+    margin: 0 0 10px 0;
+}
+
+div.columnmanager-visibilitycontrol {
+    margin: 0 auto;
+    position: relative;
+    width: 50px;
+}
+
+div.columnmanager-visibilitycontrol > button.dropdown-button {
+    background-image: -moz-linear-gradient(top, #ffffff, #dbdbdb);
+    background-image: -webkit-gradient(linear,left top,left bottom,
+    color-stop(0, #ffffff),color-stop(1, #dbdbdb));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#dbdbdb');
+    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#dbdbdb')";
+    border: 1px solid #fff;
+    -moz-box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.4);
+    -webkit-box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.4);
+    box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.4);
+    text-decoration: none;
+    text-shadow: #fff 0 1px 0;
+    color: #597390;
+    font-weight: bold;
+}
+
+div.columnmanager-visibilitycontrol > button.dropdown-button:hover {
+    background-image: -moz-linear-gradient(top, #ffffff, #eeeeee);
+    background-image: -webkit-gradient(linear,left top,left bottom,
+    color-stop(0, #ffffff),color-stop(1, #eeeeee));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#eeeeee');
+    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#ffffff', EndColorStr='#eeeeee')";
+    color: #000;
+}
+
+div.columnmanager-visibilitycontrol > button.dropdown-button:active {
+    background-image: -moz-linear-gradient(top, #dbdbdb, #ffffff);
+    background-image: -webkit-gradient(linear,left top,left bottom,
+    color-stop(0, #dbdbdb),color-stop(1, #ffffff));
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#dbdbdb', EndColorStr='#ffffff');
+    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#dbdbdb', EndColorStr='#ffffff')";
+    text-shadow: 0px -1px 0 rgba(255, 255, 255, 0.5);
+}
+
+div.columnmanager-dropdown-container {
+    cursor: default;
+    position: absolute;
+    z-index: 10;
+    top: 0;
+    left: 0;
+    background: #fff;
+    border: solid 1px #bbb;
+    -webkit-box-shadow: #999999 0 1px 3px;
+    -moz-box-shadow: #999999 0 1px 3px;
+    box-shadow: #999999 0 1px 3px;
+    width: 200px;
+    display: none !important;
+    min-height: 20px;
+    max-height: 400px;
+    font-size: 14px;
+    line-height: 1.1em;
+    font-weight: normal;
+    text-align: left;
+    color: #444;
+    text-transform: none;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 3px;
+    border-radius: 3px;
+    -moz-background-clip: padding;
+    -webkit-background-clip: padding-box;
+    background-clip: padding-box;
+    pointer-events: none;
+}
+
+div.columnmanager-dropdown-container.open {
+    display: block !important;
+    pointer-events: auto;
+}
+
+.columnmanager-dropdown-container > li {
+    list-style-type:none;
+    padding: 5px 0px 0px 20px;
+    border-bottom: solid 1px lightgray;
+    cursor: pointer;
+}
+
+.columnmanager-dropdown-container > li:hover {
+    background-color: #f0f0f0;
+}
+
+.columnmanager-dropdown-container > li:last-child {
+    border-bottom: none;
+}
+
+.columnmanager-dropdown-container > li > span.indicator {
+    width: 20px;
+    display: inline-block;
+}
+.columnmanager-dropdown-container > li.visible > span.indicator::before {
+    content: "\f00c";
+    color: grey;
+    font-family: "FontAwesome";
+}
+
+.columnmanager-dropdown-container > li > span.column-label {
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    display: inline-block;
+    width: 150px;
+ }
+
+th.columnVisibility {
+    overflow: visible;
+}


[56/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
new file mode 100644
index 0000000..60363c8
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-service_logs-solrconfig.xml
@@ -0,0 +1,1928 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_service_logs_max_retention</name>
+    <value>7</value>
+    <display-name>Max retention</display-name>
+    <description>Days to retain the service logs in Solr</description>
+  </property>
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+ 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.
+--&gt;
+
+&lt;!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+--&gt;
+&lt;config&gt;
+  &lt;!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    --&gt;
+
+  &lt;!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  --&gt;
+  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;
+
+  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that &lt;lib/&gt; directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              &lt;lib dir="./lib" /&gt;
+    --&gt;
+
+  &lt;!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    --&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /&gt;
+
+  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    --&gt;
+  &lt;!--
+     &lt;lib path="../a-jar-that-does-not-exist.jar" /&gt; 
+  --&gt;
+  
+  &lt;!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    --&gt;
+  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;
+
+
+  &lt;!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    --&gt;
+  &lt;directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"&gt;
+    
+         
+    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. --&gt;      
+    &lt;!-- The root directory that collection data should be written to. --&gt;     
+    &lt;str name="solr.hdfs.home"&gt;${solr.hdfs.home:}&lt;/str&gt;
+    &lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;    
+    &lt;str name="solr.hdfs.confdir"&gt;${solr.hdfs.confdir:}&lt;/str&gt;
+    &lt;!-- Enable/Disable the hdfs cache. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.enabled"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;
+    &lt;!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.global"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;
+    
+  &lt;/directoryFactory&gt; 
+
+  &lt;!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  --&gt;
+  &lt;codecFactory class="solr.SchemaCodecFactory"/&gt;
+
+  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;
+  
+       &lt;schemaFactory class="ManagedIndexSchemaFactory"&gt;
+         &lt;bool name="mutable"&gt;true&lt;/bool&gt;
+         &lt;str name="managedSchemaResourceName"&gt;managed-schema&lt;/str&gt;
+       &lt;/schemaFactory&gt;
+&lt;!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  &lt;schemaFactory class="ClassicIndexSchemaFactory"/&gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;indexConfig&gt;
+    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     &lt;filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/&gt;
+    --&gt;
+    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;
+    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;
+    &lt;!-- LogSearch customization to avoid timeouts --&gt;
+    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;
+
+    &lt;!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. --&gt;
+    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;
+    &lt;!-- LogSearch customization of increase performance --&gt;
+    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;
+
+    &lt;!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) --&gt;
+    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;
+
+    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  --&gt;
+    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;
+    &lt;!-- &lt;maxBufferedDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;
+
+    &lt;!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      --&gt;
+    &lt;!--
+        &lt;mergePolicy class="org.apache.lucene.index.TieredMergePolicy"&gt;
+          &lt;int name="maxMergeAtOnce"&gt;10&lt;/int&gt;
+          &lt;int name="segmentsPerTier"&gt;10&lt;/int&gt;
+        &lt;/mergePolicy&gt;
+      --&gt;
+       
+    &lt;!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      --&gt;
+    &lt;!-- 
+    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;
+      --&gt;
+    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;
+    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;
+
+    &lt;!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     --&gt;
+    &lt;!-- 
+       &lt;mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/&gt;
+       --&gt;
+
+    &lt;!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    --&gt;
+    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;
+
+    &lt;!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     --&gt;
+    &lt;!--
+    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
+      --&gt;
+
+    &lt;!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    --&gt;
+    &lt;!-- 
+    &lt;deletionPolicy class="solr.SolrDeletionPolicy"&gt;
+    --&gt;
+      &lt;!-- The number of commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxCommitsToKeep"&gt;1&lt;/str&gt; --&gt;
+      &lt;!-- The number of optimized commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxOptimizedCommitsToKeep"&gt;0&lt;/str&gt; --&gt;
+      &lt;!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        --&gt;
+      &lt;!--
+         &lt;str name="maxCommitAge"&gt;30MINUTES&lt;/str&gt;
+         &lt;str name="maxCommitAge"&gt;1DAY&lt;/str&gt;
+      --&gt;
+    &lt;!-- 
+    &lt;/deletionPolicy&gt;
+    --&gt;
+
+    &lt;!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      --&gt;
+     &lt;infoStream&gt;true&lt;/infoStream&gt;
+  &lt;/indexConfig&gt;
+
+
+  &lt;!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    --&gt;
+  &lt;jmx /&gt;
+  &lt;!-- If you want to connect to a particular server, specify the
+       agentId 
+    --&gt;
+  &lt;!-- &lt;jmx agentId="myAgent" /&gt; --&gt;
+  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;
+  &lt;!-- &lt;jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/&gt;
+    --&gt;
+
+  &lt;!-- The default high-performance update handler --&gt;
+  &lt;updateHandler class="solr.DirectUpdateHandler2"&gt;
+
+    &lt;!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --&gt; 
+    &lt;updateLog&gt;
+      &lt;str name="dir"&gt;${solr.ulog.dir:}&lt;/str&gt;
+    &lt;/updateLog&gt;
+ 
+    &lt;!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      --&gt;
+     &lt;autoCommit&gt; 
+       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt; 
+       &lt;openSearcher&gt;false&lt;/openSearcher&gt; 
+     &lt;/autoCommit&gt;
+
+    &lt;!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      --&gt;
+
+     &lt;autoSoftCommit&gt; 
+       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt; 
+     &lt;/autoSoftCommit&gt;
+
+    &lt;!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      --&gt;
+    &lt;!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      --&gt;
+    &lt;!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      --&gt;
+    &lt;!--
+       &lt;listener event="postCommit" class="solr.RunExecutableListener"&gt;
+         &lt;str name="exe"&gt;solr/bin/snapshooter&lt;/str&gt;
+         &lt;str name="dir"&gt;.&lt;/str&gt;
+         &lt;bool name="wait"&gt;true&lt;/bool&gt;
+         &lt;arr name="args"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;
+         &lt;arr name="env"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;
+       &lt;/listener&gt;
+      --&gt;
+
+  &lt;/updateHandler&gt;
+  
+  &lt;!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    --&gt;
+  &lt;!--
+  &lt;indexReaderFactory name="IndexReaderFactory" class="package.class"&gt;
+    &lt;str name="someArg"&gt;Some Value&lt;/str&gt;
+  &lt;/indexReaderFactory &gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;query&gt;
+    &lt;!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      --&gt;
+    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;
+
+
+    &lt;!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (&gt; 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    --&gt;
+
+    &lt;!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      --&gt;
+    &lt;filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/&gt;
+
+    &lt;!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      --&gt;
+    &lt;queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/&gt;
+   
+    &lt;!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      --&gt;
+    &lt;documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/&gt;
+    
+    &lt;!-- custom cache currently used by block join --&gt; 
+    &lt;cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" /&gt;
+
+    &lt;!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      --&gt;
+    &lt;!--
+       &lt;fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" /&gt;
+      --&gt;
+
+    &lt;!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      --&gt;
+    &lt;!--
+       &lt;cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              /&gt;
+      --&gt;
+
+
+    &lt;!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    --&gt;
+    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;
+
+   &lt;!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     --&gt;
+   &lt;!--
+      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSortedQuery&gt;
+     --&gt;
+
+   &lt;!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     --&gt;
+   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;
+
+   &lt;!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     --&gt;
+   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;
+
+   &lt;!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     --&gt;
+    &lt;!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      --&gt;
+    &lt;listener event="newSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;!--
+           &lt;lst&gt;&lt;str name="q"&gt;solr&lt;/str&gt;&lt;str name="sort"&gt;price asc&lt;/str&gt;&lt;/lst&gt;
+           &lt;lst&gt;&lt;str name="q"&gt;rocks&lt;/str&gt;&lt;str name="sort"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;
+          --&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+    &lt;listener event="firstSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;lst&gt;
+          &lt;str name="q"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+
+    &lt;!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      --&gt;
+    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;
+
+    &lt;!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      --&gt;
+    &lt;maxWarmingSearchers&gt;2&lt;/maxWarmingSearchers&gt;
+
+  &lt;/query&gt;
+
+
+  &lt;!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    --&gt;
+  &lt;requestDispatcher handleSelect="false" &gt;
+    &lt;!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --&gt; 
+    &lt;requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/&gt;
+
+    &lt;!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      --&gt;
+    &lt;httpCaching never304="true" /&gt;
+    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the &lt;cacheControl&gt; option even if you have set
+         never304="true"
+      --&gt;
+    &lt;!--
+       &lt;httpCaching never304="true" &gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+    &lt;!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      --&gt;
+    &lt;!--
+       &lt;httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr"&gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+  &lt;/requestDispatcher&gt;
+
+  &lt;!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    --&gt;
+
+  &lt;requestHandler name="/dataimport" class="solr.DataImportHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="config"&gt;solr-data-config.xml&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    --&gt;
+  &lt;requestHandler name="/select" class="solr.SearchHandler"&gt;
+    &lt;!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      --&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;int name="rows"&gt;10&lt;/int&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+    &lt;!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      --&gt;
+    &lt;!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="appends"&gt;
+         &lt;str name="fq"&gt;inStock:true&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="invariants"&gt;
+         &lt;str name="facet.field"&gt;cat&lt;/str&gt;
+         &lt;str name="facet.field"&gt;manu_exact&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[* TO 500]&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[500 TO *]&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      --&gt;
+    &lt;!--
+       &lt;arr name="components"&gt;
+         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;
+         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;
+       &lt;/arr&gt;
+      --&gt;
+    &lt;/requestHandler&gt;
+
+  &lt;!-- A request handler that returns indented JSON by default --&gt;
+  &lt;requestHandler name="/query" class="solr.SearchHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  --&gt;
+  &lt;requestHandler name="/get" class="solr.RealTimeGetHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="omitHeader"&gt;true&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    --&gt;
+  &lt;requestHandler name="/browse" class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+
+      &lt;!-- VelocityResponseWriter settings --&gt;
+      &lt;str name="wt"&gt;velocity&lt;/str&gt;
+      &lt;str name="v.template"&gt;browse&lt;/str&gt;
+      &lt;str name="v.layout"&gt;layout&lt;/str&gt;
+
+      &lt;!-- Query settings --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+
+      &lt;!-- Faceting defaults --&gt;
+      &lt;str name="facet"&gt;on&lt;/str&gt;
+      &lt;str name="facet.mincount"&gt;1&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;str name="update.chain"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/initParams&gt;
+
+  &lt;!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    --&gt;
+  &lt;requestHandler name="/update" class="solr.UpdateRequestHandler"&gt;
+    &lt;!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      --&gt;
+    &lt;!--
+       &lt;lst name="defaults"&gt;
+         &lt;str name="update.chain"&gt;dedupe&lt;/str&gt;
+       &lt;/lst&gt;
+       --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    --&gt;
+  &lt;requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="lowernames"&gt;true&lt;/str&gt;
+      &lt;str name="uprefix"&gt;ignored_&lt;/str&gt;
+
+      &lt;!-- capture link hrefs but ignore div attributes --&gt;
+      &lt;str name="captureAttr"&gt;true&lt;/str&gt;
+      &lt;str name="fmap.a"&gt;links&lt;/str&gt;
+      &lt;str name="fmap.div"&gt;ignored_&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   --&gt;
+  &lt;requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" /&gt;
+
+
+  &lt;!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       &lt;docs&gt;
+         &lt;doc&gt;
+           &lt;field name="id"&gt;1&lt;/field&gt;
+           &lt;field name="name"&gt;The Name&lt;/field&gt;
+           &lt;field name="text"&gt;The Text Value&lt;/field&gt;
+         &lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         ...
+       &lt;/docs&gt;
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  --&gt;
+  &lt;requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" /&gt;
+
+  &lt;!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    --&gt;
+  &lt;requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" /&gt;
+  &lt;!-- This single handler is equivalent to the following... --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" /&gt;
+     &lt;requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" &gt;
+    --&gt;
+  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" &gt;
+       &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;*&lt;/str&gt; 
+       &lt;/lst&gt;
+     &lt;/requestHandler&gt;
+    --&gt;
+
+  &lt;!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  --&gt;
+  &lt;!--
+  &lt;requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" &gt;
+    &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  --&gt;
+  &lt;!-- ping/healthcheck --&gt;
+  &lt;requestHandler name="/admin/ping" class="solr.PingRequestHandler"&gt;
+    &lt;lst name="invariants"&gt;
+      &lt;str name="q"&gt;solrpingquery&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;all&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      --&gt;
+    &lt;!-- &lt;str name="healthcheckFile"&gt;server-enabled.txt&lt;/str&gt; --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Echo the request contents back to the client --&gt;
+  &lt;requestHandler name="/debug/dump" class="solr.DumpRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+     &lt;str name="echoParams"&gt;explicit&lt;/str&gt; 
+     &lt;str name="echoHandler"&gt;true&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    --&gt;
+  &lt;requestHandler name="/replication" class="solr.ReplicationHandler" &gt; 
+    &lt;!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    --&gt;
+    &lt;!--
+       &lt;lst name="master"&gt;
+         &lt;str name="replicateAfter"&gt;commit&lt;/str&gt;
+         &lt;str name="replicateAfter"&gt;startup&lt;/str&gt;
+         &lt;str name="confFiles"&gt;schema.xml,stopwords.txt&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+    &lt;!--
+       &lt;lst name="slave"&gt;
+         &lt;str name="masterUrl"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;
+         &lt;str name="pollInterval"&gt;00:00:60&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       &lt;searchComponent name="query"     class="solr.QueryComponent" /&gt;
+       &lt;searchComponent name="facet"     class="solr.FacetComponent" /&gt;
+       &lt;searchComponent name="mlt"       class="solr.MoreLikeThisComponent" /&gt;
+       &lt;searchComponent name="highlight" class="solr.HighlightComponent" /&gt;
+       &lt;searchComponent name="stats"     class="solr.StatsComponent" /&gt;
+       &lt;searchComponent name="debug"     class="solr.DebugComponent" /&gt;
+   
+       Default configuration in a requestHandler would look like:
+
+       &lt;arr name="components"&gt;
+         &lt;str&gt;query&lt;/str&gt;
+         &lt;str&gt;facet&lt;/str&gt;
+         &lt;str&gt;mlt&lt;/str&gt;
+         &lt;str&gt;highlight&lt;/str&gt;
+         &lt;str&gt;stats&lt;/str&gt;
+         &lt;str&gt;debug&lt;/str&gt;
+       &lt;/arr&gt;
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       &lt;arr name="first-components"&gt;
+         &lt;str&gt;myFirstComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+    
+       &lt;arr name="last-components"&gt;
+         &lt;str&gt;myLastComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     --&gt;
+  
+   &lt;!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     --&gt;
+  &lt;searchComponent name="spellcheck" class="solr.SpellCheckComponent"&gt;
+
+    &lt;str name="queryAnalyzerFieldType"&gt;key_lower_case&lt;/str&gt;
+
+    &lt;!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      --&gt;
+
+    &lt;!-- a spellchecker built from a field of the main index --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;default&lt;/str&gt;
+      &lt;str name="field"&gt;text&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+      &lt;!-- the spellcheck distance measure used, the default is the internal levenshtein --&gt;
+      &lt;str name="distanceMeasure"&gt;internal&lt;/str&gt;
+      &lt;!-- minimum accuracy needed to be considered a valid spellcheck suggestion --&gt;
+      &lt;float name="accuracy"&gt;0.5&lt;/float&gt;
+      &lt;!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --&gt;
+      &lt;int name="maxEdits"&gt;2&lt;/int&gt;
+      &lt;!-- the minimum shared prefix when enumerating terms --&gt;
+      &lt;int name="minPrefix"&gt;1&lt;/int&gt;
+      &lt;!-- maximum number of inspections per result. --&gt;
+      &lt;int name="maxInspections"&gt;5&lt;/int&gt;
+      &lt;!-- minimum length of a query term to be considered for correction --&gt;
+      &lt;int name="minQueryLength"&gt;4&lt;/int&gt;
+      &lt;!-- maximum threshold of documents a query term can appear to be considered for correction --&gt;
+      &lt;float name="maxQueryFrequency"&gt;0.01&lt;/float&gt;
+      &lt;!-- uncomment this to require suggestions to occur in 1% of the documents
+      	&lt;float name="thresholdTokenFrequency"&gt;.01&lt;/float&gt;
+      --&gt;
+    &lt;/lst&gt;
+    
+    &lt;!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.WordBreakSolrSpellChecker&lt;/str&gt;      
+      &lt;str name="field"&gt;name&lt;/str&gt;
+      &lt;str name="combineWords"&gt;true&lt;/str&gt;
+      &lt;str name="breakWords"&gt;true&lt;/str&gt;
+      &lt;int name="maxChanges"&gt;10&lt;/int&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- a spellchecker that uses a different distance measure --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;jarowinkler&lt;/str&gt;
+         &lt;str name="field"&gt;spell&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="distanceMeasure"&gt;
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         &lt;/str&gt;
+       &lt;/lst&gt;
+     --&gt;
+
+    &lt;!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;freq&lt;/str&gt;
+         &lt;str name="field"&gt;lowerfilt&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="comparatorClass"&gt;freq&lt;/str&gt;
+      --&gt;
+
+    &lt;!-- A spellchecker that reads the list of words from a file --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="classname"&gt;solr.FileBasedSpellChecker&lt;/str&gt;
+         &lt;str name="name"&gt;file&lt;/str&gt;
+         &lt;str name="sourceLocation"&gt;spellings.txt&lt;/str&gt;
+         &lt;str name="characterEncoding"&gt;UTF-8&lt;/str&gt;
+         &lt;str name="spellcheckIndexDir"&gt;spellcheckerFile&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+  &lt;/searchComponent&gt;
+  
+  &lt;!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    --&gt;
+  &lt;requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers --&gt;
+      &lt;str name="spellcheck.dictionary"&gt;default&lt;/str&gt;
+      &lt;str name="spellcheck.dictionary"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="spellcheck"&gt;on&lt;/str&gt;
+      &lt;str name="spellcheck.extendedResults"&gt;true&lt;/str&gt;       
+      &lt;str name="spellcheck.count"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.alternativeTermCount"&gt;5&lt;/str&gt;
+      &lt;str name="spellcheck.maxResultsForSuggest"&gt;5&lt;/str&gt;       
+      &lt;str name="spellcheck.collate"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.collateExtendedResults"&gt;true&lt;/str&gt;  
+      &lt;str name="spellcheck.maxCollationTries"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.maxCollations"&gt;5&lt;/str&gt;         
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;spellcheck&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;searchComponent name="suggest" class="solr.SuggestComponent"&gt;
+  	&lt;lst name="suggester"&gt;
+      &lt;str name="name"&gt;mySuggester&lt;/str&gt;
+      &lt;str name="lookupImpl"&gt;FuzzyLookupFactory&lt;/str&gt;      &lt;!-- org.apache.solr.spelling.suggest.fst --&gt;
+      &lt;str name="dictionaryImpl"&gt;DocumentDictionaryFactory&lt;/str&gt;     &lt;!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --&gt; 
+      &lt;str name="field"&gt;cat&lt;/str&gt;
+      &lt;str name="weightField"&gt;price&lt;/str&gt;
+      &lt;str name="suggestAnalyzerFieldType"&gt;string&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="suggest"&gt;true&lt;/str&gt;
+      &lt;str name="suggest.count"&gt;10&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="components"&gt;
+      &lt;str&gt;suggest&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  &lt;!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    --&gt;
+  &lt;searchComponent name="tvComponent" class="solr.TermVectorComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;bool name="tv"&gt;true&lt;/bool&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;tvComponent&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    --&gt;
+  &lt;searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" &gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;lingo&lt;/str&gt;
+
+      &lt;!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        --&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.lingo.LingoClusteringAlgorithm&lt;/str&gt;
+
+      &lt;!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       --&gt;
+      &lt;str name="carrot.resourcesDir"&gt;clustering/carrot2&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the STC clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;stc&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.stc.STCClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the bisecting kmeans clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;kmeans&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;bool name="clustering"&gt;true&lt;/bool&gt;
+      &lt;bool name="clustering.results"&gt;true&lt;/bool&gt;
+      &lt;!-- Field name with the logical "title" of a each document (optional) --&gt;
+      &lt;str name="carrot.title"&gt;name&lt;/str&gt;
+      &lt;!-- Field name with the logical "URL" of a each document (optional) --&gt;
+      &lt;str name="carrot.url"&gt;id&lt;/str&gt;
+      &lt;!-- Field name with the logical "content" of a each document (optional) --&gt;
+      &lt;str name="carrot.snippet"&gt;features&lt;/str&gt;
+      &lt;!-- Apply highlighter to the title/ content and use this for clustering. --&gt;
+      &lt;bool name="carrot.produceSummary"&gt;true&lt;/bool&gt;
+      &lt;!-- the maximum number of labels per cluster --&gt;
+      &lt;!--&lt;int name="carrot.numDescriptions"&gt;5&lt;/int&gt;--&gt;
+      &lt;!-- produce sub clusters --&gt;
+      &lt;bool name="carrot.outputSubClusters"&gt;false&lt;/bool&gt;
+
+      &lt;!-- Configure the remaining request handler parameters. --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="qf"&gt;
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      &lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;clustering&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    --&gt;
+  &lt;searchComponent name="terms" class="solr.TermsComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the terms component --&gt;
+  &lt;requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"&gt;
+     &lt;lst name="defaults"&gt;
+      &lt;bool name="terms"&gt;true&lt;/bool&gt;
+      &lt;bool name="distrib"&gt;false&lt;/bool&gt;
+    &lt;/lst&gt;     
+    &lt;arr name="components"&gt;
+      &lt;str&gt;terms&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    --&gt;
+  &lt;searchComponent name="elevator" class="solr.QueryElevationComponent" &gt;
+    &lt;!-- pick a fieldType to analyze queries --&gt;
+    &lt;str name="queryFieldType"&gt;string&lt;/str&gt;
+    &lt;str name="config-file"&gt;elevate.xml&lt;/str&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the elevator component --&gt;
+  &lt;requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;elevator&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    --&gt;
+  &lt;searchComponent class="solr.HighlightComponent" name="highlight"&gt;
+    &lt;highlighting&gt;
+      &lt;!-- Configure the standard fragmenter --&gt;
+      &lt;!-- This could most likely be commented out in the "default" case --&gt;
+      &lt;fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;int name="hl.fragsize"&gt;100&lt;/int&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        --&gt;
+      &lt;fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- slightly smaller fragsizes work better because of slop --&gt;
+          &lt;int name="hl.fragsize"&gt;70&lt;/int&gt;
+          &lt;!-- allow 50% slop on fragment sizes --&gt;
+          &lt;float name="hl.regex.slop"&gt;0.5&lt;/float&gt;
+          &lt;!-- a basic sentence pattern --&gt;
+          &lt;str name="hl.regex.pattern"&gt;[-\w ,/\n\&amp;quot;&amp;apos;]{20,200}&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- Configure the standard formatter --&gt;
+      &lt;formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.simple.pre"&gt;&lt;![CDATA[&lt;em&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.simple.post"&gt;&lt;![CDATA[&lt;/em&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/formatter&gt;
+
+      &lt;!-- Configure the standard encoder --&gt;
+      &lt;encoder name="html" 
+               class="solr.highlight.HtmlEncoder" /&gt;
+
+      &lt;!-- Configure the standard fragListBuilder --&gt;
+      &lt;fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the single fragListBuilder --&gt;
+      &lt;fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the weighted fragListBuilder --&gt;
+      &lt;fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/&gt;
+      
+      &lt;!-- default tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;!-- 
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.multiValuedSeparatorChar"&gt;/&lt;/str&gt;
+        &lt;/lst&gt;
+        --&gt;
+      &lt;/fragmentsBuilder&gt;
+
+      &lt;!-- multi-colored tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.tag.pre"&gt;&lt;![CDATA[
+               &lt;b style="background:yellow"&gt;,&lt;b style="background:lawgreen"&gt;,
+               &lt;b style="background:aquamarine"&gt;,&lt;b style="background:magenta"&gt;,
+               &lt;b style="background:palegreen"&gt;,&lt;b style="background:coral"&gt;,
+               &lt;b style="background:wheat"&gt;,&lt;b style="background:khaki"&gt;,
+               &lt;b style="background:lime"&gt;,&lt;b style="background:deepskyblue"&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.tag.post"&gt;&lt;![CDATA[&lt;/b&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmentsBuilder&gt;
+      
+      &lt;boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.bs.maxScan"&gt;10&lt;/str&gt;
+          &lt;str name="hl.bs.chars"&gt;.,!? &amp;#9;&amp;#10;&amp;#13;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+      
+      &lt;boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --&gt;
+          &lt;str name="hl.bs.type"&gt;WORD&lt;/str&gt;
+          &lt;!-- language and country are used when constructing Locale object.  --&gt;
+          &lt;!-- And the Locale object will be used when getting instance of BreakIterator --&gt;
+          &lt;str name="hl.bs.language"&gt;en&lt;/str&gt;
+          &lt;str name="hl.bs.country"&gt;US&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+    &lt;/highlighting&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --&gt; 
+
+  &lt;!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    --&gt;
+  &lt;updateRequestProcessorChain name="add-unknown-fields-to-the-schema"&gt;
+
+    &lt;processor class="solr.DefaultValueUpdateProcessorFactory"&gt;
+        &lt;str name="fieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="value"&gt;+{{logsearch_service_logs_max_retention}}DAYS&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.processor.DocExpirationUpdateProcessorFactory"&gt;
+        &lt;int name="autoDeletePeriodSeconds"&gt;30&lt;/int&gt;
+        &lt;str name="ttlFieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="expirationFieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.FirstFieldValueUpdateProcessorFactory"&gt;
+      &lt;str name="fieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+
+
+    &lt;processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseLongFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDateFieldUpdateProcessorFactory"&gt;
+      &lt;arr name="format"&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd&lt;/str&gt;
+      &lt;/arr&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.AddSchemaFieldsUpdateProcessorFactory"&gt;
+      &lt;str name="defaultFieldType"&gt;key_lower_case&lt;/str&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Boolean&lt;/str&gt;
+        &lt;str name="fieldType"&gt;booleans&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.util.Date&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdates&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Long&lt;/str&gt;
+        &lt;str name="valueClass"&gt;java.lang.Integer&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tlongs&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Number&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdoubles&lt;/str&gt;
+      &lt;/lst&gt;
+    &lt;/processor&gt;
+
+    &lt;processor class="solr.LogUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.RunUpdateProcessorFactory"/&gt;
+  &lt;/updateRequestProcessorChain&gt;
+
+
+  &lt;!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    --&gt;
+  &lt;!--
+     &lt;updateRequestProcessorChain name="dedupe"&gt;
+       &lt;processor class="solr.processor.SignatureUpdateProcessorFactory"&gt;
+         &lt;bool name="enabled"&gt;true&lt;/bool&gt;
+         &lt;str name="signatureField"&gt;id&lt;/str&gt;
+         &lt;bool name="overwriteDupes"&gt;false&lt;/bool&gt;
+         &lt;str name="fields"&gt;name,features,cat&lt;/str&gt;
+         &lt;str name="signatureClass"&gt;solr.processor.Lookup3Signature&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+  
+  &lt;!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    --&gt;
+    &lt;!--
+     &lt;updateRequestProcessorChain name="langid"&gt;
+       &lt;processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"&gt;
+         &lt;str name="langid.fl"&gt;text,title,subject,description&lt;/str&gt;
+         &lt;str name="langid.langField"&gt;language_s&lt;/str&gt;
+         &lt;str name="langid.fallback"&gt;en&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+
+  &lt;!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  --&gt;
+  &lt;!--
+    &lt;updateRequestProcessorChain name="script"&gt;
+      &lt;processor class="solr.StatelessScriptUpdateProcessorFactory"&gt;
+        &lt;str name="script"&gt;update-script.js&lt;/str&gt;
+        &lt;lst name="params"&gt;
+          &lt;str name="config_param"&gt;example config parameter&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/processor&gt;
+      &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+    &lt;/updateRequestProcessorChain&gt;
+  --&gt;
+ 
+  &lt;!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    --&gt;
+  &lt;!-- The following response writers are implicitly configured unless
+       overridden...
+    --&gt;
+  &lt;!--
+     &lt;queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" /&gt;
+     &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"/&gt;
+     &lt;queryResponseWriter name="python" class="solr.PythonResponseWriter"/&gt;
+     &lt;queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/&gt;
+     &lt;queryResponseWriter name="php" class="solr.PHPResponseWriter"/&gt;
+     &lt;queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/&gt;
+     &lt;queryResponseWriter name="csv" class="solr.CSVResponseWriter"/&gt;
+     &lt;queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/&gt;
+    --&gt;
+
+  &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"&gt;
+     &lt;!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     --&gt;
+    &lt;str name="content-type"&gt;text/plain; charset=UTF-8&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+  
+  &lt;!--
+     Custom response writers can be declared as needed...
+    --&gt;
+  &lt;queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"&gt;
+    &lt;str name="template.base.dir"&gt;${velocity.template.base.dir:}&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    --&gt;
+  &lt;queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"&gt;
+    &lt;int name="xsltCacheLifetimeSeconds"&gt;5&lt;/int&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    --&gt;
+  &lt;!-- example of registering a query parser --&gt;
+  &lt;!--
+     &lt;queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/&gt;
+    --&gt;
+
+  &lt;!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    --&gt;
+  &lt;!-- example of registering a custom function parser  --&gt;
+  &lt;!--
+     &lt;valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" /&gt;
+    --&gt;
+    
+  
+  &lt;!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    --&gt;
+  &lt;!--
+     Could be something like:
+     &lt;transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" &gt;
+       &lt;int name="connection"&gt;jdbc://....&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     To add a constant value to all docs, use:
+     &lt;transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;int name="value"&gt;5&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     &lt;transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;double name="defaultValue"&gt;5&lt;/double&gt;
+     &lt;/transformer&gt;
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     &lt;transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /&gt;
+    --&gt;
+    
+
+  &lt;!-- Legacy config for the admin interface --&gt;
+  &lt;admin&gt;
+    &lt;defaultQuery&gt;*:*&lt;/defaultQuery&gt;
+  &lt;/admin&gt;
+
+&lt;/config&gt;
+    </value>
+  </property>
+
+  
+</configuration>  

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
new file mode 100644
index 0000000..5ac4572
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-site.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>logsearch.ui.port</name>
+    <value>61888</value>
+    <description>Default port for LogSearch UI</description>
+    <display-name>Logsearch UI Port</display-name>
+  </property>
+
+  <property>
+    <name>logsearch.collection.numshards</name>
+    <value>5</value>
+    <display-name>Logsearch Solr Shards</display-name>
+    <description>Number of shards for Solr collections</description>
+  </property>
+  
+  <property>
+    <name>logsearch.collection.replication.factor</name>
+    <value>1</value>
+    <display-name>Logsearch Solr Replication Factor</display-name>
+    <description>Replication factor for Solr collections</description>
+  </property>
+
+  <property>
+    <name>logsearch.solr.collection.service.logs</name>
+    <value>hadoop_logs</value>
+    <display-name>Logsearch Solr Service Logs Collection</display-name>
+    <description>Name for the service logs collection</description>
+  </property>
+
+  <property>
+    <name>logsearch.solr.collection.audit.logs</name>
+    <value>audit_logs</value>
+    <display-name>Logsearch Solr Audit Logs Collection</display-name>
+    <description>Name for the audit logs collection</description>
+  </property>
+
+  <property>
+    <name>logsearch.service.logs.fields</name>
+    <value>logtime,level,event_count,ip,type,seq_num,path,file,line_number,host,log_message,id</value>
+    <display-name>Logsearch Solr Service Logs Fields</display-name>
+    <description>Solr fields for service logs</description>
+  </property>
+
+  <property>
+    <name>logsearch.service.logs.split.interval.mins</name>
+    <value>15</value>
+    <display-name>Logsearch Service Logs split interval</display-name>
+    <description>Will create multiple collections and use alias. Valid values are single,hour_week</description>
+  </property>
+
+  <property>
+    <name>logsearch.audit.logs.split.interval.mins</name>
+    <value>15</value>
+    <display-name>Logsearch Audit Logs split interval</display-name>
+    <description>Will switch the shard after the interval specified. Valid values are none and greater than 1</description>
+  </property>
+
+</configuration>


[54/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
new file mode 100644
index 0000000..ecce706
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-kafka.json.j2
@@ -0,0 +1,105 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"kafka_controller",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/controller.log"
+    },
+    {
+      "type":"kafka_request",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/kafka-request.log"
+    },
+    {
+      "type":"kafka_logcleaner",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/log-cleaner.log"
+    },
+    {
+      "type":"kafka_server",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/server.log"
+    },
+    {
+      "type":"kafka_statechange",
+      "rowtype":"service",
+      "path":"{{kafka_log_dir}}/state-change.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "kafka_controller",
+            "kafka_request",
+            "kafka_logcleaner"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"[%d] %p %m (%c)%n",
+      "multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+      "message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "comment":"Suppose to be same log4j pattern as other kafka processes, but some reason thread is not printed",
+      "conditions":{
+        "fields":{
+          "type":[
+            "kafka_server",
+            "kafka_statechange"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"[%d] %p %m (%c)%n",
+      "multiline_pattern":"^(\\[%{TIMESTAMP_ISO8601:logtime}\\])",
+      "message_pattern":"(?m)^\\[%{TIMESTAMP_ISO8601:logtime}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
new file mode 100644
index 0000000..7c8e635
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-knox.json.j2
@@ -0,0 +1,68 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"knox_gateway",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/gateway.log"
+    },
+    {
+      "type":"knox_cli",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/knoxcli.log"
+    },
+    {
+      "type":"knox_ldap",
+      "rowtype":"service",
+      "path":"{{knox_log_dir}}/ldap.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "knox_gateway",
+            "knox_cli",
+            "knox_ldap"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
new file mode 100644
index 0000000..cf338da
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-logsearch.json.j2
@@ -0,0 +1,68 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"logsearch_app",
+      "rowtype":"service",
+      "path":"{{logsearch_log_dir}}/logsearch.log"
+    },
+    {
+      "type":"logsearch_feeder",
+      "rowtype":"service",
+      "path":"{{logfeeder_log_dir}}/logfeeder.log"
+    },
+    {
+      "type":"logsearch_perf",
+      "rowtype":"service",
+      "path":"{{logsearch_log_dir}}/logsearch-performance.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "logsearch_app",
+            "logsearch_feeder",
+            "logsearch_perf"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
new file mode 100644
index 0000000..00cf789
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-oozie.json.j2
@@ -0,0 +1,56 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"oozie_app",
+      "rowtype":"service",
+      "path":"{{oozie_log_dir}}/oozie.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "oozie_app"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %5p %c{1}:%L - SERVER[${oozie.instance.id}] %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{DATA:logger_name}:%{INT:line_number}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
new file mode 100644
index 0000000..29a280a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-ranger.json.j2
@@ -0,0 +1,122 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"ranger_admin",
+      "rowtype":"service",
+      "path":"{{ranger_admin_log_dir}}/xa_portal.log"
+    },
+    {
+      "type":"ranger_dbpatch",
+      "is_enabled":"true",
+      "path":"{{ranger_admin_log_dir}}/ranger_db_patch.log"
+    },
+    {
+      "type":"ranger_kms",
+      "rowtype":"service",
+      "path":"{{ranger_kms_log_dir}}/kms.log"
+    },
+    {
+      "type":"ranger_usersync",
+      "rowtype":"service",
+      "path":"{{ranger_usersync_log_dir}}/usersync.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_admin",
+            "ranger_dbpatch"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d [%t] %-5p %C{6} (%F:%L) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{INT:line_number}\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_kms"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{1} - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    },
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "ranger_usersync"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %m%n",
+      "multiline_pattern":"^(%{USER_SYNC_DATE:logtime})",
+      "message_pattern":"(?m)^%{USER_SYNC_DATE:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{DATA:thread_name}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"dd MMM yyyy HH:mm:ss"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
new file mode 100644
index 0000000..9995689
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-storm.json.j2
@@ -0,0 +1,86 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"storm_drpc",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/drpc.log"
+    },
+    {
+      "type":"storm_logviewer",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/logviewer.log"
+    },
+    {
+      "type":"storm_nimbus",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/nimbus.log"
+    },
+    {
+      "type":"storm_supervisor",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/supervisor.log"
+    },
+    {
+      "type":"storm_ui",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/ui.log"
+    },
+    {
+      "type":"storm_worker",
+      "rowtype":"service",
+      "path":"{{storm_log_dir}}/*worker*.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "storm_drpc",
+            "storm_logviewer",
+            "storm_nimbus",
+            "storm_supervisor",
+            "storm_ui",
+            "storm_worker"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\[%{LOGLEVEL:level}\\]%{SPACE}%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss.SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
new file mode 100644
index 0000000..8df7fb6
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-yarn.json.j2
@@ -0,0 +1,86 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"mapred_historyserver",
+      "rowtype":"service",
+      "path":"{{mapred_log_dir_prefix}}/mapred/mapred-mapred-historyserver*.log"
+    },
+    {
+      "type":"yarn_nodemanager",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-nodemanager-*.log"
+    },
+    {
+      "type":"yarn_resourcemanager",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-resourcemanager-*.log"
+    },
+    {
+      "type":"yarn_timelineserver",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-timelineserver-*.log"
+    },
+    {
+      "type":"yarn_historyserver",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/yarn-yarn-historyserver-*.log"
+    },
+    {
+      "type":"yarn_jobsummary",
+      "rowtype":"service",
+      "path":"{{yarn_log_dir_prefix}}/yarn/hadoop-mapreduce.jobsummary.log"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "mapred_historyserver",
+            "yarn_historyserver",
+            "yarn_jobsummary",
+            "yarn_nodemanager",
+            "yarn_resourcemanager",
+            "yarn_timelineserver"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}%{LOGLEVEL:level}%{SPACE}%{JAVACLASS:logger_name}%{SPACE}\\(%{JAVAFILE:file}:%{JAVAMETHOD:method}\\(%{INT:line_number}\\)\\)%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
new file mode 100644
index 0000000..b90cb6d
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/input.config-zookeeper.json.j2
@@ -0,0 +1,56 @@
+{#
+ # 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.
+ #}
+{
+  "input":[
+    {
+      "type":"zookeeper",
+      "rowtype":"service",
+      "path":"{{zk_log_dir}}/zookeeper*.out"
+    }
+    
+  ],
+  "filter":[
+    {
+      "filter":"grok",
+      "conditions":{
+        "fields":{
+          "type":[
+            "zookeeper"
+          ]
+          
+        }
+        
+      },
+      "log4j_format":"%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n",
+      "multiline_pattern":"^(%{TIMESTAMP_ISO8601:logtime})",
+      "message_pattern":"(?m)^%{TIMESTAMP_ISO8601:logtime}%{SPACE}-%{SPACE}%{LOGLEVEL:level}%{SPACE}\\[%{DATA:thread_name}\\@%{INT:line_number}\\]%{SPACE}-%{SPACE}%{GREEDYDATA:log_message}",
+      "post_map_values":{
+        "logtime":{
+          "map_date":{
+            "date_pattern":"yyyy-MM-dd HH:mm:ss,SSS"
+          }
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
new file mode 100644
index 0000000..1edf16a
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logfeeder.properties.j2
@@ -0,0 +1,18 @@
+# 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.
+
+logfeeder.checkpoint.folder={{logfeeder_checkpoint_folder}}
+metrics.collector.hosts={{metrics_collector_hosts}}
+config.files={{logfeeder_config_files}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
new file mode 100644
index 0000000..1e183bd
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/logsearch.properties.j2
@@ -0,0 +1,40 @@
+# 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.
+
+#solr.url=http://solr_host:{{logsearch_solr_port}}/solr
+solr.zkhosts={{zookeeper_quorum}}{{logsearch_solr_znode}}
+
+# Service Logs
+solr.core.logs={{logsearch_solr_collection_service_logs}}
+
+solr.service_logs.split_interval_mins={{service_logs_collection_splits_interval_mins}}
+solr.service_logs.shards={{logsearch_numshards}}
+solr.service_logs.replication_factor={{logsearch_repfactor}}
+
+solr.servicelogs.fields={{logsearch_service_logs_fields}}
+
+# Audit logs
+auditlog.solr.zkhosts={{solr_audit_logs_zk_quorum}}{{solr_audit_logs_zk_node}}
+auditlog.solr.core.logs={{logsearch_solr_collection_audit_logs}}
+auditlog.solr.url={{solr_audit_logs_url}}
+
+solr.audit_logs.split_interval_mins={{audit_logs_collection_splits_interval_mins}}
+solr.audit_logs.shards={{logsearch_numshards}}
+solr.audit_logs.replication_factor={{logsearch_repfactor}}
+
+# History logs
+solr.core.history=history
+solr.history.config_name=history
+solr.history.replication_factor={{logsearch_repfactor}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
new file mode 100644
index 0000000..bd88ba7
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/output.config.json.j2
@@ -0,0 +1,97 @@
+{#
+ # 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.
+ #}
+{
+  "output":[
+    {
+      "is_enabled":"{{solr_service_logs_enable}}",
+      "comment":"Output to solr for service logs",
+      "destination":"solr",
+      "zk_hosts":"{{zookeeper_quorum}}{{logsearch_solr_znode}}",
+      "collection":"{{logsearch_solr_collection_service_logs}}",
+      "number_of_shards": "{{logsearch_numshards}}",
+      "splits_interval_mins": "{{service_logs_collection_splits_interval_mins}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "service"
+          ]
+          
+        }
+        
+      }
+      
+    },
+    {
+      "comment":"Output to solr for audit records",
+      "is_enabled":"{{solr_audit_logs_enable}}",
+      "destination":"solr",
+      "zk_hosts":"{{zookeeper_quorum}}{{logsearch_solr_znode}}",
+      "collection":"{{logsearch_solr_collection_audit_logs}}",
+      "number_of_shards": "{{logsearch_numshards}}",
+      "splits_interval_mins": "{{audit_logs_collection_splits_interval_mins}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "audit"
+          ]
+          
+        }
+        
+      }
+      
+    },
+    {
+      "is_enabled":"{{kafka_service_logs_enable}}",
+      "destination":"kafka",
+      "broker_list":"{{kafka_broker_list}}",
+      "topic":"{{kafka_topic_service_logs}}",
+      "kafka.security.protocol":"{{kafka_security_protocol}}",
+      "kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "service"
+          ]
+          
+        }
+        
+      }
+      
+    },
+    {
+      "is_enabled":"{{kafka_audit_logs_enable}}",
+      "destination":"kafka",
+      "broker_list":"{{kafka_broker_list}}",
+      "topic":"{{kafka_topic_audit_logs}}",
+      "kafka.security.protocol":"{{kafka_security_protocol}}",
+      "kafka.sasl.kerberos.service.name":"{{kafka_kerberos_service_name}}",
+      "conditions":{
+        "fields":{
+          "rowtype":[
+            "audit"
+          ]
+          
+        }
+        
+      }
+      
+    }
+    
+  ]
+  
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
new file mode 100644
index 0000000..6210f06
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/templates/zoo.cfg.j2
@@ -0,0 +1,31 @@
+# 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.
+
+# The number of milliseconds of each tick
+tickTime=2000
+# The number of ticks that the initial
+# synchronization phase can take
+initLimit=10
+# The number of ticks that can pass between
+# sending a request and getting an acknowledgement
+syncLimit=5
+
+# the directory where the snapshot is stored.
+# dataDir=/opt/zookeeper/data
+# NOTE: Solr defaults the dataDir to $solrHome/zoo_data
+
+# the port at which the clients will connect
+# clientPort=2181
+# NOTE: Solr sets this based on zkRun / zkHost params
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
new file mode 100644
index 0000000..16e1f4c
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/quicklinks/quicklinks.json
@@ -0,0 +1,28 @@
+{
+  "name": "default",
+  "description": "default quick links configuration",
+  "configuration": {
+    "protocol":
+    {
+      "type":"http"
+    },
+    "links" : [
+      {
+        "name": "logsearch_ui",
+        "label": "Logsearch UI",
+        "url":"%@://%@:%@",
+        "requires_user_name": "false",
+        "port":{
+          "http_property": "logsearch.ui.port",
+          "http_default_port": "8888",
+          "https_property": "logsearch.ui.port",
+          "https_default_port": "8888",
+          "regex": "^(\\d+)$",
+          "site": "logsearch-site"
+        }
+      }
+    ]
+
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index 77ff982..b0cff68 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -174,6 +174,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -210,6 +211,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -322,6 +324,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
index 0ef4674..bf041de 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.4.xml
@@ -180,6 +180,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -216,6 +217,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -328,6 +330,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
index 9ab413e..d64714a 100755
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/role_command_order.json
@@ -20,6 +20,9 @@
     "KNOX_GATEWAY-START" : ["RANGER_USERSYNC-START", "NAMENODE-START"],
     "KAFKA_BROKER-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", "NAMENODE-START"],
     "NIMBUS-START" : ["ZOOKEEPER_SERVER-START", "RANGER_USERSYNC-START", "NAMENODE-START"],
-    "STORM_UI_SERVER-START" : ["NIMBUS-START", "NAMENODE-START"]
+    "STORM_UI_SERVER-START" : ["NIMBUS-START", "NAMENODE-START"],
+    "LOGSEARCH_SOLR-START" : ["ZOOKEEPER_SERVER-START"],
+    "LOGSEARCH_SERVER-START": ["LOGSEARCH_SOLR-START"],
+    "LOGSEARCH_LOGFEEDER-START": ["LOGSEARCH_SOLR-START", "LOGSEARCH_SERVER-START"]
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
new file mode 100644
index 0000000..df697dc
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/LOGSEARCH/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.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.
+-->
+<metainfo>
+  <schemaVersion>2.0</schemaVersion>
+  <services>
+    <service>
+      <name>LOGSEARCH</name>
+      <extends>common-services/LOGSEARCH/0.5.0</extends>
+    </service>
+  </services>
+</metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
index ed30846..6b74af0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.3.xml
@@ -175,6 +175,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     
@@ -213,6 +214,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -339,6 +341,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 4731631..9fb2bba 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -166,6 +166,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -203,6 +204,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -320,6 +322,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
index b53a090..e3bc7a3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.4.xml
@@ -173,6 +173,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
     
@@ -211,6 +212,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 
@@ -337,6 +339,7 @@
       </priority>
       <exclude>
         <service>AMBARI_METRICS</service>
+        <service>LOGSEARCH</service>
       </exclude>
     </group>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
new file mode 100644
index 0000000..ab11ba1
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py
@@ -0,0 +1,152 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+
+class TestLogFeeder(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+  
+  def configureResourcesCalled(self):
+    self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-logfeeder',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-logfeeder',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-logfeeder',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-logfeeder/conf',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-logfeeder/conf/checkpoints',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    
+    self.assertResourceCalled('File', '/var/log/ambari-logsearch-logfeeder/logfeeder.out',
+                              owner = 'logfeeder',
+                              group = 'logfeeder',
+                              mode = 0644,
+                              content = ''
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/logfeeder.properties',
+                              owner = 'logfeeder',
+                              content = Template('logfeeder.properties.j2')
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/logfeeder-env.sh',
+                              owner = 'logfeeder',
+                              content = InlineTemplate(self.getConfig()['configurations']['logfeeder-env']['content'])
+                              )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/log4j.xml',
+                              owner = 'logfeeder',
+                              content = InlineTemplate(self.getConfig()['configurations']['logfeeder-log4j']['content'])
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/grok-patterns',
+                              owner = 'logfeeder',
+                              content = Template('grok-patterns.j2'),
+                              encoding = 'utf-8'
+    )
+    
+    logfeeder_supported_services = ['accumulo', 'ambari', 'ams', 'atlas', 'falcon', 'hbase', 'hdfs', 'hive', 'kafka',
+                                    'knox', 'logsearch', 'oozie', 'ranger', 'storm', 'yarn', 'zookeeper']
+    
+    logfeeder_config_file_names = ['global.config.json', 'output.config.json'] + ['input.config-%s.json' % (tag) for tag in logfeeder_supported_services]
+    
+    for file_name in logfeeder_config_file_names:
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-logfeeder/conf/' + file_name,
+                                owner = 'logfeeder',
+                                content = Template(file_name + ".j2")
+      )
+  
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+                       classname = "LogFeeder",
+                       command = "configure",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+  
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+                       classname = "LogFeeder",
+                       command = "start",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', '/usr/lib/ambari-logsearch-logfeeder/run.sh',
+                              environment={'LOGFEEDER_INCLUDE': '/etc/ambari-logsearch-logfeeder/conf/logfeeder-env.sh'},
+                              user = 'logfeeder'
+    )
+  
+  def test_stop_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+                       classname = "LogFeeder",
+                       command = "stop",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.assertResourceCalled('Execute', 'kill `cat /var/run/ambari-logsearch-logfeeder/logfeeder.pid`',
+                              user = 'logfeeder',
+                              only_if = 'test -f /var/run/ambari-logsearch-logfeeder/logfeeder.pid'
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-logsearch-logfeeder/logfeeder.pid',
+                              action = ['delete']
+    )
+  
+#  def test_status_default(self):
+#    with self.assertRaises(ComponentIsNotRunning) as e:
+#      self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logfeeder.py",
+#                         classname = "LogFeeder",
+#                         command = "status",
+#                         config_file = "default.json",
+#                         stack_version = self.STACK_VERSION,
+#                         target = RMFTestCase.TARGET_COMMON_SERVICES
+#      )

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
new file mode 100644
index 0000000..585988d
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
@@ -0,0 +1,159 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+from mock.mock import MagicMock, patch
+from resource_management.libraries.script.config_dictionary import UnknownConfiguration
+
+class TestLogSearch(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+  
+  def configureResourcesCalled(self):
+    self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-portal',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    self.assertResourceCalled('Directory', '/etc/ambari-logsearch-portal/conf',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              create_parents = True,
+                              cd_access = 'a',
+                              mode = 0755
+    )
+    
+    self.assertResourceCalled('File', '/var/log/ambari-logsearch-portal/logsearch.out',
+                              owner = 'logsearch',
+                              group = 'logsearch',
+                              mode = 0644,
+                              content = ''
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/logsearch.properties',
+                              owner = 'logsearch',
+                              content = Template('logsearch.properties.j2')
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/log4j.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-log4j']['content'])
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/logsearch-env.sh',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-env']['content']),
+                              mode = 0755,
+                              owner = "logsearch"
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/solr_configsets/hadoop_logs/conf/solrconfig.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-service_logs-solrconfig']['content'])
+    )
+    self.assertResourceCalled('File', '/etc/ambari-logsearch-portal/conf/solr_configsets/audit_logs/conf/solrconfig.xml',
+                              owner = 'logsearch',
+                              content = InlineTemplate(self.getConfig()['configurations']['logsearch-audit_logs-solrconfig']['content'])
+                              )
+    
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd downconfig -confdir /tmp/solr_config_hadoop_logs_0.[0-9]* -confname hadoop_logs$',
+                                    only_if = "^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd get /configs/hadoop_logs$"
+    )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd upconfig -confdir /etc/ambari-logsearch-portal/conf/solr_configsets/hadoop_logs/conf -confname hadoop_logs$',
+                                    not_if = "^test -d /tmp/solr_config_hadoop_logs_0.[0-9]*$"
+    )
+    self.assertResourceCalled('Execute', '/usr/lib/ambari-logsearch-solr/bin/solr create -c history -d /etc/ambari-logsearch-portal/conf/solr_configsets/history/conf -s 10 -rf 1',
+                              environment={'SOLR_INCLUDE': '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh'}
+                              )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd downconfig -confdir /tmp/solr_config_audit_logs_0.[0-9]* -confname audit_logs$',
+                                    only_if = "^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd get /configs/audit_logs$"
+    )
+    self.assertResourceCalledRegexp('^Execute$', '^export JAVA_HOME=/usr/jdk64/jdk1.7.0_45 ; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org:None/logsearch -cmd upconfig -confdir /etc/ambari-logsearch-portal/conf/solr_configsets/audit_logs/conf -confname audit_logs$',
+                                    not_if = "^test -d /tmp/solr_config_audit_logs_0.[0-9]*$"
+    )
+    self.assertResourceCalled('Execute', ('chmod', '-R', 'ugo+r', '/etc/ambari-logsearch-portal/conf/solr_configsets'),
+                              sudo=True
+    )
+  
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+                       classname = "LogSearch",
+                       command = "configure",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+  
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+                       classname = "LogSearch",
+                       command = "start",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', "/usr/lib/ambari-logsearch-portal/run.sh 61888",
+                              environment = {'LOGSEARCH_INCLUDE': '/etc/ambari-logsearch-portal/conf/logsearch-env.sh'},
+                              user = "logsearch"
+    )
+  
+  def test_stop_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+                       classname = "LogSearch",
+                       command = "stop",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.assertResourceCalled('Execute', 'kill `cat /var/run/ambari-logsearch-portal/logsearch.pid` >/dev/null 2>&1',
+                              user = 'logsearch',
+                              only_if = 'test -f /var/run/ambari-logsearch-portal/logsearch.pid'
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-logsearch-portal/logsearch.pid',
+                              action = ['delete']
+    )
+  
+#  def test_status_default(self):
+#    with self.assertRaises(ComponentIsNotRunning) as e:
+#      self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/logsearch.py",
+#                         classname = "LogSearch",
+#                         command = "status",
+#                         config_file = "default.json",
+#                         stack_version = self.STACK_VERSION,
+#                         target = RMFTestCase.TARGET_COMMON_SERVICES
+#      )

http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
new file mode 100644
index 0000000..5a684e6
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_solr.py
@@ -0,0 +1,155 @@
+#!/usr/bin/env python
+
+'''
+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.
+'''
+
+from stacks.utils.RMFTestCase import RMFTestCase, Template, InlineTemplate, StaticFile
+from resource_management.core.exceptions import ComponentIsNotRunning
+from resource_management.libraries.script.config_dictionary import UnknownConfiguration
+
+class TestSolr(RMFTestCase):
+  COMMON_SERVICES_PACKAGE_DIR = "LOGSEARCH/0.5.0/package"
+  STACK_VERSION = "2.4"
+  
+  def configureResourcesCalled(self):
+      self.assertResourceCalled('Directory', '/usr/lib/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/var/log/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/var/run/ambari-logsearch-solr',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/etc/ambari-logsearch-solr/conf',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/opt/logsearch_solr/data',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      self.assertResourceCalled('Directory', '/opt/logsearch_solr/data/resources',
+                                owner = 'solr',
+                                group = 'solr',
+                                create_parents = True,
+                                cd_access = 'a',
+                                mode = 0755
+      )
+      
+      self.assertResourceCalled('File', '/var/log/ambari-logsearch-solr/solr-install.log',
+                                owner = 'solr',
+                                group = 'solr',
+                                mode = 0644,
+                                content = ''
+      )
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh',
+                                owner = 'solr',
+                                mode = 0755,
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-env']['content'])
+      )
+      self.assertResourceCalled('File', '/opt/logsearch_solr/data/solr.xml',
+                                owner = 'solr',
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-xml']['content'])
+      )
+      self.assertResourceCalled('File', '/etc/ambari-logsearch-solr/conf/log4j.properties',
+                                owner = 'solr',
+                                content = InlineTemplate(self.getConfig()['configurations']['logsearch-solr-log4j']['content'])
+      )
+      self.assertResourceCalled('File', '/opt/logsearch_solr/data/zoo.cfg',
+                                owner = 'solr',
+                                content = Template('zoo.cfg.j2')
+      )
+      self.assertResourceCalled('Execute', 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org -cmd makepath /logsearch',
+                                not_if = "export JAVA_HOME=/usr/jdk64/jdk1.7.0_45; /usr/lib/ambari-logsearch-solr/server/scripts/cloud-scripts/zkcli.sh -zkhost c6401.ambari.apache.org -cmd get /logsearch",
+                                ignore_failures = True,
+                                user = "solr"
+      )
+  
+  def test_configure_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "configure",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertNoMoreResources()
+  
+  def test_start_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "start",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.configureResourcesCalled()
+    self.assertResourceCalled('Execute', "/usr/lib/ambari-logsearch-solr/bin/solr start -cloud -noprompt -s /opt/logsearch_solr/data >> /var/log/ambari-logsearch-solr/solr-install.log 2>&1",
+                              environment = {'SOLR_INCLUDE': '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh'},
+                              user = "solr"
+    )
+  
+  def test_stop_default(self):
+    self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+                       classname = "Solr",
+                       command = "stop",
+                       config_file = "default.json",
+                       stack_version = self.STACK_VERSION,
+                       target = RMFTestCase.TARGET_COMMON_SERVICES
+    )
+    
+    self.assertResourceCalled('Execute', '/usr/lib/ambari-logsearch-solr/bin/solr stop -all >> /var/log/ambari-logsearch-solr/solr-install.log',
+                              environment = {'SOLR_INCLUDE': '/etc/ambari-logsearch-solr/conf/logsearch-solr-env.sh'},
+                              user = "solr",
+                              only_if = "test -f /var/run/ambari-logsearch-solr/solr-8886.pid"
+    )
+    self.assertResourceCalled('File', '/var/run/ambari-logsearch-solr/solr-8886.pid',
+                              action = ['delete']
+    )
+  
+#  def test_status_default(self):
+#    with self.assertRaises(ComponentIsNotRunning) as e:
+#      self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/solr.py",
+#                         classname = "Solr",
+#                         command = "status",
+#                         config_file = "default.json",
+#                         stack_version = self.STACK_VERSION,
+#                         target = RMFTestCase.TARGET_COMMON_SERVICES
+#      )


[45/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2 b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
new file mode 100644
index 0000000..713a73a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/run.sh.j2
@@ -0,0 +1,83 @@
+#!/bin/bash
+# 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.
+
+curr_dir=`pwd`
+cd `dirname $0`; script_dir=`pwd`; cd $curr_dir
+
+foreground=0
+if [ "$1" = "-foreground" ]; then
+    foreground=1
+    shift
+fi
+
+JAVA=java
+if [ -x $JAVA_HOME/bin/java ]; then
+    JAVA=$JAVA_HOME/bin/java
+fi
+
+if [ "$LOGFEEDER_JAVA_MEM" = "" ]; then
+    LOGFEEDER_JAVA_MEM="-Xmx512m"
+fi
+
+if [ "$LOGFILE" = "" ]; then
+    LOGFILE="{{logfeeder_log_dir}}/logfeeder.out"
+fi
+
+if [ "$PID_FILE" = "" ]; then
+    LOGFEEDER_PID_DIR=$HOME
+    PID_FILE=$LOGFEEDER_PID_DIR/logsearch-logfeeder-$USER.pid
+fi
+
+if [ "$LOGFEEDER_CONF_DIR" = "" ]; then
+    LOGFEEDER_CONF_DIR="/etc/logfeeder/conf"
+fi
+
+LOGFEEDER_GC_LOGFILE=`dirname $LOGFILE`/logfeeder_gc.log
+LOGFEEDER_GC_OPTS="-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$LOGFEEDER_GC_LOGFILE"
+
+#LOGFEEDER_JAVA_OPTS=
+#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=2098"
+
+if [ $foreground -eq 0 ]; then
+    if [ -f ${PID_FILE} ]; then
+	PID=`cat ${PID_FILE}`
+	if kill -0 $PID 2>/dev/null; then
+	    echo "logfeeder already running (${PID}) killing..."
+	    kill $PID 2>/dev/null
+	    sleep 5
+	    if kill -0 $PID 2>/dev/null; then
+		echo "logfeeder still running. Will kill process forcefully in another 10 seconds..."
+		sleep 10
+		kill -9 $PID 2>/dev/null
+		sleep 2
+	    fi
+	fi
+
+	if kill -0 $PID 2>/dev/null; then
+	    echo "ERROR: Even after all efforts to stop logfeeder, it is still running. pid=$PID. Please manually kill the service and try again."
+	    exit 1
+	fi
+    fi
+
+    echo "Starting logfeeder. Output file=$LOGFILE pid_file=$PID_FILE"
+    #LOGFEEDER_CLI_CLASSPATH=
+    #set -x
+    nohup $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:/etc/logfeeder/conf:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_GC_OPTS $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $* > $LOGFILE 2>&1 &
+    echo $! > $PID_FILE
+else
+    $JAVA -cp "$LOGFEEDER_CLI_CLASSPATH:$LOGFEEDER_CONF_DIR:$script_dir/libs/*:$script_dir/classes:$script_dir/LogProcessor.jar" $LOGFEEDER_JAVA_MEM $LOGFEEDER_JAVA_OPTS $JMX org.apache.ambari.logfeeder.LogFeeder $*
+fi
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
new file mode 100644
index 0000000..193cb48
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/java/org/apache/ambari/logfeeder/AppTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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.
+ */
+package org.apache.ambari.logfeeder;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.filter.FilterGrok;
+import org.apache.log4j.Logger;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest extends TestCase {
+  static Logger logger = Logger.getLogger(AppTest.class);
+
+  /**
+   * Create the test case
+   *
+   * @param testName name of the test case
+   */
+  public AppTest(String testName) {
+    super(testName);
+  }
+
+  /**
+   * @return the suite of tests being tested
+   */
+  public static Test suite() {
+    return new TestSuite(AppTest.class);
+  }
+
+  /**
+   * Rigourous Test :-)
+   */
+  public void testApp() {
+    assertTrue(true);
+  }
+
+  public void testGrok() {
+    logger.info("testGrok()");
+    FilterGrok grokFilter = new FilterGrok();
+    try {
+      Map<String, Object> map = new HashMap<String, Object>();
+      map.put("message_pattern",
+        "^%{LOGLEVEL:level}%{SPACE}%{GREEDYDATA:log_message}");
+      grokFilter.loadConfig(map);
+      grokFilter.init();
+      String out = grokFilter.grokParse("INFO This is a test");
+      logger.info("out=" + out);
+
+    } catch (Exception e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+      assertFalse(true);
+    }
+
+    assertTrue(true);
+  }
+
+  public void testGrokUGI() {
+    logger.info("testGrok()");
+    String[] ugis = new String[]{"user1@xyz.com (auth:TOKEN)",
+      "ambari-qa@example.com (auth:kerberos)",
+      "my_user@example.com (auth:kerberos)",
+      "hive/bdurai-dojran-2.novalocal@example.com (auth:kerberos)",
+      "just_me",
+      "ambari-qa (auth:PROXY) via hive/myhost.novalocal@EXAMPLE.COM (auth:KERBEROS)"};
+
+    FilterGrok grokFilter = new FilterGrok();
+    try {
+      Map<String, Object> map = new HashMap<String, Object>();
+      // map.put("message_pattern",
+      // "(?<user>([\\w\\d\\-]+))\\/|(?<user>([\\w\\d\\-]+))@|(?<user>([\\w\\d\\-]+))/[\\w\\d\\-.]+@|(?<user>([\\w\\d.\\-_]+))[\\s(]+");
+      // map.put("message_pattern",
+      // "(?<user>([\\w\\d\\-]+))/[\\w\\d\\-.]+@");
+      // *(auth:(?<auth>[\\w\\d\\-]+))
+      // GOOD: map.put("message_pattern", "(?<user>([\\w\\d\\-]+)).+auth:(?<auth>([\\w\\d\\-]+))");
+      // OK: map.put("message_pattern", "(?<user>([\\w\\d\\-]+)).+auth:(?<auth>([\\w\\d\\-]+))|%{USERNAME:xuser}");
+      //map.put("message_pattern", "%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}");
+      map.put("message_pattern", "%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}");
+      grokFilter.loadConfig(map);
+      grokFilter.init();
+      for (String ugi : ugis) {
+        String out = grokFilter.grokParse(ugi);
+        logger.info(ugi + "=" + out);
+      }
+
+    } catch (Exception e) {
+      // TODO Auto-generated catch block
+      e.printStackTrace();
+      assertFalse(true);
+    }
+    assertTrue(true);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
new file mode 100644
index 0000000..8c64c28
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/sample_filter.json
@@ -0,0 +1,166 @@
+{
+	"filter": {
+		"hdfs_namenode": {
+			"label": "hdfs_namenode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_resourcemanager": {
+			"label": "yarn_resourcemanager",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"logsearch_perf": {
+			"label": "logsearch_perf",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hdfs_secondarynamenode": {
+			"label": "hdfs_secondarynamenode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"mapred_historyserver": {
+			"label": "mapred_historyserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ams_hbase_master": {
+			"label": "ams_hbase_master",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ambari_server": {
+			"label": "ambari_server",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_timelineserver": {
+			"label": "yarn_timelineserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hdfs_datanode": {
+			"label": "hdfs_datanode",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"logsearch_app": {
+			"label": "logsearch_app",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_statechange": {
+			"label": "kafka_statechange",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hbase_master": {
+			"label": "hbase_master",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_server": {
+			"label": "kafka_server",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"oozie_app": {
+			"label": "oozie_app",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hive_hiveserver2": {
+			"label": "hive_hiveserver2",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_nodemanager": {
+			"label": "yarn_nodemanager",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hbase_regionserver": {
+			"label": "hbase_regionserver",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ambari_agent": {
+			"label": "ambari_agent",
+			"hosts": ["host1","host2"],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": "2016-04-05T08:30:00.000Z"
+		},
+		"logsearch_feeder": {
+			"label": "logsearch_feeder",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"kafka_controller": {
+			"label": "kafka_controller",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"ams_collector": {
+			"label": "ams_collector",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"yarn_jobsummary": {
+			"label": "yarn_jobsummary",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		},
+		"hive_metastore": {
+			"label": "hive_metastore",
+			"hosts": [],
+			"defaultLevels": ["FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"],
+			"overrideLevels": [],
+			"expiryTime": ""
+		}
+	},
+	"id": "1459861568220"
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
new file mode 100644
index 0000000..b7d0a6e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_audit.json
@@ -0,0 +1,173 @@
+{
+	"global": {
+		"add_fields": {
+			"cluster": "audit"
+		},
+		"source": "file",
+		"tail": "true",
+		"gen_event_md5": "true",
+		"start_position": "beginning"
+	},
+	"input": [{
+		"type": "hdfs_audit",
+		"rowtype": "hdfs_audit",
+		"path": "{path}/src/test/resources/samples/jsonlogs/audit_log.json"
+	}],
+	"filter": [{
+			"filter": "json",
+			"conditions": {
+				"fields": {
+					"type": [
+						"hdfs_audit"
+					]
+
+				}
+			}
+		}, {
+			"filter": "keyvalue",
+			"sort_order": 1,
+			"conditions": {
+				"fields": {
+					"type": [
+						"hdfs_audit"
+					]
+
+				}
+
+			},
+			"source_field": "log_message",
+			"value_split": "=",
+			"field_split": "\t",
+			"post_map_values": {
+				"src": {
+					"map_fieldname": {
+						"new_fieldname": "resource"
+					}
+
+				},
+				"ip": {
+					"map_fieldname": {
+						"new_fieldname": "cliIP"
+					}
+
+				},
+				"allowed": [{
+						"map_fieldvalue": {
+							"pre_value": "true",
+							"post_value": "1"
+						}
+
+					}, {
+						"map_fieldvalue": {
+							"pre_value": "false",
+							"post_value": "0"
+						}
+
+					}, {
+						"map_fieldname": {
+							"new_fieldname": "result"
+						}
+
+					}
+
+				],
+				"cmd": {
+					"map_fieldname": {
+						"new_fieldname": "action"
+					}
+
+				},
+				"proto": {
+					"map_fieldname": {
+						"new_fieldname": "cliType"
+					}
+
+				},
+				"callerContext": {
+					"map_fieldname": {
+						"new_fieldname": "req_caller_id"
+					}
+
+				}
+
+			}
+
+		}, {
+			"filter": "grok",
+			"sort_order": 2,
+			"source_field": "ugi",
+			"remove_source_field": "false",
+			"conditions": {
+				"fields": {
+					"type": [
+						"hdfs_audit"
+					]
+
+				}
+
+			},
+			"message_pattern": "%{USERNAME:p_user}.+auth:%{USERNAME:p_authType}.+via %{USERNAME:k_user}.+auth:%{USERNAME:k_authType}|%{USERNAME:user}.+auth:%{USERNAME:authType}|%{USERNAME:x_user}",
+			"post_map_values": {
+				"user": {
+					"map_fieldname": {
+						"new_fieldname": "reqUser"
+					}
+
+				},
+				"x_user": {
+					"map_fieldname": {
+						"new_fieldname": "reqUser"
+					}
+
+				},
+				"p_user": {
+					"map_fieldname": {
+						"new_fieldname": "reqUser"
+					}
+
+				},
+				"k_user": {
+					"map_fieldname": {
+						"new_fieldname": "proxyUsers"
+					}
+
+				},
+				"p_authType": {
+					"map_fieldname": {
+						"new_fieldname": "authType"
+					}
+
+				},
+				"k_authType": {
+					"map_fieldname": {
+						"new_fieldname": "proxyAuthType"
+					}
+
+				}
+
+			}
+
+		}
+
+	],
+
+	"output": [{
+			"is_enabled": "true",
+			"comment": "Output to file for audit logs",
+			"destination": "solr",
+			"url": "http://localhost:8983/solr/audit_logs",
+			"collection": "audit_logs",
+			"number_of_shards": "1",
+			"splits_interval_mins": "100000",
+			"conditions": {
+				"fields": {
+					"rowtype": [
+						"hdfs_audit"
+					]
+				}
+			}
+		}
+
+	]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
new file mode 100644
index 0000000..2e96fd7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/config/config_service.json
@@ -0,0 +1,43 @@
+{
+	"global": {
+		"add_fields": {
+			"cluster": "cluster_name"
+		},
+		"source": "file",
+		"tail": "true",
+		"gen_event_md5": "true",
+		"start_position": "beginning"
+	},
+	"input": [{
+		"type": "logsearch",
+		"rowtype": "service",
+		"path": "{path}/src/test/resources/samples/jsonlogs/service_log.json"
+	}],
+	"filter": [{
+		"filter": "json",
+		"conditions": {
+			"fields": {
+				"type": [
+					"logsearch"
+				]
+			}
+		}
+	}],
+	"output": [{
+		"comment": "Output to solr for service records",
+		"is_enabled": "true",
+		"destination": "solr",
+		"url": "http://localhost:8983/solr/hadoop_logs",
+		"collection": "hadoop_logs",
+		"number_of_shards": "1",
+		"splits_interval_mins": "100000",
+		"conditions": {
+			"fields": {
+				"rowtype": [
+					"service"
+				]
+			}
+		}
+	}]
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
new file mode 100644
index 0000000..3ffa40d
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/audit_log.json
@@ -0,0 +1,9 @@
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917617284"}
+{"level":"DEBUG","file":"App.java","thread_name":"main","line_number":15,"log_message":"FSNamesystem.audit: allowed\u003dtrue\tugi\u003doozie (auth:SIMPLE)\tip\u003d/10.10.10.41\tcmd\u003dlistStatus\tsrc\u003d/user/oozie/share/lib\tdst\u003dnull\tperm\u003dnull\tproto\u003drpc","logger_name":"logserach.appender.test.App","logtime":"1456917717290"}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
new file mode 100644
index 0000000..e0a3728
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/test/resources/samples/jsonlogs/service_log.json
@@ -0,0 +1,7 @@
+{"level":"INFO","file":"LogSearch.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":48,"log_message":"Starting logsearch server...","logger_name":"org.apache.ambari.logsearch.LogSearch","logtime":"1457000117434"}
+{"level":"INFO","file":"PropertiesLoaderSupport.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":177,"log_message":"Loading properties file from class path resource [logsearch.properties]","logger_name":"org.apache.ambari.logsearch.util.PropertiesUtil","logtime":"1457000118770"}
+{"level":"INFO","file":"PropertiesLoaderSupport.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":177,"log_message":"Loading properties file from class path resource [custom.properties]","logger_name":"org.apache.ambari.logsearch.util.PropertiesUtil","logtime":"1457000118774"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":83,"log_message":"connectToSolr() zkHosts\u003dnull, collection\u003daudit_logs, url\u003dhttp://localhost:8983/solr","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000118940"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":104,"log_message":"Connencting to  solr : http://localhost:8983/solr/audit_logs","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000118942"}
+{"level":"ERROR","file":"AuditSolrDao.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":53,"log_message":"Error while connecting to Solr for audit logs : solrUrl\u003dhttp://localhost:8983/solr, zkHosts\u003dnull, collection\u003daudit_logs\norg.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8983/solr/audit_logs: Expected mime type application/octet-stream but got text/html. \u003chtml\u003e\n\u003chead\u003e\n\u003cmeta http-equiv\u003d\"Content-Type\" content\u003d\"text/html; charset\u003dUTF-8\"/\u003e\n\u003ctitle\u003eError 404 Not Found\u003c/title\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003ch2\u003eHTTP ERROR 404\u003c/h2\u003e\n\u003cp\u003eProblem accessing /solr/audit_logs/admin/collections. Reason:\n\u003cpre\u003e    Not Found\u003c/pre\u003e\u003c/p\u003e\u003chr\u003e\u003ci\u003e\u003csmall\u003ePowered by Jetty://\u003c/small\u003e\u003c/i\u003e\u003chr/\u003e\n\n\u003c/body\
 u003e\n\u003c/html\u003e\n\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:528)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:234)\n\tat org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:226)\n\tat org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:135)\n\tat org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:152)\n\tat org.apache.ambari.logsearch.dao.SolrDaoBase.setupCollections(SolrDaoBase.java:169)\n\tat org.apache.ambari.logsearch.dao.AuditSolrDao.postConstructor(AuditSolrDao.java:50)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotatio
 nBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:346)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:299)\n\tat org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:132)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Abstract
 AutowireCapableBeanFactory.java:456)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)\n\tat org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)\n\tat org.spri
 ngframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)\n\tat org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)\n\tat org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549)\n\tat org.mortbay.jetty.servlet.Context.startContext(Context.java:136)\n\tat org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)\n\tat org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)\n\tat org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)\n\tat org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.mortbay.jetty.handler.HandlerWrapper.doStart(Hand
 lerWrapper.java:130)\n\tat org.mortbay.jetty.Server.doStart(Server.java:224)\n\tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\n\tat org.apache.hadoop.http.HttpServer2.start(HttpServer2.java:857)\n\tat org.apache.ambari.logsearch.LogSearch.main(LogSearch.java:50)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)\n\tat java.lang.Thread.run(Thread.java:745)\n","logger_name":"org.apache.ambari.logsearch.dao.AuditSolrDao","logtime":"1457000119375"}
+{"level":"INFO","file":"SolrDaoBase.java","thread_name":"org.apache.ambari.logsearch.LogSearch.main()","line_number":83,"log_message":"connectToSolr() zkHosts\u003dnull, collection\u003dhadoop_logs, url\u003dhttp://localhost:8983/solr","logger_name":"org.apache.ambari.logsearch.dao.SolrDaoBase","logtime":"1457000119392"}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/.gitignore
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/.gitignore b/ambari-logsearch/ambari-logsearch-portal/.gitignore
new file mode 100644
index 0000000..07e0389
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/.gitignore
@@ -0,0 +1,9 @@
+target
+.settings
+.classpath
+.project
+/bin/
+node_modules/
+logs/
+node/
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/README.md b/ambari-logsearch/ambari-logsearch-portal/README.md
new file mode 100644
index 0000000..126f651
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/README.md
@@ -0,0 +1,55 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
+#Compilation
+mvn clean compile package
+
+#Deploy
+##Copy to remote
+copy target/logsearch-portal.tar.gz to host machine
+##Setup environment
+```bash
+mkdir /opt/logsearch
+cd /opt/logsearch
+tar xfz ~/logsearch-portal.tar.gz 
+```
+#Create Solr Collection
+*Edit for log retention days (default is 7 days)*
+```bash
+vi solr_configsets/hadoop_logs/conf/solrconfig.xml
+```
+```
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+7DAYS</str>
+    </processor>
+```
+```bash
+./create_collections.sh $SOLR_HOME $NUM_SHARDS $NUM_OF_REPLICATIONS `pwd`/solr_configsets
+```
+```bash
+vi classes/logsearch.properties
+```
+```
+solr.zkhosts=$ZK1:2181,$ZK2:2181,$ZK3:2181/solr
+```
+*This script will stop logsearch if it is running and restart it*
+```bash
+./run.sh
+```

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/build.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/build.properties b/ambari-logsearch/ambari-logsearch-portal/build.properties
new file mode 100644
index 0000000..1cd118a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/build.properties
@@ -0,0 +1,23 @@
+#   Licensed 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.
+
+# log4j configuration used during build and unit tests
+
+TOMCAT_HOME=/Library/Tomcat/Home
+app.work.dir=${builddir}/build/work
+app.war.dir=${app.work.dir}/war
+app.pkg.dir=${app.work.dir}/pkg
+
+app.dev.war.dir=${app.work.dir}/webapps/logsearch
+app.war.name=logsearch.war
+
+app.target.dir=${builddir}/target/classes/webapps/app
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/build.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/build.xml b/ambari-logsearch/ambari-logsearch-portal/build.xml
new file mode 100644
index 0000000..22c7938
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/build.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+   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.
+-->
+<project basedir="." default="build" name="logsearch">
+  <property environment="env"/>
+  <property name="debuglevel" value="source,lines,vars"/>
+  <dirname property="builddir" file="build.xml"/>
+  <property name="target" value="1.7"/>
+  <property name="source" value="1.7"/>
+  <property file="local.properties"/>
+  <property file="build.properties"/>
+
+  <target name="init">
+  </target>
+  <target name="build"/>
+  <target name="create-dev-war">
+    <copy todir="${app.target.dir}" includeEmptyDirs="no">
+      <fileset dir="src/main/webapp" excludes="**/*.class"/>
+    </copy>
+  </target>
+
+  <target name="package">
+    <delete dir="target/package"/>
+    <copy todir="target/package/libs" includeEmptyDirs="no">
+      <fileset dir="target/libs"/>
+    </copy>
+    <copy todir="target/package/" includeEmptyDirs="no">
+      <fileset file="target/LogSearch.jar"/>
+    </copy>
+    <copy todir="target/package/classes" includeEmptyDirs="no">
+      <fileset dir="target/classes"/>
+    </copy>
+    <copy todir="target/package/solr_configsets" includeEmptyDirs="yes">
+      <fileset dir="src/main/configsets"/>
+    </copy>
+    <copy todir="target/package" includeEmptyDirs="no">
+      <fileset file="src/main/scripts/*"/>
+    </copy>
+    <chmod file="target/package/*.sh" perm="755"/>
+    <tar compression="gzip" destfile="target/ambari-logsearch-portal.tar.gz">
+      <tarfileset mode="755" dir="target/package">
+        <include name="*.sh"/>
+      </tarfileset>
+      <tarfileset mode="664" dir="target/package">
+        <exclude name="*.sh"/>
+      </tarfileset>
+    </tar>
+
+  </target>
+
+
+  <target description="Build all projects which reference this project. Useful to propagate changes."
+          name="build-refprojects"/>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/gulpfile.js b/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
new file mode 100644
index 0000000..88ab1b3
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/gulpfile.js
@@ -0,0 +1,136 @@
+/**
+ * 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.
+ */
+
+'use strict';
+
+var gulp = require('gulp'),
+    minifyHTML = require('gulp-minify-html'),
+    minifyCss = require('gulp-minify-css'),
+    Del = require('del'),
+    Yargs = require('yargs'),
+    RunSequence = require('run-sequence'),
+    shell = require('gulp-shell');
+
+
+var argv = Yargs.argv;
+
+
+/**
+ * Build Settings
+ */
+var settings = {
+
+    /*
+     * Environment to build our application for
+     *
+     * If we have passed an environment via a
+     * CLI option, then use that. If not attempt
+     * to use the NODE_ENV. If not set, use production.
+     */
+    environment: !!argv.env ? argv.env : process.env.NODE_ENV || 'p',
+
+    productionFolder: 'target/webapp-build',
+
+    devFolder: 'src/main/webapp'
+
+};
+
+
+
+/**
+ * Clean Task
+ *
+ * Clears the build folder from our
+ * previous builds files.
+ */
+gulp.task('clean', function(cb) {
+    return Del([
+        settings.productionFolder
+    ], cb);
+
+});
+
+/**
+ * minify JS Task
+ *
+ */
+gulp.task('minify-js', ['clean'], shell.task([
+    'node production/r.js -o production/build.js'
+]));
+
+
+/**
+ * minify CSS Task
+ *
+ */
+
+gulp.task('minify-css', ['minify-js'], function() {
+    return gulp.src(settings.productionFolder+'/**/*.css')
+        .pipe(minifyCss({
+            compatibility: 'ie8'
+        }))
+        .pipe(gulp.dest(settings.productionFolder+'/'));
+});
+/**
+ * minify HTML Task
+ *
+ */
+// gulp.task('minify-html', function() {
+//     return gulp.src(settings.productionFolder+'/**/*.html')
+//         .pipe(minifyHTML({
+//             empty: true
+//         }))
+//         .pipe(gulp.dest(settings.productionFolder+'/'));
+// });
+
+/**
+ * Build Task
+ *
+ */
+/*gulp.task('builProduction', ['minify-css'], shell.task([
+    'mvn clean compile package -Denv=' + settings.productionFolder
+]));
+
+gulp.task('runProduction', ['builProduction'], shell.task([
+    'mvn exec:java -Denv=' + settings.productionFolder
+]));
+
+gulp.task('runDev', ['buildDev'], shell.task([
+    'mvn exec:java -DwebAppDir=' + settings.devFolder
+]));
+
+gulp.task('buildDev', shell.task([
+    'mvn clean compile package -DwebAppDir=' + settings.devFolder
+]));*/
+/**
+ * Default Task
+ *
+ * Run the above tasks in the correct order
+ */
+gulp.task('default', function(cb) {
+
+/*    if (settings.environment) {
+        if (settings.environment == "p") {
+            gulp.run(['runProduction']);
+        }
+        if (settings.environment == "d") {
+            gulp.run(['runDev']);
+        }
+    }
+    return gutil.log("All Done!");*/
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/package.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/package.json b/ambari-logsearch/ambari-logsearch-portal/package.json
new file mode 100644
index 0000000..dcc1fef
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/package.json
@@ -0,0 +1,21 @@
+{
+  "name": "logsearch-portal",
+  "version": "1.0.0",
+  "description": "<!-- {% comment %} 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",
+  "main": "gulpfile.js",
+  "dependencies": {
+    "del": "^2.2.0",
+    "gulp": "^3.9.0",
+    "gulp-minify-css": "^1.2.3",
+    "gulp-minify-html": "^1.0.5",
+    "gulp-shell": "^0.5.2",
+    "run-sequence": "^1.1.5",
+    "yargs": "^3.32.0"
+  },
+  "devDependencies": {},
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC"
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/pom.xml b/ambari-logsearch/ambari-logsearch-portal/pom.xml
new file mode 100755
index 0000000..9c5ba72
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/pom.xml
@@ -0,0 +1,547 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari</groupId>
+  <artifactId>ambari-logsearch-portal</artifactId>
+  <packaging>jar</packaging>
+  <version>2.0.0.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <name>Ambari Logsearch Portal</name>
+  <properties>
+    <spring.version>4.2.5.RELEASE</spring.version>
+    <spring.security.version>4.0.4.RELEASE</spring.security.version>
+    <spring.ldap.version>2.0.4.RELEASE</spring.ldap.version>
+  </properties>
+  <profiles>
+    <!-- Dev Profile Start -->
+    <profile>
+      <id>dev</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>src/main/webapp</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.rat</groupId>
+            <artifactId>apache-rat-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>src/main/webapp/libs/**/*</exclude>
+                <exclude>production/r.js</exclude>
+                <exclude>src/main/configsets/hadoop_logs/conf/managed-schema</exclude>
+                <exclude>src/main/webapp/robots.txt</exclude>
+                <exclude>src/main/webapp/styles/animate.css</exclude>
+                <exclude>**/*.json</exclude>
+                <exclude>src/main/webapp/styles/visualsearch.css</exclude>
+              </excludes>
+            </configuration>
+            <executions>
+              <execution>
+                <phase>test</phase>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- /ant package -->
+        </plugins>
+      </build>
+    </profile>
+    <!-- Dev Profile End -->
+    <!-- Production Profile Start -->
+    <profile>
+      <id>production</id>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>target/webapp-build</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <!-- <execution>
+                <id>Packag Install</id>
+                <phase>generate-resources</phase>
+                <configuration>
+                  <target>
+                    <exec executable="npm">
+                      <arg value="install" />
+                    </exec>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>Js Packaging</id>
+                <phase>generate-resources</phase>
+                <configuration>
+                  <target>
+                    <exec executable="gulp">
+                      <arg value="minify-css" />
+                    </exec>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution> -->
+            </executions>
+          </plugin>
+          <plugin>
+            <groupId>org.apache.rat</groupId>
+            <artifactId>apache-rat-plugin</artifactId>
+            <configuration>
+              <excludes>
+                <exclude>**/*</exclude>
+              </excludes>
+            </configuration>
+            <executions>
+              <execution>
+                <phase>test</phase>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <!-- Production Profile End -->
+    <profile>
+      <id>skipMinify</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <build>
+        <finalName>LogSearch</finalName>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <artifactId>maven-compiler-plugin</artifactId>
+              <version>3.0</version>
+            </plugin>
+            <plugin>
+              <artifactId>maven-dependency-plugin</artifactId>
+              <version>2.8</version>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <version>3.0</version>
+            <configuration>
+              <source>1.7</source>
+              <target>1.7</target>
+            </configuration>
+          </plugin>
+          <!-- copying resources UI -->
+          <plugin>
+            <artifactId>maven-resources-plugin</artifactId>
+            <version>2.6</version>
+            <executions>
+              <execution>
+                <id>copy-resources</id>
+                <phase>process-resources</phase>
+                <goals>
+                  <goal>copy-resources</goal>
+                </goals>
+                <configuration>
+                  <outputDirectory>${basedir}/target/classes/webapps/app</outputDirectory>
+                  <resources>
+                    <resource>
+                      <directory>target/webapp-build</directory>
+                      <filtering>false</filtering>
+                    </resource>
+                  </resources>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- Exec main class plugin -->
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>java</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <mainClass>org.apache.ambari.logsearch.LogSearch</mainClass>
+              <!-- <arguments> <argument></argument> </arguments> -->
+            </configuration>
+          </plugin>
+          <!-- copy-dependencies -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.8</version>
+            <executions>
+              <execution>
+                <id>copy-dependencies</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>copy-dependencies</goal>
+                </goals>
+                <configuration>
+                  <artifactItems>*</artifactItems>
+                  <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
+                  <outputDirectory>${basedir}/target/libs</outputDirectory>
+                  <overWriteReleases>false</overWriteReleases>
+                  <overWriteSnapshots>false</overWriteSnapshots>
+                  <overWriteIfNewer>true</overWriteIfNewer>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+          <!-- - -->
+          <!-- ant pacakge -->
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <version>1.7</version>
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <!-- <taskdef resource="build.properties" classpathref="maven.plugin.classpath" 
+                      /> -->
+                    <ant antfile="build.xml">
+                      <target name="package"/>
+                    </ant>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+  <dependencies>
+    <!-- Spring dependencies -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${spring.version}</version>
+    </dependency>
+    <!-- Spring Security -->
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-web</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-core</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-config</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.springframework.ldap</groupId>
+      <artifactId>spring-ldap-core</artifactId>
+      <version>${spring.ldap.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework.security</groupId>
+      <artifactId>spring-security-ldap</artifactId>
+      <version>${spring.security.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey.contribs</groupId>
+      <artifactId>jersey-spring</artifactId>
+      <version>1.19</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.springframework</groupId>
+          <artifactId>*</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-solrj</artifactId>
+      <version>${solr.version}</version>
+    </dependency>
+    <!-- Hadoop -->
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>3.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-common</artifactId>
+      <version>2.7.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.4</version>
+    </dependency>
+
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/production/build.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/production/build.js b/ambari-logsearch/ambari-logsearch-portal/production/build.js
new file mode 100644
index 0000000..afeea67
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/production/build.js
@@ -0,0 +1,28 @@
+/**
+* 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.
+*/
+
+{
+    appDir: "../src/main/webapp",
+    baseUrl: "scripts",
+    dir: "../target/webapp-build",
+    modules: [
+        {
+            name: "Init"
+        }
+    ]
+}


[49/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
new file mode 100644
index 0000000..445c294
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
@@ -0,0 +1,545 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.WatchEvent;
+import java.nio.file.WatchKey;
+import java.nio.file.WatchService;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import static java.nio.file.StandardWatchEventKinds.*;
+
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputFile;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
+import org.apache.log4j.Logger;
+import org.apache.solr.common.util.Base64;
+
+public class InputMgr {
+  static Logger logger = Logger.getLogger(InputMgr.class);
+
+  List<Input> inputList = new ArrayList<Input>();
+  Set<Input> notReadyList = new HashSet<Input>();
+
+  WatchService folderWatcher = null;
+  Set<File> foldersToMonitor = new HashSet<File>();
+  Map<String, Input> filesToMonitor = new HashMap<String, Input>();
+  boolean isDrain = false;
+  boolean isAnyInputTail = false;
+
+  private String checkPointSubFolderName = "logfeeder_checkpoints";
+  File checkPointFolderFile = null;
+
+  MetricCount filesCountMetric = new MetricCount();
+
+  private String checkPointExtension = ".cp";
+
+  public List<Input> getInputList() {
+    return inputList;
+  }
+
+  public void add(Input input) {
+    inputList.add(input);
+  }
+
+  /**
+   * @param input
+   */
+  public void removeInput(Input input) {
+    logger.info("Trying to remove from inputList. "
+      + input.getShortDescription());
+    Iterator<Input> iter = inputList.iterator();
+    while (iter.hasNext()) {
+      Input iterInput = iter.next();
+      if (iterInput.equals(input)) {
+        logger.info("Removing Input from inputList. "
+          + input.getShortDescription());
+        iter.remove();
+      }
+    }
+  }
+
+  /**
+   * @return
+   */
+  public int getActiveFilesCount() {
+    int count = 0;
+    for (Input input : inputList) {
+      if (input.isReady()) {
+        count++;
+      }
+    }
+    return count;
+  }
+
+  public void init() {
+    filesCountMetric.metricsName = "input.files.count";
+    filesCountMetric.isPointInTime = true;
+
+    checkPointExtension = LogFeederUtil.getStringProperty(
+      "logfeeder.checkpoint.extension", checkPointExtension);
+    for (Input input : inputList) {
+      try {
+        input.init();
+        if (input.isTail()) {
+          isAnyInputTail = true;
+        }
+      } catch (Exception e) {
+        logger.error(
+          "Error initializing input. "
+            + input.getShortDescription(), e);
+      }
+    }
+
+    if (isAnyInputTail) {
+      logger.info("Determining valid checkpoint folder");
+      boolean isCheckPointFolderValid = false;
+      // We need to keep track of the files we are reading.
+      String checkPointFolder = LogFeederUtil
+        .getStringProperty("logfeeder.checkpoint.folder");
+      if (checkPointFolder != null && !checkPointFolder.isEmpty()) {
+        checkPointFolderFile = new File(checkPointFolder);
+        isCheckPointFolderValid = verifyCheckPointFolder(checkPointFolderFile);
+      }
+      if (!isCheckPointFolderValid) {
+        // Let's try home folder
+        String userHome = LogFeederUtil.getStringProperty("user.home");
+        if (userHome != null) {
+          checkPointFolderFile = new File(userHome,
+            checkPointSubFolderName);
+          logger.info("Checking if home folder can be used for checkpoints. Folder="
+            + checkPointFolderFile);
+          isCheckPointFolderValid = verifyCheckPointFolder(checkPointFolderFile);
+        }
+      }
+      if (!isCheckPointFolderValid) {
+        // Let's use tmp folder
+        String tmpFolder = LogFeederUtil
+          .getStringProperty("java.io.tmpdir");
+        if (tmpFolder == null) {
+          tmpFolder = "/tmp";
+        }
+        checkPointFolderFile = new File(tmpFolder,
+          checkPointSubFolderName);
+        logger.info("Checking if tmps folder can be used for checkpoints. Folder="
+          + checkPointFolderFile);
+        isCheckPointFolderValid = verifyCheckPointFolder(checkPointFolderFile);
+        if (isCheckPointFolderValid) {
+          logger.warn("Using tmp folder "
+            + checkPointFolderFile
+            + " to store check points. This is not recommended."
+            + "Please set logfeeder.checkpoint.folder property");
+        }
+      }
+
+      if (isCheckPointFolderValid) {
+        logger.warn("Using folder " + checkPointFolderFile
+          + " for storing checkpoints");
+      }
+    }
+
+  }
+
+  public File getCheckPointFolderFile() {
+    return checkPointFolderFile;
+  }
+
+  boolean verifyCheckPointFolder(File folderPathFile) {
+    if (!folderPathFile.exists()) {
+      // Create the folder
+      try {
+        if (!folderPathFile.mkdir()) {
+          logger.warn("Error creating folder for check point. folder="
+            + folderPathFile);
+        }
+      } catch (Throwable t) {
+        logger.warn("Error creating folder for check point. folder="
+          + folderPathFile, t);
+      }
+    }
+
+    if (folderPathFile.exists() && folderPathFile.isDirectory()) {
+      // Let's check whether we can create a file
+      File testFile = new File(folderPathFile, UUID.randomUUID()
+        .toString());
+      try {
+        testFile.createNewFile();
+        return testFile.delete();
+      } catch (IOException e) {
+        logger.warn(
+          "Couldn't create test file in "
+            + folderPathFile.getAbsolutePath()
+            + " for checkPoint", e);
+      }
+    }
+    return false;
+  }
+
+  public void monitor() {
+    for (Input input : inputList) {
+      if (input.isReady()) {
+        input.monitor();
+      } else {
+        if (input.isTail()) {
+          logger.info("Adding input to not ready list. Note, it is possible this component is not run on this host. So it might not be an issue. "
+            + input.getShortDescription());
+          notReadyList.add(input);
+        } else {
+          logger.info("Input is not ready, so going to ignore it "
+            + input.getShortDescription());
+        }
+      }
+    }
+    // Start the monitoring thread if any file is in tail mode
+    if (isAnyInputTail) {
+      Thread monitorThread = new Thread("InputIsReadyMonitor") {
+        @Override
+        public void run() {
+          logger.info("Going to monitor for these missing files: "
+            + notReadyList.toString());
+          while (true) {
+            if (isDrain) {
+              logger.info("Exiting missing file monitor.");
+              break;
+            }
+            try {
+              Iterator<Input> iter = notReadyList.iterator();
+              while (iter.hasNext()) {
+                Input input = iter.next();
+                try {
+                  if (input.isReady()) {
+                    input.monitor();
+                    iter.remove();
+                  }
+                } catch (Throwable t) {
+                  logger.error("Error while enabling monitoring for input. "
+                    + input.getShortDescription());
+                }
+              }
+              Thread.sleep(30 * 1000);
+            } catch (Throwable t) {
+              // Ignore
+            }
+          }
+        }
+      };
+      monitorThread.start();
+    }
+  }
+
+  public void addToNotReady(Input notReadyInput) {
+    notReadyList.add(notReadyInput);
+  }
+
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    for (Input input : inputList) {
+      input.addMetricsContainers(metricsList);
+    }
+    filesCountMetric.count = getActiveFilesCount();
+    metricsList.add(filesCountMetric);
+  }
+
+  /**
+   *
+   */
+  public void logStats() {
+    for (Input input : inputList) {
+      input.logStat();
+    }
+
+    filesCountMetric.count = getActiveFilesCount();
+    LogFeederUtil.logStatForMetric(filesCountMetric,
+      "Stat: Files Monitored Count", null);
+  }
+
+  public void close() {
+    for (Input input : inputList) {
+      try {
+        input.setDrain(true);
+      } catch (Throwable t) {
+        logger.error(
+          "Error while draining. input="
+            + input.getShortDescription(), t);
+      }
+    }
+    isDrain = true;
+
+    // Need to get this value from property
+    int iterations = 30;
+    int waitTimeMS = 1000;
+    int i = 0;
+    boolean allClosed = true;
+    for (i = 0; i < iterations; i++) {
+      allClosed = true;
+      for (Input input : inputList) {
+        if (!input.isClosed()) {
+          try {
+            allClosed = false;
+            logger.warn("Waiting for input to close. "
+              + input.getShortDescription() + ", "
+              + (iterations - i) + " more seconds");
+            Thread.sleep(waitTimeMS);
+          } catch (Throwable t) {
+            // Ignore
+          }
+        }
+      }
+      if (allClosed) {
+        break;
+      }
+    }
+    if (!allClosed) {
+      logger.warn("Some inputs were not closed. Iterations=" + i);
+      for (Input input : inputList) {
+        if (!input.isClosed()) {
+          logger.warn("Input not closed. Will ignore it."
+            + input.getShortDescription());
+        }
+      }
+    } else {
+      logger.info("All inputs are closed. Iterations=" + i);
+    }
+
+  }
+
+  public void checkInAll() {
+    for (Input input : inputList) {
+      input.checkIn();
+    }
+  }
+
+  public void cleanCheckPointFiles() {
+
+    if (checkPointFolderFile == null) {
+      logger.info("Will not clean checkPoint files. checkPointFolderFile="
+        + checkPointFolderFile);
+      return;
+    }
+    logger.info("Cleaning checkPoint files. checkPointFolderFile="
+      + checkPointFolderFile.getAbsolutePath());
+    try {
+      // Loop over the check point files and if filePath is not present,
+      // then
+      // move to closed
+      String searchPath = "*" + checkPointExtension;
+      FileFilter fileFilter = new WildcardFileFilter(searchPath);
+      File[] checkPointFiles = checkPointFolderFile.listFiles(fileFilter);
+      int totalCheckFilesDeleted = 0;
+      for (File checkPointFile : checkPointFiles) {
+        RandomAccessFile checkPointReader = null;
+        try {
+          checkPointReader = new RandomAccessFile(checkPointFile, "r");
+
+          int contentSize = checkPointReader.readInt();
+          byte b[] = new byte[contentSize];
+          int readSize = checkPointReader.read(b, 0, contentSize);
+          if (readSize != contentSize) {
+            logger.error("Couldn't read expected number of bytes from checkpoint file. expected="
+              + contentSize
+              + ", read="
+              + readSize
+              + ", checkPointFile=" + checkPointFile);
+          } else {
+            // Create JSON string
+            String jsonCheckPointStr = new String(b, 0, readSize);
+            Map<String, Object> jsonCheckPoint = LogFeederUtil
+              .toJSONObject(jsonCheckPointStr);
+
+            String logFilePath = (String) jsonCheckPoint
+              .get("file_path");
+            String logFileKey = (String) jsonCheckPoint
+              .get("file_key");
+            if (logFilePath != null && logFileKey != null) {
+              boolean deleteCheckPointFile = false;
+              File logFile = new File(logFilePath);
+              if (logFile.exists()) {
+                Object fileKeyObj = InputFile
+                  .getFileKey(logFile);
+                String fileBase64 = Base64
+                  .byteArrayToBase64(fileKeyObj
+                    .toString().getBytes());
+                if (!logFileKey.equals(fileBase64)) {
+                  deleteCheckPointFile = true;
+                  logger.info("CheckPoint clean: File key has changed. old="
+                    + logFileKey
+                    + ", new="
+                    + fileBase64
+                    + ", filePath="
+                    + logFilePath
+                    + ", checkPointFile="
+                    + checkPointFile.getAbsolutePath());
+                }
+              } else {
+                logger.info("CheckPoint clean: Log file doesn't exist. filePath="
+                  + logFilePath
+                  + ", checkPointFile="
+                  + checkPointFile.getAbsolutePath());
+                deleteCheckPointFile = true;
+              }
+              if (deleteCheckPointFile) {
+                logger.info("Deleting CheckPoint file="
+                  + checkPointFile.getAbsolutePath()
+                  + ", logFile=" + logFilePath);
+                checkPointFile.delete();
+                totalCheckFilesDeleted++;
+              }
+            }
+          }
+        } catch (EOFException eof) {
+          logger.warn("Caught EOFException. Ignoring reading existing checkPoint file. "
+            + checkPointFile);
+        } catch (Throwable t) {
+          logger.error("Error while checking checkPoint file. "
+            + checkPointFile, t);
+        } finally {
+          if (checkPointReader != null) {
+            try {
+              checkPointReader.close();
+            } catch (Throwable t) {
+              logger.error("Error closing checkPoint file. "
+                + checkPointFile, t);
+            }
+          }
+        }
+      }
+      logger.info("Deleted " + totalCheckFilesDeleted
+        + " checkPoint file(s). checkPointFolderFile="
+        + checkPointFolderFile.getAbsolutePath());
+
+    } catch (Throwable t) {
+      logger.error("Error while cleaning checkPointFiles", t);
+    }
+  }
+
+  synchronized public void monitorSystemFileChanges(Input inputToMonitor) {
+    try {
+      File fileToMonitor = new File(inputToMonitor.getFilePath());
+      if (filesToMonitor.containsKey(fileToMonitor.getAbsolutePath())) {
+        logger.info("Already monitoring file " + fileToMonitor
+          + ". So ignoring this request");
+        return;
+      }
+
+      // make a new watch service that we can register interest in
+      // directories and files with.
+      if (folderWatcher == null) {
+        folderWatcher = FileSystems.getDefault().newWatchService();
+        // start the file watcher thread below
+        Thread th = new Thread(new FileSystemMonitor(),
+          "FileSystemWatcher");
+        th.setDaemon(true);
+        th.start();
+
+      }
+      File folderToWatch = fileToMonitor.getParentFile();
+      if (folderToWatch != null) {
+        if (foldersToMonitor.contains(folderToWatch.getAbsolutePath())) {
+          logger.info("Already monitoring folder " + folderToWatch
+            + ". So ignoring this request.");
+        } else {
+          logger.info("Configuring to monitor folder "
+            + folderToWatch + " for file " + fileToMonitor);
+          // get the directory we want to watch, using the Paths
+          // singleton
+          // class
+          Path toWatch = Paths.get(folderToWatch.getAbsolutePath());
+          if (toWatch == null) {
+            throw new UnsupportedOperationException(
+              "Directory not found. folder=" + folderToWatch);
+          }
+
+          toWatch.register(folderWatcher, ENTRY_CREATE);
+          foldersToMonitor.add(folderToWatch);
+        }
+        filesToMonitor.put(fileToMonitor.getAbsolutePath(),
+          inputToMonitor);
+      } else {
+        logger.error("File doesn't have parent folder." + fileToMonitor);
+      }
+    } catch (IOException e) {
+      logger.error("Error while trying to set watcher for file:"
+        + inputToMonitor);
+    }
+
+  }
+
+  class FileSystemMonitor implements Runnable {
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Runnable#run()
+     */
+    @Override
+    public void run() {
+      try {
+        // get the first event before looping
+        WatchKey key = folderWatcher.take();
+        while (key != null) {
+          Path dir = (Path) key.watchable();
+          // we have a polled event, now we traverse it and
+          // receive all the states from it
+          for (WatchEvent<?> event : key.pollEvents()) {
+            if (!event.kind().equals(ENTRY_CREATE)) {
+              logger.info("Ignoring event.kind=" + event.kind());
+              continue;
+            }
+            logger.info("Received " + event.kind()
+              + " event for file " + event.context());
+
+            File newFile = new File(dir.toFile(), event.context()
+              .toString());
+            Input rolledOverInput = filesToMonitor.get(newFile
+              .getAbsolutePath());
+            if (rolledOverInput == null) {
+              logger.info("Input not found for file " + newFile);
+            } else {
+              rolledOverInput.rollOver();
+            }
+          }
+          if (!key.reset()) {
+            logger.error("Error while key.reset(). Will have to abort watching files. Rollover will not work.");
+            break;
+          }
+          key = folderWatcher.take();
+        }
+      } catch (InterruptedException e) {
+        logger.info("Stop request for thread");
+      }
+      logger.info("Exiting FileSystemMonitor thread.");
+    }
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
new file mode 100644
index 0000000..f4ca51b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
@@ -0,0 +1,570 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ambari.logfeeder.AliasUtil.ALIAS_PARAM;
+import org.apache.ambari.logfeeder.AliasUtil.ALIAS_TYPE;
+import org.apache.ambari.logfeeder.filter.Filter;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.logconfig.LogfeederScheduler;
+import org.apache.ambari.logfeeder.output.Output;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import com.google.gson.reflect.TypeToken;
+
+public class LogFeeder {
+  static Logger logger = Logger.getLogger(LogFeeder.class);
+
+  // List<Input> inputList = new ArrayList<Input>();
+  Collection<Output> outputList = new ArrayList<Output>();
+
+  OutputMgr outMgr = new OutputMgr();
+  InputMgr inputMgr = new InputMgr();
+  MetricsMgr metricsMgr = new MetricsMgr();
+
+  Map<String, Object> globalMap = null;
+  String[] inputParams;
+
+  List<Map<String, Object>> globalConfigList = new ArrayList<Map<String, Object>>();
+  List<Map<String, Object>> inputConfigList = new ArrayList<Map<String, Object>>();
+  List<Map<String, Object>> filterConfigList = new ArrayList<Map<String, Object>>();
+  List<Map<String, Object>> outputConfigList = new ArrayList<Map<String, Object>>();
+
+  int checkPointCleanIntervalMS = 24 * 60 * 60 * 60 * 1000; // 24 hours
+  long lastCheckPointCleanedMS = 0;
+
+  public LogFeeder(String[] args) {
+    inputParams = args;
+  }
+
+  public void init() throws Throwable {
+
+    // Load properties
+    LogFeederUtil.loadProperties("logfeeder.properties", inputParams);
+
+    // loop the properties and load them
+    // Load the configs
+    String configFiles = LogFeederUtil.getStringProperty("config.files");
+    if (configFiles == null) {
+      configFiles = LogFeederUtil.getStringProperty("config.file",
+        "config.json");
+    }
+    logger.info("config.files=" + configFiles);
+    String[] configFileList = configFiles.split(",");
+    for (String configFileName : configFileList) {
+      logger.info("Going to load config file:" + configFileName);
+      File configFile = new File(configFileName);
+      if (configFile.exists() && configFile.isFile()) {
+        logger.info("Config file exists in path."
+          + configFile.getAbsolutePath());
+        loadConfigsUsingFile(configFile);
+      } else {
+        // Let's try to load it from class loader
+        logger.info("Trying to load config file from classloader: "
+          + configFileName);
+        laodConfigsUsingClassLoader(configFileName);
+        logger.info("Loaded config file from classloader: "
+          + configFileName);
+      }
+    }
+    mergeAllConfigs();
+    outMgr.setOutputList(outputList);
+    for (Output output : outputList) {
+      output.init();
+    }
+    inputMgr.init();
+    metricsMgr.init();
+    //starting timer to fetch config from solr 
+    LogfeederScheduler.INSTANCE.start();
+    logger.debug("==============");
+  }
+
+  void laodConfigsUsingClassLoader(String configFileName) throws Exception {
+    BufferedInputStream fileInputStream = (BufferedInputStream) this
+      .getClass().getClassLoader()
+      .getResourceAsStream(configFileName);
+    if (fileInputStream != null) {
+      BufferedReader br = new BufferedReader(new InputStreamReader(
+        fileInputStream));
+      String configData = readFile(br);
+      loadConfigs(configData);
+    } else {
+      throw new Exception("Can't find configFile=" + configFileName);
+    }
+  }
+
+  /**
+   * This method loads the configurations from the given file.
+   *
+   * @param configFile
+   * @return
+   * @throws Exception
+   */
+  void loadConfigsUsingFile(File configFile) throws Exception {
+    FileInputStream fileInputStream = null;
+    try {
+      fileInputStream = new FileInputStream(configFile);
+      BufferedReader br = new BufferedReader(new InputStreamReader(
+        fileInputStream));
+      String configData = readFile(br);
+      loadConfigs(configData);
+    } catch (Exception t) {
+      logger.error("Error opening config file. configFilePath="
+        + configFile.getAbsolutePath());
+      throw t;
+    } finally {
+      if (fileInputStream != null) {
+        try {
+          fileInputStream.close();
+        } catch (Throwable t) {
+          // ignore
+        }
+      }
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  void loadConfigs(String configData) throws Exception {
+    Type type = new TypeToken<Map<String, Object>>() {
+    }.getType();
+    Map<String, Object> configMap = LogFeederUtil.getGson().fromJson(
+      configData, type);
+
+    // Get the globals
+    for (String key : configMap.keySet()) {
+      if (key.equalsIgnoreCase("global")) {
+        globalConfigList.add((Map<String, Object>) configMap.get(key));
+      } else if (key.equalsIgnoreCase("input")) {
+        List<Map<String, Object>> mapList = (List<Map<String, Object>>) configMap
+          .get(key);
+        inputConfigList.addAll(mapList);
+      } else if (key.equalsIgnoreCase("filter")) {
+        List<Map<String, Object>> mapList = (List<Map<String, Object>>) configMap
+          .get(key);
+        filterConfigList.addAll(mapList);
+      } else if (key.equalsIgnoreCase("output")) {
+        List<Map<String, Object>> mapList = (List<Map<String, Object>>) configMap
+          .get(key);
+        outputConfigList.addAll(mapList);
+      }
+    }
+
+  }
+
+  /**
+   *
+   */
+  private void mergeAllConfigs() {
+    globalMap = mergeConfigs(globalConfigList);
+
+    // Sort the filter blocks
+    sortBlocks(filterConfigList);
+    // First loop for output
+    for (Map<String, Object> map : outputConfigList) {
+      if (map == null) {
+        continue;
+      }
+      mergeBlocks(globalMap, map);
+
+      String value = (String) map.get("destination");
+      Output output;
+      if (value == null || value.isEmpty()) {
+        logger.error("Output block doesn't have destination element");
+        continue;
+      }
+      String classFullName = AliasUtil.getInstance().readAlias(value, ALIAS_TYPE.OUTPUT, ALIAS_PARAM.KLASS);
+      if (classFullName == null || classFullName.isEmpty()) {
+        logger.error("Destination block doesn't have output element");
+        continue;
+      }
+      output = (Output) LogFeederUtil.getClassInstance(classFullName, ALIAS_TYPE.OUTPUT);
+
+      if (output == null) {
+        logger.error("Destination Object is null");
+        continue;
+      }
+
+      output.setDestination(value);
+      output.loadConfig(map);
+
+      // We will only check for is_enabled out here. Down below we will
+      // check whether this output is enabled for the input
+      boolean isEnabled = output.getBooleanValue("is_enabled", true);
+      if (isEnabled) {
+        outputList.add(output);
+        output.logConfgs(Level.INFO);
+      } else {
+        logger.info("Output is disabled. So ignoring it. "
+          + output.getShortDescription());
+      }
+    }
+
+    // Second loop for input
+    for (Map<String, Object> map : inputConfigList) {
+      if (map == null) {
+        continue;
+      }
+      mergeBlocks(globalMap, map);
+
+      String value = (String) map.get("source");
+      Input input;
+      if (value == null || value.isEmpty()) {
+        logger.error("Input block doesn't have source element");
+        continue;
+      }
+      String classFullName = AliasUtil.getInstance().readAlias(value, ALIAS_TYPE.INPUT, ALIAS_PARAM.KLASS);
+      if (classFullName == null || classFullName.isEmpty()) {
+        logger.error("Source block doesn't have source element");
+        continue;
+      }
+      input = (Input) LogFeederUtil.getClassInstance(classFullName, ALIAS_TYPE.INPUT);
+
+      if (input == null) {
+        logger.error("Source Object is null");
+        continue;
+      }
+
+      input.setType(value);
+      input.loadConfig(map);
+
+      if (input.isEnabled()) {
+        input.setOutputMgr(outMgr);
+        input.setInputMgr(inputMgr);
+        inputMgr.add(input);
+        input.logConfgs(Level.INFO);
+      } else {
+        logger.info("Input is disabled. So ignoring it. "
+          + input.getShortDescription());
+      }
+    }
+
+    // Third loop is for filter, but we will have to create a filter
+    // instance for each input, so it can maintain the state per input
+    List<Input> toRemoveInputList = new ArrayList<Input>();
+    for (Input input : inputMgr.getInputList()) {
+      Filter prevFilter = null;
+      for (Map<String, Object> map : filterConfigList) {
+        if (map == null) {
+          continue;
+        }
+        mergeBlocks(globalMap, map);
+
+        String value = (String) map.get("filter");
+        Filter filter;
+        if (value == null || value.isEmpty()) {
+          logger.error("Filter block doesn't have filter element");
+          continue;
+        }
+
+        String classFullName = AliasUtil.getInstance().readAlias(value, ALIAS_TYPE.FILTER, ALIAS_PARAM.KLASS);
+        if (classFullName == null || classFullName.isEmpty()) {
+          logger.error("Filter block doesn't have filter element");
+          continue;
+        }
+        filter = (Filter) LogFeederUtil.getClassInstance(classFullName, ALIAS_TYPE.FILTER);
+
+        if (filter == null) {
+          logger.error("Filter Object is null");
+          continue;
+        }
+        filter.loadConfig(map);
+        filter.setInput(input);
+
+        if (filter.isEnabled()) {
+          filter.setOutputMgr(outMgr);
+          if (prevFilter == null) {
+            input.setFirstFilter(filter);
+          } else {
+            prevFilter.setNextFilter(filter);
+          }
+          prevFilter = filter;
+          filter.logConfgs(Level.INFO);
+        } else {
+          logger.debug("Ignoring filter "
+            + filter.getShortDescription() + " for input "
+            + input.getShortDescription());
+        }
+      }
+      if (input.getFirstFilter() == null) {
+        toRemoveInputList.add(input);
+      }
+    }
+
+    // Fourth loop is for associating valid outputs to input
+    Set<Output> usedOutputSet = new HashSet<Output>();
+    for (Input input : inputMgr.getInputList()) {
+      for (Output output : outputList) {
+        boolean ret = LogFeederUtil.isEnabled(output.getConfigs(),
+          input.getConfigs());
+        if (ret) {
+          usedOutputSet.add(output);
+          input.addOutput(output);
+        }
+      }
+    }
+    outputList = usedOutputSet;
+
+    for (Input toRemoveInput : toRemoveInputList) {
+      logger.warn("There are no filters, we will ignore this input. "
+        + toRemoveInput.getShortDescription());
+      inputMgr.removeInput(toRemoveInput);
+    }
+  }
+
+  /**
+   * @param filterConfigList2
+   * @return
+   */
+  private void sortBlocks(List<Map<String, Object>> blockList) {
+
+    Collections.sort(blockList, new Comparator<Map<String, Object>>() {
+
+      @Override
+      public int compare(Map<String, Object> o1, Map<String, Object> o2) {
+        Object o1Sort = o1.get("sort_order");
+        Object o2Sort = o2.get("sort_order");
+        if (o1Sort == null) {
+          return 0;
+        }
+        if (o2Sort == null) {
+          return 0;
+        }
+        int o1Value = 0;
+        if (!(o1Sort instanceof Number)) {
+          try {
+            o1Value = (new Double(Double.parseDouble(o1Sort
+              .toString()))).intValue();
+          } catch (Throwable t) {
+            logger.error("Value is not of type Number. class="
+              + o1Sort.getClass().getName() + ", value="
+              + o1Sort.toString() + ", map=" + o1.toString());
+          }
+        } else {
+          o1Value = ((Number) o1Sort).intValue();
+        }
+        int o2Value = 0;
+        if (!(o2Sort instanceof Integer)) {
+          try {
+            o2Value = (new Double(Double.parseDouble(o2Sort
+              .toString()))).intValue();
+          } catch (Throwable t) {
+            logger.error("Value is not of type Number. class="
+              + o2Sort.getClass().getName() + ", value="
+              + o2Sort.toString() + ", map=" + o2.toString());
+          }
+        } else {
+
+        }
+        return o1Value - o2Value;
+      }
+    });
+  }
+
+  /**
+   * @param globalConfigList2
+   */
+  private Map<String, Object> mergeConfigs(
+    List<Map<String, Object>> configList) {
+    Map<String, Object> mergedConfig = new HashMap<String, Object>();
+    for (Map<String, Object> config : configList) {
+      mergeBlocks(config, mergedConfig);
+    }
+    return mergedConfig;
+  }
+
+  private void mergeBlocks(Map<String, Object> fromMap,
+                           Map<String, Object> toMap) {
+    // Merge the non-string
+    for (String key : fromMap.keySet()) {
+      Object objValue = fromMap.get(key);
+      if (objValue == null) {
+        continue;
+      }
+      if (objValue instanceof Map) {
+        @SuppressWarnings("unchecked")
+        Map<String, Object> globalFields = LogFeederUtil
+          .cloneObject((Map<String, Object>) fromMap.get(key));
+
+        @SuppressWarnings("unchecked")
+        Map<String, Object> localFields = (Map<String, Object>) toMap
+          .get(key);
+        if (localFields == null) {
+          localFields = new HashMap<String, Object>();
+          toMap.put(key, localFields);
+        }
+
+        if (globalFields != null) {
+          for (String fieldKey : globalFields.keySet()) {
+            if (!localFields.containsKey(fieldKey)) {
+              localFields.put(fieldKey,
+                globalFields.get(fieldKey));
+            }
+          }
+        }
+      }
+    }
+
+    // Let's add the rest of the top level fields if missing
+    for (String key : fromMap.keySet()) {
+      if (!toMap.containsKey(key)) {
+        toMap.put(key, fromMap.get(key));
+      }
+    }
+  }
+
+  private void monitor() throws Exception {
+    inputMgr.monitor();
+    Runtime.getRuntime().addShutdownHook(new JVMShutdownHook());
+
+    Thread statLogger = new Thread("statLogger") {
+
+      @Override
+      public void run() {
+        while (true) {
+          try {
+            Thread.sleep(30 * 1000);
+          } catch (Throwable t) {
+            // Ignore
+          }
+          try {
+            logStats();
+          } catch (Throwable t) {
+            logger.error(
+              "LogStats: Caught exception while logging stats.",
+              t);
+          }
+
+          if (System.currentTimeMillis() > (lastCheckPointCleanedMS + checkPointCleanIntervalMS)) {
+            lastCheckPointCleanedMS = System.currentTimeMillis();
+            inputMgr.cleanCheckPointFiles();
+          }
+        }
+      }
+
+    };
+    statLogger.setDaemon(true);
+    statLogger.start();
+
+  }
+
+  private void logStats() {
+    inputMgr.logStats();
+    outMgr.logStats();
+
+    if (metricsMgr.isMetricsEnabled()) {
+      List<MetricCount> metricsList = new ArrayList<MetricCount>();
+      inputMgr.addMetricsContainers(metricsList);
+      outMgr.addMetricsContainers(metricsList);
+      metricsMgr.useMetrics(metricsList);
+    }
+  }
+
+  /**
+   * @param inFile
+   * @return
+   * @throws Throwable
+   */
+  public String readFile(BufferedReader br) throws Exception {
+    try {
+      StringBuilder sb = new StringBuilder();
+      String line = br.readLine();
+      while (line != null) {
+        sb.append(line);
+        line = br.readLine();
+      }
+      return sb.toString();
+    } catch (Exception t) {
+      logger.error("Error loading properties file.", t);
+      throw t;
+    }
+  }
+
+  public Collection<Output> getOutputList() {
+    return outputList;
+  }
+
+  public OutputMgr getOutMgr() {
+    return outMgr;
+  }
+
+  public static void main(String[] args) {
+    LogFeeder logFeeder = new LogFeeder(args);
+    logFeeder.run(logFeeder);
+  }
+
+
+  public static void run(String[] args) {
+    LogFeeder logFeeder = new LogFeeder(args);
+    logFeeder.run(logFeeder);
+  }
+
+  public void run(LogFeeder logFeeder) {
+    try {
+      Date startTime = new Date();
+      logFeeder.init();
+      Date endTime = new Date();
+      logger.info("Took " + (endTime.getTime() - startTime.getTime())
+        + " ms to initialize");
+      logFeeder.monitor();
+
+    } catch (Throwable t) {
+      logger.fatal("Caught exception in main.", t);
+      System.exit(1);
+    }
+  }
+
+  private class JVMShutdownHook extends Thread {
+
+    public void run() {
+      try {
+        logger.info("Processing is shutting down.");
+
+        inputMgr.close();
+        outMgr.close();
+        inputMgr.checkInAll();
+
+        logStats();
+
+        logger.info("LogSearch is exiting.");
+      } catch (Throwable t) {
+        // Ignore
+      }
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
new file mode 100644
index 0000000..e53a227
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
+import org.apache.log4j.Logger;
+
+public class LogFeederAMSClient extends AbstractTimelineMetricsSink {
+  static Logger logger = Logger.getLogger(LogFeederAMSClient.class);
+
+  String collectorHosts = null;
+
+  public LogFeederAMSClient() {
+    collectorHosts = LogFeederUtil
+      .getStringProperty("metrics.collector.hosts");
+    if (collectorHosts != null && collectorHosts.trim().length() == 0) {
+      collectorHosts = null;
+    }
+    if (collectorHosts != null) {
+      collectorHosts = collectorHosts.trim();
+    }
+    logger.info("AMS collector URL=" + collectorHosts);
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink#
+   * getCollectorUri()
+   */
+  @Override
+  public String getCollectorUri() {
+
+    return collectorHosts;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.apache.hadoop.metrics2.sink.timeline.AbstractTimelineMetricsSink#
+   * getTimeoutSeconds()
+   */
+  @Override
+  protected int getTimeoutSeconds() {
+    // TODO: Hard coded timeout
+    return 10;
+  }
+
+  @Override
+  protected void emitMetrics(TimelineMetrics metrics) {
+    super.emitMetrics(metrics);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
new file mode 100644
index 0000000..7303694
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
@@ -0,0 +1,480 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.ambari.logfeeder.filter.Filter;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.mapper.Mapper;
+import org.apache.ambari.logfeeder.output.Output;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.type.TypeReference;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.reflect.TypeToken;
+
+/**
+ * This class contains utility methods used by LogFeeder
+ */
+public class LogFeederUtil {
+  static Logger logger = Logger.getLogger(LogFeederUtil.class);
+
+  final static int HASH_SEED = 31174077;
+  public final static String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
+  static Gson gson = new GsonBuilder().setDateFormat(DATE_FORMAT).create();
+
+  static Properties props;
+
+  private static Map<String, LogHistory> logHistoryList = new Hashtable<String, LogHistory>();
+  private static int logInterval = 30000; // 30 seconds
+
+  public static Gson getGson() {
+    return gson;
+  }
+
+  /**
+   * This method will read the properties from System, followed by propFile
+   * and finally from the map
+   *
+   * @param propFile
+   * @param propNVList
+   * @throws Exception
+   */
+  static public void loadProperties(String propFile, String[] propNVList)
+    throws Exception {
+    logger.info("Loading properties. propFile=" + propFile);
+    props = new Properties(System.getProperties());
+    boolean propLoaded = false;
+
+    // First get properties file path from environment value
+    String propertiesFilePath = System.getProperty("properties");
+    if (propertiesFilePath != null && !propertiesFilePath.isEmpty()) {
+      File propertiesFile = new File(propertiesFilePath);
+      if (propertiesFile.exists() && propertiesFile.isFile()) {
+        logger.info("Properties file path set in environment. Loading properties file="
+          + propertiesFilePath);
+        FileInputStream fileInputStream = null;
+        try {
+          fileInputStream = new FileInputStream(propertiesFile);
+          props.load(fileInputStream);
+          propLoaded = true;
+        } catch (Throwable t) {
+          logger.error("Error loading properties file. properties file="
+            + propertiesFile.getAbsolutePath());
+        } finally {
+          if (fileInputStream != null) {
+            try {
+              fileInputStream.close();
+            } catch (Throwable t) {
+              // Ignore error
+            }
+          }
+        }
+      } else {
+        logger.error("Properties file path set in environment, but file not found. properties file="
+          + propertiesFilePath);
+      }
+    }
+
+    if (!propLoaded) {
+      // Properties not yet loaded, let's try from class loader
+      BufferedInputStream fileInputStream = (BufferedInputStream) LogFeeder.class
+        .getClassLoader().getResourceAsStream(propFile);
+      if (fileInputStream != null) {
+        logger.info("Loading properties file " + propFile
+          + " from classpath");
+        props.load(fileInputStream);
+        propLoaded = true;
+      } else {
+        logger.fatal("Properties file not found in classpath. properties file name= "
+          + propFile);
+      }
+    }
+
+    if (!propLoaded) {
+      logger.fatal("Properties file is not loaded.");
+      throw new Exception("Properties not loaded");
+    } else {
+      // Let's load properties from argument list
+      updatePropertiesFromMap(propNVList);
+    }
+  }
+
+  /**
+   * @param nvList
+   */
+  private static void updatePropertiesFromMap(String[] nvList) {
+    if (nvList == null) {
+      return;
+    }
+    logger.info("Trying to load additional proeprties from argument paramters. nvList.length="
+      + nvList.length);
+    if (nvList != null && nvList.length > 0) {
+      for (String nv : nvList) {
+        logger.info("Passed nv=" + nv);
+        if (nv.startsWith("-") && nv.length() > 1) {
+          nv = nv.substring(1);
+          logger.info("Stripped nv=" + nv);
+          int i = nv.indexOf("=");
+          if (nv.length() > i) {
+            logger.info("Candidate nv=" + nv);
+            String name = nv.substring(0, i);
+            String value = nv.substring(i + 1);
+            logger.info("Adding property from argument to properties. name="
+              + name + ", value=" + value);
+            props.put(name, value);
+          }
+        }
+      }
+    }
+  }
+
+  static public String getStringProperty(String key) {
+    if (props != null) {
+      return props.getProperty(key);
+    }
+    return null;
+  }
+
+  static public String getStringProperty(String key, String defaultValue) {
+    if (props != null) {
+      return props.getProperty(key, defaultValue);
+    }
+    return defaultValue;
+  }
+
+  static public boolean getBooleanProperty(String key, boolean defaultValue) {
+    String strValue = getStringProperty(key);
+    return toBoolean(strValue, defaultValue);
+  }
+
+  private static boolean toBoolean(String strValue, boolean defaultValue) {
+    boolean retValue = defaultValue;
+    if (!StringUtils.isEmpty(strValue)) {
+      if (strValue.equalsIgnoreCase("true")
+        || strValue.equalsIgnoreCase("yes")) {
+        retValue = true;
+      } else {
+        retValue = false;
+      }
+    }
+    return retValue;
+  }
+
+  static public int getIntProperty(String key, int defaultValue) {
+    String strValue = getStringProperty(key);
+    int retValue = defaultValue;
+    retValue = objectToInt(strValue, retValue, ", key=" + key);
+    return retValue;
+  }
+
+  public static int objectToInt(Object objValue, int retValue,
+                                String errMessage) {
+    if (objValue == null) {
+      return retValue;
+    }
+    String strValue = objValue.toString();
+    if (!StringUtils.isEmpty(strValue)) {
+      try {
+        retValue = Integer.parseInt(strValue);
+      } catch (Throwable t) {
+        logger.error("Error parsing integer value. str=" + strValue
+          + ", " + errMessage);
+      }
+    }
+    return retValue;
+  }
+
+  static public boolean isEnabled(Map<String, Object> configs) {
+    return isEnabled(configs, configs);
+  }
+
+  static public boolean isEnabled(Map<String, Object> conditionConfigs,
+                                  Map<String, Object> valueConfigs) {
+    boolean allow = toBoolean((String) valueConfigs.get("is_enabled"), true);
+    @SuppressWarnings("unchecked")
+    Map<String, Object> conditions = (Map<String, Object>) conditionConfigs
+      .get("conditions");
+    if (conditions != null && conditions.size() > 0) {
+      allow = false;
+      for (String conditionType : conditions.keySet()) {
+        if (conditionType.equalsIgnoreCase("fields")) {
+          @SuppressWarnings("unchecked")
+          Map<String, Object> fields = (Map<String, Object>) conditions
+            .get("fields");
+          for (String fieldName : fields.keySet()) {
+            Object values = fields.get(fieldName);
+            if (values instanceof String) {
+              allow = isFieldConditionMatch(valueConfigs,
+                fieldName, (String) values);
+            } else {
+              @SuppressWarnings("unchecked")
+              List<String> listValues = (List<String>) values;
+              for (String stringValue : listValues) {
+                allow = isFieldConditionMatch(valueConfigs,
+                  fieldName, stringValue);
+                if (allow) {
+                  break;
+                }
+              }
+            }
+            if (allow) {
+              break;
+            }
+          }
+        }
+        if (allow) {
+          break;
+        }
+      }
+    }
+    return allow;
+  }
+
+  static public boolean isFieldConditionMatch(Map<String, Object> configs,
+                                              String fieldName, String stringValue) {
+    boolean allow = false;
+    String fieldValue = (String) configs.get(fieldName);
+    if (fieldValue != null && fieldValue.equalsIgnoreCase(stringValue)) {
+      allow = true;
+    } else {
+      @SuppressWarnings("unchecked")
+      Map<String, Object> addFields = (Map<String, Object>) configs
+        .get("add_fields");
+      if (addFields != null && addFields.get(fieldName) != null) {
+        String addFieldValue = (String) addFields.get(fieldName);
+        if (stringValue.equalsIgnoreCase(addFieldValue)) {
+          allow = true;
+        }
+      }
+
+    }
+    return allow;
+  }
+
+  static public void logStatForMetric(MetricCount metric, String prefixStr,
+                                      String postFix) {
+    long currStat = metric.count;
+    long currMS = System.currentTimeMillis();
+    if (currStat > metric.prevLogCount) {
+      if (postFix == null) {
+        postFix = "";
+      }
+      logger.info(prefixStr + ": total_count=" + metric.count
+        + ", duration=" + (currMS - metric.prevLogMS) / 1000
+        + " secs, count=" + (currStat - metric.prevLogCount)
+        + postFix);
+    }
+    metric.prevLogCount = currStat;
+    metric.prevLogMS = currMS;
+  }
+
+  static public void logCountForMetric(MetricCount metric, String prefixStr,
+                                       String postFix) {
+    logger.info(prefixStr + ": count=" + metric.count + postFix);
+  }
+
+  public static Map<String, Object> cloneObject(Map<String, Object> map) {
+    if (map == null) {
+      return null;
+    }
+    String jsonStr = gson.toJson(map);
+    // We need to clone it, so we will create a JSON string and convert it
+    // back
+    Type type = new TypeToken<Map<String, Object>>() {
+    }.getType();
+    return gson.fromJson(jsonStr, type);
+  }
+
+  public static Map<String, Object> toJSONObject(String jsonStr) {
+    Type type = new TypeToken<Map<String, Object>>() {
+    }.getType();
+    return gson.fromJson(jsonStr, type);
+  }
+
+  static public boolean logErrorMessageByInterval(String key, String message,
+                                                  Throwable e, Logger callerLogger, Level level) {
+
+    LogHistory log = logHistoryList.get(key);
+    if (log == null) {
+      log = new LogHistory();
+      logHistoryList.put(key, log);
+    }
+    if ((System.currentTimeMillis() - log.lastLogTime) > logInterval) {
+      log.lastLogTime = System.currentTimeMillis();
+      int counter = log.counter;
+      log.counter = 0;
+      if (counter > 0) {
+        message += ". Messages suppressed before: " + counter;
+      }
+      if (e == null) {
+        callerLogger.log(level, message);
+      } else {
+        callerLogger.log(level, message, e);
+      }
+
+      return true;
+    } else {
+      log.counter++;
+    }
+    return false;
+
+  }
+
+  static public String subString(String str, int maxLength) {
+    if (str == null || str.length() == 0) {
+      return "";
+    }
+    maxLength = str.length() < maxLength ? str.length() : maxLength;
+    return str.substring(0, maxLength);
+  }
+
+  static public long genHash(String value) {
+    if (value == null) {
+      value = "null";
+    }
+    return MurmurHash.hash64A(value.getBytes(), HASH_SEED);
+  }
+
+  static class LogHistory {
+    long lastLogTime = 0;
+    int counter = 0;
+  }
+
+  public static String getDate(String timeStampStr) {
+    try {
+      DateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
+      Date netDate = (new Date(Long.parseLong(timeStampStr)));
+      return sdf.format(netDate);
+    } catch (Exception ex) {
+      return null;
+    }
+  }
+
+  public static File getFileFromClasspath(String filename) {
+    URL fileCompleteUrl = Thread.currentThread().getContextClassLoader()
+      .getResource(filename);
+    logger.debug("File Complete URI :" + fileCompleteUrl);
+    File file = null;
+    try {
+      file = new File(fileCompleteUrl.toURI());
+    } catch (Exception exception) {
+      logger.debug(exception.getMessage(), exception.getCause());
+    }
+    return file;
+  }
+
+  public static Object getClassInstance(String classFullName, AliasUtil.ALIAS_TYPE aliasType) {
+    Object instance = null;
+    try {
+      instance = (Object) Class.forName(classFullName).getConstructor().newInstance();
+    } catch (Exception exception) {
+      logger.error("Unsupported class =" + classFullName, exception.getCause());
+    }
+    // check instance class as par aliasType
+    if (instance != null) {
+      boolean isValid = false;
+      switch (aliasType) {
+        case FILTER:
+          isValid = Filter.class.isAssignableFrom(instance.getClass());
+          break;
+        case INPUT:
+          isValid = Input.class.isAssignableFrom(instance.getClass());
+          break;
+        case OUTPUT:
+          isValid = Output.class.isAssignableFrom(instance.getClass());
+          break;
+        case MAPPER:
+          isValid = Mapper.class.isAssignableFrom(instance.getClass());
+          break;
+        default:
+          // by default consider all are valid class
+          isValid = true;
+      }
+      if (!isValid) {
+        logger.error("Not a valid class :" + classFullName + " AliasType :" + aliasType.name());
+      }
+    }
+    return instance;
+  }
+
+  /**
+   * @param fileName
+   * @return
+   */
+  public static HashMap<String, Object> readJsonFromFile(File jsonFile) {
+    ObjectMapper mapper = new ObjectMapper();
+    try {
+      HashMap<String, Object> jsonmap = mapper.readValue(jsonFile, new TypeReference<HashMap<String, Object>>() {
+      });
+      return jsonmap;
+    } catch (JsonParseException e) {
+      logger.error(e, e.getCause());
+    } catch (JsonMappingException e) {
+      logger.error(e, e.getCause());
+    } catch (IOException e) {
+      logger.error(e, e.getCause());
+    }
+    return new HashMap<String, Object>();
+  }
+
+  public static boolean isListContains(List<String> list, String str, boolean caseSensitive) {
+    if (list != null) {
+      for (String value : list) {
+        if (value != null) {
+          if (caseSensitive) {
+            if (value.equals(str)) {
+              return true;
+            }
+          } else {
+            if (value.equalsIgnoreCase(str)) {
+              return true;
+            }
+          }
+          if (value.equalsIgnoreCase("ALL")) {
+            return true;
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricCount.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricCount.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricCount.java
new file mode 100644
index 0000000..c715881
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricCount.java
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+public class MetricCount {
+  public String metricsName = null;
+  public boolean isPointInTime = false;
+
+  public long count = 0;
+  public long prevLogCount = 0;
+  public long prevLogMS = System.currentTimeMillis();
+  public long prevPublishCount = 0;
+  public long prevPublishMS = 0; // We will try to publish one immediately
+  public int publishCount = 0; // Count of published metrics. Used for first
+  // time sending metrics
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
new file mode 100644
index 0000000..2152d14
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
@@ -0,0 +1,185 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
+import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
+import org.apache.log4j.Logger;
+
+public class MetricsMgr {
+  static Logger logger = Logger.getLogger(MetricsMgr.class);
+
+  boolean isMetricsEnabled = false;
+  String nodeHostName = null;
+  String appId = "logfeeder";
+
+  long lastPublishTimeMS = 0; // Let's do the first publish immediately
+  long lastFailedPublishTimeMS = System.currentTimeMillis(); // Reset the
+  // clock
+
+  int publishIntervalMS = 60 * 1000;
+  int maxMetricsBuffer = 60 * 60 * 1000; // If AMS is down, we should not keep
+  // the metrics in memory forever
+  HashMap<String, TimelineMetric> metricsMap = new HashMap<String, TimelineMetric>();
+  LogFeederAMSClient amsClient = null;
+
+  public void init() {
+    logger.info("Initializing MetricsMgr()");
+    amsClient = new LogFeederAMSClient();
+
+    if (amsClient.getCollectorUri() != null) {
+      nodeHostName = LogFeederUtil.getStringProperty("node.hostname");
+      if (nodeHostName == null) {
+        try {
+          nodeHostName = InetAddress.getLocalHost().getHostName();
+        } catch (Throwable e) {
+          logger.warn(
+            "Error getting hostname using InetAddress.getLocalHost().getHostName()",
+            e);
+        }
+        if (nodeHostName == null) {
+          try {
+            nodeHostName = InetAddress.getLocalHost()
+              .getCanonicalHostName();
+          } catch (Throwable e) {
+            logger.warn(
+              "Error getting hostname using InetAddress.getLocalHost().getCanonicalHostName()",
+              e);
+          }
+        }
+      }
+      if (nodeHostName == null) {
+        isMetricsEnabled = false;
+        logger.error("Failed getting hostname for node. Disabling publishing LogFeeder metrics");
+      } else {
+        isMetricsEnabled = true;
+        logger.info("LogFeeder Metrics is enabled. Metrics host="
+          + amsClient.getCollectorUri());
+      }
+    } else {
+      logger.info("LogFeeder Metrics publish is disabled");
+    }
+  }
+
+  /**
+   * @return
+   */
+  public boolean isMetricsEnabled() {
+    return isMetricsEnabled;
+  }
+
+  /**
+   * @param metricsList
+   */
+  synchronized public void useMetrics(List<MetricCount> metricsList) {
+    if (!isMetricsEnabled) {
+      return;
+    }
+    logger.info("useMetrics() metrics.size=" + metricsList.size());
+    long currMS = System.currentTimeMillis();
+    Long currMSLong = new Long(currMS);
+    for (MetricCount metric : metricsList) {
+      if (metric.metricsName == null) {
+        logger.debug("metric.metricsName is null");
+        // Metrics is not meant to be published
+        continue;
+      }
+      long currCount = metric.count;
+      if (!metric.isPointInTime && metric.publishCount > 0
+        && currCount <= metric.prevPublishCount) {
+        // No new data added, so let's ignore it
+        logger.debug("Nothing changed. " + metric.metricsName
+          + ", currCount=" + currCount + ", prevPublishCount="
+          + metric.prevPublishCount);
+        continue;
+      }
+      metric.publishCount++;
+
+      TimelineMetric timelineMetric = metricsMap.get(metric.metricsName);
+      if (timelineMetric == null) {
+        logger.debug("Creating new metric obbject for "
+          + metric.metricsName);
+        // First time for this metric
+        timelineMetric = new TimelineMetric();
+        timelineMetric.setMetricName(metric.metricsName);
+        timelineMetric.setHostName(nodeHostName);
+        timelineMetric.setAppId(appId);
+        timelineMetric.setStartTime(currMS);
+        timelineMetric.setType("Long");
+        timelineMetric.setMetricValues(new TreeMap<Long, Double>());
+
+        metricsMap.put(metric.metricsName, timelineMetric);
+      }
+      logger.debug("Adding metrics=" + metric.metricsName);
+      if (metric.isPointInTime) {
+        timelineMetric.getMetricValues().put(currMSLong,
+          new Double(currCount));
+      } else {
+        Double value = timelineMetric.getMetricValues().get(currMSLong);
+        if (value == null) {
+          value = new Double(0);
+        }
+        value += (currCount - metric.prevPublishCount);
+        timelineMetric.getMetricValues().put(currMSLong, value);
+        metric.prevPublishCount = currCount;
+        metric.prevPublishMS = currMS;
+      }
+    }
+
+    if (metricsMap.size() > 0
+      && currMS - lastPublishTimeMS > publishIntervalMS) {
+      try {
+        // Time to publish
+        TimelineMetrics timelineMetrics = new TimelineMetrics();
+        List<TimelineMetric> timeLineMetricList = new ArrayList<TimelineMetric>();
+        timeLineMetricList.addAll(metricsMap.values());
+        timelineMetrics.setMetrics(timeLineMetricList);
+        amsClient.emitMetrics(timelineMetrics);
+        logger.info("Published " + timeLineMetricList.size()
+          + " metrics to AMS");
+        metricsMap.clear();
+        timeLineMetricList.clear();
+        lastPublishTimeMS = currMS;
+      } catch (Throwable t) {
+        logger.warn("Error sending metrics to AMS.", t);
+        if (currMS - lastFailedPublishTimeMS > maxMetricsBuffer) {
+          logger.error("AMS was not sent for last "
+            + maxMetricsBuffer
+            / 1000
+            + " seconds. Purging it and will start rebuilding it again");
+          metricsMap.clear();
+          lastFailedPublishTimeMS = currMS;
+        }
+      }
+    } else {
+      logger.info("Not publishing metrics. metrics.size()="
+        + metricsMap.size() + ", lastPublished="
+        + (currMS - lastPublishTimeMS) / 1000
+        + " seconds ago, intervalConfigured=" + publishIntervalMS
+        / 1000);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MurmurHash.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MurmurHash.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MurmurHash.java
new file mode 100644
index 0000000..2a54f28
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MurmurHash.java
@@ -0,0 +1,163 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import com.google.common.primitives.Ints;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * This is a very fast, non-cryptographic hash suitable for general hash-based
+ * lookup.  See http://murmurhash.googlepages.com/ for more details.
+ * <p/>
+ * <p>The C version of MurmurHash 2.0 found at that site was ported
+ * to Java by Andrzej Bialecki (ab at getopt org).</p>
+ */
+public final class MurmurHash {
+
+  private MurmurHash() {
+  }
+
+  /**
+   * Hashes an int.
+   *
+   * @param data The int to hash.
+   * @param seed The seed for the hash.
+   * @return The 32 bit hash of the bytes in question.
+   */
+  public static int hash(int data, int seed) {
+    return hash(ByteBuffer.wrap(Ints.toByteArray(data)), seed);
+  }
+
+  /**
+   * Hashes bytes in an array.
+   *
+   * @param data The bytes to hash.
+   * @param seed The seed for the hash.
+   * @return The 32 bit hash of the bytes in question.
+   */
+  public static int hash(byte[] data, int seed) {
+    return hash(ByteBuffer.wrap(data), seed);
+  }
+
+  /**
+   * Hashes bytes in part of an array.
+   *
+   * @param data   The data to hash.
+   * @param offset Where to start munging.
+   * @param length How many bytes to process.
+   * @param seed   The seed to start with.
+   * @return The 32-bit hash of the data in question.
+   */
+  public static int hash(byte[] data, int offset, int length, int seed) {
+    return hash(ByteBuffer.wrap(data, offset, length), seed);
+  }
+
+  /**
+   * Hashes the bytes in a buffer from the current position to the limit.
+   *
+   * @param buf  The bytes to hash.
+   * @param seed The seed for the hash.
+   * @return The 32 bit murmur hash of the bytes in the buffer.
+   */
+  public static int hash(ByteBuffer buf, int seed) {
+    // save byte order for later restoration
+    ByteOrder byteOrder = buf.order();
+    buf.order(ByteOrder.LITTLE_ENDIAN);
+
+    int m = 0x5bd1e995;
+    int r = 24;
+
+    int h = seed ^ buf.remaining();
+
+    while (buf.remaining() >= 4) {
+      int k = buf.getInt();
+
+      k *= m;
+      k ^= k >>> r;
+      k *= m;
+
+      h *= m;
+      h ^= k;
+    }
+
+    if (buf.remaining() > 0) {
+      ByteBuffer finish = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN);
+      // for big-endian version, use this first:
+      // finish.position(4-buf.remaining());
+      finish.put(buf).rewind();
+      h ^= finish.getInt();
+      h *= m;
+    }
+
+    h ^= h >>> 13;
+    h *= m;
+    h ^= h >>> 15;
+
+    buf.order(byteOrder);
+    return h;
+  }
+
+
+  public static long hash64A(byte[] data, int seed) {
+    return hash64A(ByteBuffer.wrap(data), seed);
+  }
+
+  public static long hash64A(byte[] data, int offset, int length, int seed) {
+    return hash64A(ByteBuffer.wrap(data, offset, length), seed);
+  }
+
+  public static long hash64A(ByteBuffer buf, int seed) {
+    ByteOrder byteOrder = buf.order();
+    buf.order(ByteOrder.LITTLE_ENDIAN);
+
+    long m = 0xc6a4a7935bd1e995L;
+    int r = 47;
+
+    long h = seed ^ (buf.remaining() * m);
+
+    while (buf.remaining() >= 8) {
+      long k = buf.getLong();
+
+      k *= m;
+      k ^= k >>> r;
+      k *= m;
+
+      h ^= k;
+      h *= m;
+    }
+
+    if (buf.remaining() > 0) {
+      ByteBuffer finish = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN);
+      // for big-endian version, do this first:
+      // finish.position(8-buf.remaining());
+      finish.put(buf).rewind();
+      h ^= finish.getLong();
+      h *= m;
+    }
+
+    h ^= h >>> r;
+    h *= m;
+    h ^= h >>> r;
+
+    buf.order(byteOrder);
+    return h;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
new file mode 100644
index 0000000..5b70bca
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
@@ -0,0 +1,272 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.ambari.logfeeder.logconfig.filter.FilterLogData;
+import org.apache.ambari.logfeeder.output.Output;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+public class OutputMgr {
+  static Logger logger = Logger.getLogger(OutputMgr.class);
+
+  Collection<Output> outputList = new ArrayList<Output>();
+
+  String hostName = null;
+  String ipAddress = null;
+  boolean addMessageMD5 = true;
+
+  private int MAX_OUTPUT_SIZE = 32765; // 32766-1
+  static long doc_counter = 0;
+  public MetricCount messageTruncateMetric = new MetricCount();
+
+  public OutputMgr() {
+    // Set the host for this server
+    try {
+      InetAddress ip = InetAddress.getLocalHost();
+      ipAddress = ip.getHostAddress();
+      hostName = ip.getHostName();
+    } catch (UnknownHostException e) {
+      logger.error("Error getting hostname.", e);
+    }
+  }
+
+  public Collection<Output> getOutputList() {
+    return outputList;
+  }
+
+  public void setOutputList(Collection<Output> outputList) {
+    this.outputList = outputList;
+  }
+
+  /**
+   * @param jsonObj
+   * @param inputStr
+   * @param input
+   */
+  public void write(Map<String, Object> jsonObj, InputMarker inputMarker) {
+    Input input = inputMarker.input;
+
+    // Update the block with the context fields
+    for (Map.Entry<String, String> entry : input.getContextFields()
+      .entrySet()) {
+      if (jsonObj.get(entry.getKey()) == null) {
+        jsonObj.put(entry.getKey(), entry.getValue());
+      }
+    }
+
+    // TODO: Ideally most of the overrides should be configurable
+
+    // Add the input type
+    if (jsonObj.get("type") == null) {
+      jsonObj.put("type", input.getStringValue("type"));
+    }
+    if (jsonObj.get("path") == null && input.getFilePath() != null) {
+      jsonObj.put("path", input.getFilePath());
+    }
+    if (jsonObj.get("path") == null && input.getStringValue("path") != null) {
+      jsonObj.put("path", input.getStringValue("path"));
+    }
+
+    // Add host if required
+    if (jsonObj.get("host") == null && hostName != null) {
+      jsonObj.put("host", hostName);
+    }
+    // Add IP if required
+    if (jsonObj.get("ip") == null && ipAddress != null) {
+      jsonObj.put("ip", ipAddress);
+    }
+
+    if (input.isUseEventMD5() || input.isGenEventMD5()) {
+      String prefix = "";
+      Object logtimeObj = jsonObj.get("logtime");
+      if (logtimeObj != null) {
+        if (logtimeObj instanceof Date) {
+          prefix = "" + ((Date) logtimeObj).getTime();
+        } else {
+          prefix = logtimeObj.toString();
+        }
+      }
+      Long eventMD5 = LogFeederUtil.genHash(LogFeederUtil.getGson()
+        .toJson(jsonObj));
+      if (input.isGenEventMD5()) {
+        jsonObj.put("event_md5", prefix + eventMD5.toString());
+      }
+      if (input.isUseEventMD5()) {
+        jsonObj.put("id", prefix + eventMD5.toString());
+      }
+    }
+
+    // jsonObj.put("@timestamp", new Date());
+    jsonObj.put("seq_num", new Long(doc_counter++));
+    if (jsonObj.get("id") == null) {
+      jsonObj.put("id", UUID.randomUUID().toString());
+    }
+    if (jsonObj.get("event_count") == null) {
+      jsonObj.put("event_count", new Integer(1));
+    }
+    if (inputMarker.lineNumber > 0) {
+      jsonObj.put("logfile_line_number", new Integer(
+        inputMarker.lineNumber));
+    }
+    if (jsonObj.containsKey("log_message")) {
+      // TODO: Let's check size only for log_message for now
+      String logMessage = (String) jsonObj.get("log_message");
+      if (logMessage != null
+        && logMessage.getBytes().length > MAX_OUTPUT_SIZE) {
+        messageTruncateMetric.count++;
+        final String LOG_MESSAGE_KEY = this.getClass().getSimpleName()
+          + "_MESSAGESIZE";
+        LogFeederUtil.logErrorMessageByInterval(LOG_MESSAGE_KEY,
+          "Message is too big. size="
+            + logMessage.getBytes().length + ", input="
+            + input.getShortDescription()
+            + ". Truncating to " + MAX_OUTPUT_SIZE
+            + ", first upto 100 characters="
+            + LogFeederUtil.subString(logMessage, 100),
+          null, logger, Level.WARN);
+        logMessage = new String(logMessage.getBytes(), 0,
+          MAX_OUTPUT_SIZE);
+        jsonObj.put("log_message", logMessage);
+        // Add error tags
+        @SuppressWarnings("unchecked")
+        List<String> tagsList = (List<String>) jsonObj.get("tags");
+        if (tagsList == null) {
+          tagsList = new ArrayList<String>();
+          jsonObj.put("tags", tagsList);
+        }
+        tagsList.add("error_message_truncated");
+
+      }
+      if (addMessageMD5) {
+        jsonObj.put("message_md5",
+          "" + LogFeederUtil.genHash(logMessage));
+      }
+    }
+    //check log is allowed to send output
+    if (FilterLogData.INSTANCE.isAllowed(jsonObj)) {
+      for (Output output : input.getOutputList()) {
+        try {
+          output.write(jsonObj, inputMarker);
+        } catch (Exception e) {
+          logger.error("Error writing. to " + output.getShortDescription(), e);
+        }
+      }
+    }
+  }
+
+  public void write(String jsonBlock, InputMarker inputMarker) {
+    //check log is allowed to send output
+    if (FilterLogData.INSTANCE.isAllowed(jsonBlock)) {
+      for (Output output : inputMarker.input.getOutputList()) {
+        try {
+          output.write(jsonBlock, inputMarker);
+        } catch (Exception e) {
+          logger.error("Error writing. to " + output.getShortDescription(), e);
+        }
+      }
+    }
+  }
+
+  /**
+   * Close all the outputs
+   */
+  public void close() {
+    logger.info("Close called for outputs ...");
+    for (Output output : outputList) {
+      try {
+        output.setDrain(true);
+        output.close();
+      } catch (Exception e) {
+        // Ignore
+      }
+    }
+    // Need to get this value from property
+    int iterations = 30;
+    int waitTimeMS = 1000;
+    int i;
+    boolean allClosed = true;
+    for (i = 0; i < iterations; i++) {
+      allClosed = true;
+      for (Output output : outputList) {
+        if (!output.isClosed()) {
+          try {
+            allClosed = false;
+            logger.warn("Waiting for output to close. "
+              + output.getShortDescription() + ", "
+              + (iterations - i) + " more seconds");
+            Thread.sleep(waitTimeMS);
+          } catch (Throwable t) {
+            // Ignore
+          }
+        }
+      }
+      if (allClosed) {
+        break;
+      }
+    }
+
+    if (!allClosed) {
+      logger.warn("Some outpus were not closed. Iterations=" + i);
+      for (Output output : outputList) {
+        if (!output.isClosed()) {
+          logger.warn("Output not closed. Will ignore it."
+            + output.getShortDescription() + ", pendingCound="
+            + output.getPendingCount());
+        }
+      }
+    } else {
+      logger.info("All outputs are closed. Iterations=" + i);
+    }
+  }
+
+  /**
+   *
+   */
+  public void logStats() {
+    for (Output output : outputList) {
+      output.logStat();
+    }
+    LogFeederUtil.logStatForMetric(messageTruncateMetric,
+      "Stat: Messages Truncated", null);
+  }
+
+  /**
+   * @param metricsList
+   */
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    metricsList.add(messageTruncateMetric);
+    for (Output output : outputList) {
+      output.addMetricsContainers(metricsList);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
new file mode 100644
index 0000000..aa1edea
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
@@ -0,0 +1,223 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logfeeder.filter;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ambari.logfeeder.AliasUtil;
+import org.apache.ambari.logfeeder.ConfigBlock;
+import org.apache.ambari.logfeeder.LogFeederUtil;
+import org.apache.ambari.logfeeder.MetricCount;
+import org.apache.ambari.logfeeder.OutputMgr;
+import org.apache.ambari.logfeeder.AliasUtil.ALIAS_PARAM;
+import org.apache.ambari.logfeeder.AliasUtil.ALIAS_TYPE;
+import org.apache.ambari.logfeeder.input.Input;
+import org.apache.ambari.logfeeder.input.InputMarker;
+import org.apache.ambari.logfeeder.mapper.Mapper;
+import org.apache.log4j.Logger;
+import org.apache.log4j.Priority;
+
+public abstract class Filter extends ConfigBlock {
+  static private Logger logger = Logger.getLogger(Filter.class);
+
+  OutputMgr outputMgr;
+  Input input;
+  Filter nextFilter = null;
+
+  Map<String, List<Mapper>> postFieldValueMappers = new HashMap<String, List<Mapper>>();
+
+  @Override
+  public void init() throws Exception {
+    super.init();
+
+    initializePostMapValues();
+    if (nextFilter != null) {
+      nextFilter.init();
+    }
+  }
+
+  /**
+   *
+   */
+  @SuppressWarnings("unchecked")
+  protected void initializePostMapValues() {
+    // Initialize map values
+    Map<String, Object> postMapValues = (Map<String, Object>) getConfigValue("post_map_values");
+    if (postMapValues == null) {
+      return;
+    }
+    for (String fieldName : postMapValues.keySet()) {
+      List<Map<String, Object>> mapList = null;
+      Object values = postMapValues.get(fieldName);
+      if (values instanceof List<?>) {
+        mapList = (List<Map<String, Object>>) values;
+      } else {
+        mapList = new ArrayList<Map<String, Object>>();
+        mapList.add((Map<String, Object>) values);
+      }
+      for (Map<String, Object> mapObject : mapList) {
+        for (String mapClassCode : mapObject.keySet()) {
+          Mapper mapper = getMapper(mapClassCode);
+          if (mapper == null) {
+            break;
+          }
+          if (mapper.init(getInput().getShortDescription(),
+            fieldName, mapClassCode,
+            mapObject.get(mapClassCode))) {
+            List<Mapper> fieldMapList = postFieldValueMappers
+              .get(fieldName);
+            if (fieldMapList == null) {
+              fieldMapList = new ArrayList<Mapper>();
+              postFieldValueMappers.put(fieldName, fieldMapList);
+            }
+            fieldMapList.add(mapper);
+          }
+        }
+      }
+    }
+  }
+
+  /**
+   * @param mapClassCode
+   * @return
+   */
+  protected Mapper getMapper(String mapClassCode) {
+    String classFullName = AliasUtil.getInstance().readAlias(mapClassCode, ALIAS_TYPE.MAPPER, ALIAS_PARAM.KLASS);
+    if (classFullName != null && !classFullName.isEmpty()) {
+      Mapper mapper = (Mapper) LogFeederUtil.getClassInstance(classFullName, ALIAS_TYPE.MAPPER);
+      return mapper;
+    }
+    return null;
+  }
+
+  public void setOutputMgr(OutputMgr outputMgr) {
+    this.outputMgr = outputMgr;
+  }
+
+  public Filter getNextFilter() {
+    return nextFilter;
+  }
+
+  public void setNextFilter(Filter nextFilter) {
+    this.nextFilter = nextFilter;
+  }
+
+  public Input getInput() {
+    return input;
+  }
+
+  public void setInput(Input input) {
+    this.input = input;
+  }
+
+  /**
+   * Deriving classes should implement this at the minimum
+   *
+   * @param inputStr
+   * @param marker
+   */
+  public void apply(String inputStr, InputMarker inputMarker) {
+    // TODO: There is no transformation for string types.
+    if (nextFilter != null) {
+      nextFilter.apply(inputStr, inputMarker);
+    } else {
+      outputMgr.write(inputStr, inputMarker);
+    }
+  }
+
+  public void apply(Map<String, Object> jsonObj, InputMarker inputMarker) {
+    if (postFieldValueMappers.size() > 0) {
+      for (String fieldName : postFieldValueMappers.keySet()) {
+        Object value = jsonObj.get(fieldName);
+        if (value != null) {
+          for (Mapper mapper : postFieldValueMappers.get(fieldName)) {
+            value = mapper.apply(jsonObj, value);
+          }
+        }
+      }
+    }
+    if (nextFilter != null) {
+      nextFilter.apply(jsonObj, inputMarker);
+    } else {
+      outputMgr.write(jsonObj, inputMarker);
+    }
+  }
+
+  /**
+   *
+   */
+  public void close() {
+    if (nextFilter != null) {
+      nextFilter.close();
+    }
+  }
+
+  public void flush() {
+
+  }
+
+  @Override
+  public void logStat() {
+    super.logStat();
+    if (nextFilter != null) {
+      nextFilter.logStat();
+    }
+  }
+
+  @Override
+  public boolean isFieldConditionMatch(String fieldName, String stringValue) {
+    if (!super.isFieldConditionMatch(fieldName, stringValue)) {
+      // Let's try input
+      if (input != null) {
+        return input.isFieldConditionMatch(fieldName, stringValue);
+      } else {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  @Override
+  public String getShortDescription() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public boolean logConfgs(Priority level) {
+    if (!super.logConfgs(level)) {
+      return false;
+    }
+    logger.log(level, "input=" + input.getShortDescription());
+    return true;
+  }
+
+  @Override
+  public void addMetricsContainers(List<MetricCount> metricsList) {
+    super.addMetricsContainers(metricsList);
+    if (nextFilter != null) {
+      nextFilter.addMetricsContainers(metricsList);
+    }
+  }
+
+}


[40/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
new file mode 100644
index 0000000..fa33516
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/managed-schema
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Solr managed schema - automatically generated - DO NOT EDIT -->
+<schema name="hadoop-logs-schema" version="1.5">
+  <uniqueKey>id</uniqueKey>
+  <fieldType name="binary" class="solr.BinaryField"/>
+  <fieldType name="boolean" class="solr.BoolField" sortMissingLast="true"/>
+  <fieldType name="booleans" class="solr.BoolField" sortMissingLast="true" multiValued="true"/>
+  <fieldType name="date" class="solr.TrieDateField" positionIncrementGap="0" precisionStep="0"/>
+  <fieldType name="double" class="solr.TrieDoubleField" positionIncrementGap="0" precisionStep="0"/>
+  <fieldType name="float" class="solr.TrieFloatField" positionIncrementGap="0" precisionStep="0"/>
+  <fieldType name="ignored" class="solr.StrField" indexed="false" stored="false" multiValued="true"/>
+  <fieldType name="int" class="solr.TrieIntField" positionIncrementGap="0" precisionStep="0"/>
+  <fieldType name="ip_address" class="solr.TextField">
+    <analyzer>
+      <tokenizer class="solr.PathHierarchyTokenizerFactory" replace="." delimiter="."/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="logLevel" class="solr.EnumField" enumsConfig="enumsConfig.xml" enumName="log_levels"/>
+  <fieldType name="long" class="solr.TrieLongField" positionIncrementGap="0" precisionStep="0"/>
+  <fieldType name="random" class="solr.RandomSortField" indexed="true"/>
+  <fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
+  <fieldType name="tdate" class="solr.TrieDateField" positionIncrementGap="0" precisionStep="6"/>
+  <fieldType name="tdates" class="solr.TrieDateField" positionIncrementGap="0" multiValued="true" precisionStep="6"/>
+  <fieldType name="tdouble" class="solr.TrieDoubleField" positionIncrementGap="0" precisionStep="8"/>
+  <fieldType name="tdoubles" class="solr.TrieDoubleField" positionIncrementGap="0" multiValued="true" precisionStep="8"/>
+  <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
+    <analyzer>
+      <tokenizer class="solr.StandardTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="n_gram" class="solr.TextField" sortMissingLast="true" omitNorms="true">
+    <analyzer>
+      <tokenizer class="solr.NGramTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="key_lower_case" class="solr.TextField"
+               sortMissingLast="true" omitNorms="true">
+      <analyzer>
+        <tokenizer class="solr.KeywordTokenizerFactory"/>
+        <filter class="solr.LowerCaseFilterFactory" />
+      </analyzer>
+    </fieldType>
+  <fieldType name="text_std_token_lower_case" class="solr.TextField" positionIncrementGap="100" multiValued="true">
+    <analyzer>
+      <tokenizer class="solr.StandardTokenizerFactory"/>
+      <filter class="solr.LowerCaseFilterFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="text_ws" class="solr.TextField" positionIncrementGap="100">
+    <analyzer>
+      <tokenizer class="solr.WhitespaceTokenizerFactory"/>
+    </analyzer>
+  </fieldType>
+  <fieldType name="tfloat" class="solr.TrieFloatField" positionIncrementGap="0" precisionStep="8"/>
+  <fieldType name="tfloats" class="solr.TrieFloatField" positionIncrementGap="0" multiValued="true" precisionStep="8"/>
+  <fieldType name="tint" class="solr.TrieIntField" positionIncrementGap="0" precisionStep="8"/>
+  <fieldType name="tints" class="solr.TrieIntField" positionIncrementGap="0" multiValued="true" precisionStep="8"/>
+  <fieldType name="tlong" class="solr.TrieLongField" positionIncrementGap="0" precisionStep="8"/>
+  <fieldType name="tlongs" class="solr.TrieLongField" positionIncrementGap="0" multiValued="true" precisionStep="8"/>
+  <field name="@timestamp" type="tdate" multiValued="false" stored="false"/>
+  <field name="@version" type="long" multiValued="false" indexed="true" stored="false"/>
+  <field name="_version_" type="long" indexed="true" stored="true"/>
+  <field name="_expire_at_" type="tdate" stored="true"  multiValued="false"/>
+  <field name="_ttl_" type="string" indexed="true" stored="true" multiValued="false"/>
+  <field name="_router_field_" type="int" indexed="false" stored="false" multiValued="false"/>
+  
+  <field name="bundle_id" type="key_lower_case" multiValued="false"/>
+  <field name="case_id" type="key_lower_case" multiValued="false"/>
+  <field name="cluster" type="key_lower_case" multiValued="false"/>
+  <field name="event_count" type="tlong" multiValued="false" docValues="true" default="1"/>
+  <field name="event_dur_ms" type="tlong" multiValued="false" docValues="true"/>
+  <field name="event_md5" type="string" multiValued="false"/>
+  <field name="file" type="key_lower_case" multiValued="false"/>
+  <field name="host" type="key_lower_case" multiValued="false"/>
+  <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
+  <field name="ip" type="ip_address" multiValued="false"/>
+  <field name="level" type="key_lower_case" multiValued="false"/>
+  <field name="line_number" type="tint" omitNorms="false"/>
+  <field name="log_message" type="key_lower_case" multiValued="false" omitNorms="false"/>
+  <field name="logfile_line_number" type="tint" omitNorms="false"/>
+  <field name="logger_name" type="key_lower_case" multiValued="false"/>
+  <field name="logtime" type="tdate" multiValued="false"  docValues="true"/>
+  <field name="logtype" type="key_lower_case" multiValued="false"/>
+  <field name="message" type="text_std_token_lower_case" indexed="true" stored="true"/>
+  <field name="message_md5" type="string" multiValued="false"/>
+  <field name="method" type="key_lower_case" multiValued="false" omitNorms="false"/>
+  <field name="path" type="key_lower_case" multiValued="false"/>
+  <field name="rowtype" type="key_lower_case" multiValued="false"/>
+  <field name="seq_num" type="tlong" multiValued="false" omitNorms="false"/>
+  <field name="tags" type="key_lower_case" multiValued="true"/>
+  <field name="text" type="text_std_token_lower_case" multiValued="true" indexed="true" stored="false"/>
+  <field name="thread_name" type="key_lower_case" multiValued="false" omitNorms="false"/>
+  <field name="type" type="key_lower_case" multiValued="false"/>
+  
+  <dynamicField name='ngram_*' type="n_gram" multiValued="false" stored="false"/>
+  <dynamicField name='std_*' type="text_std_token_lower_case" multiValued="false" stored="false"/>
+  
+  
+  <!-- Copy Fields-->
+  <!-- ngram fields -->
+  <!-- Whenever using a copy field provide following structure "ngram_"<OriginalFieldName> --> 
+  <copyField source="bundle_id" dest="ngram_bundle_id"/>
+  <copyField source="case_id" dest="ngram_case_id"/>
+  <copyField source="cluster" dest="ngram_cluster"/>
+  <copyField source="file" dest="ngram_file"/>
+  <copyField source="host" dest="ngram_host"/>
+  <copyField source="level" dest="ngram_level"/>
+  <copyField source="log_message" dest="ngram_log_message"/>
+  <copyField source="logger_name" dest="ngram_logger_name"/>
+  <copyField source="logtype" dest="ngram_logtype"/>
+  <copyField source="method" dest="ngram_method"/>
+  <copyField source="path" dest="ngram_path"/>
+  <copyField source="thread_name" dest="ngram_thread_name"/>
+  <copyField source="type" dest="ngram_type"/>
+  
+  <!-- Standard text tokenizer -->
+  <copyField source="log_message" dest="std_log_message"/>
+  
+  <!-- Copying everything text -->
+  <copyField source="*" dest="text" maxChars="25000" />
+  
+  
+</schema>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml
new file mode 100644
index 0000000..59f778f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/configsets/hadoop_logs/conf/solrconfig.xml
@@ -0,0 +1,1887 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+-->
+<config>
+  <!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    -->
+
+  <!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  -->
+  <luceneMatchVersion>5.0.0</luceneMatchVersion>
+
+  <!-- <lib/> directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that <lib/> directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              <lib dir="./lib" />
+    -->
+
+  <!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    -->
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />
+
+  <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />
+  <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" />
+
+  <!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    -->
+  <!--
+     <lib path="../a-jar-that-does-not-exist.jar" /> 
+  -->
+  
+  <!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    -->
+  <dataDir>${solr.data.dir:}</dataDir>
+
+
+  <!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    -->
+  <directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}">
+    
+         
+    <!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. -->      
+    <!-- The root directory that collection data should be written to. -->     
+    <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
+    <!-- The hadoop configuration files to use for the hdfs client. -->    
+    <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
+    <!-- Enable/Disable the hdfs cache. -->    
+    <str name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</str>
+    <!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. -->    
+    <str name="solr.hdfs.blockcache.global">${solr.hdfs.blockcache.global:true}</str>
+    
+  </directoryFactory> 
+
+  <!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  -->
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
+  <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>: -->
+  
+       <schemaFactory class="ManagedIndexSchemaFactory">
+         <bool name="mutable">true</bool>
+         <str name="managedSchemaResourceName">managed-schema</str>
+       </schemaFactory>
+<!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces <indexDefaults> and <mainIndex> from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <indexConfig>
+    <!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     <filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/>
+    -->
+    <!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 -->
+    <!-- <writeLockTimeout>1000</writeLockTimeout>  -->
+    <!-- LogSearch customization to avoid timeouts -->
+    <writeLockTimeout>10000</writeLockTimeout>
+
+    <!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. -->
+    <!-- <maxIndexingThreads>8</maxIndexingThreads>  -->
+    <!-- LogSearch customization of increase performance -->
+    <maxIndexingThreads>50</maxIndexingThreads>
+
+    <!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) -->
+    <!-- <useCompoundFile>false</useCompoundFile> -->
+
+    <!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  -->
+    <!-- <ramBufferSizeMB>100</ramBufferSizeMB> -->
+    <!-- <maxBufferedDocs>1000</maxBufferedDocs> -->
+
+    <!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      -->
+    <!--
+        <mergePolicy class="org.apache.lucene.index.TieredMergePolicy">
+          <int name="maxMergeAtOnce">10</int>
+          <int name="segmentsPerTier">10</int>
+        </mergePolicy>
+      -->
+       
+    <!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      -->
+    <!-- 
+    <mergeFactor>10</mergeFactor>
+      -->
+    <!-- LogSearch customization. Set to 5 to trigger purging of deleted documents more often -->
+    <mergeFactor>5</mergeFactor>
+
+    <!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     -->
+    <!-- 
+       <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
+       -->
+
+    <!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    -->
+    <lockType>${solr.lock.type:native}</lockType>
+
+    <!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     -->
+    <!--
+    <unlockOnStartup>false</unlockOnStartup>
+      -->
+
+    <!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    -->
+    <!-- 
+    <deletionPolicy class="solr.SolrDeletionPolicy">
+    -->
+      <!-- The number of commit points to be kept -->
+      <!-- <str name="maxCommitsToKeep">1</str> -->
+      <!-- The number of optimized commit points to be kept -->
+      <!-- <str name="maxOptimizedCommitsToKeep">0</str> -->
+      <!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        -->
+      <!--
+         <str name="maxCommitAge">30MINUTES</str>
+         <str name="maxCommitAge">1DAY</str>
+      -->
+    <!-- 
+    </deletionPolicy>
+    -->
+
+    <!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      -->
+     <infoStream>true</infoStream>
+  </indexConfig>
+
+
+  <!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    -->
+  <jmx />
+  <!-- If you want to connect to a particular server, specify the
+       agentId 
+    -->
+  <!-- <jmx agentId="myAgent" /> -->
+  <!-- If you want to start a new MBeanServer, specify the serviceUrl -->
+  <!-- <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
+    -->
+
+  <!-- The default high-performance update handler -->
+  <updateHandler class="solr.DirectUpdateHandler2">
+
+    <!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --> 
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+    </updateLog>
+ 
+    <!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      -->
+     <autoCommit> 
+       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
+       <openSearcher>false</openSearcher> 
+     </autoCommit>
+
+    <!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      -->
+
+     <autoSoftCommit> 
+       <maxTime>${solr.autoSoftCommit.maxTime:5000}</maxTime> 
+     </autoSoftCommit>
+
+    <!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      -->
+    <!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      -->
+    <!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      -->
+    <!--
+       <listener event="postCommit" class="solr.RunExecutableListener">
+         <str name="exe">solr/bin/snapshooter</str>
+         <str name="dir">.</str>
+         <bool name="wait">true</bool>
+         <arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
+         <arr name="env"> <str>MYVAR=val1</str> </arr>
+       </listener>
+      -->
+
+  </updateHandler>
+  
+  <!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    -->
+  <!--
+  <indexReaderFactory name="IndexReaderFactory" class="package.class">
+    <str name="someArg">Some Value</str>
+  </indexReaderFactory >
+  -->
+
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <query>
+    <!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      -->
+    <maxBooleanClauses>1024</maxBooleanClauses>
+
+
+    <!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (> 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    -->
+
+    <!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      -->
+    <filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/>
+
+    <!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      -->
+    <queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/>
+   
+    <!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      -->
+    <documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/>
+    
+    <!-- custom cache currently used by block join --> 
+    <cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" />
+
+    <!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      -->
+    <!--
+       <fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" />
+      -->
+
+    <!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      -->
+    <!--
+       <cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              />
+      -->
+
+
+    <!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    -->
+    <enableLazyFieldLoading>true</enableLazyFieldLoading>
+
+   <!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     -->
+   <!--
+      <useFilterForSortedQuery>true</useFilterForSortedQuery>
+     -->
+
+   <!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     -->
+   <queryResultWindowSize>20</queryResultWindowSize>
+
+   <!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     -->
+   <queryResultMaxDocsCached>200</queryResultMaxDocsCached>
+
+   <!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     -->
+    <!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      -->
+    <listener event="newSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <!--
+           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
+           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
+          -->
+      </arr>
+    </listener>
+    <listener event="firstSearcher" class="solr.QuerySenderListener">
+      <arr name="queries">
+        <lst>
+          <str name="q">static firstSearcher warming in solrconfig.xml</str>
+        </lst>
+      </arr>
+    </listener>
+
+    <!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      -->
+    <useColdSearcher>true</useColdSearcher>
+
+    <!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      -->
+    <maxWarmingSearchers>2</maxWarmingSearchers>
+
+  </query>
+
+
+  <!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    -->
+  <requestDispatcher handleSelect="false" >
+    <!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --> 
+    <requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/>
+
+    <!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      -->
+    <httpCaching never304="true" />
+    <!-- If you include a <cacheControl> directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the <cacheControl> option even if you have set
+         never304="true"
+      -->
+    <!--
+       <httpCaching never304="true" >
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+    <!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      -->
+    <!--
+       <httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr">
+         <cacheControl>max-age=30, public</cacheControl> 
+       </httpCaching>
+      -->
+  </requestDispatcher>
+
+  <!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    -->
+
+  <requestHandler name="/dataimport" class="solr.DataImportHandler">
+    <lst name="defaults">
+      <str name="config">solr-data-config.xml</str>
+    </lst>
+  </requestHandler>
+
+  <!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    -->
+  <requestHandler name="/select" class="solr.SearchHandler">
+    <!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      -->
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <int name="rows">10</int>
+       <str name="df">text</str>
+     </lst>
+    <!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      -->
+    <!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="appends">
+         <str name="fq">inStock:true</str>
+       </lst>
+      -->
+    <!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      -->
+    <!--
+       <lst name="invariants">
+         <str name="facet.field">cat</str>
+         <str name="facet.field">manu_exact</str>
+         <str name="facet.query">price:[* TO 500]</str>
+         <str name="facet.query">price:[500 TO *]</str>
+       </lst>
+      -->
+    <!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      -->
+    <!--
+       <arr name="components">
+         <str>nameOfCustomComponent1</str>
+         <str>nameOfCustomComponent2</str>
+       </arr>
+      -->
+    </requestHandler>
+
+  <!-- A request handler that returns indented JSON by default -->
+  <requestHandler name="/query" class="solr.SearchHandler">
+     <lst name="defaults">
+       <str name="echoParams">explicit</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+       <str name="df">text</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  -->
+  <requestHandler name="/get" class="solr.RealTimeGetHandler">
+     <lst name="defaults">
+       <str name="omitHeader">true</str>
+       <str name="wt">json</str>
+       <str name="indent">true</str>
+     </lst>
+  </requestHandler>
+
+
+  <!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    -->
+  <requestHandler name="/browse" class="solr.SearchHandler">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+
+      <!-- VelocityResponseWriter settings -->
+      <str name="wt">velocity</str>
+      <str name="v.template">browse</str>
+      <str name="v.layout">layout</str>
+
+      <!-- Query settings -->
+      <str name="defType">edismax</str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+
+      <!-- Faceting defaults -->
+      <str name="facet">on</str>
+      <str name="facet.mincount">1</str>
+    </lst>
+  </requestHandler>
+
+
+  <initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <str name="update.chain">add-unknown-fields-to-the-schema</str>
+    </lst>
+  </initParams>
+
+  <!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    -->
+  <requestHandler name="/update" class="solr.UpdateRequestHandler">
+    <!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      -->
+    <!--
+       <lst name="defaults">
+         <str name="update.chain">dedupe</str>
+       </lst>
+       -->
+  </requestHandler>
+
+  <!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    -->
+  <requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" >
+    <lst name="defaults">
+      <str name="lowernames">true</str>
+      <str name="uprefix">ignored_</str>
+
+      <!-- capture link hrefs but ignore div attributes -->
+      <str name="captureAttr">true</str>
+      <str name="fmap.a">links</str>
+      <str name="fmap.div">ignored_</str>
+    </lst>
+  </requestHandler>
+
+
+  <!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   -->
+  <requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" />
+
+
+  <!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       <docs>
+         <doc>
+           <field name="id">1</field>
+           <field name="name">The Name</field>
+           <field name="text">The Text Value</field>
+         </doc>
+         <doc>...</doc>
+         <doc>...</doc>
+         ...
+       </docs>
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  -->
+  <requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" />
+
+  <!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    -->
+  <requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" />
+  <!-- This single handler is equivalent to the following... -->
+  <!--
+     <requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" />
+     <requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" />
+     <requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" />
+     <requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" />
+     <requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
+     <requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" >
+    -->
+  <!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    -->
+  <!--
+     <requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" >
+       <lst name="invariants">
+         <str name="hidden">synonyms.txt</str> 
+         <str name="hidden">anotherfile.txt</str> 
+         <str name="hidden">*</str> 
+       </lst>
+     </requestHandler>
+    -->
+
+  <!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  -->
+  <!--
+  <requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" >
+    <lst name="invariants">
+         <str name="hidden">synonyms.txt</str>
+         <str name="hidden">anotherfile.txt</str>
+    </lst>
+  </requestHandler>
+  -->
+  <!-- ping/healthcheck -->
+  <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
+    <lst name="invariants">
+      <str name="q">solrpingquery</str>
+    </lst>
+    <lst name="defaults">
+      <str name="echoParams">all</str>
+    </lst>
+    <!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      -->
+    <!-- <str name="healthcheckFile">server-enabled.txt</str> -->
+  </requestHandler>
+
+  <!-- Echo the request contents back to the client -->
+  <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
+    <lst name="defaults">
+     <str name="echoParams">explicit</str> 
+     <str name="echoHandler">true</str>
+    </lst>
+  </requestHandler>
+  
+  <!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    -->
+  <requestHandler name="/replication" class="solr.ReplicationHandler" > 
+    <!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    -->
+    <!--
+       <lst name="master">
+         <str name="replicateAfter">commit</str>
+         <str name="replicateAfter">startup</str>
+         <str name="confFiles">schema.xml,stopwords.txt</str>
+       </lst>
+    -->
+    <!--
+       <lst name="slave">
+         <str name="masterUrl">http://your-master-hostname:8983/solr</str>
+         <str name="pollInterval">00:00:60</str>
+       </lst>
+    -->
+  </requestHandler>
+
+  <!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       <searchComponent name="query"     class="solr.QueryComponent" />
+       <searchComponent name="facet"     class="solr.FacetComponent" />
+       <searchComponent name="mlt"       class="solr.MoreLikeThisComponent" />
+       <searchComponent name="highlight" class="solr.HighlightComponent" />
+       <searchComponent name="stats"     class="solr.StatsComponent" />
+       <searchComponent name="debug"     class="solr.DebugComponent" />
+   
+       Default configuration in a requestHandler would look like:
+
+       <arr name="components">
+         <str>query</str>
+         <str>facet</str>
+         <str>mlt</str>
+         <str>highlight</str>
+         <str>stats</str>
+         <str>debug</str>
+       </arr>
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       <arr name="first-components">
+         <str>myFirstComponentName</str>
+       </arr>
+    
+       <arr name="last-components">
+         <str>myLastComponentName</str>
+       </arr>
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     -->
+  
+   <!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     -->
+  <searchComponent name="spellcheck" class="solr.SpellCheckComponent">
+
+    <str name="queryAnalyzerFieldType">key_lower_case</str>
+
+    <!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      -->
+
+    <!-- a spellchecker built from a field of the main index -->
+    <lst name="spellchecker">
+      <str name="name">default</str>
+      <str name="field">text</str>
+      <str name="classname">solr.DirectSolrSpellChecker</str>
+      <!-- the spellcheck distance measure used, the default is the internal levenshtein -->
+      <str name="distanceMeasure">internal</str>
+      <!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
+      <float name="accuracy">0.5</float>
+      <!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
+      <int name="maxEdits">2</int>
+      <!-- the minimum shared prefix when enumerating terms -->
+      <int name="minPrefix">1</int>
+      <!-- maximum number of inspections per result. -->
+      <int name="maxInspections">5</int>
+      <!-- minimum length of a query term to be considered for correction -->
+      <int name="minQueryLength">4</int>
+      <!-- maximum threshold of documents a query term can appear to be considered for correction -->
+      <float name="maxQueryFrequency">0.01</float>
+      <!-- uncomment this to require suggestions to occur in 1% of the documents
+      	<float name="thresholdTokenFrequency">.01</float>
+      -->
+    </lst>
+    
+    <!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage -->
+    <lst name="spellchecker">
+      <str name="name">wordbreak</str>
+      <str name="classname">solr.WordBreakSolrSpellChecker</str>      
+      <str name="field">name</str>
+      <str name="combineWords">true</str>
+      <str name="breakWords">true</str>
+      <int name="maxChanges">10</int>
+    </lst>
+
+    <!-- a spellchecker that uses a different distance measure -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">jarowinkler</str>
+         <str name="field">spell</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="distanceMeasure">
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         </str>
+       </lst>
+     -->
+
+    <!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      -->
+    <!--
+       <lst name="spellchecker">
+         <str name="name">freq</str>
+         <str name="field">lowerfilt</str>
+         <str name="classname">solr.DirectSolrSpellChecker</str>
+         <str name="comparatorClass">freq</str>
+      -->
+
+    <!-- A spellchecker that reads the list of words from a file -->
+    <!--
+       <lst name="spellchecker">
+         <str name="classname">solr.FileBasedSpellChecker</str>
+         <str name="name">file</str>
+         <str name="sourceLocation">spellings.txt</str>
+         <str name="characterEncoding">UTF-8</str>
+         <str name="spellcheckIndexDir">spellcheckerFile</str>
+       </lst>
+      -->
+  </searchComponent>
+  
+  <!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    -->
+  <requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers -->
+      <str name="spellcheck.dictionary">default</str>
+      <str name="spellcheck.dictionary">wordbreak</str>
+      <str name="spellcheck">on</str>
+      <str name="spellcheck.extendedResults">true</str>       
+      <str name="spellcheck.count">10</str>
+      <str name="spellcheck.alternativeTermCount">5</str>
+      <str name="spellcheck.maxResultsForSuggest">5</str>       
+      <str name="spellcheck.collate">true</str>
+      <str name="spellcheck.collateExtendedResults">true</str>  
+      <str name="spellcheck.maxCollationTries">10</str>
+      <str name="spellcheck.maxCollations">5</str>         
+    </lst>
+    <arr name="last-components">
+      <str>spellcheck</str>
+    </arr>
+  </requestHandler>
+
+  <searchComponent name="suggest" class="solr.SuggestComponent">
+  	<lst name="suggester">
+      <str name="name">mySuggester</str>
+      <str name="lookupImpl">FuzzyLookupFactory</str>      <!-- org.apache.solr.spelling.suggest.fst -->
+      <str name="dictionaryImpl">DocumentDictionaryFactory</str>     <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --> 
+      <str name="field">cat</str>
+      <str name="weightField">price</str>
+      <str name="suggestAnalyzerFieldType">string</str>
+    </lst>
+  </searchComponent>
+
+  <requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="suggest">true</str>
+      <str name="suggest.count">10</str>
+    </lst>
+    <arr name="components">
+      <str>suggest</str>
+    </arr>
+  </requestHandler>
+  <!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    -->
+  <searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
+
+  <!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="df">text</str>
+      <bool name="tv">true</bool>
+    </lst>
+    <arr name="last-components">
+      <str>tvComponent</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    -->
+  <searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" >
+    <lst name="engine">
+      <str name="name">lingo</str>
+
+      <!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        -->
+      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
+
+      <!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       -->
+      <str name="carrot.resourcesDir">clustering/carrot2</str>
+    </lst>
+
+    <!-- An example definition for the STC clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">stc</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
+    </lst>
+
+    <!-- An example definition for the bisecting kmeans clustering algorithm. -->
+    <lst name="engine">
+      <str name="name">kmeans</str>
+      <str name="carrot.algorithm">org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm</str>
+    </lst>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    -->
+  <requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler">
+    <lst name="defaults">
+      <bool name="clustering">true</bool>
+      <bool name="clustering.results">true</bool>
+      <!-- Field name with the logical "title" of a each document (optional) -->
+      <str name="carrot.title">name</str>
+      <!-- Field name with the logical "URL" of a each document (optional) -->
+      <str name="carrot.url">id</str>
+      <!-- Field name with the logical "content" of a each document (optional) -->
+      <str name="carrot.snippet">features</str>
+      <!-- Apply highlighter to the title/ content and use this for clustering. -->
+      <bool name="carrot.produceSummary">true</bool>
+      <!-- the maximum number of labels per cluster -->
+      <!--<int name="carrot.numDescriptions">5</int>-->
+      <!-- produce sub clusters -->
+      <bool name="carrot.outputSubClusters">false</bool>
+
+      <!-- Configure the remaining request handler parameters. -->
+      <str name="defType">edismax</str>
+      <str name="qf">
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      </str>
+      <str name="q.alt">*:*</str>
+      <str name="rows">10</str>
+      <str name="fl">*,score</str>
+    </lst>
+    <arr name="last-components">
+      <str>clustering</str>
+    </arr>
+  </requestHandler>
+  
+  <!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    -->
+  <searchComponent name="terms" class="solr.TermsComponent"/>
+
+  <!-- A request handler for demonstrating the terms component -->
+  <requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
+     <lst name="defaults">
+      <bool name="terms">true</bool>
+      <bool name="distrib">false</bool>
+    </lst>     
+    <arr name="components">
+      <str>terms</str>
+    </arr>
+  </requestHandler>
+
+
+  <!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    -->
+  <searchComponent name="elevator" class="solr.QueryElevationComponent" >
+    <!-- pick a fieldType to analyze queries -->
+    <str name="queryFieldType">string</str>
+    <str name="config-file">elevate.xml</str>
+  </searchComponent>
+
+  <!-- A request handler for demonstrating the elevator component -->
+  <requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
+    <lst name="defaults">
+      <str name="echoParams">explicit</str>
+      <str name="df">text</str>
+    </lst>
+    <arr name="last-components">
+      <str>elevator</str>
+    </arr>
+  </requestHandler>
+
+  <!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    -->
+  <searchComponent class="solr.HighlightComponent" name="highlight">
+    <highlighting>
+      <!-- Configure the standard fragmenter -->
+      <!-- This could most likely be commented out in the "default" case -->
+      <fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter">
+        <lst name="defaults">
+          <int name="hl.fragsize">100</int>
+        </lst>
+      </fragmenter>
+
+      <!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        -->
+      <fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter">
+        <lst name="defaults">
+          <!-- slightly smaller fragsizes work better because of slop -->
+          <int name="hl.fragsize">70</int>
+          <!-- allow 50% slop on fragment sizes -->
+          <float name="hl.regex.slop">0.5</float>
+          <!-- a basic sentence pattern -->
+          <str name="hl.regex.pattern">[-\w ,/\n\&quot;&apos;]{20,200}</str>
+        </lst>
+      </fragmenter>
+
+      <!-- Configure the standard formatter -->
+      <formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter">
+        <lst name="defaults">
+          <str name="hl.simple.pre"><![CDATA[<em>]]></str>
+          <str name="hl.simple.post"><![CDATA[</em>]]></str>
+        </lst>
+      </formatter>
+
+      <!-- Configure the standard encoder -->
+      <encoder name="html" 
+               class="solr.highlight.HtmlEncoder" />
+
+      <!-- Configure the standard fragListBuilder -->
+      <fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/>
+      
+      <!-- Configure the single fragListBuilder -->
+      <fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/>
+      
+      <!-- Configure the weighted fragListBuilder -->
+      <fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/>
+      
+      <!-- default tag FragmentsBuilder -->
+      <fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <!-- 
+        <lst name="defaults">
+          <str name="hl.multiValuedSeparatorChar">/</str>
+        </lst>
+        -->
+      </fragmentsBuilder>
+
+      <!-- multi-colored tag FragmentsBuilder -->
+      <fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder">
+        <lst name="defaults">
+          <str name="hl.tag.pre"><![CDATA[
+               <b style="background:yellow">,<b style="background:lawgreen">,
+               <b style="background:aquamarine">,<b style="background:magenta">,
+               <b style="background:palegreen">,<b style="background:coral">,
+               <b style="background:wheat">,<b style="background:khaki">,
+               <b style="background:lime">,<b style="background:deepskyblue">]]></str>
+          <str name="hl.tag.post"><![CDATA[</b>]]></str>
+        </lst>
+      </fragmentsBuilder>
+      
+      <boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner">
+        <lst name="defaults">
+          <str name="hl.bs.maxScan">10</str>
+          <str name="hl.bs.chars">.,!? &#9;&#10;&#13;</str>
+        </lst>
+      </boundaryScanner>
+      
+      <boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner">
+        <lst name="defaults">
+          <!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
+          <str name="hl.bs.type">WORD</str>
+          <!-- language and country are used when constructing Locale object.  -->
+          <!-- And the Locale object will be used when getting instance of BreakIterator -->
+          <str name="hl.bs.language">en</str>
+          <str name="hl.bs.country">US</str>
+        </lst>
+      </boundaryScanner>
+    </highlighting>
+  </searchComponent>
+
+  <!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --> 
+
+  <!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    -->
+  <updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
+
+    <processor class="solr.DefaultValueUpdateProcessorFactory">
+        <str name="fieldName">_ttl_</str>
+        <str name="value">+7DAYS</str>
+    </processor>
+    <processor class="solr.processor.DocExpirationUpdateProcessorFactory">
+        <int name="autoDeletePeriodSeconds">86400</int>
+        <str name="ttlFieldName">_ttl_</str>
+        <str name="expirationFieldName">_expire_at_</str>
+    </processor>
+    <processor class="solr.FirstFieldValueUpdateProcessorFactory">
+      <str name="fieldName">_expire_at_</str>
+    </processor>
+
+
+    <processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseLongFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/>
+    <processor class="solr.ParseDateFieldUpdateProcessorFactory">
+      <arr name="format">
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd'T'HH:mm:ssZ</str>
+        <str>yyyy-MM-dd'T'HH:mm:ss</str>
+        <str>yyyy-MM-dd'T'HH:mmZ</str>
+        <str>yyyy-MM-dd'T'HH:mm</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSSZ</str>
+        <str>yyyy-MM-dd HH:mm:ss.SSS</str>
+        <str>yyyy-MM-dd HH:mm:ss,SSS</str>
+        <str>yyyy-MM-dd HH:mm:ssZ</str>
+        <str>yyyy-MM-dd HH:mm:ss</str>
+        <str>yyyy-MM-dd HH:mmZ</str>
+        <str>yyyy-MM-dd HH:mm</str>
+        <str>yyyy-MM-dd</str>
+      </arr>
+    </processor>
+    <processor class="solr.AddSchemaFieldsUpdateProcessorFactory">
+      <str name="defaultFieldType">key_lower_case</str>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Boolean</str>
+        <str name="fieldType">booleans</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.util.Date</str>
+        <str name="fieldType">tdates</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Long</str>
+        <str name="valueClass">java.lang.Integer</str>
+        <str name="fieldType">tlongs</str>
+      </lst>
+      <lst name="typeMapping">
+        <str name="valueClass">java.lang.Number</str>
+        <str name="fieldType">tdoubles</str>
+      </lst>
+    </processor>
+
+    <processor class="solr.LogUpdateProcessorFactory"/>
+    <processor class="solr.RunUpdateProcessorFactory"/>
+  </updateRequestProcessorChain>
+
+
+  <!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    -->
+  <!--
+     <updateRequestProcessorChain name="dedupe">
+       <processor class="solr.processor.SignatureUpdateProcessorFactory">
+         <bool name="enabled">true</bool>
+         <str name="signatureField">id</str>
+         <bool name="overwriteDupes">false</bool>
+         <str name="fields">name,features,cat</str>
+         <str name="signatureClass">solr.processor.Lookup3Signature</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+  
+  <!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    -->
+    <!--
+     <updateRequestProcessorChain name="langid">
+       <processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory">
+         <str name="langid.fl">text,title,subject,description</str>
+         <str name="langid.langField">language_s</str>
+         <str name="langid.fallback">en</str>
+       </processor>
+       <processor class="solr.LogUpdateProcessorFactory" />
+       <processor class="solr.RunUpdateProcessorFactory" />
+     </updateRequestProcessorChain>
+    -->
+
+  <!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  -->
+  <!--
+    <updateRequestProcessorChain name="script">
+      <processor class="solr.StatelessScriptUpdateProcessorFactory">
+        <str name="script">update-script.js</str>
+        <lst name="params">
+          <str name="config_param">example config parameter</str>
+        </lst>
+      </processor>
+      <processor class="solr.RunUpdateProcessorFactory" />
+    </updateRequestProcessorChain>
+  -->
+ 
+  <!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    -->
+  <!-- The following response writers are implicitly configured unless
+       overridden...
+    -->
+  <!--
+     <queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" />
+     <queryResponseWriter name="json" class="solr.JSONResponseWriter"/>
+     <queryResponseWriter name="python" class="solr.PythonResponseWriter"/>
+     <queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/>
+     <queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
+     <queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
+     <queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
+     <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
+    -->
+
+  <queryResponseWriter name="json" class="solr.JSONResponseWriter">
+     <!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     -->
+    <str name="content-type">text/plain; charset=UTF-8</str>
+  </queryResponseWriter>
+  
+  <!--
+     Custom response writers can be declared as needed...
+    -->
+  <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">
+    <str name="template.base.dir">${velocity.template.base.dir:}</str>
+  </queryResponseWriter>
+
+  <!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    -->
+  <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
+    <int name="xsltCacheLifetimeSeconds">5</int>
+  </queryResponseWriter>
+
+  <!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    -->
+  <!-- example of registering a query parser -->
+  <!--
+     <queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/>
+    -->
+
+  <!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    -->
+  <!-- example of registering a custom function parser  -->
+  <!--
+     <valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" />
+    -->
+    
+  
+  <!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    -->
+  <!--
+     Could be something like:
+     <transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" >
+       <int name="connection">jdbc://....</int>
+     </transformer>
+     
+     To add a constant value to all docs, use:
+     <transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <int name="value">5</int>
+     </transformer>
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     <transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" >
+       <double name="defaultValue">5</double>
+     </transformer>
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     <transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" />
+    -->
+    
+
+  <!-- Legacy config for the admin interface -->
+  <admin>
+    <defaultQuery>*:*</defaultQuery>
+  </admin>
+
+</config>


[53/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/test/python/stacks/2.4/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/configs/default.json b/ambari-server/src/test/python/stacks/2.4/configs/default.json
new file mode 100644
index 0000000..e03d25f
--- /dev/null
+++ b/ambari-server/src/test/python/stacks/2.4/configs/default.json
@@ -0,0 +1,398 @@
+{
+    "roleCommand": "SERVICE_CHECK",
+    "clusterName": "c1",
+    "hostname": "c6401.ambari.apache.org",
+    "hostLevelParams": {
+        "not_managed_hdfs_path_list": "[\"/apps/hive/warehouse\",\"/apps/falcon\",\"/mr-history/done\",\"/app-logs\",\"/tmp\"]",
+        "agent_stack_retry_count": "5",
+        "agent_stack_retry_on_unavailability": "false",
+        "jdk_location": "http://c6401.ambari.apache.org:8080/resources/",
+        "ambari_db_rca_password": "mapred",
+        "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca",
+        "jce_name": "UnlimitedJCEPolicyJDK7.zip",
+        "stack_version": "2.3",
+        "stack_name": "HDP",
+        "ambari_db_rca_driver": "org.postgresql.Driver",
+        "jdk_name": "jdk-7u67-linux-x64.tar.gz",
+        "ambari_db_rca_username": "mapred",
+        "java_home": "/usr/jdk64/jdk1.7.0_45",
+        "db_name": "ambari"
+    },
+    "commandType": "EXECUTION_COMMAND",
+    "roleParams": {},
+    "serviceName": "SLIDER",
+    "role": "SLIDER",
+    "commandParams": {
+        "version": "2.2.1.0-2067",
+        "command_timeout": "300",
+        "service_package_folder": "OOZIE",
+        "script_type": "PYTHON",
+        "script": "scripts/service_check.py",
+        "excluded_hosts": "host1,host2"
+    },
+    "taskId": 152,
+    "public_hostname": "c6401.ambari.apache.org",
+    "configurations": {
+        "slider-client": {
+            "slider.yarn.queue": "default"
+        },
+        "sqoop-site": {
+          "atlas.cluster.name": "c1",
+          "sqoop.job.data.publish.class": "org.apache.atlas.sqoop.hook.SqoopHook"
+        },
+        "mahout-env": {
+             "mahout_user": "mahout"
+        },
+        "yarn-env": {
+            "yarn_user": "yarn"
+        },
+        "mahout-log4j": {
+            "content": "\n            #\n            #\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #   http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing,\n            # software distributed under the License is distributed on an\n            # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n            # KIND, either express or implied.  See the License for the\n            # specific language governing permiss
 ions and limitations\n            # under the License.\n            #\n            #\n            #\n\n            # Set everything to be logged to the console\n            log4j.rootCategory=WARN, console\n            log4j.appender.console=org.apache.log4j.ConsoleAppender\n            log4j.appender.console.target=System.err\n            log4j.appender.console.layout=org.apache.log4j.PatternLayout\n            log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n\n\n            # Settings to quiet third party logs that are too verbose\n            log4j.logger.org.eclipse.jetty=WARN\n            log4j.logger.org.apache.spark.repl.SparkIMain$exprTyper=WARN\n            log4j.logger.org.apache.spark.repl.SparkILoop$SparkILoopInterpreter=WARN"
+        },
+        "hadoop-env": {
+             "hdfs_user": "hdfs"
+        },
+        "core-site": {
+            "fs.defaultFS": "hdfs://c6401.ambari.apache.org:8020"
+        },
+        "hdfs-site": {
+            "a": "b"
+        },
+        "yarn-site": {
+            "yarn.application.classpath": "/etc/hadoop/conf,/usr/lib/hadoop/*,/usr/lib/hadoop/lib/*,/usr/lib/hadoop-hdfs/*,/usr/lib/hadoop-hdfs/lib/*,/usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,/usr/lib/hadoop-mapreduce/*,/usr/lib/hadoop-mapreduce/lib/*",
+            "yarn.resourcemanager.address": "c6401.ambari.apache.org:8050",
+            "yarn.resourcemanager.scheduler.address": "c6401.ambari.apache.org:8030"
+        },
+        "cluster-env": {
+            "managed_hdfs_resource_property_names": "",
+            "security_enabled": "false",
+            "ignore_groupsusers_create": "false",
+            "smokeuser": "ambari-qa",
+            "kerberos_domain": "EXAMPLE.COM",
+            "user_group": "hadoop"
+        },
+        "webhcat-site": {
+            "templeton.jar": "/usr/hdp/current/hive-webhcat/share/webhcat/svr/lib/hive-webhcat-*.jar",
+            "templeton.pig.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/pig/pig.tar.gz",
+            "templeton.hive.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/hive/hive.tar.gz",
+            "templeton.sqoop.archive": "hdfs:///hdp/apps/{{ hdp_stack_version }}/sqoop/sqoop.tar.gz",
+            "templeton.streaming.jar": "hdfs:///hdp/apps/{{ hdp_stack_version }}/mr/hadoop-streaming.jar"
+        },
+        "slider-log4j": {
+            "content": "log4jproperties\nline2"
+        },
+        "slider-env": {
+            "content": "envproperties\nline2"
+        },
+      "gateway-site": {
+        "java.security.auth.login.config": "/etc/knox/conf/krb5JAASLogin.conf",
+        "gateway.hadoop.kerberos.secured": "false",
+        "gateway.gateway.conf.dir": "deployments",
+        "gateway.path": "gateway",
+        "sun.security.krb5.debug": "true",
+        "java.security.krb5.conf": "/etc/knox/conf/krb5.conf",
+        "gateway.port": "8443"
+      },
+
+      "users-ldif": {
+        "content": "\n            # Licensed to the Apache Software Foundation (ASF) under one\n            # or more contributor license agreements.  See the NOTICE file\n            # distributed with this work for additional information\n            # regarding copyright ownership.  The ASF licenses this file\n            # to you under the Apache License, Version 2.0 (the\n            # \"License\"); you may not use this file except in compliance\n            # with the License.  You may obtain a copy of the License at\n            #\n            #     http://www.apache.org/licenses/LICENSE-2.0\n            #\n            # Unless required by applicable law or agreed to in writing, software\n            # distributed under the License is distributed on an \"AS IS\" BASIS,\n            # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n            # See the License for the specific language governing permissions and\n            # limitations under the Li
 cense.\n\n            version: 1\n\n            # Please replace with site specific values\n            dn: dc=hadoop,dc=apache,dc=org\n            objectclass: organization\n            objectclass: dcObject\n            o: Hadoop\n            dc: hadoop\n\n            # Entry for a sample people container\n            # Please replace with site specific values\n            dn: ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: people\n\n            # Entry for a sample end user\n            # Please replace with site specific values\n            dn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Guest\n            sn: User\n            uid: guest\n            userPassword:guest-password\n\n            # entry for sample user admin\n            dn
 : uid=admin,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: Admin\n            sn: Admin\n            uid: admin\n            userPassword:admin-password\n\n            # entry for sample user sam\n            dn: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: sam\n            sn: sam\n            uid: sam\n            userPassword:sam-password\n\n            # entry for sample user tom\n            dn: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:person\n            objectclass:organizationalPerson\n            objectclass:inetOrgPerson\n            cn: tom\n            sn: tom\n            uid: tom\n            userPassw
 ord:tom-password\n\n            # create FIRST Level groups branch\n            dn: ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass:organizationalUnit\n            ou: groups\n            description: generic groups branch\n\n            # create the analyst group under groups\n            dn: cn=analyst,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: analyst\n            description:analyst  group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org\n            member: uid=tom,ou=people,dc=hadoop,dc=apache,dc=org\n\n\n            # create the scientist group under groups\n            dn: cn=scientist,ou=groups,dc=hadoop,dc=apache,dc=org\n            objectclass:top\n            objectclass: groupofnames\n            cn: scientist\n            description: scientist group\n            member: uid=sam,ou=people,dc=hadoop,dc=apache,dc=org"
+      },
+
+      "topology": {
+        "content": "\n        <topology>\n\n            <gateway>\n\n                <provider>\n                    <role>authentication</role>\n                    <name>ShiroProvider</name>\n                    <enabled>true</enabled>\n                    <param>\n                        <name>sessionTimeout</name>\n                        <value>30</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm</name>\n                        <value>org.apache.hadoop.gateway.shirorealm.KnoxLdapRealm</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.userDnTemplate</name>\n                        <value>uid={0},ou=people,dc=hadoop,dc=apache,dc=org</value>\n                    </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.url</name>\n                        <value>ldap://{{knox_host_name}}:33389</value>\n               
      </param>\n                    <param>\n                        <name>main.ldapRealm.contextFactory.authenticationMechanism</name>\n                        <value>simple</value>\n                    </param>\n                    <param>\n                        <name>urls./**</name>\n                        <value>authcBasic</value>\n                    </param>\n                </provider>\n\n                <provider>\n                    <role>identity-assertion</role>\n                    <name>Default</name>\n                    <enabled>true</enabled>\n                </provider>\n\n            </gateway>\n\n            <service>\n                <role>NAMENODE</role>\n                <url>hdfs://{{namenode_host}}:{{namenode_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>JOBTRACKER</role>\n                <url>rpc://{{rm_host}}:{{jt_rpc_port}}</url>\n            </service>\n\n            <service>\n                <role>WEBHDFS</ro
 le>\n                <url>http://{{namenode_host}}:{{namenode_http_port}}/webhdfs</url>\n            </service>\n\n            <service>\n                <role>WEBHCAT</role>\n                <url>http://{{webhcat_server_host}}:{{templeton_port}}/templeton</url>\n            </service>\n\n            <service>\n                <role>OOZIE</role>\n                <url>http://{{oozie_server_host}}:{{oozie_server_port}}/oozie</url>\n            </service>\n\n            <service>\n                <role>WEBHBASE</role>\n                <url>http://{{hbase_master_host}}:{{hbase_master_port}}</url>\n            </service>\n\n            <service>\n                <role>HIVE</role>\n                <url>http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}</url>\n            </service>\n\n            <service>\n                <role>RESOURCEMANAGER</role>\n                <url>http://{{rm_host}}:{{rm_port}}/ws</url>\n            </service>\n        </topology>"
+      },
+
+      "ldap-log4j": {
+        "content": "\n        # Licensed to the Apache Software Foundation (ASF) under one\n        # or more contributor license agreements.  See the NOTICE file\n        # distributed with this work for additional information\n        # regarding copyright ownership.  The ASF licenses this file\n        # to you under the Apache License, Version 2.0 (the\n        # \"License\"); you may not use this file except in compliance\n        # with the License.  You may obtain a copy of the License at\n        #\n        #     http://www.apache.org/licenses/LICENSE-2.0\n        #\n        # Unless required by applicable law or agreed to in writing, software\n        # distributed under the License is distributed on an \"AS IS\" BASIS,\n        # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n        # See the License for the specific language governing permissions and\n        # limitations under the License.\n        #testing\n\n        app.log.dir=${launcher.d
 ir}/../logs\n        app.log.file=${launcher.name}.log\n\n        log4j.rootLogger=ERROR, drfa\n        log4j.logger.org.apache.directory.server.ldap.LdapServer=INFO\n        log4j.logger.org.apache.directory=WARN\n\n        log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n        log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n        log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n        log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n        log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n        log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n        log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n        log4j.appender.drfa.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n"
+      },
+
+      "gateway-log4j": {
+        "content": "\n\n      # Licensed to the Apache Software Foundation (ASF) under one\n      # or more contributor license agreements. See the NOTICE file\n      # distributed with this work for additional information\n      # regarding copyright ownership. The ASF licenses this file\n      # to you under the Apache License, Version 2.0 (the\n      # \"License\"); you may not use this file except in compliance\n      # with the License. You may obtain a copy of the License at\n      #\n      # http://www.apache.org/licenses/LICENSE-2.0\n      #\n      # Unless required by applicable law or agreed to in writing, software\n      # distributed under the License is distributed on an \"AS IS\" BASIS,\n      # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n      # See the License for the specific language governing permissions and\n      # limitations under the License.\n\n      app.log.dir=${launcher.dir}/../logs\n      app.log.file=${launcher.name}.log\n 
      app.audit.file=${launcher.name}-audit.log\n\n      log4j.rootLogger=ERROR, drfa\n\n      log4j.logger.org.apache.hadoop.gateway=INFO\n      #log4j.logger.org.apache.hadoop.gateway=DEBUG\n\n      #log4j.logger.org.eclipse.jetty=DEBUG\n      #log4j.logger.org.apache.shiro=DEBUG\n      #log4j.logger.org.apache.http=DEBUG\n      #log4j.logger.org.apache.http.client=DEBUG\n      #log4j.logger.org.apache.http.headers=DEBUG\n      #log4j.logger.org.apache.http.wire=DEBUG\n\n      log4j.appender.stdout=org.apache.log4j.ConsoleAppender\n      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\n      log4j.appender.stdout.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n\n\n      log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.drfa.File=${app.log.dir}/${app.log.file}\n      log4j.appender.drfa.DatePattern=.yyyy-MM-dd\n      log4j.appender.drfa.layout=org.apache.log4j.PatternLayout\n      log4j.appender.drfa.layout.ConversionPattern
 =%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n\n\n      log4j.logger.audit=INFO, auditfile\n      log4j.appender.auditfile=org.apache.log4j.DailyRollingFileAppender\n      log4j.appender.auditfile.File=${app.log.dir}/${app.audit.file}\n      log4j.appender.auditfile.Append = true\n      log4j.appender.auditfile.DatePattern = '.'yyyy-MM-dd\n      log4j.appender.auditfile.layout = org.apache.hadoop.gateway.audit.log4j.layout.AuditLayout"
+      },
+      "knox-env": {
+        "knox_master_secret": "sa",
+        "knox_group": "knox",
+        "knox_pid_dir": "/var/run/knox",
+        "knox_user": "knox"
+      },
+      "kafka-env": {
+        "content": "\n#!/bin/bash\n\n# Set KAFKA specific environment variables here.\n\n# The java implementation to use.\nexport JAVA_HOME={{java64_home}}\nexport PATH=$PATH:$JAVA_HOME/bin",
+        "kafka_user": "kafka",
+        "kafka_log_dir": "/var/log/kafka",
+        "kafka_pid_dir": "/var/run/kafka"
+      },
+      "kafka-log4j": {
+        "content": "\n#\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n#   http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n#\n#\nkafka.logs.dir=logs\n\nlog4j.rootLogger=INFO, stdout\n\nlog4j.appender.stdout=org.apache.log4j.ConsoleAppender\nlog4j.appender.stdout.layout=org.apache.log
 4j.PatternLayout\nlog4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log\nlog4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log\nlog4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-requ
 est.log\nlog4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log\nlog4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\nlog4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender\nlog4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH\nlog4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log\nlog4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout\nlog4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n\n\n# Turn on all our debugging info\n#log4j.logger.kafka.producer.async.DefaultEventHandler=DEBUG, kafkaAppender\n#log4j.log
 ger.kafka.client.ClientUtils=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf=DEBUG, kafkaAppender\n#log4j.logger.kafka.perf.ProducerPerformance$ProducerThread=DEBUG, kafkaAppender\n#log4j.logger.org.I0Itec.zkclient.ZkClient=DEBUG\nlog4j.logger.kafka=INFO, kafkaAppender\nlog4j.logger.kafka.network.RequestChannel$=WARN, requestAppender\nlog4j.additivity.kafka.network.RequestChannel$=false\n\n#log4j.logger.kafka.network.Processor=TRACE, requestAppender\n#log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender\n#log4j.additivity.kafka.server.KafkaApis=false\nlog4j.logger.kafka.request.logger=WARN, requestAppender\nlog4j.additivity.kafka.request.logger=false\n\nlog4j.logger.kafka.controller=TRACE, controllerAppender\nlog4j.additivity.kafka.controller=false\n\nlog4j.logger.kafka.log.LogCleaner=INFO, cleanerAppender\nlog4j.additivity.kafka.log.LogCleaner=false\n\nlog4j.logger.state.change.logger=TRACE, stateChangeAppender\nlog4j.additivity.state.change.logger=false"
+      },
+      "kafka-broker": {
+        "log.segment.bytes": "1073741824",
+        "socket.send.buffer.bytes": "102400",
+        "num.network.threads": "3",
+        "log.flush.scheduler.interval.ms": "3000",
+        "kafka.ganglia.metrics.host": "localhost",
+        "zookeeper.session.timeout.ms": "6000",
+        "replica.lag.time.max.ms": "10000",
+        "num.io.threads": "8",
+        "kafka.ganglia.metrics.group": "kafka",
+        "replica.lag.max.messages": "4000",
+        "port": "6667",
+        "log.retention.bytes": "-1",
+        "fetch.purgatory.purge.interval.requests": "10000",
+        "producer.purgatory.purge.interval.requests": "10000",
+        "default.replication.factor": "1",
+        "replica.high.watermark.checkpoint.interval.ms": "5000",
+        "zookeeper.connect": "c6402.ambari.apache.org:2181",
+        "controlled.shutdown.retry.backoff.ms": "5000",
+        "num.partitions": "1",
+        "log.flush.interval.messages": "10000",
+        "replica.fetch.min.bytes": "1",
+        "queued.max.requests": "500",
+        "controlled.shutdown.max.retries": "3",
+        "replica.fetch.wait.max.ms": "500",
+        "controlled.shutdown.enable": "false",
+        "log.roll.hours": "168",
+        "log.cleanup.interval.mins": "10",
+        "replica.socket.receive.buffer.bytes": "65536",
+        "zookeeper.connection.timeout.ms": "6000",
+        "replica.fetch.max.bytes": "1048576",
+        "num.replica.fetchers": "1",
+        "socket.request.max.bytes": "104857600",
+        "message.max.bytes": "1000000",
+        "zookeeper.sync.time.ms": "2000",
+        "socket.receive.buffer.bytes": "102400",
+        "controller.message.queue.size": "10",
+        "log.flush.interval.ms": "3000",
+        "log.dirs": "/tmp/log/dir",
+        "controller.socket.timeout.ms": "30000",
+        "replica.socket.timeout.ms": "30000",
+        "auto.create.topics.enable": "true",
+        "log.index.size.max.bytes": "10485760",
+        "kafka.ganglia.metrics.port": "8649",
+        "log.index.interval.bytes": "4096",
+        "log.retention.hours": "168"
+      },
+      "application-properties": {
+        "atlas.cluster.name" : "c2",
+        "atlas.graph.storage.backend": "berkeleyje",
+        "atlas.graph.storage.directory": "data/berkley",
+        "atlas.graph.index.search.backend": "elasticsearch",
+        "atlas.graph.index.search.directory": "data/es",
+        "atlas.graph.index.search.elasticsearch.client-only": false,
+        "atlas.graph.index.search.elasticsearch.local-mode": true,
+        "atlas.lineage.hive.table.type.name": "Table",
+        "atlas.lineage.hive.column.type.name": "Column",
+        "atlas.lineage.hive.table.column.name": "columns",
+        "atlas.lineage.hive.process.type.name": "LoadProcess",
+        "atlas.lineage.hive.process.inputs.name": "inputTables",
+        "atlas.lineage.hive.process.outputs.name": "outputTables",
+        "atlas.enableTLS": false,
+        "atlas.authentication.method": "simple",
+        "atlas.authentication.principal": "atlas",
+        "atlas.authentication.keytab": "/etc/security/keytabs/atlas.service.keytab",
+        "atlas.http.authentication.enabled": false,
+        "atlas.http.authentication.type": "simple",
+        "atlas.http.authentication.kerberos.principal": "HTTP/_HOST@EXAMPLE.COM",
+        "atlas.http.authentication.kerberos.keytab": "/etc/security/keytabs/spnego.service.keytab",
+        "atlas.http.authentication.kerberos.name.rules": "DEFAULT",
+        "atlas.server.http.port" : "21000",
+        "atlas.notification.embedded" : false,
+        "atlas.kafka.bootstrap.servers" : "c6401.ambari.apache.org:6667",
+        "atlas.kafka.data" : "/usr/hdp/current/atlas-server/data/kafka",
+        "atlas.kafka.entities.group.id" : "entities",
+        "atlas.kafka.hook.group.id" : "atlas",
+        "atlas.kafka.zookeeper.connect" : "c6401.ambari.apache.org:2181"
+      },
+      "atlas-env": {
+        "content": "# The java implementation to use. If JAVA_HOME is not found we expect java and jar to be in path\nexport JAVA_HOME={{java64_home}}\n# any additional java opts you want to set. This will apply to both client and server operations\nexport METADATA_OPTS={{metadata_opts}}\n# metadata configuration directory\nexport METADATA_CONF={{conf_dir}}\n# Where log files are stored. Defatult is logs directory under the base install location\nexport METADATA_LOG_DIR={{log_dir}}\n# additional classpath entries\nexport METADATACPPATH={{metadata_classpath}}\n# data dir\nexport METADATA_DATA_DIR={{data_dir}}\n# Where do you want to expand the war file. By Default it is in /server/webapp dir under the base install dir.\nexport METADATA_EXPANDED_WEBAPP_DIR={{expanded_war_dir}}",
+        "metadata_user": "atlas",
+        "metadata_port": 21000,
+        "metadata_pid_dir": "/var/run/atlas",
+        "metadata_log_dir": "/var/log/atlas",
+        "metadata_data_dir": "/var/lib/atlas/data",
+        "metadata_expanded_war_dir": "/var/lib/atlas/server/webapp",
+        "metadata_conf_file": "application.properties"
+      },
+      "ranger-hbase-plugin-properties": {
+            "ranger-hbase-plugin-enabled":"yes"
+      },
+      "ranger-hive-plugin-properties": {
+            "ranger-hive-plugin-enabled":"yes"
+       },
+      "ranger-env": {
+            "xml_configurations_supported" : "true"
+      },
+      "logsearch-solr-env": {
+        "logsearch_solr_user": "solr",
+        "logsearch_solr_group": "solr",
+        "logsearch_solr_port": "8886",
+        "logsearch_solr_minmem": "512m",
+        "logsearch_solr_maxmem": "512m",
+        "logsearch_solr_znode": "/logsearch",
+        "logsearch_solr_conf": "/etc/ambari-logsearch-solr",
+        "logsearch_solr_pid_dir": "/var/run/ambari-logsearch-solr",
+        "logsearch_solr_datadir": "/opt/logsearch_solr/data",
+        "logsearch_solr_log_dir": "/var/log/ambari-logsearch-solr",
+        "content": "# By default the script will use JAVA_HOME to determine which java\n# to use, but you can set a specific path for Solr to use without\n# affecting other Java applications on your server/workstation.\nSOLR_JAVA_HOME={{java64_home}}\n\n# Increase Java Min/Max Heap as needed to support your indexing / query needs\nSOLR_JAVA_MEM=\"-Xms{{solr_min_mem}} -Xmx{{solr_max_mem}}\"\n\n# Enable verbose GC logging\nGC_LOG_OPTS=\"-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \\\n-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime\"\n\n# These GC settings have shown to work well for a number of common Solr workloads\nGC_TUNE=\"-XX:NewRatio=3 \\\n-XX:SurvivorRatio=4 \\\n-XX:TargetSurvivorRatio=90 \\\n-XX:MaxTenuringThreshold=8 \\\n-XX:+UseConcMarkSweepGC \\\n-XX:+UseParNewGC \\\n-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \\\n-XX:+CMSScavengeBeforeRemark \\\n-XX:PretenureSizeThreshold=64m \\\n-XX:+UseCMSInitiatingOc
 cupancyOnly \\\n-XX:CMSInitiatingOccupancyFraction=50 \\\n-XX:CMSMaxAbortablePrecleanTime=6000 \\\n-XX:+CMSParallelRemarkEnabled \\\n-XX:+ParallelRefProcEnabled\"\n\n# Set the ZooKeeper connection string if using an external ZooKeeper ensemble\n# e.g. host1:2181,host2:2181/chroot\n# Leave empty if not using SolrCloud\nZK_HOST=\"{{zookeeper_quorum}}{{solr_znode}}\"\n\n# Set the ZooKeeper client timeout (for SolrCloud mode)\nZK_CLIENT_TIMEOUT=\"60000\"\n\n# By default the start script uses \"localhost\"; override the hostname here\n# for production SolrCloud environments to control the hostname exposed to cluster state\n#SOLR_HOST=\"192.168.1.1\"\n\n# By default the start script uses UTC; override the timezone if needed\n#SOLR_TIMEZONE=\"UTC\"\n\n# Set to true to activate the JMX RMI connector to allow remote JMX client applications\n# to monitor the JVM hosting Solr; set to \"false\" to disable that behavior\n# (false is recommended in production environments)\nENABLE_REMOTE_JMX_OPTS
 =\"false\"\n\n# The script will use SOLR_PORT+10000 for the RMI_PORT or you can set it here\n# RMI_PORT=18983\n\n# Anything you add to the SOLR_OPTS variable will be included in the java\n# start command line as-is, in ADDITION to other options. If you specify the\n# -a option on start script, those options will be appended as well. Examples:\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.autoSoftCommit.maxTime=3000\"\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.autoCommit.maxTime=60000\"\n#SOLR_OPTS=\"$SOLR_OPTS -Dsolr.clustering.enabled=true\"\n\n# Location where the bin/solr script will save PID files for running instances\n# If not set, the script will create PID files in $SOLR_TIP/bin\nSOLR_PID_DIR={{solr_piddir}}\n\n# Path to a directory where Solr creates index files, the specified directory\n# must contain a solr.xml; by default, Solr will use server/solr\nSOLR_HOME={{logsearch_solr_datadir}}\n\n# Solr provides a default Log4J configuration properties file in server/resources\n# however, you may want t
 o customize the log settings and file appender location\n# so you can point the script to use a different log4j.properties file\nLOG4J_PROPS={{logsearch_solr_datadir}}/resources/log4j.properties\n\n# Location where Solr should write logs to; should agree with the file appender\n# settings in server/resources/log4j.properties\nSOLR_LOGS_DIR={{solr_log_dir}}\n\n# Sets the port Solr binds to, default is 8983\nSOLR_PORT={{solr_port}}\n\n# Uncomment to set SSL-related system properties\n# Be sure to update the paths to the correct keystore for your environment\n#SOLR_SSL_OPTS=\"-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks \\\n#-Djavax.net.ssl.keyStorePassword=secret \\\n#-Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks \\\n#-Djavax.net.ssl.trustStorePassword=secret\"\n\n# Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set\n# and you are using SSL, then the start script will use SOLR_PORT for the SSL port\n#SOLR_SSL_PORT="
+      },
+      "logsearch-solr-xml": {
+        "content": "\n&lt;solr&gt;\n  &lt;solrcloud&gt;\n    &lt;str name=\"host\"&gt;${host:}&lt;/str&gt;\n    &lt;int name=\"hostPort\"&gt;${jetty.port:}&lt;/int&gt;\n    &lt;str name=\"hostContext\"&gt;${hostContext:solr}&lt;/str&gt;\n    &lt;int name=\"zkClientTimeout\"&gt;${zkClientTimeout:15000}&lt;/int&gt;\n    &lt;bool name=\"genericCoreNodeNames\"&gt;${genericCoreNodeNames:true}&lt;/bool&gt;\n  &lt;/solrcloud&gt;\n&lt;/solr&gt;"
+      },
+      "logsearch-solr-log4j": {
+        "content": "\n#  Logging level\nsolr.log={{solr_log_dir}}\n#log4j.rootLogger=INFO, file, CONSOLE\nlog4j.rootLogger=INFO, file\n\nlog4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender\n\nlog4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout\nlog4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x [%X{collection} %X{shard} %X{replica} %X{core}] \\u2013 %m%n\n\n#- size rotation with log cleanup.\nlog4j.appender.file=org.apache.log4j.RollingFileAppender\nlog4j.appender.file.MaxFileSize=10MB\nlog4j.appender.file.MaxBackupIndex=9\n\n#- File to log to and log format\nlog4j.appender.file.File=${solr.log}/solr.log\nlog4j.appender.file.layout=org.apache.log4j.PatternLayout\nlog4j.appender.file.layout.ConversionPattern=%d{ISO8601} [%t] %-5p [%X{collection} %X{shard} %X{replica} %X{core}] %C (%F:%L) - %m%n\n\nlog4j.logger.org.apache.zookeeper=WARN\nlog4j.logger.org.apache.hadoop=WARN\n\n# set to INFO to enable infostream log messages\nlog4j.logger.org.apache.solr.u
 pdate.LoggingInfoStream=OFF"
+      },
+      "solr-zoo-env": {
+        "content": "\n# The number of milliseconds of each tick\ntickTime=2000\n# The number of ticks that the initial\n# synchronization phase can take\ninitLimit=10\n# The number of ticks that can pass between\n# sending a request and getting an acknowledgement\nsyncLimit=5\n\n# the directory where the snapshot is stored.\n# dataDir=/opt/zookeeper/data\n# NOTE: Solr defaults the dataDir to $solrHome/zoo_data\n\n# the port at which the clients will connect\n# clientPort=2181\n# NOTE: Solr sets this based on zkRun / zkHost params"
+      },
+      "solr-sh": {
+        "content": "\n#!/bin/bash\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n#This script is a wrapper for calling bin/solr but using custom properties\nSOLR_INCLUDE={{logsearch_solr_conf}}/solr.in.sh {{solr_bindir}}/solr $*"
+      },
+      "logsearch-env": {
+        "logsearch_user": "logsearch",
+        "logsearch_group": "logsearch",
+        "logsearch_pid_dir": "/var/run/ambari-logsearch-portal",
+        "logsearch_log_dir": "/var/log/ambari-logsearch-portal",
+        "logsearch_debug_enabled": "false",
+        "logsearch_debug_port": "5005",
+        "logsearch_solr_audit_logs_use_ranger": "false",
+        "content": "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#solr.url=http://{{solr_host}}:{{solr_port}}/solr\n\n#Service Logs and History colletion\nsolr.zkhosts={{zookeeper_quorum}}{{solr_znode}}\nsolr.core.logs={{logsearch_collection_s
 ervice_logs}}\nsolr.core.history=history\n\nsolr.service_logs.split_interval_mins={{service_logs_collection_splits_interval_mins}}\nsolr.service_logs.shards={{logsearch_numshards}}\nsolr.service_logs.replication_factor={{logsearch_repfactor}}\n\nsolr.servicelogs.fields={{logsearch_service_logs_fields}}\n\n#Audit logs\nauditlog.solr.zkhosts={{solr_audit_logs_zk_quorum}}{{solr_audit_logs_zk_node}}\nauditlog.solr.core.logs={{solr_collection_audit_logs}}\nauditlog.solr.url={{solr_audit_logs_url}}\n\nsolr.audit_logs.split_interval_mins={{audit_logs_collection_splits_interval_mins}}\nsolr.audit_logs.shards={{logsearch_numshards}}\nsolr.audit_logs.replication_factor={{logsearch_repfactor}}"
+      },
+      "logsearch-service_logs-solrconfig": {
+        "content": "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n&lt;!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements.  See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License.  You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n--&gt;\n\n&lt;!-- \n     For more details about configurations options that may appear in\n     this file, see http://wiki.apache.or
 g/solr/SolrConfigXml. \n--&gt;\n&lt;config&gt;\n  &lt;!-- In all configuration below, a prefix of \"solr.\" for class names\n       is an alias that causes solr to search appropriate packages,\n       including org.apache.solr.(search|update|request|core|analysis)\n\n       You may also specify a fully qualified Java classname if you\n       have your own custom plugins.\n    --&gt;\n\n  &lt;!-- Controls what version of Lucene various components of Solr\n       adhere to.  Generally, you want to use the latest version to\n       get all bug fixes and improvements. It is highly recommended\n       that you fully re-index after changing this setting as it can\n       affect both how text is indexed and queried.\n  --&gt;\n  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;\n\n  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars\n       identified and use them to resolve any \"plugins\" specified in\n       your solrconfig.xml or schema.xml (ie: Anal
 yzers, Request\n       Handlers, etc...).\n\n       All directories and paths are resolved relative to the\n       instanceDir.\n\n       Please note that &lt;lib/&gt; directives are processed in the order\n       that they appear in your solrconfig.xml file, and are \"stacked\" \n       on top of each other when building a ClassLoader - so if you have \n       plugin jars with dependencies on other jars, the \"lower level\" \n       dependency jars should be loaded first.\n\n       If a \"./lib\" directory exists in your instanceDir, all files\n       found in it are included as if you had used the following\n       syntax...\n       \n              &lt;lib dir=\"./lib\" /&gt;\n    --&gt;\n\n  &lt;!-- A 'dir' option by itself adds any files found in the directory \n       to the classpath, this is useful for including all jars in a\n       directory.\n\n       When a 'regex' is specified in addition to a 'dir', only the\n       files in that directory which completely match the reg
 ex\n       (anchored on both ends) will be included.\n\n       If a 'dir' option (with or without a regex) is used and nothing\n       is found that matches, a warning will be logged.\n\n       The examples below can be used to load some solr-contribs along \n       with their external dependencies.\n    --&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-dataimporthandler-.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/extraction/lib\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-cell-\\d.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/clustering/lib/\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-clustering-\\d.*\\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/langid/lib/\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-langid-\\d.*
 \\.jar\" /&gt;\n\n  &lt;lib dir=\"${solr.install.dir:../../../..}/contrib/velocity/lib\" regex=\".*\\.jar\" /&gt;\n  &lt;lib dir=\"${solr.install.dir:../../../..}/dist/\" regex=\"solr-velocity-\\d.*\\.jar\" /&gt;\n\n  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a \n       specific jar file.  This will cause a serious error to be logged \n       if it can't be loaded.\n    --&gt;\n  &lt;!--\n     &lt;lib path=\"../a-jar-that-does-not-exist.jar\" /&gt; \n  --&gt;\n  \n  &lt;!-- Data Directory\n\n       Used to specify an alternate directory to hold all index data\n       other than the default ./data under the Solr home.  If\n       replication is in use, this should match the replication\n       configuration.\n    --&gt;\n  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;\n\n\n  &lt;!-- The DirectoryFactory to use for indexes.\n       \n       solr.StandardDirectoryFactory is filesystem\n       based and tries to pick the best implementation for the current\n  
      JVM and platform.  solr.NRTCachingDirectoryFactory, the default,\n       wraps solr.StandardDirectoryFactory and caches small files in memory\n       for better NRT performance.\n\n       One can force a particular implementation via solr.MMapDirectoryFactory,\n       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.\n\n       solr.RAMDirectoryFactory is memory based, not\n       persistent, and doesn't work with replication.\n    --&gt;\n  &lt;directoryFactory name=\"DirectoryFactory\" \n                    class=\"${solr.directoryFactory:solr.NRTCachingDirectoryFactory}\"&gt;\n    \n         \n    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,\n         otherwise they will be ignored. If you don't plan on using hdfs,\n         you can safely remove this section. --&gt;      \n    &lt;!-- The root directory that collection data should be written to. --&gt;     \n    &lt;str name=\"solr.hdfs.home\"&gt;${solr.hdfs.home:}&lt;/str&gt;\n    &
 lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;    \n    &lt;str name=\"solr.hdfs.confdir\"&gt;${solr.hdfs.confdir:}&lt;/str&gt;\n    &lt;!-- Enable/Disable the hdfs cache. --&gt;    \n    &lt;str name=\"solr.hdfs.blockcache.enabled\"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;\n    &lt;!-- Enable/Disable using one global cache for all SolrCores. \n         The settings used will be from the first HdfsDirectoryFactory created. --&gt;    \n    &lt;str name=\"solr.hdfs.blockcache.global\"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;\n    \n  &lt;/directoryFactory&gt; \n\n  &lt;!-- The CodecFactory for defining the format of the inverted index.\n       The default implementation is SchemaCodecFactory, which is the official Lucene\n       index format, but hooks into the schema to provide per-field customization of\n       the postings lists and per-document values in the fieldType element\n       (postingsFormat/docValuesFormat). Note that most of
  the alternative implementations\n       are experimental, so if you choose to customize the index format, it's a good\n       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)\n       before upgrading to a newer version to avoid unnecessary reindexing.\n  --&gt;\n  &lt;codecFactory class=\"solr.SchemaCodecFactory\"/&gt;\n\n  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;\n  \n       &lt;schemaFactory class=\"ManagedIndexSchemaFactory\"&gt;\n         &lt;bool name=\"mutable\"&gt;true&lt;/bool&gt;\n         &lt;str name=\"managedSchemaResourceName\"&gt;managed-schema&lt;/str&gt;\n       &lt;/schemaFactory&gt;\n&lt;!--       \n       When ManagedIndexSchemaFactory is specified, Solr will load the schema from\n       the resource named in 'managedSchemaResourceName', rather than from schema.xml.\n       Note that the managed schema resource CANNOT be named schema.xml.  If the managed\n       schema 
 does not exist, Solr will create it after reading schema.xml, then rename\n       'schema.xml' to 'schema.xml.bak'. \n       \n       Do NOT hand edit the managed schema - external modifications will be ignored and\n       overwritten as a result of schema modification REST API calls.\n\n       When ManagedIndexSchemaFactory is specified with mutable = true, schema\n       modification REST API calls will be allowed; otherwise, error responses will be\n       sent back for these requests. \n\n  &lt;schemaFactory class=\"ClassicIndexSchemaFactory\"/&gt;\n  --&gt;\n\n  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n       Index Config - These settings control low-level behavior of indexing\n       Most example settings here show the default value, but are commented\n       out, to more easily see where customizations have been made.\n       \n       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions\n       ~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;\n  &lt;indexConfig&gt;\n    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a \n         LimitTokenCountFilterFactory in your fieldType definition. E.g. \n     &lt;filter class=\"solr.LimitTokenCountFilterFactory\" maxTokenCount=\"10000\"/&gt;\n    --&gt;\n    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;\n    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;\n    &lt;!-- LogSearch customization to avoid timeouts --&gt;\n    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;\n\n    &lt;!-- The maximum number of simultaneous threads that may be\n         indexing documents at once in IndexWriter; if more than this\n         many threads arrive they will wait for others to finish.\n         Default in Solr/Lucene is 8. --&gt;\n    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;\n    &lt;!-- LogSearch cu
 stomization of increase performance --&gt;\n    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;\n\n    &lt;!-- Expert: Enabling compound file will use less files for the index, \n         using fewer file descriptors on the expense of performance decrease. \n         Default in Lucene is \"true\". Default in Solr is \"false\" (since 3.6) --&gt;\n    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;\n\n    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene\n         indexing for buffering added documents and deletions before they are\n         flushed to the Directory.\n         maxBufferedDocs sets a limit on the number of documents buffered\n         before flushing.\n         If both ramBufferSizeMB and maxBufferedDocs is set, then\n         Lucene will flush based on whichever limit is hit first.\n         The default is 100 MB.  --&gt;\n    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;\n    &lt;!-- &lt;maxBuffe
 redDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;\n\n    &lt;!-- Expert: Merge Policy \n         The Merge Policy in Lucene controls how merging of segments is done.\n         The default since Solr/Lucene 3.3 is TieredMergePolicy.\n         The default since Lucene 2.3 was the LogByteSizeMergePolicy,\n         Even older versions of Lucene used LogDocMergePolicy.\n      --&gt;\n    &lt;!--\n        &lt;mergePolicy class=\"org.apache.lucene.index.TieredMergePolicy\"&gt;\n          &lt;int name=\"maxMergeAtOnce\"&gt;10&lt;/int&gt;\n          &lt;int name=\"segmentsPerTier\"&gt;10&lt;/int&gt;\n        &lt;/mergePolicy&gt;\n      --&gt;\n       \n    &lt;!-- Merge Factor\n         The merge factor controls how many segments will get merged at a time.\n         For TieredMergePolicy, mergeFactor is a convenience parameter which\n         will set both MaxMergeAtOnce and SegmentsPerTier at once.\n         For LogByteSizeMergePolicy, mergeFactor decides how many new segments\n         will b
 e allowed before they are merged into one.\n         Default is 10 for both merge policies.\n      --&gt;\n    &lt;!-- \n    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;\n      --&gt;\n    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;\n    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;\n\n    &lt;!-- Expert: Merge Scheduler\n         The Merge Scheduler in Lucene controls how merges are\n         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)\n         can perform merges in the background using separate threads.\n         The SerialMergeScheduler (Lucene 2.2 default) does not.\n     --&gt;\n    &lt;!-- \n       &lt;mergeScheduler class=\"org.apache.lucene.index.ConcurrentMergeScheduler\"/&gt;\n       --&gt;\n\n    &lt;!-- LockFactory \n\n         This option specifies which Lucene LockFactory implementation\n         to use.\n      \n         single = SingleInstanceLockFactory - suggested for a\n                  read-only index or when th
 ere is no possibility of\n                  another process trying to modify the index.\n         native = NativeFSLockFactory - uses OS native file locking.\n                  Do not use when multiple solr webapps in the same\n                  JVM are attempting to share a single index.\n         simple = SimpleFSLockFactory  - uses a plain file for locking\n\n         Defaults: 'native' is default for Solr3.6 and later, otherwise\n                   'simple' is the default\n\n         More details on the nuances of each LockFactory...\n         http://wiki.apache.org/lucene-java/AvailableLockFactories\n    --&gt;\n    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;\n\n    &lt;!-- Unlock On Startup\n\n         If true, unlock any held write or commit locks on startup.\n         This defeats the locking mechanism that allows multiple\n         processes to safely access a lucene index, and should be used\n         with care. Default is \"false\".\n\n         This is not n
 eeded if lock type is 'single'\n     --&gt;\n    &lt;!--\n    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;\n      --&gt;\n\n    &lt;!-- Commit Deletion Policy\n         Custom deletion policies can be specified here. The class must\n         implement org.apache.lucene.index.IndexDeletionPolicy.\n\n         The default Solr IndexDeletionPolicy implementation supports\n         deleting index commit points on number of commits, age of\n         commit point and optimized status.\n         \n         The latest commit point should always be preserved regardless\n         of the criteria.\n    --&gt;\n    &lt;!-- \n    &lt;deletionPolicy class=\"solr.SolrDeletionPolicy\"&gt;\n    --&gt;\n      &lt;!-- The number of commit points to be kept --&gt;\n      &lt;!-- &lt;str name=\"maxCommitsToKeep\"&gt;1&lt;/str&gt; --&gt;\n      &lt;!-- The number of optimized commit points to be kept --&gt;\n      &lt;!-- &lt;str name=\"maxOptimizedCommitsToKeep\"&gt;0&lt;/str&gt; --&gt;\n      &l
 t;!--\n          Delete all commit points once they have reached the given age.\n          Supports DateMathParser syntax e.g.\n        --&gt;\n      &lt;!--\n         &lt;str name=\"maxCommitAge\"&gt;30MINUTES&lt;/str&gt;\n         &lt;str name=\"maxCommitAge\"&gt;1DAY&lt;/str&gt;\n      --&gt;\n    &lt;!-- \n    &lt;/deletionPolicy&gt;\n    --&gt;\n\n    &lt;!-- Lucene Infostream\n       \n         To aid in advanced debugging, Lucene provides an \"InfoStream\"\n         of detailed information when indexing.\n\n         Setting the value to true will instruct the underlying Lucene\n         IndexWriter to write its info stream to solr's log. By default,\n         this is enabled here, and controlled through log4j.properties.\n      --&gt;\n     &lt;infoStream&gt;true&lt;/infoStream&gt;\n  &lt;/indexConfig&gt;\n\n\n  &lt;!-- JMX\n       \n       This example enables JMX if and only if an existing MBeanServer\n       is found, use this if you want to configure JMX through JVM\n    
    parameters. Remove this to disable exposing Solr configuration\n       and statistics to JMX.\n\n       For more details see http://wiki.apache.org/solr/SolrJmx\n    --&gt;\n  &lt;jmx /&gt;\n  &lt;!-- If you want to connect to a particular server, specify the\n       agentId \n    --&gt;\n  &lt;!-- &lt;jmx agentId=\"myAgent\" /&gt; --&gt;\n  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;\n  &lt;!-- &lt;jmx serviceUrl=\"service:jmx:rmi:///jndi/rmi://localhost:9999/solr\"/&gt;\n    --&gt;\n\n  &lt;!-- The default high-performance update handler --&gt;\n  &lt;updateHandler class=\"solr.DirectUpdateHandler2\"&gt;\n\n    &lt;!-- Enables a transaction log, used for real-time get, durability, and\n         and solr cloud replica recovery.  The log can grow as big as\n         uncommitted changes to the index, so use of a hard autoCommit\n         is recommended (see below).\n         \"dir\" - the target directory for transaction logs, defaults to the\n   
              solr data directory.  --&gt; \n    &lt;updateLog&gt;\n      &lt;str name=\"dir\"&gt;${solr.ulog.dir:}&lt;/str&gt;\n    &lt;/updateLog&gt;\n \n    &lt;!-- AutoCommit\n\n         Perform a hard commit automatically under certain conditions.\n         Instead of enabling autoCommit, consider using \"commitWithin\"\n         when adding documents. \n\n         http://wiki.apache.org/solr/UpdateXmlMessages\n\n         maxDocs - Maximum number of documents to add since the last\n                   commit before automatically triggering a new commit.\n\n         maxTime - Maximum amount of time in ms that is allowed to pass\n                   since a document was added before automatically\n                   triggering a new commit. \n         openSearcher - if false, the commit causes recent index changes\n           to be flushed to stable storage, but does not cause a new\n           searcher to be opened to make those changes visible.\n\n         If the updateLog is enab
 led, then it's highly recommended to\n         have some sort of hard autoCommit to limit the log size.\n      --&gt;\n     &lt;autoCommit&gt; \n       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt; \n       &lt;openSearcher&gt;false&lt;/openSearcher&gt; \n     &lt;/autoCommit&gt;\n\n    &lt;!-- softAutoCommit is like autoCommit except it causes a\n         'soft' commit which only ensures that changes are visible\n         but does not ensure that data is synced to disk.  This is\n         faster and more near-realtime friendly than a hard commit.\n      --&gt;\n\n     &lt;autoSoftCommit&gt; \n       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt; \n     &lt;/autoSoftCommit&gt;\n\n    &lt;!-- Update Related Event Listeners\n         \n         Various IndexWriter related events can trigger Listeners to\n         take actions.\n\n         postCommit - fired after every commit or optimize command\n         postOptimize - fired after every optimize 
 command\n      --&gt;\n    &lt;!-- The RunExecutableListener executes an external command from a\n         hook such as postCommit or postOptimize.\n         \n         exe - the name of the executable to run\n         dir - dir to use as the current working directory. (default=\".\")\n         wait - the calling thread waits until the executable returns. \n                (default=\"true\")\n         args - the arguments to pass to the program.  (default is none)\n         env - environment variables to set.  (default is none)\n      --&gt;\n    &lt;!-- This example shows how RunExecutableListener could be used\n         with the script based replication...\n         http://wiki.apache.org/solr/CollectionDistribution\n      --&gt;\n    &lt;!--\n       &lt;listener event=\"postCommit\" class=\"solr.RunExecutableListener\"&gt;\n         &lt;str name=\"exe\"&gt;solr/bin/snapshooter&lt;/str&gt;\n         &lt;str name=\"dir\"&gt;.&lt;/str&gt;\n         &lt;bool name=\"wait\"&gt;true&lt;
 /bool&gt;\n         &lt;arr name=\"args\"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;\n         &lt;arr name=\"env\"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;\n       &lt;/listener&gt;\n      --&gt;\n\n  &lt;/updateHandler&gt;\n  \n  &lt;!-- IndexReaderFactory\n\n       Use the following format to specify a custom IndexReaderFactory,\n       which allows for alternate IndexReader implementations.\n\n       ** Experimental Feature **\n\n       Please note - Using a custom IndexReaderFactory may prevent\n       certain other features from working. The API to\n       IndexReaderFactory may change without warning or may even be\n       removed from future releases if the problems cannot be\n       resolved.\n\n\n       ** Features that may not work with custom IndexReaderFactory **\n\n       The ReplicationHandler assumes a disk-resident index. Using a\n       custom IndexReader implementation may cause incompatibility\n       with ReplicationHandle
 r and may cause replication to not work\n       correctly. See SOLR-1366 for details.\n\n    --&gt;\n  &lt;!--\n  &lt;indexReaderFactory name=\"IndexReaderFactory\" class=\"package.class\"&gt;\n    &lt;str name=\"someArg\"&gt;Some Value&lt;/str&gt;\n  &lt;/indexReaderFactory &gt;\n  --&gt;\n\n  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n       Query section - these settings control query time things like caches\n       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;\n  &lt;query&gt;\n    &lt;!-- Max Boolean Clauses\n\n         Maximum number of clauses in each BooleanQuery,  an exception\n         is thrown if exceeded.\n\n         ** WARNING **\n         \n         This option actually modifies a global Lucene property that\n         will affect all SolrCores.  If multiple solrconfig.xml files\n         disagree on this property, the value at any given moment will\n         be based on the last SolrCore to be initiali
 zed.\n         \n      --&gt;\n    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;\n\n\n    &lt;!-- Solr Internal Query Caches\n\n         There are two implementations of cache available for Solr,\n         LRUCache, based on a synchronized LinkedHashMap, and\n         FastLRUCache, based on a ConcurrentHashMap.  \n\n         FastLRUCache has faster gets and slower puts in single\n         threaded operation and thus is generally faster than LRUCache\n         when the hit ratio of the cache is high (&gt; 75%), and may be\n         faster under other scenarios on multi-cpu systems.\n    --&gt;\n\n    &lt;!-- Filter Cache\n\n         Cache used by SolrIndexSearcher for filters (DocSets),\n         unordered sets of *all* documents that match a query.  When a\n         new searcher is opened, its caches may be prepopulated or\n         \"autowarmed\" using data from caches in the old searcher.\n         autowarmCount is the number of items to prepopulate.  For\n         LRUCa
 che, the autowarmed items will be the most recently\n         accessed items.\n\n         Parameters:\n           class - the SolrCache implementation LRUCache or\n               (LRUCache or FastLRUCache)\n           size - the maximum number of entries in the cache\n           initialSize - the initial capacity (number of entries) of\n               the cache.  (see java.util.HashMap)\n           autowarmCount - the number of entries to prepopulate from\n               and old cache.  \n      --&gt;\n    &lt;filterCache class=\"solr.FastLRUCache\"\n                 size=\"512\"\n                 initialSize=\"512\"\n                 autowarmCount=\"0\"/&gt;\n\n    &lt;!-- Query Result Cache\n         \n         Caches results of searches - ordered lists of document ids\n         (DocList) based on a query, a sort, and the range of documents requested.  \n      --&gt;\n    &lt;queryResultCache class=\"solr.LRUCache\"\n                     size=\"512\"\n                     initialS
 ize=\"512\"\n                     autowarmCount=\"0\"/&gt;\n   \n    &lt;!-- Document Cache\n\n         Caches Lucene Document objects (the stored fields for each\n         document).  Since Lucene internal document ids are transient,\n         this cache will not be autowarmed.  \n      --&gt;\n    &lt;documentCache class=\"solr.LRUCache\"\n                   size=\"512\"\n                   initialSize=\"512\"\n                   autowarmCount=\"0\"/&gt;\n    \n    &lt;!-- custom cache currently used by block join --&gt; \n    &lt;cache name=\"perSegFilter\"\n      class=\"solr.search.LRUCache\"\n      size=\"10\"\n      initialSize=\"0\"\n      autowarmCount=\"10\"\n      regenerator=\"solr.NoOpRegenerator\" /&gt;\n\n    &lt;!-- Field Value Cache\n         \n         Cache used to hold field values that are quickly accessible\n         by document id.  The fieldValueCache is created by default\n         even if not configured here.\n      --&gt;\n    &lt;!--\n       &lt;fieldValu
 eCache class=\"solr.FastLRUCache\"\n                        size=\"512\"\n                        autowarmCount=\"128\"\n                        showItems=\"32\" /&gt;\n      --&gt;\n\n    &lt;!-- Custom Cache\n\n         Example of a generic cache.  These caches may be accessed by\n         name through SolrIndexSearcher.getCache(),cacheLookup(), and\n         cacheInsert().  The purpose is to enable easy caching of\n         user/application level data.  The regenerator argument should\n         be specified as an implementation of solr.CacheRegenerator \n         if autowarming is desired.  \n      --&gt;\n    &lt;!--\n       &lt;cache name=\"myUserCache\"\n              class=\"solr.LRUCache\"\n              size=\"4096\"\n              initialSize=\"1024\"\n              autowarmCount=\"1024\"\n              regenerator=\"com.mycompany.MyRegenerator\"\n              /&gt;\n      --&gt;\n\n\n    &lt;!-- Lazy Field Loading\n\n         If true, stored fields that are not requested
  will be loaded\n         lazily.  This can result in a significant speed improvement\n         if the usual case is to not load all stored fields,\n         especially if the skipped fields are large compressed text\n         fields.\n    --&gt;\n    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;\n\n   &lt;!-- Use Filter For Sorted Query\n\n        A possible optimization that attempts to use a filter to\n        satisfy a search.  If the requested sort does not include\n        score, then the filterCache will be checked for a filter\n        matching the query. If found, the filter will be used as the\n        source of document ids, and then the sort will be applied to\n        that.\n\n        For most situations, this will not be useful unless you\n        frequently get the same search repeatedly with different sort\n        options, and none of them ever use \"score\"\n     --&gt;\n   &lt;!--\n      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSorte
 dQuery&gt;\n     --&gt;\n\n   &lt;!-- Result Window Size\n\n        An optimization for use with the queryResultCache.  When a search\n        is requested, a superset of the requested number of document ids\n        are collected.  For example, if a search for a particular query\n        requests matching documents 10 through 19, and queryWindowSize is 50,\n        then documents 0 through 49 will be collected and cached.  Any further\n        requests in that range can be satisfied via the cache.  \n     --&gt;\n   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;\n\n   &lt;!-- Maximum number of documents to cache for any entry in the\n        queryResultCache. \n     --&gt;\n   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;\n\n   &lt;!-- Query Related Event Listeners\n\n        Various IndexSearcher related events can trigger Listeners to\n        take actions.\n\n        newSearcher - fired whenever a new searcher is being prepared\n        and 
 there is a current searcher handling requests (aka\n        registered).  It can be used to prime certain caches to\n        prevent long request times for certain requests.\n\n        firstSearcher - fired whenever a new searcher is being\n        prepared but there is no current registered searcher to handle\n        requests or to gain autowarming data from.\n\n        \n     --&gt;\n    &lt;!-- QuerySenderListener takes an array of NamedList and executes a\n         local query request for each NamedList in sequence. \n      --&gt;\n    &lt;listener event=\"newSearcher\" class=\"solr.QuerySenderListener\"&gt;\n      &lt;arr name=\"queries\"&gt;\n        &lt;!--\n           &lt;lst&gt;&lt;str name=\"q\"&gt;solr&lt;/str&gt;&lt;str name=\"sort\"&gt;price asc&lt;/str&gt;&lt;/lst&gt;\n           &lt;lst&gt;&lt;str name=\"q\"&gt;rocks&lt;/str&gt;&lt;str name=\"sort\"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;\n          --&gt;\n      &lt;/arr&gt;\n    &lt;/listener&gt;\n    &lt;listener ev
 ent=\"firstSearcher\" class=\"solr.QuerySenderListener\"&gt;\n      &lt;arr name=\"queries\"&gt;\n        &lt;lst&gt;\n          &lt;str name=\"q\"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;\n        &lt;/lst&gt;\n      &lt;/arr&gt;\n    &lt;/listener&gt;\n\n    &lt;!-- Use Cold Searcher\n\n         If a search request comes in and there is no current\n         registered searcher, then immediately register the still\n         warming searcher and use it.  If \"false\" then all requests\n         will block until the first searcher is done warming.\n      --&gt;\n    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;\n\n    &lt;!-- Max Warming Searchers\n         \n         Maximum number of searchers that may be warming in the\n         background concurrently.  An error is returned if this limit\n         is exceeded.\n\n         Recommend values of 1-2 for read-only slaves, higher for\n         masters w/o cache warming.\n      --&gt;\n    &lt;maxWarmingSearc
 hers&gt;2&lt;/maxWarmingSearchers&gt;\n\n  &lt;/query&gt;\n\n\n  &lt;!-- Request Dispatcher\n\n       This section contains instructions for how the SolrDispatchFilter\n       should behave when processing requests for this SolrCore.\n\n       handleSelect is a legacy option that affects the behavior of requests\n       such as /select?qt=XXX\n\n       handleSelect=\"true\" will cause the SolrDispatchFilter to process\n       the request and dispatch the query to a handler specified by the \n       \"qt\" param, assuming \"/select\" isn't already registered.\n\n       handleSelect=\"false\" will cause the SolrDispatchFilter to\n       ignore \"/select\" requests, resulting in a 404 unless a handler\n       is explicitly registered with the name \"/select\"\n\n       handleSelect=\"true\" is not recommended for new users, but is the default\n       for backwards compatibility\n    --&gt;\n  &lt;requestDispatcher handleSelect=\"false\" &gt;\n    &lt;!-- Request Parsing\n\n         The
 se settings indicate how Solr Requests may be parsed, and\n         what restrictions may be placed on the ContentStreams from\n         those requests\n\n         enableRemoteStreaming - enables use of the stream.file\n         and stream.url parameters for specifying remote streams.\n\n         multipartUploadLimitInKB - specifies the max size (in KiB) of\n         Multipart File Uploads that Solr will allow in a Request.\n         \n         formdataUploadLimitInKB - specifies the max size (in KiB) of\n         form data (application/x-www-form-urlencoded) sent via\n         POST. You can use POST to pass request parameters not\n         fitting into the URL.\n         \n         addHttpRequestToContext - if set to true, it will instruct\n         the requestParsers to include the original HttpServletRequest\n         object in the context map of the SolrQueryRequest under the \n         key \"httpRequest\". It will not be used by any of the existing\n         Solr components, bu
 t may be useful when developing custom \n         plugins.\n         \n         *** WARNING ***\n         The settings below authorize Solr to fetch remote files, You\n         should make sure your system has some authentication before\n         using enableRemoteStreaming=\"true\"\n\n      --&gt; \n    &lt;requestParsers enableRemoteStreaming=\"true\" \n                    multipartUploadLimitInKB=\"2048000\"\n                    formdataUploadLimitInKB=\"2048\"\n                    addHttpRequestToContext=\"false\"/&gt;\n\n    &lt;!-- HTTP Caching\n\n         Set HTTP caching related parameters (for proxy caches and clients).\n\n         The options below instruct Solr not to output any HTTP Caching\n         related headers\n      --&gt;\n    &lt;httpCaching never304=\"true\" /&gt;\n    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to\n         generate a Cache-Control header (as well as an Expires header\n         if the value contains \"max-age=\")\n
          \n         By default, no Cache-Control header is generated.\n         \n         You can use the &lt;cacheControl&gt; option even if you have set\n         never304=\"true\"\n      --&gt;\n    &lt;!--\n       &lt;httpCaching never304=\"true\" &gt;\n         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; \n       &lt;/httpCaching&gt;\n      --&gt;\n    &lt;!-- To enable Solr to respond with automatically generated HTTP\n         Caching headers, and to response to Cache Validation requests\n         correctly, set the value of never304=\"false\"\n         \n         This will cause Solr to generate Last-Modified and ETag\n         headers based on the properties of the Index.\n\n         The following options can also be specified to affect the\n         values of these headers...\n\n         lastModFrom - the default value is \"openTime\" which means the\n         Last-Modified value (and validation against If-Modified-Since\n         requests) will all be rel
 ative to when the current Searcher\n         was opened.  You can change it to lastModFrom=\"dirLastMod\" if\n         you want the value to exactly correspond to when the physical\n         index was last modified.\n\n         etagSeed=\"...\" is an option you can change to force the ETag\n         header (and validation against If-None-Match requests) to be\n         different even if the index has not changed (ie: when making\n         significant changes to your config file)\n\n         (lastModifiedFrom and etagSeed are both ignored if you use\n         the never304=\"true\" option)\n      --&gt;\n    &lt;!--\n       &lt;httpCaching lastModifiedFrom=\"openTime\"\n                    etagSeed=\"Solr\"&gt;\n         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; \n       &lt;/httpCaching&gt;\n      --&gt;\n  &lt;/requestDispatcher&gt;\n\n  &lt;!-- Request Handlers \n\n       http://wiki.apache.org/solr/SolrRequestHandler\n\n       Incoming queries will be dispatched 
 to a specific handler by name\n       based on the path specified in the request.\n\n       Legacy behavior: If the request path uses \"/select\" but no Request\n       Handler has that name, and if handleSelect=\"true\" has been specified in\n       the requestDispatcher, then the Request Handler is dispatched based on\n       the qt parameter.  Handlers without a leading '/' are accessed this way\n       like so: http://host/app/[core/]select?qt=name  If no qt is\n       given, then the requestHandler that declares default=\"true\" will be\n       used or the one named \"standard\".\n\n       If a Request Handler is declared with startup=\"lazy\", then it will\n       not be initialized until the first request that uses it.\n\n    --&gt;\n\n  &lt;requestHandler name=\"/dataimport\" class=\"solr.DataImportHandler\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"config\"&gt;solr-data-config.xml&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Searc
 hHandler\n\n       http://wiki.apache.org/solr/SearchHandler\n\n       For processing Search Queries, the primary Request Handler\n       provided with Solr is \"SearchHandler\" It delegates to a sequent\n       of SearchComponents (see below) and supports distributed\n       queries across multiple shards\n    --&gt;\n  &lt;requestHandler name=\"/select\" class=\"solr.SearchHandler\"&gt;\n    &lt;!-- default values for query parameters can be specified, these\n         will be overridden by parameters in the request\n      --&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n       &lt;int name=\"rows\"&gt;10&lt;/int&gt;\n       &lt;str name=\"df\"&gt;text&lt;/str&gt;\n     &lt;/lst&gt;\n    &lt;!-- In addition to defaults, \"appends\" params can be specified\n         to identify values which should be appended to the list of\n         multi-val params from the query (or the existing \"defaults\").\n      --&gt;\n    &lt;!-- In th
 is example, the param \"fq=instock:true\" would be appended to\n         any query time fq params the user may specify, as a mechanism for\n         partitioning the index, independent of any user selected filtering\n         that may also be desired (perhaps as a result of faceted searching).\n\n         NOTE: there is *absolutely* nothing a client can do to prevent these\n         \"appends\" values from being used, so don't use this mechanism\n         unless you are sure you always want it.\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"appends\"&gt;\n         &lt;str name=\"fq\"&gt;inStock:true&lt;/str&gt;\n       &lt;/lst&gt;\n      --&gt;\n    &lt;!-- \"invariants\" are a way of letting the Solr maintainer lock down\n         the options available to Solr clients.  Any params values\n         specified here are used regardless of what values may be specified\n         in either the query, the \"defaults\", or the \"appends\" params.\n\n         In this example, the facet.f
 ield and facet.query params would\n         be fixed, limiting the facets clients can use.  Faceting is\n         not turned on by default - but if the client does specify\n         facet=true in the request, these are the only facets they\n         will be able to see counts for; regardless of what other\n         facet.field or facet.query params they may specify.\n\n         NOTE: there is *absolutely* nothing a client can do to prevent these\n         \"invariants\" values from being used, so don't use this mechanism\n         unless you are sure you always want it.\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"invariants\"&gt;\n         &lt;str name=\"facet.field\"&gt;cat&lt;/str&gt;\n         &lt;str name=\"facet.field\"&gt;manu_exact&lt;/str&gt;\n         &lt;str name=\"facet.query\"&gt;price:[* TO 500]&lt;/str&gt;\n         &lt;str name=\"facet.query\"&gt;price:[500 TO *]&lt;/str&gt;\n       &lt;/lst&gt;\n      --&gt;\n    &lt;!-- If the default list of SearchComponents 
 is not desired, that\n         list can either be overridden completely, or components can be\n         prepended or appended to the default list.  (see below)\n      --&gt;\n    &lt;!--\n       &lt;arr name=\"components\"&gt;\n         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;\n         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;\n       &lt;/arr&gt;\n      --&gt;\n    &lt;/requestHandler&gt;\n\n  &lt;!-- A request handler that returns indented JSON by default --&gt;\n  &lt;requestHandler name=\"/query\" class=\"solr.SearchHandler\"&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n       &lt;str name=\"wt\"&gt;json&lt;/str&gt;\n       &lt;str name=\"indent\"&gt;true&lt;/str&gt;\n       &lt;str name=\"df\"&gt;text&lt;/str&gt;\n     &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of\n       any document, without the need to commit or open a new searcher
 .  The\n       current implementation relies on the updateLog feature being enabled.\n\n       ** WARNING **\n       Do NOT disable the realtime get handler at /get if you are using\n       SolrCloud otherwise any leader election will cause a full sync in ALL\n       replicas for the shard in question. Similarly, a replica recovery will\n       also always fetch the complete index from the leader because a partial\n       sync will not be possible in the absence of this handler.\n  --&gt;\n  &lt;requestHandler name=\"/get\" class=\"solr.RealTimeGetHandler\"&gt;\n     &lt;lst name=\"defaults\"&gt;\n       &lt;str name=\"omitHeader\"&gt;true&lt;/str&gt;\n       &lt;str name=\"wt\"&gt;json&lt;/str&gt;\n       &lt;str name=\"indent\"&gt;true&lt;/str&gt;\n     &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- A Robust Example\n\n       This example SearchHandler declaration shows off usage of the\n       SearchHandler with many defaults declared\n\n       Note that multiple instance
 s of the same Request Handler\n       (SearchHandler) can be registered multiple times with different\n       names (and different init parameters)\n    --&gt;\n  &lt;requestHandler name=\"/browse\" class=\"solr.SearchHandler\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt;\n\n      &lt;!-- VelocityResponseWriter settings --&gt;\n      &lt;str name=\"wt\"&gt;velocity&lt;/str&gt;\n      &lt;str name=\"v.template\"&gt;browse&lt;/str&gt;\n      &lt;str name=\"v.layout\"&gt;layout&lt;/str&gt;\n\n      &lt;!-- Query settings --&gt;\n      &lt;str name=\"defType\"&gt;edismax&lt;/str&gt;\n      &lt;str name=\"q.alt\"&gt;*:*&lt;/str&gt;\n      &lt;str name=\"rows\"&gt;10&lt;/str&gt;\n      &lt;str name=\"fl\"&gt;*,score&lt;/str&gt;\n\n      &lt;!-- Faceting defaults --&gt;\n      &lt;str name=\"facet\"&gt;on&lt;/str&gt;\n      &lt;str name=\"facet.mincount\"&gt;1&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;initParams
  path=\"/update/**,/query,/select,/tvrh,/elevate,/spell,/browse\"&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"df\"&gt;text&lt;/str&gt;\n      &lt;str name=\"update.chain\"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/initParams&gt;\n\n  &lt;!-- Update Request Handler.\n       \n       http://wiki.apache.org/solr/UpdateXmlMessages\n\n       The canonical Request Handler for Modifying the Index through\n       commands specified using XML, JSON, CSV, or JAVABIN\n\n       Note: Since solr1.1 requestHandlers requires a valid content\n       type header if posted in the body. For example, curl now\n       requires: -H 'Content-type:text/xml; charset=utf-8'\n       \n       To override the request content type and force a specific \n       Content-type, use the request parameter: \n         ?update.contentType=text/csv\n       \n       This handler will pick a response format to match the input\n       if the 'wt' parameter is not explicit\n  
   --&gt;\n  &lt;requestHandler name=\"/update\" class=\"solr.UpdateRequestHandler\"&gt;\n    &lt;!-- See below for information on defining \n         updateRequestProcessorChains that can be used by name \n         on each Update Request\n      --&gt;\n    &lt;!--\n       &lt;lst name=\"defaults\"&gt;\n         &lt;str name=\"update.chain\"&gt;dedupe&lt;/str&gt;\n       &lt;/lst&gt;\n       --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Solr Cell Update Request Handler\n\n       http://wiki.apache.org/solr/ExtractingRequestHandler \n\n    --&gt;\n  &lt;requestHandler name=\"/update/extract\" \n                  startup=\"lazy\"\n                  class=\"solr.extraction.ExtractingRequestHandler\" &gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"lowernames\"&gt;true&lt;/str&gt;\n      &lt;str name=\"uprefix\"&gt;ignored_&lt;/str&gt;\n\n      &lt;!-- capture link hrefs but ignore div attributes --&gt;\n      &lt;str name=\"captureAttr\"&gt;true&lt;/str&gt;\n      &lt;str 
 name=\"fmap.a\"&gt;links&lt;/str&gt;\n      &lt;str name=\"fmap.div\"&gt;ignored_&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n\n\n  &lt;!-- Field Analysis Request Handler\n\n       RequestHandler that provides much the same functionality as\n       analysis.jsp. Provides the ability to specify multiple field\n       types and field names in the same request and outputs\n       index-time and query-time analysis for each of them.\n\n       Request parameters are:\n       analysis.fieldname - field name whose analyzers are to be used\n\n       analysis.fieldtype - field type whose analyzers are to be used\n       analysis.fieldvalue - text for index-time analysis\n       q (or analysis.q) - text for query time analysis\n       analysis.showmatch (true|false) - When set to true and when\n           query analysis is performed, the produced tokens of the\n           field value analysis will be marked as \"matched\" for every\n           token that is produces by the query
  analysis\n   --&gt;\n  &lt;requestHandler name=\"/analysis/field\" \n                  startup=\"lazy\"\n                  class=\"solr.FieldAnalysisRequestHandler\" /&gt;\n\n\n  &lt;!-- Document Analysis Handler\n\n       http://wiki.apache.org/solr/AnalysisRequestHandler\n\n       An analysis handler that provides a breakdown of the analysis\n       process of provided documents. This handler expects a (single)\n       content stream with the following format:\n\n       &lt;docs&gt;\n         &lt;doc&gt;\n           &lt;field name=\"id\"&gt;1&lt;/field&gt;\n           &lt;field name=\"name\"&gt;The Name&lt;/field&gt;\n           &lt;field name=\"text\"&gt;The Text Value&lt;/field&gt;\n         &lt;/doc&gt;\n         &lt;doc&gt;...&lt;/doc&gt;\n         &lt;doc&gt;...&lt;/doc&gt;\n         ...\n       &lt;/docs&gt;\n\n    Note: Each document must contain a field which serves as the\n    unique key. This key is used in the returned response to associate\n    an analysis breakdown t
 o the analyzed document.\n\n    Like the FieldAnalysisRequestHandler, this handler also supports\n    query analysis by sending either an \"analysis.query\" or \"q\"\n    request parameter that holds the query text to be analyzed. It\n    also supports the \"analysis.showmatch\" parameter which when set to\n    true, all field tokens that match the query tokens will be marked\n    as a \"match\". \n  --&gt;\n  &lt;requestHandler name=\"/analysis/document\" \n                  class=\"solr.DocumentAnalysisRequestHandler\" \n                  startup=\"lazy\" /&gt;\n\n  &lt;!-- Admin Handlers\n\n       Admin Handlers - This will register all the standard admin\n       RequestHandlers.  \n    --&gt;\n  &lt;requestHandler name=\"/admin/\" \n                  class=\"solr.admin.AdminHandlers\" /&gt;\n  &lt;!-- This single handler is equivalent to the following... --&gt;\n  &lt;!--\n     &lt;requestHandler name=\"/admin/luke\"       class=\"solr.admin.LukeRequestHandler\" /&gt;\n     &lt;
 requestHandler name=\"/admin/system\"     class=\"solr.admin.SystemInfoHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/plugins\"    class=\"solr.admin.PluginInfoHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/threads\"    class=\"solr.admin.ThreadDumpHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/properties\" class=\"solr.admin.PropertiesRequestHandler\" /&gt;\n     &lt;requestHandler name=\"/admin/file\"       class=\"solr.admin.ShowFileRequestHandler\" &gt;\n    --&gt;\n  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly\n       register the ShowFileRequestHandler using the definition below. \n       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will\n             not exclude all files ending in '.xml'. Use it to exclude _all_ updates\n    --&gt;\n  &lt;!--\n     &lt;requestHandler name=\"/admin/file\" \n                     class=\"solr.admin.ShowFileRequestHandler\" &gt;\n       &lt;lst name=\"invariants\"&
 gt;\n         &lt;str name=\"hidden\"&gt;synonyms.txt&lt;/str&gt; \n         &lt;str name=\"hidden\"&gt;anotherfile.txt&lt;/str&gt; \n         &lt;str name=\"hidden\"&gt;*&lt;/str&gt; \n       &lt;/lst&gt;\n     &lt;/requestHandler&gt;\n    --&gt;\n\n  &lt;!--\n    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit\n    all the config files. This is intended for secure/development use ONLY! Leaving available and publically\n    accessible is a security vulnerability and should be done with extreme caution!\n  --&gt;\n  &lt;!--\n  &lt;requestHandler name=\"/admin/fileedit\" class=\"solr.admin.EditFileRequestHandler\" &gt;\n    &lt;lst name=\"invariants\"&gt;\n         &lt;str name=\"hidden\"&gt;synonyms.txt&lt;/str&gt;\n         &lt;str name=\"hidden\"&gt;anotherfile.txt&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n  --&gt;\n  &lt;!-- ping/healthcheck --&gt;\n  &lt;requestHandler name=\"/admin/ping\" class=\"so
 lr.PingRequestHandler\"&gt;\n    &lt;lst name=\"invariants\"&gt;\n      &lt;str name=\"q\"&gt;solrpingquery&lt;/str&gt;\n    &lt;/lst&gt;\n    &lt;lst name=\"defaults\"&gt;\n      &lt;str name=\"echoParams\"&gt;all&lt;/str&gt;\n    &lt;/lst&gt;\n    &lt;!-- An optional feature of the PingRequestHandler is to configure the \n         handler with a \"healthcheckFile\" which can be used to enable/disable \n         the PingRequestHandler.\n         relative paths are resolved against the data dir \n      --&gt;\n    &lt;!-- &lt;str name=\"healthcheckFile\"&gt;server-enabled.txt&lt;/str&gt; --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Echo the request contents back to the client --&gt;\n  &lt;requestHandler name=\"/debug/dump\" class=\"solr.DumpRequestHandler\" &gt;\n    &lt;lst name=\"defaults\"&gt;\n     &lt;str name=\"echoParams\"&gt;explicit&lt;/str&gt; \n     &lt;str name=\"echoHandler\"&gt;true&lt;/str&gt;\n    &lt;/lst&gt;\n  &lt;/requestHandler&gt;\n  \n  &lt;!-- Solr Replica
 tion\n\n       The SolrReplicationHandler supports replicating indexes from a\n       \"master\" used for indexing and \"slaves\" used for queries.\n\n       http://wiki.apache.org/solr/SolrReplication \n\n       It is also necessary for SolrCloud to function (in Cloud mode, the\n       replication handler is used to bulk transfer segments when nodes \n       are added or need to recover).\n\n       https://wiki.apache.org/solr/SolrCloud/\n    --&gt;\n  &lt;requestHandler name=\"/replication\" class=\"solr.ReplicationHandler\" &gt; \n    &lt;!--\n       To enable simple master/slave replication, uncomment one of the \n       sections below, depending on whether this solr instance should be\n       the \"master\" or a \"slave\".  If this instance is a \"slave\" you will \n       also need to fill in the masterUrl to point to a real machine.\n    --&gt;\n    &lt;!--\n       &lt;lst name=\"master\"&gt;\n         &lt;str name=\"replicateAfter\"&gt;commit&lt;/str&gt;\n         &lt;str na
 me=\"replicateAfter\"&gt;startup&lt;/str&gt;\n         &lt;str name=\"confFiles\"&gt;schema.xml,stopwords.txt&lt;/str&gt;\n       &lt;/lst&gt;\n    --&gt;\n    &lt;!--\n       &lt;lst name=\"slave\"&gt;\n         &lt;str name=\"masterUrl\"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;\n         &lt;str name=\"pollInterval\"&gt;00:00:60&lt;/str&gt;\n       &lt;/lst&gt;\n    --&gt;\n  &lt;/requestHandler&gt;\n\n  &lt;!-- Search Components\n\n       Search components are registered to SolrCore and used by \n       instances of SearchHandler (which can access them by name)\n       \n       By default, the following components are available:\n       \n       &lt;searchComponent name=\"query\"     class=\"solr.QueryComponent\" /&gt;\n       &lt;searchComponent name=\"facet\"     class=\"solr.FacetComponent\" /&gt;\n       &lt;searchComponent name=\"mlt\"       class=\"solr.MoreLikeThisComponent\" /&gt;\n       &lt;searchComponent name=\"highlight\" class=\"solr.HighlightComponent\"
  /&gt;\n       &lt;searchComponent name=\"stats\"     class=\"solr.StatsComponent\" /&gt;\n       &lt;searchComponent name=\"debug\"     class=\"solr.DebugComponent\" /&gt;\n   \n       Default configuration in a requestHandler would look like:\n\n       &lt;arr name=\"components\"&gt;\n         &lt;str&gt;query&lt;/str&gt;\n         &lt;str&gt;facet&lt;/str&gt;\n         &lt;str&gt;mlt&lt;/str&gt;\n         &lt;str&gt;highligh

<TRUNCATED>

[58/61] [abbrv] ambari git commit: AMBARI-15679. Stack definition for Logsearch (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/cb6a7b9b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
new file mode 100644
index 0000000..155756e
--- /dev/null
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-audit_logs-solrconfig.xml
@@ -0,0 +1,1929 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * 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.
+ */
+-->
+
+<!-- This is a special config file for properties used to monitor status of the service -->
+<configuration supports_adding_forbidden="true">
+
+  <property>
+    <name>logsearch_audit_logs_max_retention</name>
+    <value>7</value>
+    <display-name>Max retention</display-name>
+    <description>Days to retain the audit logs in Solr</description>
+  </property>
+
+  <!-- solrconfig.xml -->
+
+  <property>
+    <name>content</name>
+    <description>This is the jinja template for solrconfig.xml file for service logs</description>
+    <value>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
+&lt;!--
+ 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.
+--&gt;
+
+&lt;!-- 
+     For more details about configurations options that may appear in
+     this file, see http://wiki.apache.org/solr/SolrConfigXml. 
+--&gt;
+&lt;config&gt;
+  &lt;!-- In all configuration below, a prefix of "solr." for class names
+       is an alias that causes solr to search appropriate packages,
+       including org.apache.solr.(search|update|request|core|analysis)
+
+       You may also specify a fully qualified Java classname if you
+       have your own custom plugins.
+    --&gt;
+
+  &lt;!-- Controls what version of Lucene various components of Solr
+       adhere to.  Generally, you want to use the latest version to
+       get all bug fixes and improvements. It is highly recommended
+       that you fully re-index after changing this setting as it can
+       affect both how text is indexed and queried.
+  --&gt;
+  &lt;luceneMatchVersion&gt;5.0.0&lt;/luceneMatchVersion&gt;
+
+  &lt;!-- &lt;lib/&gt; directives can be used to instruct Solr to load any Jars
+       identified and use them to resolve any "plugins" specified in
+       your solrconfig.xml or schema.xml (ie: Analyzers, Request
+       Handlers, etc...).
+
+       All directories and paths are resolved relative to the
+       instanceDir.
+
+       Please note that &lt;lib/&gt; directives are processed in the order
+       that they appear in your solrconfig.xml file, and are "stacked" 
+       on top of each other when building a ClassLoader - so if you have 
+       plugin jars with dependencies on other jars, the "lower level" 
+       dependency jars should be loaded first.
+
+       If a "./lib" directory exists in your instanceDir, all files
+       found in it are included as if you had used the following
+       syntax...
+       
+              &lt;lib dir="./lib" /&gt;
+    --&gt;
+
+  &lt;!-- A 'dir' option by itself adds any files found in the directory 
+       to the classpath, this is useful for including all jars in a
+       directory.
+
+       When a 'regex' is specified in addition to a 'dir', only the
+       files in that directory which completely match the regex
+       (anchored on both ends) will be included.
+
+       If a 'dir' option (with or without a regex) is used and nothing
+       is found that matches, a warning will be logged.
+
+       The examples below can be used to load some solr-contribs along 
+       with their external dependencies.
+    --&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /&gt;
+
+  &lt;lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /&gt;
+  &lt;lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /&gt;
+
+  &lt;!-- an exact 'path' can be used instead of a 'dir' to specify a 
+       specific jar file.  This will cause a serious error to be logged 
+       if it can't be loaded.
+    --&gt;
+  &lt;!--
+     &lt;lib path="../a-jar-that-does-not-exist.jar" /&gt; 
+  --&gt;
+  
+  &lt;!-- Data Directory
+
+       Used to specify an alternate directory to hold all index data
+       other than the default ./data under the Solr home.  If
+       replication is in use, this should match the replication
+       configuration.
+    --&gt;
+  &lt;dataDir&gt;${solr.data.dir:}&lt;/dataDir&gt;
+
+
+  &lt;!-- The DirectoryFactory to use for indexes.
+       
+       solr.StandardDirectoryFactory is filesystem
+       based and tries to pick the best implementation for the current
+       JVM and platform.  solr.NRTCachingDirectoryFactory, the default,
+       wraps solr.StandardDirectoryFactory and caches small files in memory
+       for better NRT performance.
+
+       One can force a particular implementation via solr.MMapDirectoryFactory,
+       solr.NIOFSDirectoryFactory, or solr.SimpleFSDirectoryFactory.
+
+       solr.RAMDirectoryFactory is memory based, not
+       persistent, and doesn't work with replication.
+    --&gt;
+  &lt;directoryFactory name="DirectoryFactory" 
+                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"&gt;
+    
+         
+    &lt;!-- These will be used if you are using the solr.HdfsDirectoryFactory,
+         otherwise they will be ignored. If you don't plan on using hdfs,
+         you can safely remove this section. --&gt;      
+    &lt;!-- The root directory that collection data should be written to. --&gt;     
+    &lt;str name="solr.hdfs.home"&gt;${solr.hdfs.home:}&lt;/str&gt;
+    &lt;!-- The hadoop configuration files to use for the hdfs client. --&gt;    
+    &lt;str name="solr.hdfs.confdir"&gt;${solr.hdfs.confdir:}&lt;/str&gt;
+    &lt;!-- Enable/Disable the hdfs cache. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.enabled"&gt;${solr.hdfs.blockcache.enabled:true}&lt;/str&gt;
+    &lt;!-- Enable/Disable using one global cache for all SolrCores. 
+         The settings used will be from the first HdfsDirectoryFactory created. --&gt;    
+    &lt;str name="solr.hdfs.blockcache.global"&gt;${solr.hdfs.blockcache.global:true}&lt;/str&gt;
+    
+  &lt;/directoryFactory&gt; 
+
+  &lt;!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, it's a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  --&gt;
+  &lt;codecFactory class="solr.SchemaCodecFactory"/&gt;
+
+  &lt;!-- To enable dynamic schema REST APIs, use the following for &lt;schemaFactory&gt;: --&gt;
+  
+       &lt;schemaFactory class="ManagedIndexSchemaFactory"&gt;
+         &lt;bool name="mutable"&gt;true&lt;/bool&gt;
+         &lt;str name="managedSchemaResourceName"&gt;managed-schema&lt;/str&gt;
+       &lt;/schemaFactory&gt;
+&lt;!--       
+       When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+       the resource named in 'managedSchemaResourceName', rather than from schema.xml.
+       Note that the managed schema resource CANNOT be named schema.xml.  If the managed
+       schema does not exist, Solr will create it after reading schema.xml, then rename
+       'schema.xml' to 'schema.xml.bak'. 
+       
+       Do NOT hand edit the managed schema - external modifications will be ignored and
+       overwritten as a result of schema modification REST API calls.
+
+       When ManagedIndexSchemaFactory is specified with mutable = true, schema
+       modification REST API calls will be allowed; otherwise, error responses will be
+       sent back for these requests. 
+
+  &lt;schemaFactory class="ClassicIndexSchemaFactory"/&gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Index Config - These settings control low-level behavior of indexing
+       Most example settings here show the default value, but are commented
+       out, to more easily see where customizations have been made.
+       
+       Note: This replaces &lt;indexDefaults&gt; and &lt;mainIndex&gt; from older versions
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;indexConfig&gt;
+    &lt;!-- maxFieldLength was removed in 4.0. To get similar behavior, include a 
+         LimitTokenCountFilterFactory in your fieldType definition. E.g. 
+     &lt;filter class="solr.LimitTokenCountFilterFactory" maxTokenCount="10000"/&gt;
+    --&gt;
+    &lt;!-- Maximum time to wait for a write lock (ms) for an IndexWriter. Default: 1000 --&gt;
+    &lt;!-- &lt;writeLockTimeout&gt;1000&lt;/writeLockTimeout&gt;  --&gt;
+    &lt;!-- LogSearch customization to avoid timeouts --&gt;
+    &lt;writeLockTimeout&gt;10000&lt;/writeLockTimeout&gt;
+
+    &lt;!-- The maximum number of simultaneous threads that may be
+         indexing documents at once in IndexWriter; if more than this
+         many threads arrive they will wait for others to finish.
+         Default in Solr/Lucene is 8. --&gt;
+    &lt;!-- &lt;maxIndexingThreads&gt;8&lt;/maxIndexingThreads&gt;  --&gt;
+    &lt;!-- LogSearch customization of increase performance --&gt;
+    &lt;maxIndexingThreads&gt;50&lt;/maxIndexingThreads&gt;
+
+    &lt;!-- Expert: Enabling compound file will use less files for the index, 
+         using fewer file descriptors on the expense of performance decrease. 
+         Default in Lucene is "true". Default in Solr is "false" (since 3.6) --&gt;
+    &lt;!-- &lt;useCompoundFile&gt;false&lt;/useCompoundFile&gt; --&gt;
+
+    &lt;!-- ramBufferSizeMB sets the amount of RAM that may be used by Lucene
+         indexing for buffering added documents and deletions before they are
+         flushed to the Directory.
+         maxBufferedDocs sets a limit on the number of documents buffered
+         before flushing.
+         If both ramBufferSizeMB and maxBufferedDocs is set, then
+         Lucene will flush based on whichever limit is hit first.
+         The default is 100 MB.  --&gt;
+    &lt;!-- &lt;ramBufferSizeMB&gt;100&lt;/ramBufferSizeMB&gt; --&gt;
+    &lt;!-- &lt;maxBufferedDocs&gt;1000&lt;/maxBufferedDocs&gt; --&gt;
+
+    &lt;!-- Expert: Merge Policy 
+         The Merge Policy in Lucene controls how merging of segments is done.
+         The default since Solr/Lucene 3.3 is TieredMergePolicy.
+         The default since Lucene 2.3 was the LogByteSizeMergePolicy,
+         Even older versions of Lucene used LogDocMergePolicy.
+      --&gt;
+    &lt;!--
+        &lt;mergePolicy class="org.apache.lucene.index.TieredMergePolicy"&gt;
+          &lt;int name="maxMergeAtOnce"&gt;10&lt;/int&gt;
+          &lt;int name="segmentsPerTier"&gt;10&lt;/int&gt;
+        &lt;/mergePolicy&gt;
+      --&gt;
+       
+    &lt;!-- Merge Factor
+         The merge factor controls how many segments will get merged at a time.
+         For TieredMergePolicy, mergeFactor is a convenience parameter which
+         will set both MaxMergeAtOnce and SegmentsPerTier at once.
+         For LogByteSizeMergePolicy, mergeFactor decides how many new segments
+         will be allowed before they are merged into one.
+         Default is 10 for both merge policies.
+      --&gt;
+    &lt;!-- 
+    &lt;mergeFactor&gt;10&lt;/mergeFactor&gt;
+      --&gt;
+    &lt;!-- LogSearch customization. Increased to 25 to maximize indexing speed --&gt;
+    &lt;mergeFactor&gt;25&lt;/mergeFactor&gt;
+
+    &lt;!-- Expert: Merge Scheduler
+         The Merge Scheduler in Lucene controls how merges are
+         performed.  The ConcurrentMergeScheduler (Lucene 2.3 default)
+         can perform merges in the background using separate threads.
+         The SerialMergeScheduler (Lucene 2.2 default) does not.
+     --&gt;
+    &lt;!-- 
+       &lt;mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/&gt;
+       --&gt;
+
+    &lt;!-- LockFactory 
+
+         This option specifies which Lucene LockFactory implementation
+         to use.
+      
+         single = SingleInstanceLockFactory - suggested for a
+                  read-only index or when there is no possibility of
+                  another process trying to modify the index.
+         native = NativeFSLockFactory - uses OS native file locking.
+                  Do not use when multiple solr webapps in the same
+                  JVM are attempting to share a single index.
+         simple = SimpleFSLockFactory  - uses a plain file for locking
+
+         Defaults: 'native' is default for Solr3.6 and later, otherwise
+                   'simple' is the default
+
+         More details on the nuances of each LockFactory...
+         http://wiki.apache.org/lucene-java/AvailableLockFactories
+    --&gt;
+    &lt;lockType&gt;${solr.lock.type:native}&lt;/lockType&gt;
+
+    &lt;!-- Unlock On Startup
+
+         If true, unlock any held write or commit locks on startup.
+         This defeats the locking mechanism that allows multiple
+         processes to safely access a lucene index, and should be used
+         with care. Default is "false".
+
+         This is not needed if lock type is 'single'
+     --&gt;
+    &lt;!--
+    &lt;unlockOnStartup&gt;false&lt;/unlockOnStartup&gt;
+      --&gt;
+
+    &lt;!-- Commit Deletion Policy
+         Custom deletion policies can be specified here. The class must
+         implement org.apache.lucene.index.IndexDeletionPolicy.
+
+         The default Solr IndexDeletionPolicy implementation supports
+         deleting index commit points on number of commits, age of
+         commit point and optimized status.
+         
+         The latest commit point should always be preserved regardless
+         of the criteria.
+    --&gt;
+    &lt;!-- 
+    &lt;deletionPolicy class="solr.SolrDeletionPolicy"&gt;
+    --&gt;
+      &lt;!-- The number of commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxCommitsToKeep"&gt;1&lt;/str&gt; --&gt;
+      &lt;!-- The number of optimized commit points to be kept --&gt;
+      &lt;!-- &lt;str name="maxOptimizedCommitsToKeep"&gt;0&lt;/str&gt; --&gt;
+      &lt;!--
+          Delete all commit points once they have reached the given age.
+          Supports DateMathParser syntax e.g.
+        --&gt;
+      &lt;!--
+         &lt;str name="maxCommitAge"&gt;30MINUTES&lt;/str&gt;
+         &lt;str name="maxCommitAge"&gt;1DAY&lt;/str&gt;
+      --&gt;
+    &lt;!-- 
+    &lt;/deletionPolicy&gt;
+    --&gt;
+
+    &lt;!-- Lucene Infostream
+       
+         To aid in advanced debugging, Lucene provides an "InfoStream"
+         of detailed information when indexing.
+
+         Setting the value to true will instruct the underlying Lucene
+         IndexWriter to write its info stream to solr's log. By default,
+         this is enabled here, and controlled through log4j.properties.
+      --&gt;
+     &lt;infoStream&gt;true&lt;/infoStream&gt;
+  &lt;/indexConfig&gt;
+
+
+  &lt;!-- JMX
+       
+       This example enables JMX if and only if an existing MBeanServer
+       is found, use this if you want to configure JMX through JVM
+       parameters. Remove this to disable exposing Solr configuration
+       and statistics to JMX.
+
+       For more details see http://wiki.apache.org/solr/SolrJmx
+    --&gt;
+  &lt;jmx /&gt;
+  &lt;!-- If you want to connect to a particular server, specify the
+       agentId 
+    --&gt;
+  &lt;!-- &lt;jmx agentId="myAgent" /&gt; --&gt;
+  &lt;!-- If you want to start a new MBeanServer, specify the serviceUrl --&gt;
+  &lt;!-- &lt;jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/&gt;
+    --&gt;
+
+  &lt;!-- The default high-performance update handler --&gt;
+  &lt;updateHandler class="solr.DirectUpdateHandler2"&gt;
+
+    &lt;!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --&gt; 
+    &lt;updateLog&gt;
+      &lt;str name="dir"&gt;${solr.ulog.dir:}&lt;/str&gt;
+    &lt;/updateLog&gt;
+ 
+    &lt;!-- AutoCommit
+
+         Perform a hard commit automatically under certain conditions.
+         Instead of enabling autoCommit, consider using "commitWithin"
+         when adding documents. 
+
+         http://wiki.apache.org/solr/UpdateXmlMessages
+
+         maxDocs - Maximum number of documents to add since the last
+                   commit before automatically triggering a new commit.
+
+         maxTime - Maximum amount of time in ms that is allowed to pass
+                   since a document was added before automatically
+                   triggering a new commit. 
+         openSearcher - if false, the commit causes recent index changes
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
+      --&gt;
+     &lt;autoCommit&gt; 
+       &lt;maxTime&gt;${solr.autoCommit.maxTime:15000}&lt;/maxTime&gt; 
+       &lt;openSearcher&gt;false&lt;/openSearcher&gt; 
+     &lt;/autoCommit&gt;
+
+    &lt;!-- softAutoCommit is like autoCommit except it causes a
+         'soft' commit which only ensures that changes are visible
+         but does not ensure that data is synced to disk.  This is
+         faster and more near-realtime friendly than a hard commit.
+      --&gt;
+
+     &lt;autoSoftCommit&gt; 
+       &lt;maxTime&gt;${solr.autoSoftCommit.maxTime:5000}&lt;/maxTime&gt; 
+     &lt;/autoSoftCommit&gt;
+
+    &lt;!-- Update Related Event Listeners
+         
+         Various IndexWriter related events can trigger Listeners to
+         take actions.
+
+         postCommit - fired after every commit or optimize command
+         postOptimize - fired after every optimize command
+      --&gt;
+    &lt;!-- The RunExecutableListener executes an external command from a
+         hook such as postCommit or postOptimize.
+         
+         exe - the name of the executable to run
+         dir - dir to use as the current working directory. (default=".")
+         wait - the calling thread waits until the executable returns. 
+                (default="true")
+         args - the arguments to pass to the program.  (default is none)
+         env - environment variables to set.  (default is none)
+      --&gt;
+    &lt;!-- This example shows how RunExecutableListener could be used
+         with the script based replication...
+         http://wiki.apache.org/solr/CollectionDistribution
+      --&gt;
+    &lt;!--
+       &lt;listener event="postCommit" class="solr.RunExecutableListener"&gt;
+         &lt;str name="exe"&gt;solr/bin/snapshooter&lt;/str&gt;
+         &lt;str name="dir"&gt;.&lt;/str&gt;
+         &lt;bool name="wait"&gt;true&lt;/bool&gt;
+         &lt;arr name="args"&gt; &lt;str&gt;arg1&lt;/str&gt; &lt;str&gt;arg2&lt;/str&gt; &lt;/arr&gt;
+         &lt;arr name="env"&gt; &lt;str&gt;MYVAR=val1&lt;/str&gt; &lt;/arr&gt;
+       &lt;/listener&gt;
+      --&gt;
+
+  &lt;/updateHandler&gt;
+  
+  &lt;!-- IndexReaderFactory
+
+       Use the following format to specify a custom IndexReaderFactory,
+       which allows for alternate IndexReader implementations.
+
+       ** Experimental Feature **
+
+       Please note - Using a custom IndexReaderFactory may prevent
+       certain other features from working. The API to
+       IndexReaderFactory may change without warning or may even be
+       removed from future releases if the problems cannot be
+       resolved.
+
+
+       ** Features that may not work with custom IndexReaderFactory **
+
+       The ReplicationHandler assumes a disk-resident index. Using a
+       custom IndexReader implementation may cause incompatibility
+       with ReplicationHandler and may cause replication to not work
+       correctly. See SOLR-1366 for details.
+
+    --&gt;
+  &lt;!--
+  &lt;indexReaderFactory name="IndexReaderFactory" class="package.class"&gt;
+    &lt;str name="someArg"&gt;Some Value&lt;/str&gt;
+  &lt;/indexReaderFactory &gt;
+  --&gt;
+
+  &lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+       Query section - these settings control query time things like caches
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;
+  &lt;query&gt;
+    &lt;!-- Max Boolean Clauses
+
+         Maximum number of clauses in each BooleanQuery,  an exception
+         is thrown if exceeded.
+
+         ** WARNING **
+         
+         This option actually modifies a global Lucene property that
+         will affect all SolrCores.  If multiple solrconfig.xml files
+         disagree on this property, the value at any given moment will
+         be based on the last SolrCore to be initialized.
+         
+      --&gt;
+    &lt;maxBooleanClauses&gt;1024&lt;/maxBooleanClauses&gt;
+
+
+    &lt;!-- Solr Internal Query Caches
+
+         There are two implementations of cache available for Solr,
+         LRUCache, based on a synchronized LinkedHashMap, and
+         FastLRUCache, based on a ConcurrentHashMap.  
+
+         FastLRUCache has faster gets and slower puts in single
+         threaded operation and thus is generally faster than LRUCache
+         when the hit ratio of the cache is high (&gt; 75%), and may be
+         faster under other scenarios on multi-cpu systems.
+    --&gt;
+
+    &lt;!-- Filter Cache
+
+         Cache used by SolrIndexSearcher for filters (DocSets),
+         unordered sets of *all* documents that match a query.  When a
+         new searcher is opened, its caches may be prepopulated or
+         "autowarmed" using data from caches in the old searcher.
+         autowarmCount is the number of items to prepopulate.  For
+         LRUCache, the autowarmed items will be the most recently
+         accessed items.
+
+         Parameters:
+           class - the SolrCache implementation LRUCache or
+               (LRUCache or FastLRUCache)
+           size - the maximum number of entries in the cache
+           initialSize - the initial capacity (number of entries) of
+               the cache.  (see java.util.HashMap)
+           autowarmCount - the number of entries to prepopulate from
+               and old cache.  
+      --&gt;
+    &lt;filterCache class="solr.FastLRUCache"
+                 size="512"
+                 initialSize="512"
+                 autowarmCount="0"/&gt;
+
+    &lt;!-- Query Result Cache
+         
+         Caches results of searches - ordered lists of document ids
+         (DocList) based on a query, a sort, and the range of documents requested.  
+      --&gt;
+    &lt;queryResultCache class="solr.LRUCache"
+                     size="512"
+                     initialSize="512"
+                     autowarmCount="0"/&gt;
+   
+    &lt;!-- Document Cache
+
+         Caches Lucene Document objects (the stored fields for each
+         document).  Since Lucene internal document ids are transient,
+         this cache will not be autowarmed.  
+      --&gt;
+    &lt;documentCache class="solr.LRUCache"
+                   size="512"
+                   initialSize="512"
+                   autowarmCount="0"/&gt;
+    
+    &lt;!-- custom cache currently used by block join --&gt; 
+    &lt;cache name="perSegFilter"
+      class="solr.search.LRUCache"
+      size="10"
+      initialSize="0"
+      autowarmCount="10"
+      regenerator="solr.NoOpRegenerator" /&gt;
+
+    &lt;!-- Field Value Cache
+         
+         Cache used to hold field values that are quickly accessible
+         by document id.  The fieldValueCache is created by default
+         even if not configured here.
+      --&gt;
+    &lt;!--
+       &lt;fieldValueCache class="solr.FastLRUCache"
+                        size="512"
+                        autowarmCount="128"
+                        showItems="32" /&gt;
+      --&gt;
+
+    &lt;!-- Custom Cache
+
+         Example of a generic cache.  These caches may be accessed by
+         name through SolrIndexSearcher.getCache(),cacheLookup(), and
+         cacheInsert().  The purpose is to enable easy caching of
+         user/application level data.  The regenerator argument should
+         be specified as an implementation of solr.CacheRegenerator 
+         if autowarming is desired.  
+      --&gt;
+    &lt;!--
+       &lt;cache name="myUserCache"
+              class="solr.LRUCache"
+              size="4096"
+              initialSize="1024"
+              autowarmCount="1024"
+              regenerator="com.mycompany.MyRegenerator"
+              /&gt;
+      --&gt;
+
+
+    &lt;!-- Lazy Field Loading
+
+         If true, stored fields that are not requested will be loaded
+         lazily.  This can result in a significant speed improvement
+         if the usual case is to not load all stored fields,
+         especially if the skipped fields are large compressed text
+         fields.
+    --&gt;
+    &lt;enableLazyFieldLoading&gt;true&lt;/enableLazyFieldLoading&gt;
+
+   &lt;!-- Use Filter For Sorted Query
+
+        A possible optimization that attempts to use a filter to
+        satisfy a search.  If the requested sort does not include
+        score, then the filterCache will be checked for a filter
+        matching the query. If found, the filter will be used as the
+        source of document ids, and then the sort will be applied to
+        that.
+
+        For most situations, this will not be useful unless you
+        frequently get the same search repeatedly with different sort
+        options, and none of them ever use "score"
+     --&gt;
+   &lt;!--
+      &lt;useFilterForSortedQuery&gt;true&lt;/useFilterForSortedQuery&gt;
+     --&gt;
+
+   &lt;!-- Result Window Size
+
+        An optimization for use with the queryResultCache.  When a search
+        is requested, a superset of the requested number of document ids
+        are collected.  For example, if a search for a particular query
+        requests matching documents 10 through 19, and queryWindowSize is 50,
+        then documents 0 through 49 will be collected and cached.  Any further
+        requests in that range can be satisfied via the cache.  
+     --&gt;
+   &lt;queryResultWindowSize&gt;20&lt;/queryResultWindowSize&gt;
+
+   &lt;!-- Maximum number of documents to cache for any entry in the
+        queryResultCache. 
+     --&gt;
+   &lt;queryResultMaxDocsCached&gt;200&lt;/queryResultMaxDocsCached&gt;
+
+   &lt;!-- Query Related Event Listeners
+
+        Various IndexSearcher related events can trigger Listeners to
+        take actions.
+
+        newSearcher - fired whenever a new searcher is being prepared
+        and there is a current searcher handling requests (aka
+        registered).  It can be used to prime certain caches to
+        prevent long request times for certain requests.
+
+        firstSearcher - fired whenever a new searcher is being
+        prepared but there is no current registered searcher to handle
+        requests or to gain autowarming data from.
+
+        
+     --&gt;
+    &lt;!-- QuerySenderListener takes an array of NamedList and executes a
+         local query request for each NamedList in sequence. 
+      --&gt;
+    &lt;listener event="newSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;!--
+           &lt;lst&gt;&lt;str name="q"&gt;solr&lt;/str&gt;&lt;str name="sort"&gt;price asc&lt;/str&gt;&lt;/lst&gt;
+           &lt;lst&gt;&lt;str name="q"&gt;rocks&lt;/str&gt;&lt;str name="sort"&gt;weight asc&lt;/str&gt;&lt;/lst&gt;
+          --&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+    &lt;listener event="firstSearcher" class="solr.QuerySenderListener"&gt;
+      &lt;arr name="queries"&gt;
+        &lt;lst&gt;
+          &lt;str name="q"&gt;static firstSearcher warming in solrconfig.xml&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/arr&gt;
+    &lt;/listener&gt;
+
+    &lt;!-- Use Cold Searcher
+
+         If a search request comes in and there is no current
+         registered searcher, then immediately register the still
+         warming searcher and use it.  If "false" then all requests
+         will block until the first searcher is done warming.
+      --&gt;
+    &lt;useColdSearcher&gt;false&lt;/useColdSearcher&gt;
+
+    &lt;!-- Max Warming Searchers
+         
+         Maximum number of searchers that may be warming in the
+         background concurrently.  An error is returned if this limit
+         is exceeded.
+
+         Recommend values of 1-2 for read-only slaves, higher for
+         masters w/o cache warming.
+      --&gt;
+    &lt;maxWarmingSearchers&gt;2&lt;/maxWarmingSearchers&gt;
+
+  &lt;/query&gt;
+
+
+  &lt;!-- Request Dispatcher
+
+       This section contains instructions for how the SolrDispatchFilter
+       should behave when processing requests for this SolrCore.
+
+       handleSelect is a legacy option that affects the behavior of requests
+       such as /select?qt=XXX
+
+       handleSelect="true" will cause the SolrDispatchFilter to process
+       the request and dispatch the query to a handler specified by the 
+       "qt" param, assuming "/select" isn't already registered.
+
+       handleSelect="false" will cause the SolrDispatchFilter to
+       ignore "/select" requests, resulting in a 404 unless a handler
+       is explicitly registered with the name "/select"
+
+       handleSelect="true" is not recommended for new users, but is the default
+       for backwards compatibility
+    --&gt;
+  &lt;requestDispatcher handleSelect="false" &gt;
+    &lt;!-- Request Parsing
+
+         These settings indicate how Solr Requests may be parsed, and
+         what restrictions may be placed on the ContentStreams from
+         those requests
+
+         enableRemoteStreaming - enables use of the stream.file
+         and stream.url parameters for specifying remote streams.
+
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
+         Multipart File Uploads that Solr will allow in a Request.
+         
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
+         addHttpRequestToContext - if set to true, it will instruct
+         the requestParsers to include the original HttpServletRequest
+         object in the context map of the SolrQueryRequest under the 
+         key "httpRequest". It will not be used by any of the existing
+         Solr components, but may be useful when developing custom 
+         plugins.
+         
+         *** WARNING ***
+         The settings below authorize Solr to fetch remote files, You
+         should make sure your system has some authentication before
+         using enableRemoteStreaming="true"
+
+      --&gt; 
+    &lt;requestParsers enableRemoteStreaming="true" 
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"
+                    addHttpRequestToContext="false"/&gt;
+
+    &lt;!-- HTTP Caching
+
+         Set HTTP caching related parameters (for proxy caches and clients).
+
+         The options below instruct Solr not to output any HTTP Caching
+         related headers
+      --&gt;
+    &lt;httpCaching never304="true" /&gt;
+    &lt;!-- If you include a &lt;cacheControl&gt; directive, it will be used to
+         generate a Cache-Control header (as well as an Expires header
+         if the value contains "max-age=")
+         
+         By default, no Cache-Control header is generated.
+         
+         You can use the &lt;cacheControl&gt; option even if you have set
+         never304="true"
+      --&gt;
+    &lt;!--
+       &lt;httpCaching never304="true" &gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+    &lt;!-- To enable Solr to respond with automatically generated HTTP
+         Caching headers, and to response to Cache Validation requests
+         correctly, set the value of never304="false"
+         
+         This will cause Solr to generate Last-Modified and ETag
+         headers based on the properties of the Index.
+
+         The following options can also be specified to affect the
+         values of these headers...
+
+         lastModFrom - the default value is "openTime" which means the
+         Last-Modified value (and validation against If-Modified-Since
+         requests) will all be relative to when the current Searcher
+         was opened.  You can change it to lastModFrom="dirLastMod" if
+         you want the value to exactly correspond to when the physical
+         index was last modified.
+
+         etagSeed="..." is an option you can change to force the ETag
+         header (and validation against If-None-Match requests) to be
+         different even if the index has not changed (ie: when making
+         significant changes to your config file)
+
+         (lastModifiedFrom and etagSeed are both ignored if you use
+         the never304="true" option)
+      --&gt;
+    &lt;!--
+       &lt;httpCaching lastModifiedFrom="openTime"
+                    etagSeed="Solr"&gt;
+         &lt;cacheControl&gt;max-age=30, public&lt;/cacheControl&gt; 
+       &lt;/httpCaching&gt;
+      --&gt;
+  &lt;/requestDispatcher&gt;
+
+  &lt;!-- Request Handlers 
+
+       http://wiki.apache.org/solr/SolrRequestHandler
+
+       Incoming queries will be dispatched to a specific handler by name
+       based on the path specified in the request.
+
+       Legacy behavior: If the request path uses "/select" but no Request
+       Handler has that name, and if handleSelect="true" has been specified in
+       the requestDispatcher, then the Request Handler is dispatched based on
+       the qt parameter.  Handlers without a leading '/' are accessed this way
+       like so: http://host/app/[core/]select?qt=name  If no qt is
+       given, then the requestHandler that declares default="true" will be
+       used or the one named "standard".
+
+       If a Request Handler is declared with startup="lazy", then it will
+       not be initialized until the first request that uses it.
+
+    --&gt;
+
+  &lt;requestHandler name="/dataimport" class="solr.DataImportHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="config"&gt;solr-data-config.xml&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- SearchHandler
+
+       http://wiki.apache.org/solr/SearchHandler
+
+       For processing Search Queries, the primary Request Handler
+       provided with Solr is "SearchHandler" It delegates to a sequent
+       of SearchComponents (see below) and supports distributed
+       queries across multiple shards
+    --&gt;
+  &lt;requestHandler name="/select" class="solr.SearchHandler"&gt;
+    &lt;!-- default values for query parameters can be specified, these
+         will be overridden by parameters in the request
+      --&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;int name="rows"&gt;10&lt;/int&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+    &lt;!-- In addition to defaults, "appends" params can be specified
+         to identify values which should be appended to the list of
+         multi-val params from the query (or the existing "defaults").
+      --&gt;
+    &lt;!-- In this example, the param "fq=instock:true" would be appended to
+         any query time fq params the user may specify, as a mechanism for
+         partitioning the index, independent of any user selected filtering
+         that may also be desired (perhaps as a result of faceted searching).
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "appends" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="appends"&gt;
+         &lt;str name="fq"&gt;inStock:true&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- "invariants" are a way of letting the Solr maintainer lock down
+         the options available to Solr clients.  Any params values
+         specified here are used regardless of what values may be specified
+         in either the query, the "defaults", or the "appends" params.
+
+         In this example, the facet.field and facet.query params would
+         be fixed, limiting the facets clients can use.  Faceting is
+         not turned on by default - but if the client does specify
+         facet=true in the request, these are the only facets they
+         will be able to see counts for; regardless of what other
+         facet.field or facet.query params they may specify.
+
+         NOTE: there is *absolutely* nothing a client can do to prevent these
+         "invariants" values from being used, so don't use this mechanism
+         unless you are sure you always want it.
+      --&gt;
+    &lt;!--
+       &lt;lst name="invariants"&gt;
+         &lt;str name="facet.field"&gt;cat&lt;/str&gt;
+         &lt;str name="facet.field"&gt;manu_exact&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[* TO 500]&lt;/str&gt;
+         &lt;str name="facet.query"&gt;price:[500 TO *]&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+    &lt;!-- If the default list of SearchComponents is not desired, that
+         list can either be overridden completely, or components can be
+         prepended or appended to the default list.  (see below)
+      --&gt;
+    &lt;!--
+       &lt;arr name="components"&gt;
+         &lt;str&gt;nameOfCustomComponent1&lt;/str&gt;
+         &lt;str&gt;nameOfCustomComponent2&lt;/str&gt;
+       &lt;/arr&gt;
+      --&gt;
+    &lt;/requestHandler&gt;
+
+  &lt;!-- A request handler that returns indented JSON by default --&gt;
+  &lt;requestHandler name="/query" class="solr.SearchHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+       &lt;str name="df"&gt;text&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- realtime get handler, guaranteed to return the latest stored fields of
+       any document, without the need to commit or open a new searcher.  The
+       current implementation relies on the updateLog feature being enabled.
+
+       ** WARNING **
+       Do NOT disable the realtime get handler at /get if you are using
+       SolrCloud otherwise any leader election will cause a full sync in ALL
+       replicas for the shard in question. Similarly, a replica recovery will
+       also always fetch the complete index from the leader because a partial
+       sync will not be possible in the absence of this handler.
+  --&gt;
+  &lt;requestHandler name="/get" class="solr.RealTimeGetHandler"&gt;
+     &lt;lst name="defaults"&gt;
+       &lt;str name="omitHeader"&gt;true&lt;/str&gt;
+       &lt;str name="wt"&gt;json&lt;/str&gt;
+       &lt;str name="indent"&gt;true&lt;/str&gt;
+     &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- A Robust Example
+
+       This example SearchHandler declaration shows off usage of the
+       SearchHandler with many defaults declared
+
+       Note that multiple instances of the same Request Handler
+       (SearchHandler) can be registered multiple times with different
+       names (and different init parameters)
+    --&gt;
+  &lt;requestHandler name="/browse" class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+
+      &lt;!-- VelocityResponseWriter settings --&gt;
+      &lt;str name="wt"&gt;velocity&lt;/str&gt;
+      &lt;str name="v.template"&gt;browse&lt;/str&gt;
+      &lt;str name="v.layout"&gt;layout&lt;/str&gt;
+
+      &lt;!-- Query settings --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+
+      &lt;!-- Faceting defaults --&gt;
+      &lt;str name="facet"&gt;on&lt;/str&gt;
+      &lt;str name="facet.mincount"&gt;1&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell,/browse"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;str name="update.chain"&gt;add-unknown-fields-to-the-schema&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/initParams&gt;
+
+  &lt;!-- Update Request Handler.
+       
+       http://wiki.apache.org/solr/UpdateXmlMessages
+
+       The canonical Request Handler for Modifying the Index through
+       commands specified using XML, JSON, CSV, or JAVABIN
+
+       Note: Since solr1.1 requestHandlers requires a valid content
+       type header if posted in the body. For example, curl now
+       requires: -H 'Content-type:text/xml; charset=utf-8'
+       
+       To override the request content type and force a specific 
+       Content-type, use the request parameter: 
+         ?update.contentType=text/csv
+       
+       This handler will pick a response format to match the input
+       if the 'wt' parameter is not explicit
+    --&gt;
+  &lt;requestHandler name="/update" class="solr.UpdateRequestHandler"&gt;
+    &lt;!-- See below for information on defining 
+         updateRequestProcessorChains that can be used by name 
+         on each Update Request
+      --&gt;
+    &lt;!--
+       &lt;lst name="defaults"&gt;
+         &lt;str name="update.chain"&gt;dedupe&lt;/str&gt;
+       &lt;/lst&gt;
+       --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Solr Cell Update Request Handler
+
+       http://wiki.apache.org/solr/ExtractingRequestHandler 
+
+    --&gt;
+  &lt;requestHandler name="/update/extract" 
+                  startup="lazy"
+                  class="solr.extraction.ExtractingRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="lowernames"&gt;true&lt;/str&gt;
+      &lt;str name="uprefix"&gt;ignored_&lt;/str&gt;
+
+      &lt;!-- capture link hrefs but ignore div attributes --&gt;
+      &lt;str name="captureAttr"&gt;true&lt;/str&gt;
+      &lt;str name="fmap.a"&gt;links&lt;/str&gt;
+      &lt;str name="fmap.div"&gt;ignored_&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Field Analysis Request Handler
+
+       RequestHandler that provides much the same functionality as
+       analysis.jsp. Provides the ability to specify multiple field
+       types and field names in the same request and outputs
+       index-time and query-time analysis for each of them.
+
+       Request parameters are:
+       analysis.fieldname - field name whose analyzers are to be used
+
+       analysis.fieldtype - field type whose analyzers are to be used
+       analysis.fieldvalue - text for index-time analysis
+       q (or analysis.q) - text for query time analysis
+       analysis.showmatch (true|false) - When set to true and when
+           query analysis is performed, the produced tokens of the
+           field value analysis will be marked as "matched" for every
+           token that is produces by the query analysis
+   --&gt;
+  &lt;requestHandler name="/analysis/field" 
+                  startup="lazy"
+                  class="solr.FieldAnalysisRequestHandler" /&gt;
+
+
+  &lt;!-- Document Analysis Handler
+
+       http://wiki.apache.org/solr/AnalysisRequestHandler
+
+       An analysis handler that provides a breakdown of the analysis
+       process of provided documents. This handler expects a (single)
+       content stream with the following format:
+
+       &lt;docs&gt;
+         &lt;doc&gt;
+           &lt;field name="id"&gt;1&lt;/field&gt;
+           &lt;field name="name"&gt;The Name&lt;/field&gt;
+           &lt;field name="text"&gt;The Text Value&lt;/field&gt;
+         &lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         &lt;doc&gt;...&lt;/doc&gt;
+         ...
+       &lt;/docs&gt;
+
+    Note: Each document must contain a field which serves as the
+    unique key. This key is used in the returned response to associate
+    an analysis breakdown to the analyzed document.
+
+    Like the FieldAnalysisRequestHandler, this handler also supports
+    query analysis by sending either an "analysis.query" or "q"
+    request parameter that holds the query text to be analyzed. It
+    also supports the "analysis.showmatch" parameter which when set to
+    true, all field tokens that match the query tokens will be marked
+    as a "match". 
+  --&gt;
+  &lt;requestHandler name="/analysis/document" 
+                  class="solr.DocumentAnalysisRequestHandler" 
+                  startup="lazy" /&gt;
+
+  &lt;!-- Admin Handlers
+
+       Admin Handlers - This will register all the standard admin
+       RequestHandlers.  
+    --&gt;
+  &lt;requestHandler name="/admin/" 
+                  class="solr.admin.AdminHandlers" /&gt;
+  &lt;!-- This single handler is equivalent to the following... --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/luke"       class="solr.admin.LukeRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/system"     class="solr.admin.SystemInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/plugins"    class="solr.admin.PluginInfoHandler" /&gt;
+     &lt;requestHandler name="/admin/threads"    class="solr.admin.ThreadDumpHandler" /&gt;
+     &lt;requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" /&gt;
+     &lt;requestHandler name="/admin/file"       class="solr.admin.ShowFileRequestHandler" &gt;
+    --&gt;
+  &lt;!-- If you wish to hide files under ${solr.home}/conf, explicitly
+       register the ShowFileRequestHandler using the definition below. 
+       NOTE: The glob pattern ('*') is the only pattern supported at present, *.xml will
+             not exclude all files ending in '.xml'. Use it to exclude _all_ updates
+    --&gt;
+  &lt;!--
+     &lt;requestHandler name="/admin/file" 
+                     class="solr.admin.ShowFileRequestHandler" &gt;
+       &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt; 
+         &lt;str name="hidden"&gt;*&lt;/str&gt; 
+       &lt;/lst&gt;
+     &lt;/requestHandler&gt;
+    --&gt;
+
+  &lt;!--
+    Enabling this request handler (which is NOT a default part of the admin handler) will allow the Solr UI to edit
+    all the config files. This is intended for secure/development use ONLY! Leaving available and publically
+    accessible is a security vulnerability and should be done with extreme caution!
+  --&gt;
+  &lt;!--
+  &lt;requestHandler name="/admin/fileedit" class="solr.admin.EditFileRequestHandler" &gt;
+    &lt;lst name="invariants"&gt;
+         &lt;str name="hidden"&gt;synonyms.txt&lt;/str&gt;
+         &lt;str name="hidden"&gt;anotherfile.txt&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  --&gt;
+  &lt;!-- ping/healthcheck --&gt;
+  &lt;requestHandler name="/admin/ping" class="solr.PingRequestHandler"&gt;
+    &lt;lst name="invariants"&gt;
+      &lt;str name="q"&gt;solrpingquery&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;all&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;!-- An optional feature of the PingRequestHandler is to configure the 
+         handler with a "healthcheckFile" which can be used to enable/disable 
+         the PingRequestHandler.
+         relative paths are resolved against the data dir 
+      --&gt;
+    &lt;!-- &lt;str name="healthcheckFile"&gt;server-enabled.txt&lt;/str&gt; --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Echo the request contents back to the client --&gt;
+  &lt;requestHandler name="/debug/dump" class="solr.DumpRequestHandler" &gt;
+    &lt;lst name="defaults"&gt;
+     &lt;str name="echoParams"&gt;explicit&lt;/str&gt; 
+     &lt;str name="echoHandler"&gt;true&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Solr Replication
+
+       The SolrReplicationHandler supports replicating indexes from a
+       "master" used for indexing and "slaves" used for queries.
+
+       http://wiki.apache.org/solr/SolrReplication 
+
+       It is also necessary for SolrCloud to function (in Cloud mode, the
+       replication handler is used to bulk transfer segments when nodes 
+       are added or need to recover).
+
+       https://wiki.apache.org/solr/SolrCloud/
+    --&gt;
+  &lt;requestHandler name="/replication" class="solr.ReplicationHandler" &gt; 
+    &lt;!--
+       To enable simple master/slave replication, uncomment one of the 
+       sections below, depending on whether this solr instance should be
+       the "master" or a "slave".  If this instance is a "slave" you will 
+       also need to fill in the masterUrl to point to a real machine.
+    --&gt;
+    &lt;!--
+       &lt;lst name="master"&gt;
+         &lt;str name="replicateAfter"&gt;commit&lt;/str&gt;
+         &lt;str name="replicateAfter"&gt;startup&lt;/str&gt;
+         &lt;str name="confFiles"&gt;schema.xml,stopwords.txt&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+    &lt;!--
+       &lt;lst name="slave"&gt;
+         &lt;str name="masterUrl"&gt;http://your-master-hostname:8983/solr&lt;/str&gt;
+         &lt;str name="pollInterval"&gt;00:00:60&lt;/str&gt;
+       &lt;/lst&gt;
+    --&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Search Components
+
+       Search components are registered to SolrCore and used by 
+       instances of SearchHandler (which can access them by name)
+       
+       By default, the following components are available:
+       
+       &lt;searchComponent name="query"     class="solr.QueryComponent" /&gt;
+       &lt;searchComponent name="facet"     class="solr.FacetComponent" /&gt;
+       &lt;searchComponent name="mlt"       class="solr.MoreLikeThisComponent" /&gt;
+       &lt;searchComponent name="highlight" class="solr.HighlightComponent" /&gt;
+       &lt;searchComponent name="stats"     class="solr.StatsComponent" /&gt;
+       &lt;searchComponent name="debug"     class="solr.DebugComponent" /&gt;
+   
+       Default configuration in a requestHandler would look like:
+
+       &lt;arr name="components"&gt;
+         &lt;str&gt;query&lt;/str&gt;
+         &lt;str&gt;facet&lt;/str&gt;
+         &lt;str&gt;mlt&lt;/str&gt;
+         &lt;str&gt;highlight&lt;/str&gt;
+         &lt;str&gt;stats&lt;/str&gt;
+         &lt;str&gt;debug&lt;/str&gt;
+       &lt;/arr&gt;
+
+       If you register a searchComponent to one of the standard names, 
+       that will be used instead of the default.
+
+       To insert components before or after the 'standard' components, use:
+    
+       &lt;arr name="first-components"&gt;
+         &lt;str&gt;myFirstComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+    
+       &lt;arr name="last-components"&gt;
+         &lt;str&gt;myLastComponentName&lt;/str&gt;
+       &lt;/arr&gt;
+
+       NOTE: The component registered with the name "debug" will
+       always be executed after the "last-components" 
+       
+     --&gt;
+  
+   &lt;!-- Spell Check
+
+        The spell check component can return a list of alternative spelling
+        suggestions.  
+
+        http://wiki.apache.org/solr/SpellCheckComponent
+     --&gt;
+  &lt;searchComponent name="spellcheck" class="solr.SpellCheckComponent"&gt;
+
+    &lt;str name="queryAnalyzerFieldType"&gt;key_lower_case&lt;/str&gt;
+
+    &lt;!-- Multiple "Spell Checkers" can be declared and used by this
+         component
+      --&gt;
+
+    &lt;!-- a spellchecker built from a field of the main index --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;default&lt;/str&gt;
+      &lt;str name="field"&gt;text&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+      &lt;!-- the spellcheck distance measure used, the default is the internal levenshtein --&gt;
+      &lt;str name="distanceMeasure"&gt;internal&lt;/str&gt;
+      &lt;!-- minimum accuracy needed to be considered a valid spellcheck suggestion --&gt;
+      &lt;float name="accuracy"&gt;0.5&lt;/float&gt;
+      &lt;!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 --&gt;
+      &lt;int name="maxEdits"&gt;2&lt;/int&gt;
+      &lt;!-- the minimum shared prefix when enumerating terms --&gt;
+      &lt;int name="minPrefix"&gt;1&lt;/int&gt;
+      &lt;!-- maximum number of inspections per result. --&gt;
+      &lt;int name="maxInspections"&gt;5&lt;/int&gt;
+      &lt;!-- minimum length of a query term to be considered for correction --&gt;
+      &lt;int name="minQueryLength"&gt;4&lt;/int&gt;
+      &lt;!-- maximum threshold of documents a query term can appear to be considered for correction --&gt;
+      &lt;float name="maxQueryFrequency"&gt;0.01&lt;/float&gt;
+      &lt;!-- uncomment this to require suggestions to occur in 1% of the documents
+      	&lt;float name="thresholdTokenFrequency"&gt;.01&lt;/float&gt;
+      --&gt;
+    &lt;/lst&gt;
+    
+    &lt;!-- a spellchecker that can break or combine words.  See "/spell" handler below for usage --&gt;
+    &lt;lst name="spellchecker"&gt;
+      &lt;str name="name"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="classname"&gt;solr.WordBreakSolrSpellChecker&lt;/str&gt;      
+      &lt;str name="field"&gt;name&lt;/str&gt;
+      &lt;str name="combineWords"&gt;true&lt;/str&gt;
+      &lt;str name="breakWords"&gt;true&lt;/str&gt;
+      &lt;int name="maxChanges"&gt;10&lt;/int&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- a spellchecker that uses a different distance measure --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;jarowinkler&lt;/str&gt;
+         &lt;str name="field"&gt;spell&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="distanceMeasure"&gt;
+           org.apache.lucene.search.spell.JaroWinklerDistance
+         &lt;/str&gt;
+       &lt;/lst&gt;
+     --&gt;
+
+    &lt;!-- a spellchecker that use an alternate comparator 
+
+         comparatorClass be one of:
+          1. score (default)
+          2. freq (Frequency first, then score)
+          3. A fully qualified class name
+      --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="name"&gt;freq&lt;/str&gt;
+         &lt;str name="field"&gt;lowerfilt&lt;/str&gt;
+         &lt;str name="classname"&gt;solr.DirectSolrSpellChecker&lt;/str&gt;
+         &lt;str name="comparatorClass"&gt;freq&lt;/str&gt;
+      --&gt;
+
+    &lt;!-- A spellchecker that reads the list of words from a file --&gt;
+    &lt;!--
+       &lt;lst name="spellchecker"&gt;
+         &lt;str name="classname"&gt;solr.FileBasedSpellChecker&lt;/str&gt;
+         &lt;str name="name"&gt;file&lt;/str&gt;
+         &lt;str name="sourceLocation"&gt;spellings.txt&lt;/str&gt;
+         &lt;str name="characterEncoding"&gt;UTF-8&lt;/str&gt;
+         &lt;str name="spellcheckIndexDir"&gt;spellcheckerFile&lt;/str&gt;
+       &lt;/lst&gt;
+      --&gt;
+  &lt;/searchComponent&gt;
+  
+  &lt;!-- A request handler for demonstrating the spellcheck component.  
+
+       NOTE: This is purely as an example.  The whole purpose of the
+       SpellCheckComponent is to hook it into the request handler that
+       handles your normal user queries so that a separate request is
+       not needed to get suggestions.
+
+       IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS
+       NOT WHAT YOU WANT FOR YOUR PRODUCTION SYSTEM!
+       
+       See http://wiki.apache.org/solr/SpellCheckComponent for details
+       on the request parameters.
+    --&gt;
+  &lt;requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;!-- Solr will use suggestions from both the 'default' spellchecker
+           and from the 'wordbreak' spellchecker and combine them.
+           collations (re-written queries) can include a combination of
+           corrections from both spellcheckers --&gt;
+      &lt;str name="spellcheck.dictionary"&gt;default&lt;/str&gt;
+      &lt;str name="spellcheck.dictionary"&gt;wordbreak&lt;/str&gt;
+      &lt;str name="spellcheck"&gt;on&lt;/str&gt;
+      &lt;str name="spellcheck.extendedResults"&gt;true&lt;/str&gt;       
+      &lt;str name="spellcheck.count"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.alternativeTermCount"&gt;5&lt;/str&gt;
+      &lt;str name="spellcheck.maxResultsForSuggest"&gt;5&lt;/str&gt;       
+      &lt;str name="spellcheck.collate"&gt;true&lt;/str&gt;
+      &lt;str name="spellcheck.collateExtendedResults"&gt;true&lt;/str&gt;  
+      &lt;str name="spellcheck.maxCollationTries"&gt;10&lt;/str&gt;
+      &lt;str name="spellcheck.maxCollations"&gt;5&lt;/str&gt;         
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;spellcheck&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;searchComponent name="suggest" class="solr.SuggestComponent"&gt;
+  	&lt;lst name="suggester"&gt;
+      &lt;str name="name"&gt;mySuggester&lt;/str&gt;
+      &lt;str name="lookupImpl"&gt;FuzzyLookupFactory&lt;/str&gt;      &lt;!-- org.apache.solr.spelling.suggest.fst --&gt;
+      &lt;str name="dictionaryImpl"&gt;DocumentDictionaryFactory&lt;/str&gt;     &lt;!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory --&gt; 
+      &lt;str name="field"&gt;cat&lt;/str&gt;
+      &lt;str name="weightField"&gt;price&lt;/str&gt;
+      &lt;str name="suggestAnalyzerFieldType"&gt;string&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="suggest"&gt;true&lt;/str&gt;
+      &lt;str name="suggest.count"&gt;10&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="components"&gt;
+      &lt;str&gt;suggest&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  &lt;!-- Term Vector Component
+
+       http://wiki.apache.org/solr/TermVectorComponent
+    --&gt;
+  &lt;searchComponent name="tvComponent" class="solr.TermVectorComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the term vector component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+      &lt;bool name="tv"&gt;true&lt;/bool&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;tvComponent&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Clustering Component
+
+       You'll need to set the solr.clustering.enabled system property
+       when running solr to run with clustering enabled:
+
+            java -Dsolr.clustering.enabled=true -jar start.jar
+
+       http://wiki.apache.org/solr/ClusteringComponent
+       http://carrot2.github.io/solr-integration-strategies/
+    --&gt;
+  &lt;searchComponent name="clustering"
+                   enable="${solr.clustering.enabled:false}"
+                   class="solr.clustering.ClusteringComponent" &gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;lingo&lt;/str&gt;
+
+      &lt;!-- Class name of a clustering algorithm compatible with the Carrot2 framework.
+
+           Currently available open source algorithms are:
+           * org.carrot2.clustering.lingo.LingoClusteringAlgorithm
+           * org.carrot2.clustering.stc.STCClusteringAlgorithm
+           * org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm
+
+           See http://project.carrot2.org/algorithms.html for more information.
+
+           A commercial algorithm Lingo3G (needs to be installed separately) is defined as:
+           * com.carrotsearch.lingo3g.Lingo3GClusteringAlgorithm
+        --&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.lingo.LingoClusteringAlgorithm&lt;/str&gt;
+
+      &lt;!-- Override location of the clustering algorithm's resources 
+           (attribute definitions and lexical resources).
+
+           A directory from which to load algorithm-specific stop words,
+           stop labels and attribute definition XMLs. 
+
+           For an overview of Carrot2 lexical resources, see:
+           http://download.carrot2.org/head/manual/#chapter.lexical-resources
+
+           For an overview of Lingo3G lexical resources, see:
+           http://download.carrotsearch.com/lingo3g/manual/#chapter.lexical-resources
+       --&gt;
+      &lt;str name="carrot.resourcesDir"&gt;clustering/carrot2&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the STC clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;stc&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.stc.STCClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+
+    &lt;!-- An example definition for the bisecting kmeans clustering algorithm. --&gt;
+    &lt;lst name="engine"&gt;
+      &lt;str name="name"&gt;kmeans&lt;/str&gt;
+      &lt;str name="carrot.algorithm"&gt;org.carrot2.clustering.kmeans.BisectingKMeansClusteringAlgorithm&lt;/str&gt;
+    &lt;/lst&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the clustering component
+
+       This is purely as an example.
+
+       In reality you will likely want to add the component to your 
+       already specified request handlers. 
+    --&gt;
+  &lt;requestHandler name="/clustering"
+                  startup="lazy"
+                  enable="${solr.clustering.enabled:false}"
+                  class="solr.SearchHandler"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;bool name="clustering"&gt;true&lt;/bool&gt;
+      &lt;bool name="clustering.results"&gt;true&lt;/bool&gt;
+      &lt;!-- Field name with the logical "title" of a each document (optional) --&gt;
+      &lt;str name="carrot.title"&gt;name&lt;/str&gt;
+      &lt;!-- Field name with the logical "URL" of a each document (optional) --&gt;
+      &lt;str name="carrot.url"&gt;id&lt;/str&gt;
+      &lt;!-- Field name with the logical "content" of a each document (optional) --&gt;
+      &lt;str name="carrot.snippet"&gt;features&lt;/str&gt;
+      &lt;!-- Apply highlighter to the title/ content and use this for clustering. --&gt;
+      &lt;bool name="carrot.produceSummary"&gt;true&lt;/bool&gt;
+      &lt;!-- the maximum number of labels per cluster --&gt;
+      &lt;!--&lt;int name="carrot.numDescriptions"&gt;5&lt;/int&gt;--&gt;
+      &lt;!-- produce sub clusters --&gt;
+      &lt;bool name="carrot.outputSubClusters"&gt;false&lt;/bool&gt;
+
+      &lt;!-- Configure the remaining request handler parameters. --&gt;
+      &lt;str name="defType"&gt;edismax&lt;/str&gt;
+      &lt;str name="qf"&gt;
+        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
+      &lt;/str&gt;
+      &lt;str name="q.alt"&gt;*:*&lt;/str&gt;
+      &lt;str name="rows"&gt;10&lt;/str&gt;
+      &lt;str name="fl"&gt;*,score&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;clustering&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+  
+  &lt;!-- Terms Component
+
+       http://wiki.apache.org/solr/TermsComponent
+
+       A component to return terms and document frequency of those
+       terms
+    --&gt;
+  &lt;searchComponent name="terms" class="solr.TermsComponent"/&gt;
+
+  &lt;!-- A request handler for demonstrating the terms component --&gt;
+  &lt;requestHandler name="/terms" class="solr.SearchHandler" startup="lazy"&gt;
+     &lt;lst name="defaults"&gt;
+      &lt;bool name="terms"&gt;true&lt;/bool&gt;
+      &lt;bool name="distrib"&gt;false&lt;/bool&gt;
+    &lt;/lst&gt;     
+    &lt;arr name="components"&gt;
+      &lt;str&gt;terms&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+
+  &lt;!-- Query Elevation Component
+
+       http://wiki.apache.org/solr/QueryElevationComponent
+
+       a search component that enables you to configure the top
+       results for a given query regardless of the normal lucene
+       scoring.
+    --&gt;
+  &lt;searchComponent name="elevator" class="solr.QueryElevationComponent" &gt;
+    &lt;!-- pick a fieldType to analyze queries --&gt;
+    &lt;str name="queryFieldType"&gt;string&lt;/str&gt;
+    &lt;str name="config-file"&gt;elevate.xml&lt;/str&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- A request handler for demonstrating the elevator component --&gt;
+  &lt;requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy"&gt;
+    &lt;lst name="defaults"&gt;
+      &lt;str name="echoParams"&gt;explicit&lt;/str&gt;
+      &lt;str name="df"&gt;text&lt;/str&gt;
+    &lt;/lst&gt;
+    &lt;arr name="last-components"&gt;
+      &lt;str&gt;elevator&lt;/str&gt;
+    &lt;/arr&gt;
+  &lt;/requestHandler&gt;
+
+  &lt;!-- Highlighting Component
+
+       http://wiki.apache.org/solr/HighlightingParameters
+    --&gt;
+  &lt;searchComponent class="solr.HighlightComponent" name="highlight"&gt;
+    &lt;highlighting&gt;
+      &lt;!-- Configure the standard fragmenter --&gt;
+      &lt;!-- This could most likely be commented out in the "default" case --&gt;
+      &lt;fragmenter name="gap" 
+                  default="true"
+                  class="solr.highlight.GapFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;int name="hl.fragsize"&gt;100&lt;/int&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- A regular-expression-based fragmenter 
+           (for sentence extraction) 
+        --&gt;
+      &lt;fragmenter name="regex" 
+                  class="solr.highlight.RegexFragmenter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- slightly smaller fragsizes work better because of slop --&gt;
+          &lt;int name="hl.fragsize"&gt;70&lt;/int&gt;
+          &lt;!-- allow 50% slop on fragment sizes --&gt;
+          &lt;float name="hl.regex.slop"&gt;0.5&lt;/float&gt;
+          &lt;!-- a basic sentence pattern --&gt;
+          &lt;str name="hl.regex.pattern"&gt;[-\w ,/\n\&amp;quot;&amp;apos;]{20,200}&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmenter&gt;
+
+      &lt;!-- Configure the standard formatter --&gt;
+      &lt;formatter name="html" 
+                 default="true"
+                 class="solr.highlight.HtmlFormatter"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.simple.pre"&gt;&lt;![CDATA[&lt;em&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.simple.post"&gt;&lt;![CDATA[&lt;/em&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/formatter&gt;
+
+      &lt;!-- Configure the standard encoder --&gt;
+      &lt;encoder name="html" 
+               class="solr.highlight.HtmlEncoder" /&gt;
+
+      &lt;!-- Configure the standard fragListBuilder --&gt;
+      &lt;fragListBuilder name="simple" 
+                       class="solr.highlight.SimpleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the single fragListBuilder --&gt;
+      &lt;fragListBuilder name="single" 
+                       class="solr.highlight.SingleFragListBuilder"/&gt;
+      
+      &lt;!-- Configure the weighted fragListBuilder --&gt;
+      &lt;fragListBuilder name="weighted" 
+                       default="true"
+                       class="solr.highlight.WeightedFragListBuilder"/&gt;
+      
+      &lt;!-- default tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="default" 
+                        default="true"
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;!-- 
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.multiValuedSeparatorChar"&gt;/&lt;/str&gt;
+        &lt;/lst&gt;
+        --&gt;
+      &lt;/fragmentsBuilder&gt;
+
+      &lt;!-- multi-colored tag FragmentsBuilder --&gt;
+      &lt;fragmentsBuilder name="colored" 
+                        class="solr.highlight.ScoreOrderFragmentsBuilder"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.tag.pre"&gt;&lt;![CDATA[
+               &lt;b style="background:yellow"&gt;,&lt;b style="background:lawgreen"&gt;,
+               &lt;b style="background:aquamarine"&gt;,&lt;b style="background:magenta"&gt;,
+               &lt;b style="background:palegreen"&gt;,&lt;b style="background:coral"&gt;,
+               &lt;b style="background:wheat"&gt;,&lt;b style="background:khaki"&gt;,
+               &lt;b style="background:lime"&gt;,&lt;b style="background:deepskyblue"&gt;]]&gt;&lt;/str&gt;
+          &lt;str name="hl.tag.post"&gt;&lt;![CDATA[&lt;/b&gt;]]&gt;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/fragmentsBuilder&gt;
+      
+      &lt;boundaryScanner name="default" 
+                       default="true"
+                       class="solr.highlight.SimpleBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;str name="hl.bs.maxScan"&gt;10&lt;/str&gt;
+          &lt;str name="hl.bs.chars"&gt;.,!? &amp;#9;&amp;#10;&amp;#13;&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+      
+      &lt;boundaryScanner name="breakIterator" 
+                       class="solr.highlight.BreakIteratorBoundaryScanner"&gt;
+        &lt;lst name="defaults"&gt;
+          &lt;!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE --&gt;
+          &lt;str name="hl.bs.type"&gt;WORD&lt;/str&gt;
+          &lt;!-- language and country are used when constructing Locale object.  --&gt;
+          &lt;!-- And the Locale object will be used when getting instance of BreakIterator --&gt;
+          &lt;str name="hl.bs.language"&gt;en&lt;/str&gt;
+          &lt;str name="hl.bs.country"&gt;US&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/boundaryScanner&gt;
+    &lt;/highlighting&gt;
+  &lt;/searchComponent&gt;
+
+  &lt;!-- Update Processors
+
+       Chains of Update Processor Factories for dealing with Update
+       Requests can be declared, and then used by name in Update
+       Request Processors
+
+       http://wiki.apache.org/solr/UpdateRequestProcessor
+
+    --&gt; 
+
+  &lt;!-- Add unknown fields to the schema 
+  
+       An example field type guessing update processor that will
+       attempt to parse string-typed field values as Booleans, Longs,
+       Doubles, or Dates, and then add schema fields with the guessed
+       field types.  
+       
+       This requires that the schema is both managed and mutable, by
+       declaring schemaFactory as ManagedIndexSchemaFactory, with
+       mutable specified as true. 
+       
+       See http://wiki.apache.org/solr/GuessingFieldTypes
+    --&gt;
+  &lt;updateRequestProcessorChain name="add-unknown-fields-to-the-schema"&gt;
+
+    &lt;processor class="solr.DefaultValueUpdateProcessorFactory"&gt;
+        &lt;str name="fieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="value"&gt;+{{logsearch_audit_logs_max_retention}}DAYS&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.processor.DocExpirationUpdateProcessorFactory"&gt;
+        &lt;int name="autoDeletePeriodSeconds"&gt;30&lt;/int&gt;
+        &lt;str name="ttlFieldName"&gt;_ttl_&lt;/str&gt;
+        &lt;str name="expirationFieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.FirstFieldValueUpdateProcessorFactory"&gt;
+      &lt;str name="fieldName"&gt;_expire_at_&lt;/str&gt;
+    &lt;/processor&gt;
+
+
+    &lt;processor class="solr.RemoveBlankFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseBooleanFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseLongFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDoubleFieldUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.ParseDateFieldUpdateProcessorFactory"&gt;
+      &lt;arr name="format"&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd'T'HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSSZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss.SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss,SSS&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ssZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm:ss&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mmZ&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd HH:mm&lt;/str&gt;
+        &lt;str&gt;yyyy-MM-dd&lt;/str&gt;
+      &lt;/arr&gt;
+    &lt;/processor&gt;
+    &lt;processor class="solr.AddSchemaFieldsUpdateProcessorFactory"&gt;
+      &lt;str name="defaultFieldType"&gt;key_lower_case&lt;/str&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Boolean&lt;/str&gt;
+        &lt;str name="fieldType"&gt;booleans&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.util.Date&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdates&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Long&lt;/str&gt;
+        &lt;str name="valueClass"&gt;java.lang.Integer&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tlongs&lt;/str&gt;
+      &lt;/lst&gt;
+      &lt;lst name="typeMapping"&gt;
+        &lt;str name="valueClass"&gt;java.lang.Number&lt;/str&gt;
+        &lt;str name="fieldType"&gt;tdoubles&lt;/str&gt;
+      &lt;/lst&gt;
+    &lt;/processor&gt;
+
+    &lt;processor class="solr.LogUpdateProcessorFactory"/&gt;
+    &lt;processor class="solr.RunUpdateProcessorFactory"/&gt;
+  &lt;/updateRequestProcessorChain&gt;
+
+
+  &lt;!-- Deduplication
+
+       An example dedup update processor that creates the "id" field
+       on the fly based on the hash code of some other fields.  This
+       example has overwriteDupes set to false since we are using the
+       id field as the signatureField and Solr will maintain
+       uniqueness based on that anyway.  
+       
+    --&gt;
+  &lt;!--
+     &lt;updateRequestProcessorChain name="dedupe"&gt;
+       &lt;processor class="solr.processor.SignatureUpdateProcessorFactory"&gt;
+         &lt;bool name="enabled"&gt;true&lt;/bool&gt;
+         &lt;str name="signatureField"&gt;id&lt;/str&gt;
+         &lt;bool name="overwriteDupes"&gt;false&lt;/bool&gt;
+         &lt;str name="fields"&gt;name,features,cat&lt;/str&gt;
+         &lt;str name="signatureClass"&gt;solr.processor.Lookup3Signature&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+  
+  &lt;!-- Language identification
+
+       This example update chain identifies the language of the incoming
+       documents using the langid contrib. The detected language is
+       written to field language_s. No field name mapping is done.
+       The fields used for detection are text, title, subject and description,
+       making this example suitable for detecting languages form full-text
+       rich documents injected via ExtractingRequestHandler.
+       See more about langId at http://wiki.apache.org/solr/LanguageDetection
+    --&gt;
+    &lt;!--
+     &lt;updateRequestProcessorChain name="langid"&gt;
+       &lt;processor class="org.apache.solr.update.processor.TikaLanguageIdentifierUpdateProcessorFactory"&gt;
+         &lt;str name="langid.fl"&gt;text,title,subject,description&lt;/str&gt;
+         &lt;str name="langid.langField"&gt;language_s&lt;/str&gt;
+         &lt;str name="langid.fallback"&gt;en&lt;/str&gt;
+       &lt;/processor&gt;
+       &lt;processor class="solr.LogUpdateProcessorFactory" /&gt;
+       &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+     &lt;/updateRequestProcessorChain&gt;
+    --&gt;
+
+  &lt;!-- Script update processor
+
+    This example hooks in an update processor implemented using JavaScript.
+
+    See more about the script update processor at http://wiki.apache.org/solr/ScriptUpdateProcessor
+  --&gt;
+  &lt;!--
+    &lt;updateRequestProcessorChain name="script"&gt;
+      &lt;processor class="solr.StatelessScriptUpdateProcessorFactory"&gt;
+        &lt;str name="script"&gt;update-script.js&lt;/str&gt;
+        &lt;lst name="params"&gt;
+          &lt;str name="config_param"&gt;example config parameter&lt;/str&gt;
+        &lt;/lst&gt;
+      &lt;/processor&gt;
+      &lt;processor class="solr.RunUpdateProcessorFactory" /&gt;
+    &lt;/updateRequestProcessorChain&gt;
+  --&gt;
+ 
+  &lt;!-- Response Writers
+
+       http://wiki.apache.org/solr/QueryResponseWriter
+
+       Request responses will be written using the writer specified by
+       the 'wt' request parameter matching the name of a registered
+       writer.
+
+       The "default" writer is the default and will be used if 'wt' is
+       not specified in the request.
+    --&gt;
+  &lt;!-- The following response writers are implicitly configured unless
+       overridden...
+    --&gt;
+  &lt;!--
+     &lt;queryResponseWriter name="xml" 
+                          default="true"
+                          class="solr.XMLResponseWriter" /&gt;
+     &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"/&gt;
+     &lt;queryResponseWriter name="python" class="solr.PythonResponseWriter"/&gt;
+     &lt;queryResponseWriter name="ruby" class="solr.RubyResponseWriter"/&gt;
+     &lt;queryResponseWriter name="php" class="solr.PHPResponseWriter"/&gt;
+     &lt;queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/&gt;
+     &lt;queryResponseWriter name="csv" class="solr.CSVResponseWriter"/&gt;
+     &lt;queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/&gt;
+    --&gt;
+
+  &lt;queryResponseWriter name="json" class="solr.JSONResponseWriter"&gt;
+     &lt;!-- For the purposes of the tutorial, JSON responses are written as
+      plain text so that they are easy to read in *any* browser.
+      If you expect a MIME type of "application/json" just remove this override.
+     --&gt;
+    &lt;str name="content-type"&gt;text/plain; charset=UTF-8&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+  
+  &lt;!--
+     Custom response writers can be declared as needed...
+    --&gt;
+  &lt;queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"&gt;
+    &lt;str name="template.base.dir"&gt;${velocity.template.base.dir:}&lt;/str&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- XSLT response writer transforms the XML output by any xslt file found
+       in Solr's conf/xslt directory.  Changes to xslt files are checked for
+       every xsltCacheLifetimeSeconds.  
+    --&gt;
+  &lt;queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"&gt;
+    &lt;int name="xsltCacheLifetimeSeconds"&gt;5&lt;/int&gt;
+  &lt;/queryResponseWriter&gt;
+
+  &lt;!-- Query Parsers
+
+       http://wiki.apache.org/solr/SolrQuerySyntax
+
+       Multiple QParserPlugins can be registered by name, and then
+       used in either the "defType" param for the QueryComponent (used
+       by SearchHandler) or in LocalParams
+    --&gt;
+  &lt;!-- example of registering a query parser --&gt;
+  &lt;!--
+     &lt;queryParser name="myparser" class="com.mycompany.MyQParserPlugin"/&gt;
+    --&gt;
+
+  &lt;!-- Function Parsers
+
+       http://wiki.apache.org/solr/FunctionQuery
+
+       Multiple ValueSourceParsers can be registered by name, and then
+       used as function names when using the "func" QParser.
+    --&gt;
+  &lt;!-- example of registering a custom function parser  --&gt;
+  &lt;!--
+     &lt;valueSourceParser name="myfunc" 
+                        class="com.mycompany.MyValueSourceParser" /&gt;
+    --&gt;
+    
+  
+  &lt;!-- Document Transformers
+       http://wiki.apache.org/solr/DocTransformers
+    --&gt;
+  &lt;!--
+     Could be something like:
+     &lt;transformer name="db" class="com.mycompany.LoadFromDatabaseTransformer" &gt;
+       &lt;int name="connection"&gt;jdbc://....&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     To add a constant value to all docs, use:
+     &lt;transformer name="mytrans2" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;int name="value"&gt;5&lt;/int&gt;
+     &lt;/transformer&gt;
+     
+     If you want the user to still be able to change it with _value:something_ use this:
+     &lt;transformer name="mytrans3" class="org.apache.solr.response.transform.ValueAugmenterFactory" &gt;
+       &lt;double name="defaultValue"&gt;5&lt;/double&gt;
+     &lt;/transformer&gt;
+
+      If you are using the QueryElevationComponent, you may wish to mark documents that get boosted.  The
+      EditorialMarkerFactory will do exactly that:
+     &lt;transformer name="qecBooster" class="org.apache.solr.response.transform.EditorialMarkerFactory" /&gt;
+    --&gt;
+    
+
+  &lt;!-- Legacy config for the admin interface --&gt;
+  &lt;admin&gt;
+    &lt;defaultQuery&gt;*:*&lt;/defaultQuery&gt;
+  &lt;/admin&gt;
+
+&lt;/config&gt;
+    </value>
+  </property>
+
+  
+</configuration>  


[26/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.js
new file mode 100644
index 0000000..082e099
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.js
@@ -0,0 +1,655 @@
+define(['jquery', 'underscore', 'backbone', 'backbone-forms'], function($, _, Backbone) {
+
+  ;(function(Form) {
+
+  /**
+   * List editor
+   * 
+   * An array editor. Creates a list of other editor items.
+   *
+   * Special options:
+   * @param {String} [options.schema.itemType]          The editor type for each item in the list. Default: 'Text'
+   * @param {String} [options.schema.confirmDelete]     Text to display in a delete confirmation dialog. If falsey, will not ask for confirmation.
+   */
+  Form.editors.List = Form.editors.Base.extend({
+
+    events: {
+      'click [data-action="add"]': function(event) {
+        event.preventDefault();
+        this.addItem(null, true);
+      }
+    },
+
+    initialize: function(options) {
+      options = options || {};
+
+      var editors = Form.editors;
+
+      editors.Base.prototype.initialize.call(this, options);
+
+      var schema = this.schema;
+      if (!schema) throw "Missing required option 'schema'";
+
+      this.template = options.template || this.constructor.template;
+
+      //Determine the editor to use
+      this.Editor = (function() {
+        var type = schema.itemType;
+
+        //Default to Text
+        if (!type) return editors.Text;
+
+        //Use List-specific version if available
+        if (editors.List[type]) return editors.List[type];
+
+        //Or whichever was passed
+        return editors[type];
+      })();
+
+      this.items = [];
+    },
+
+    render: function() {
+      var self = this,
+          value = this.value || [];
+
+      //Create main element
+      var $el = $($.trim(this.template()));
+
+      //Store a reference to the list (item container)
+      this.$list = $el.is('[data-items]') ? $el : $el.find('[data-items]');
+
+      //Add existing items
+      if (value.length) {
+        _.each(value, function(itemValue) {
+          self.addItem(itemValue);
+        });
+      }
+
+      //If no existing items create an empty one, unless the editor specifies otherwise
+      else {
+        if (!this.Editor.isAsync) this.addItem();
+      }
+
+      this.setElement($el);
+      this.$el.attr('id', this.id);
+      this.$el.attr('name', this.key);
+            
+      if (this.hasFocus) this.trigger('blur', this);
+      
+      return this;
+    },
+
+    /**
+     * Add a new item to the list
+     * @param {Mixed} [value]           Value for the new item editor
+     * @param {Boolean} [userInitiated] If the item was added by the user clicking 'add'
+     */
+    addItem: function(value, userInitiated) {
+      var self = this,
+          editors = Form.editors;
+
+      //Create the item
+      var item = new editors.List.Item({
+        list: this,
+        form: this.form,
+        schema: this.schema,
+        value: value,
+        Editor: this.Editor,
+        key: this.key
+      }).render();
+      
+      var _addItem = function() {
+        self.items.push(item);
+        self.$list.append(item.el);
+        
+        item.editor.on('all', function(event) {
+          if (event === 'change') return;
+
+          // args = ["key:change", itemEditor, fieldEditor]
+          var args = _.toArray(arguments);
+          args[0] = 'item:' + event;
+          args.splice(1, 0, self);
+          // args = ["item:key:change", this=listEditor, itemEditor, fieldEditor]
+
+          editors.List.prototype.trigger.apply(this, args);
+        }, self);
+
+        item.editor.on('change', function() {
+          if (!item.addEventTriggered) {
+            item.addEventTriggered = true;
+            this.trigger('add', this, item.editor);
+          }
+          this.trigger('item:change', this, item.editor);
+          this.trigger('change', this);
+        }, self);
+
+        item.editor.on('focus', function() {
+          if (this.hasFocus) return;
+          this.trigger('focus', this);
+        }, self);
+        item.editor.on('blur', function() {
+          if (!this.hasFocus) return;
+          var self = this;
+          setTimeout(function() {
+            if (_.find(self.items, function(item) { return item.editor.hasFocus; })) return;
+            self.trigger('blur', self);
+          }, 0);
+        }, self);
+        
+        if (userInitiated || value) {
+          item.addEventTriggered = true;
+        }
+        
+        if (userInitiated) {
+          self.trigger('add', self, item.editor);
+          self.trigger('change', self);
+        }
+      };
+
+      //Check if we need to wait for the item to complete before adding to the list
+      if (this.Editor.isAsync) {
+        item.editor.on('readyToAdd', _addItem, this);
+      }
+
+      //Most editors can be added automatically
+      else {
+        _addItem();
+        item.editor.focus();
+      }
+      
+      return item;
+    },
+
+    /**
+     * Remove an item from the list
+     * @param {List.Item} item
+     */
+    removeItem: function(item) {
+      //Confirm delete
+      var confirmMsg = this.schema.confirmDelete;
+      if (confirmMsg && !confirm(confirmMsg)) return;
+
+      var index = _.indexOf(this.items, item);
+
+      this.items[index].remove();
+      this.items.splice(index, 1);
+      
+      if (item.addEventTriggered) {
+        this.trigger('remove', this, item.editor);
+        this.trigger('change', this);
+      }
+
+      if (!this.items.length && !this.Editor.isAsync) this.addItem();
+    },
+
+    getValue: function() {
+      var values = _.map(this.items, function(item) {
+        return item.getValue();
+      });
+
+      //Filter empty items
+      return _.without(values, undefined, '');
+    },
+
+    setValue: function(value) {
+      this.value = value;
+      this.render();
+    },
+    
+    focus: function() {
+      if (this.hasFocus) return;
+
+      if (this.items[0]) this.items[0].editor.focus();
+    },
+    
+    blur: function() {
+      if (!this.hasFocus) return;
+
+      var focusedItem = _.find(this.items, function(item) { return item.editor.hasFocus; });
+      
+      if (focusedItem) focusedItem.editor.blur();
+    },
+
+    /**
+     * Override default remove function in order to remove item views
+     */
+    remove: function() {
+      _.invoke(this.items, 'remove');
+
+      Form.editors.Base.prototype.remove.call(this);
+    },
+    
+    /**
+     * Run validation
+     * 
+     * @return {Object|Null}
+     */
+    validate: function() {
+      if (!this.validators) return null;
+
+      //Collect errors
+      var errors = _.map(this.items, function(item) {
+        return item.validate();
+      });
+
+      //Check if any item has errors
+      var hasErrors = _.compact(errors).length ? true : false;
+      if (!hasErrors) return null;
+
+      //If so create a shared error
+      var fieldError = {
+        type: 'list',
+        message: 'Some of the items in the list failed validation',
+        errors: errors
+      };
+
+      return fieldError;
+    }
+  }, {
+
+    //STATICS
+    template: _.template('\
+      <div>\
+        <div data-items></div>\
+        <button type="button" data-action="add">Add</button>\
+      </div>\
+    ', null, Form.templateSettings)
+
+  });
+
+
+  /**
+   * A single item in the list
+   *
+   * @param {editors.List} options.list The List editor instance this item belongs to
+   * @param {Function} options.Editor   Editor constructor function
+   * @param {String} options.key        Model key
+   * @param {Mixed} options.value       Value
+   * @param {Object} options.schema     Field schema
+   */
+  Form.editors.List.Item = Form.editors.Base.extend({
+
+    events: {
+      'click [data-action="remove"]': function(event) {
+        event.preventDefault();
+        this.list.removeItem(this);
+      },
+      'keydown input[type=text]': function(event) {
+        if(event.keyCode !== 13) return;
+        event.preventDefault();
+        this.list.addItem();
+        this.list.$list.find("> li:last input").focus();
+      }
+    },
+
+    initialize: function(options) {
+      this.list = options.list;
+      this.schema = options.schema || this.list.schema;
+      this.value = options.value;
+      this.Editor = options.Editor || Form.editors.Text;
+      this.key = options.key;
+      this.template = options.template || this.constructor.template;
+      this.errorClassName = options.errorClassName || this.constructor.errorClassName;
+      this.form = options.form;
+    },
+
+    render: function() {
+      //Create editor
+      this.editor = new this.Editor({
+        key: this.key,
+        schema: this.schema,
+        value: this.value,
+        list: this.list,
+        item: this,
+        form: this.form
+      }).render();
+
+      //Create main element
+      var $el = $($.trim(this.template()));
+
+      $el.find('[data-editor]').append(this.editor.el);
+
+      //Replace the entire element so there isn't a wrapper tag
+      this.setElement($el);
+        
+      return this;
+    },
+
+    getValue: function() {
+      return this.editor.getValue();
+    },
+
+    setValue: function(value) {
+      this.editor.setValue(value);
+    },
+    
+    focus: function() {
+      this.editor.focus();
+    },
+    
+    blur: function() {
+      this.editor.blur();
+    },
+
+    remove: function() {
+      this.editor.remove();
+
+      Backbone.View.prototype.remove.call(this);
+    },
+
+    validate: function() {
+      var value = this.getValue(),
+          formValues = this.list.form ? this.list.form.getValue() : {},
+          validators = this.schema.validators,
+          getValidator = this.getValidator;
+
+      if (!validators) return null;
+
+      //Run through validators until an error is found
+      var error = null;
+      _.every(validators, function(validator) {
+        error = getValidator(validator)(value, formValues);
+
+        return error ? false : true;
+      });
+
+      //Show/hide error
+      if (error){
+        this.setError(error);
+      } else {
+        this.clearError();
+      }
+
+      //Return error to be aggregated by list
+      return error ? error : null;
+    },
+
+    /**
+     * Show a validation error
+     */
+    setError: function(err) {
+      this.$el.addClass(this.errorClassName);
+      this.$el.attr('title', err.message);
+    },
+
+    /**
+     * Hide validation errors
+     */
+    clearError: function() {
+      this.$el.removeClass(this.errorClassName);
+      this.$el.attr('title', null);
+    }
+  }, {
+
+    //STATICS
+    template: _.template('\
+      <div>\
+        <span data-editor></span>\
+        <button type="button" data-action="remove">&times;</button>\
+      </div>\
+    ', null, Form.templateSettings),
+
+    errorClassName: 'error'
+
+  });
+
+
+  /**
+   * Base modal object editor for use with the List editor; used by Object 
+   * and NestedModal list types
+   */
+  Form.editors.List.Modal = Form.editors.Base.extend({
+
+    events: {
+      'click': 'openEditor'
+    },
+
+    /**
+     * @param {Object} options
+     * @param {Form} options.form                       The main form
+     * @param {Function} [options.schema.itemToString]  Function to transform the value for display in the list.
+     * @param {String} [options.schema.itemType]        Editor type e.g. 'Text', 'Object'.
+     * @param {Object} [options.schema.subSchema]       Schema for nested form,. Required when itemType is 'Object'
+     * @param {Function} [options.schema.model]         Model constructor function. Required when itemType is 'NestedModel'
+     */
+    initialize: function(options) {
+      options = options || {};
+      
+      Form.editors.Base.prototype.initialize.call(this, options);
+      
+      //Dependencies
+      if (!Form.editors.List.Modal.ModalAdapter) throw 'A ModalAdapter is required';
+
+      this.form = options.form;
+      if (!options.form) throw 'Missing required option: "form"';
+
+      //Template
+      this.template = options.template || this.constructor.template;
+    },
+
+    /**
+     * Render the list item representation
+     */
+    render: function() {
+      var self = this;
+
+      //New items in the list are only rendered when the editor has been OK'd
+      if (_.isEmpty(this.value)) {
+        this.openEditor();
+      }
+
+      //But items with values are added automatically
+      else {
+        this.renderSummary();
+
+        setTimeout(function() {
+          self.trigger('readyToAdd');
+        }, 0);
+      }
+
+      if (this.hasFocus) this.trigger('blur', this);
+
+      return this;
+    },
+
+    /**
+     * Renders the list item representation
+     */
+    renderSummary: function() {
+      this.$el.html($.trim(this.template({
+        summary: this.getStringValue()
+      })));
+    },
+
+    /**
+     * Function which returns a generic string representation of an object
+     *
+     * @param {Object} value
+     * 
+     * @return {String}
+     */
+    itemToString: function(value) {
+      var createTitle = function(key) {
+        var context = { key: key };
+
+        return Form.Field.prototype.createTitle.call(context);
+      };
+
+      value = value || {};
+
+      //Pretty print the object keys and values
+      var parts = [];
+      _.each(this.nestedSchema, function(schema, key) {
+        var desc = schema.title ? schema.title : createTitle(key),
+            val = value[key];
+
+        if (_.isUndefined(val) || _.isNull(val)) val = '';
+
+        parts.push(desc + ': ' + val);
+      });
+
+      return parts.join('<br />');
+    },
+
+    /**
+     * Returns the string representation of the object value
+     */
+    getStringValue: function() {
+      var schema = this.schema,
+          value = this.getValue();
+
+      if (_.isEmpty(value)) return '[Empty]';
+
+      //If there's a specified toString use that
+      if (schema.itemToString) return schema.itemToString(value);
+      
+      //Otherwise use the generic method or custom overridden method
+      return this.itemToString(value);
+    },
+
+    openEditor: function() {
+      var self = this,
+          ModalForm = this.form.constructor;
+
+      var form = this.modalForm = new ModalForm({
+        schema: this.nestedSchema,
+        data: this.value
+      });
+
+      var modal = this.modal = new Form.editors.List.Modal.ModalAdapter({
+        content: form,
+        animate: true
+      });
+
+      modal.open();
+
+      this.trigger('open', this);
+      this.trigger('focus', this);
+
+      modal.on('cancel', this.onModalClosed, this);
+      
+      modal.on('ok', _.bind(this.onModalSubmitted, this));
+    },
+
+    /**
+     * Called when the user clicks 'OK'.
+     * Runs validation and tells the list when ready to add the item
+     */
+    onModalSubmitted: function() {
+      var modal = this.modal,
+          form = this.modalForm,
+          isNew = !this.value;
+
+      //Stop if there are validation errors
+      var error = form.validate();
+      if (error) return modal.preventClose();
+
+      //Store form value
+      this.value = form.getValue();
+
+      //Render item
+      this.renderSummary();
+
+      if (isNew) this.trigger('readyToAdd');
+      
+      this.trigger('change', this);
+
+      this.onModalClosed();
+    },
+
+    /**
+     * Cleans up references, triggers events. To be called whenever the modal closes
+     */
+    onModalClosed: function() {
+      this.modal = null;
+      this.modalForm = null;
+
+      this.trigger('close', this);
+      this.trigger('blur', this);
+    },
+
+    getValue: function() {
+      return this.value;
+    },
+
+    setValue: function(value) {
+      this.value = value;
+    },
+    
+    focus: function() {
+      if (this.hasFocus) return;
+
+      this.openEditor();
+    },
+    
+    blur: function() {
+      if (!this.hasFocus) return;
+      
+      if (this.modal) {
+        this.modal.trigger('cancel');
+      }
+    }
+  }, {
+    //STATICS
+    template: _.template('\
+      <div><%= summary %></div>\
+    '),
+
+    //The modal adapter that creates and manages the modal dialog.
+    //Defaults to BootstrapModal (http://github.com/powmedia/backbone.bootstrap-modal)
+    //Can be replaced with another adapter that implements the same interface.
+    ModalAdapter: Backbone.BootstrapModal,
+    
+    //Make the wait list for the 'ready' event before adding the item to the list
+    isAsync: true
+  });
+
+
+  Form.editors.List.Object = Form.editors.List.Modal.extend({
+    initialize: function () {
+      Form.editors.List.Modal.prototype.initialize.apply(this, arguments);
+
+      var schema = this.schema;
+
+      if (!schema.subSchema) throw 'Missing required option "schema.subSchema"';
+
+      this.nestedSchema = schema.subSchema;
+    }
+  });
+
+
+  Form.editors.List.NestedModel = Form.editors.List.Modal.extend({
+    initialize: function() {
+      Form.editors.List.Modal.prototype.initialize.apply(this, arguments);
+
+      var schema = this.schema;
+
+      if (!schema.model) throw 'Missing required option "schema.model"';
+
+      var nestedSchema = schema.model.prototype.schema;
+
+      this.nestedSchema = (_.isFunction(nestedSchema)) ? nestedSchema() : nestedSchema;
+    },
+
+    /**
+     * Returns the string representation of the object value
+     */
+    getStringValue: function() {
+      var schema = this.schema,
+          value = this.getValue();
+
+      if (_.isEmpty(value)) return null;
+
+      //If there's a specified toString use that
+      if (schema.itemToString) return schema.itemToString(value);
+      
+      //Otherwise use the model
+      return new (schema.model)(value).toString();
+    }
+  });
+
+})(Backbone.Form);
+
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.min.js
new file mode 100644
index 0000000..ce7eb66
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/list.min.js
@@ -0,0 +1 @@
+define(["jquery","underscore","backbone","backbone-forms"],function(e,t,n){(function(r){r.editors.List=r.editors.Base.extend({events:{'click [data-action="add"]':function(e){e.preventDefault(),this.addItem(null,!0)}},initialize:function(e){e=e||{};var t=r.editors;t.Base.prototype.initialize.call(this,e);var n=this.schema;if(!n)throw"Missing required option 'schema'";this.template=e.template||this.constructor.template,this.Editor=function(){var e=n.itemType;return e?t.List[e]?t.List[e]:t[e]:t.Text}(),this.items=[]},render:function(){var n=this,r=this.value||[],i=e(e.trim(this.template()));return this.$list=i.is("[data-items]")?i:i.find("[data-items]"),r.length?t.each(r,function(e){n.addItem(e)}):this.Editor.isAsync||this.addItem(),this.setElement(i),this.$el.attr("id",this.id),this.$el.attr("name",this.key),this.hasFocus&&this.trigger("blur",this),this},addItem:function(e,n){var i=this,s=r.editors,o=(new s.List.Item({list:this,form:this.form,schema:this.schema,value:e,Editor:this.Edi
 tor,key:this.key})).render(),u=function(){i.items.push(o),i.$list.append(o.el),o.editor.on("all",function(e){if(e==="change")return;var n=t.toArray(arguments);n[0]="item:"+e,n.splice(1,0,i),s.List.prototype.trigger.apply(this,n)},i),o.editor.on("change",function(){o.addEventTriggered||(o.addEventTriggered=!0,this.trigger("add",this,o.editor)),this.trigger("item:change",this,o.editor),this.trigger("change",this)},i),o.editor.on("focus",function(){if(this.hasFocus)return;this.trigger("focus",this)},i),o.editor.on("blur",function(){if(!this.hasFocus)return;var e=this;setTimeout(function(){if(t.find(e.items,function(e){return e.editor.hasFocus}))return;e.trigger("blur",e)},0)},i);if(n||e)o.addEventTriggered=!0;n&&(i.trigger("add",i,o.editor),i.trigger("change",i))};return this.Editor.isAsync?o.editor.on("readyToAdd",u,this):(u(),o.editor.focus()),o},removeItem:function(e){var n=this.schema.confirmDelete;if(n&&!confirm(n))return;var r=t.indexOf(this.items,e);this.items[r].remove(),this.i
 tems.splice(r,1),e.addEventTriggered&&(this.trigger("remove",this,e.editor),this.trigger("change",this)),!this.items.length&&!this.Editor.isAsync&&this.addItem()},getValue:function(){var e=t.map(this.items,function(e){return e.getValue()});return t.without(e,undefined,"")},setValue:function(e){this.value=e,this.render()},focus:function(){if(this.hasFocus)return;this.items[0]&&this.items[0].editor.focus()},blur:function(){if(!this.hasFocus)return;var e=t.find(this.items,function(e){return e.editor.hasFocus});e&&e.editor.blur()},remove:function(){t.invoke(this.items,"remove"),r.editors.Base.prototype.remove.call(this)},validate:function(){if(!this.validators)return null;var e=t.map(this.items,function(e){return e.validate()}),n=t.compact(e).length?!0:!1;if(!n)return null;var r={type:"list",message:"Some of the items in the list failed validation",errors:e};return r}},{template:t.template('      <div>        <div data-items></div>        <button type="button" data-action="add">Add</but
 ton>      </div>    ',null,r.templateSettings)}),r.editors.List.Item=r.editors.Base.extend({events:{'click [data-action="remove"]':function(e){e.preventDefault(),this.list.removeItem(this)},"keydown input[type=text]":function(e){if(e.keyCode!==13)return;e.preventDefault(),this.list.addItem(),this.list.$list.find("> li:last input").focus()}},initialize:function(e){this.list=e.list,this.schema=e.schema||this.list.schema,this.value=e.value,this.Editor=e.Editor||r.editors.Text,this.key=e.key,this.template=e.template||this.constructor.template,this.errorClassName=e.errorClassName||this.constructor.errorClassName,this.form=e.form},render:function(){this.editor=(new this.Editor({key:this.key,schema:this.schema,value:this.value,list:this.list,item:this,form:this.form})).render();var t=e(e.trim(this.template()));return t.find("[data-editor]").append(this.editor.el),this.setElement(t),this},getValue:function(){return this.editor.getValue()},setValue:function(e){this.editor.setValue(e)},focus:
 function(){this.editor.focus()},blur:function(){this.editor.blur()},remove:function(){this.editor.remove(),n.View.prototype.remove.call(this)},validate:function(){var e=this.getValue(),n=this.list.form?this.list.form.getValue():{},r=this.schema.validators,i=this.getValidator;if(!r)return null;var s=null;return t.every(r,function(t){return s=i(t)(e,n),s?!1:!0}),s?this.setError(s):this.clearError(),s?s:null},setError:function(e){this.$el.addClass(this.errorClassName),this.$el.attr("title",e.message)},clearError:function(){this.$el.removeClass(this.errorClassName),this.$el.attr("title",null)}},{template:t.template('      <div>        <span data-editor></span>        <button type="button" data-action="remove">&times;</button>      </div>    ',null,r.templateSettings),errorClassName:"error"}),r.editors.List.Modal=r.editors.Base.extend({events:{click:"openEditor"},initialize:function(e){e=e||{},r.editors.Base.prototype.initialize.call(this,e);if(!r.editors.List.Modal.ModalAdapter)throw"A 
 ModalAdapter is required";this.form=e.form;if(!e.form)throw'Missing required option: "form"';this.template=e.template||this.constructor.template},render:function(){var e=this;return t.isEmpty(this.value)?this.openEditor():(this.renderSummary(),setTimeout(function(){e.trigger("readyToAdd")},0)),this.hasFocus&&this.trigger("blur",this),this},renderSummary:function(){this.$el.html(e.trim(this.template({summary:this.getStringValue()})))},itemToString:function(e){var n=function(e){var t={key:e};return r.Field.prototype.createTitle.call(t)};e=e||{};var i=[];return t.each(this.nestedSchema,function(r,s){var o=r.title?r.title:n(s),u=e[s];if(t.isUndefined(u)||t.isNull(u))u="";i.push(o+": "+u)}),i.join("<br />")},getStringValue:function(){var e=this.schema,n=this.getValue();return t.isEmpty(n)?"[Empty]":e.itemToString?e.itemToString(n):this.itemToString(n)},openEditor:function(){var e=this,n=this.form.constructor,i=this.modalForm=new n({schema:this.nestedSchema,data:this.value}),s=this.modal=
 new r.editors.List.Modal.ModalAdapter({content:i,animate:!0});s.open(),this.trigger("open",this),this.trigger("focus",this),s.on("cancel",this.onModalClosed,this),s.on("ok",t.bind(this.onModalSubmitted,this))},onModalSubmitted:function(){var e=this.modal,t=this.modalForm,n=!this.value,r=t.validate();if(r)return e.preventClose();this.value=t.getValue(),this.renderSummary(),n&&this.trigger("readyToAdd"),this.trigger("change",this),this.onModalClosed()},onModalClosed:function(){this.modal=null,this.modalForm=null,this.trigger("close",this),this.trigger("blur",this)},getValue:function(){return this.value},setValue:function(e){this.value=e},focus:function(){if(this.hasFocus)return;this.openEditor()},blur:function(){if(!this.hasFocus)return;this.modal&&this.modal.trigger("cancel")}},{template:t.template("      <div><%= summary %></div>    "),ModalAdapter:n.BootstrapModal,isAsync:!0}),r.editors.List.Object=r.editors.List.Modal.extend({initialize:function(){r.editors.List.Modal.prototype.in
 itialize.apply(this,arguments);var e=this.schema;if(!e.subSchema)throw'Missing required option "schema.subSchema"';this.nestedSchema=e.subSchema}}),r.editors.List.NestedModel=r.editors.List.Modal.extend({initialize:function(){r.editors.List.Modal.prototype.initialize.apply(this,arguments);var e=this.schema;if(!e.model)throw'Missing required option "schema.model"';var n=e.model.prototype.schema;this.nestedSchema=t.isFunction(n)?n():n},getStringValue:function(){var e=this.schema,n=this.getValue();return t.isEmpty(n)?null:e.itemToString?e.itemToString(n):(new e.model(n)).toString()}})})(n.Form)})
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/old.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/old.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/old.js
new file mode 100644
index 0000000..e3efe55
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-forms/js/old.js
@@ -0,0 +1,91 @@
+/** 
+ * Include this template file after backbone-forms.amd.js to override the default templates
+ *
+ * 'data-*' attributes control where elements are placed
+ */
+define(['jquery', 'underscore', 'backbone', 'backbone-forms'], function($, _, Backbone) {
+  var Form = Backbone.Form;
+
+    
+  /**
+   * Templates to match those used previous versions of Backbone Form, i.e. <= 0.11.0.
+   * NOTE: These templates are deprecated.
+   */
+  Form.template = _.template('\
+    <form class="bbf-form" data-fieldsets></form>\
+  ');
+
+
+  Form.Fieldset.template = _.template('\
+    <fieldset>\
+      <% if (legend) { %>\
+        <legend><%= legend %></legend>\
+      <% } %>\
+      <ul data-fields></ul>\
+    </fieldset>\
+  ');
+
+
+  Form.Field.template = _.template('\
+    <li class="bbf-field field-<%= key %>">\
+      <label for="<%= editorId %>"><%= title %></label>\
+      <div class="bbf-editor" data-editor></div>\
+      <div class="bbf-help"><%= help %></div>\
+      <div class="bbf-error" data-error></div>\
+    </li>\
+  ');
+
+
+  Form.NestedField.template = _.template('\
+    <li class="bbf-field bbf-nested-field field-<%= key %>">\
+      <label for="<%= editorId %>"><%= title %></label>\
+      <div class="bbf-editor" data-editor></div>\
+      <div class="bbf-help"><%= help %></div>\
+      <div class="bbf-error" data-error></div>\
+    </li>\
+  ');
+
+
+  Form.editors.Date.template = _.template('\
+    <div class="bbf-date">\
+      <select class="bbf-date" data-type="date"><%= dates %></select>\
+      <select class="bbf-month" data-type="month"><%= months %></select>\
+      <select class="bbf-year" data-type="year"><%= years %></select>\
+    </div>\
+  ');
+
+
+  Form.editors.DateTime.template = _.template('\
+    <div class="bbf-datetime">\
+      <div class="bbf-date-container" data-date></div>\
+      <select data-type="hour"><%= hours %></select>\
+      :\
+      <select data-type="min"><%= mins %></select>\
+    </div>\
+  ');
+
+
+  Form.editors.List.template = _.template('\
+    <div class="bbf-list">\
+      <ul data-items></ul>\
+      <div class="bbf-actions"><button type="button" data-action="add">Add</div>\
+    </div>\
+  ');
+
+
+  Form.editors.List.Item.template = _.template('\
+    <li>\
+      <button type="button" data-action="remove" class="bbf-remove">&times;</button>\
+      <div class="bbf-editor-container" data-editor></div>\
+    </li>\
+  ');
+
+
+  Form.editors.List.Modal.template = _.template('\
+    <div class="bbf-list-modal">\
+      <%= summary %>\
+    </div>\
+  ');
+
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.js
new file mode 100644
index 0000000..9accadd
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone-pageable/js/backbone-pageable.js
@@ -0,0 +1,1327 @@
+/*
+  backbone-pageable 1.3.2
+  http://github.com/wyuenho/backbone-pageable
+
+  Copyright (c) 2013 Jimmy Yuen Ho Wong
+  Licensed under the MIT @license.
+*/
+
+(function (factory) {
+
+  // CommonJS
+  if (typeof exports == "object") {
+    module.exports = factory(require("underscore"), require("backbone"));
+  }
+  // AMD
+  else if (typeof define == "function" && define.amd) {
+    define(["underscore", "backbone"], factory);
+  }
+  // Browser
+  else if (typeof _ !== "undefined" && typeof Backbone !== "undefined") {
+    var oldPageableCollection = Backbone.PageableCollection;
+    var PageableCollection = factory(_, Backbone);
+
+    /**
+       __BROWSER ONLY__
+
+       If you already have an object named `PageableCollection` attached to the
+       `Backbone` module, you can use this to return a local reference to this
+       Backbone.PageableCollection class and reset the name
+       Backbone.PageableCollection to its previous definition.
+
+           // The left hand side gives you a reference to this
+           // Backbone.PageableCollection implementation, the right hand side
+           // resets Backbone.PageableCollection to your other
+           // Backbone.PageableCollection.
+           var PageableCollection = Backbone.PageableCollection.noConflict();
+
+       @static
+       @member Backbone.PageableCollection
+       @return {Backbone.PageableCollection}
+    */
+    Backbone.PageableCollection.noConflict = function () {
+      Backbone.PageableCollection = oldPageableCollection;
+      return PageableCollection;
+    };
+  }
+
+}(function (_, Backbone) {
+
+  "use strict";
+
+  var _extend = _.extend;
+  var _omit = _.omit;
+  var _clone = _.clone;
+  var _each = _.each;
+  var _pick = _.pick;
+  var _contains = _.contains;
+  var _isEmpty = _.isEmpty;
+  var _pairs = _.pairs;
+  var _invert = _.invert;
+  var _isArray = _.isArray;
+  var _isFunction = _.isFunction;
+  var _isObject = _.isObject;
+  var _keys = _.keys;
+  var _isUndefined = _.isUndefined;
+  var _result = _.result;
+  var ceil = Math.ceil;
+  var floor = Math.floor;
+  var max = Math.max;
+
+  var BBColProto = Backbone.Collection.prototype;
+
+  function finiteInt (val, name) {
+    if (!_.isNumber(val) || _.isNaN(val) || !_.isFinite(val) || ~~val !== val) {
+      throw new TypeError("`" + name + "` must be a finite integer");
+    }
+    return val;
+  }
+
+  function queryStringToParams (qs) {
+    var kvp, k, v, ls, params = {}, decode = decodeURIComponent;
+    var kvps = qs.split('&');
+    for (var i = 0, l = kvps.length; i < l; i++) {
+      var param = kvps[i];
+      kvp = param.split('='), k = kvp[0], v = kvp[1] || true;
+      k = decode(k), ls = params[k];
+      if (_isArray(ls)) ls.push(v);
+      else if (ls) params[k] = [ls, v];
+      else params[k] = v;
+    }
+    return params;
+  }
+
+  var PARAM_TRIM_RE = /[\s'"]/g;
+  var URL_TRIM_RE = /[<>\s'"]/g;
+
+  /**
+     Drop-in replacement for Backbone.Collection. Supports server-side and
+     client-side pagination and sorting. Client-side mode also support fully
+     multi-directional synchronization of changes between pages.
+
+     @class Backbone.PageableCollection
+     @extends Backbone.Collection
+  */
+  var PageableCollection = Backbone.PageableCollection = Backbone.Collection.extend({
+
+    /**
+       The container object to store all pagination states.
+
+       You can override the default state by extending this class or specifying
+       them in an `options` hash to the constructor.
+
+       @property {Object} state
+
+       @property {0|1} [state.firstPage=1] The first page index. Set to 0 if
+       your server API uses 0-based indices. You should only override this value
+       during extension, initialization or reset by the server after
+       fetching. This value should be read only at other times.
+
+       @property {number} [state.lastPage=null] The last page index. This value
+       is __read only__ and it's calculated based on whether `firstPage` is 0 or
+       1, during bootstrapping, fetching and resetting. Please don't change this
+       value under any circumstances.
+
+       @property {number} [state.currentPage=null] The current page index. You
+       should only override this value during extension, initialization or reset
+       by the server after fetching. This value should be read only at other
+       times. Can be a 0-based or 1-based index, depending on whether
+       `firstPage` is 0 or 1. If left as default, it will be set to `firstPage`
+       on initialization.
+
+       @property {number} [state.pageSize=25] How many records to show per
+       page. This value is __read only__ after initialization, if you want to
+       change the page size after initialization, you must call #setPageSize.
+
+       @property {number} [state.totalPages=null] How many pages there are. This
+       value is __read only__ and it is calculated from `totalRecords`.
+
+       @property {number} [state.totalRecords=null] How many records there
+       are. This value is __required__ under server mode. This value is optional
+       for client mode as the number will be the same as the number of models
+       during bootstrapping and during fetching, either supplied by the server
+       in the metadata, or calculated from the size of the response.
+
+       @property {string} [state.sortKey=null] The model attribute to use for
+       sorting.
+
+       @property {-1|0|1} [state.order=-1] The order to use for sorting. Specify
+       -1 for ascending order or 1 for descending order. If 0, no client side
+       sorting will be done and the order query parameter will not be sent to
+       the server during a fetch.
+    */
+    state: {
+      firstPage: 1,
+      lastPage: null,
+      currentPage: null,
+      pageSize: 25,
+      totalPages: null,
+      totalRecords: null,
+      sortKey: null,
+      order: -1
+    },
+
+    /**
+       @property {"server"|"client"|"infinite"} [mode="server"] The mode of
+       operations for this collection. `"server"` paginates on the server-side,
+       `"client"` paginates on the client-side and `"infinite"` paginates on the
+       server-side for APIs that do not support `totalRecords`.
+    */
+    mode: "server",
+
+    /**
+       A translation map to convert Backbone.PageableCollection state attributes
+       to the query parameters accepted by your server API.
+
+       You can override the default state by extending this class or specifying
+       them in `options.queryParams` object hash to the constructor.
+
+       @property {Object} queryParams
+       @property {string} [queryParams.currentPage="page"]
+       @property {string} [queryParams.pageSize="per_page"]
+       @property {string} [queryParams.totalPages="total_pages"]
+       @property {string} [queryParams.totalRecords="total_entries"]
+       @property {string} [queryParams.sortKey="sort_by"]
+       @property {string} [queryParams.order="order"]
+       @property {string} [queryParams.directions={"-1": "asc", "1": "desc"}] A
+       map for translating a Backbone.PageableCollection#state.order constant to
+       the ones your server API accepts.
+    */
+    queryParams: {
+      currentPage: "page",
+      pageSize: "per_page",
+      totalPages: "total_pages",
+      totalRecords: "total_entries",
+      sortKey: "sort_by",
+      order: "order",
+      directions: {
+        "-1": "asc",
+        "1": "desc"
+      }
+    },
+
+    /**
+       __CLIENT MODE ONLY__
+
+       This collection is the internal storage for the bootstrapped or fetched
+       models. You can use this if you want to operate on all the pages.
+
+       @property {Backbone.Collection} fullCollection
+    */
+
+    /**
+       Given a list of models or model attributues, bootstraps the full
+       collection in client mode or infinite mode, or just the page you want in
+       server mode.
+
+       If you want to initialize a collection to a different state than the
+       default, you can specify them in `options.state`. Any state parameters
+       supplied will be merged with the default. If you want to change the
+       default mapping from #state keys to your server API's query parameter
+       names, you can specifiy an object hash in `option.queryParams`. Likewise,
+       any mapping provided will be merged with the default. Lastly, all
+       Backbone.Collection constructor options are also accepted.
+
+       See:
+
+       - Backbone.PageableCollection#state
+       - Backbone.PageableCollection#queryParams
+       - [Backbone.Collection#initialize](http://backbonejs.org/#Collection-constructor)
+
+       @param {Array.<Object>} [models]
+
+       @param {Object} [options]
+
+       @param {function(*, *): number} [options.comparator] If specified, this
+       comparator is set to the current page under server mode, or the #fullCollection
+       otherwise.
+
+       @param {boolean} [options.full] If `false` and either a
+       `options.comparator` or `sortKey` is defined, the comparator is attached
+       to the current page. Default is `true` under client or infinite mode and
+       the comparator will be attached to the #fullCollection.
+
+       @param {Object} [options.state] The state attributes overriding the defaults.
+
+       @param {string} [options.state.sortKey] The model attribute to use for
+       sorting. If specified instead of `options.comparator`, a comparator will
+       be automatically created using this value, and optionally a sorting order
+       specified in `options.state.order`. The comparator is then attached to
+       the new collection instance.
+
+       @param {-1|1} [options.state.order] The order to use for sorting. Specify
+       -1 for ascending order and 1 for descending order.
+
+       @param {Object} [options.queryParam]
+    */
+    constructor: function (models, options) {
+
+      Backbone.Collection.apply(this, arguments);
+
+      options = options || {};
+
+      var mode = this.mode = options.mode || this.mode || PageableProto.mode;
+
+      var queryParams = _extend({}, PageableProto.queryParams, this.queryParams,
+                                options.queryParams || {});
+
+      queryParams.directions = _extend({},
+                                       PageableProto.queryParams.directions,
+                                       this.queryParams.directions,
+                                       queryParams.directions || {});
+
+      this.queryParams = queryParams;
+
+      var state = this.state = _extend({}, PageableProto.state, this.state,
+                                       options.state || {});
+
+      state.currentPage = state.currentPage == null ?
+        state.firstPage :
+        state.currentPage;
+
+      if (!_isArray(models)) models = models ? [models] : [];
+
+      if (mode != "server" && state.totalRecords == null && !_isEmpty(models)) {
+        state.totalRecords = models.length;
+      }
+
+      this.switchMode(mode, _extend({fetch: false,
+                                     resetState: false,
+                                     models: models}, options));
+
+      var comparator = options.comparator;
+
+      if (state.sortKey && !comparator) {
+        this.setSorting(state.sortKey, state.order, options);
+      }
+
+      if (mode != "server") {
+        var fullCollection = this.fullCollection;
+
+        if (comparator && options.full) {
+          delete this.comparator;
+          fullCollection.comparator = comparator;
+        }
+
+        if (options.full) fullCollection.sort();
+
+        // make sure the models in the current page and full collection have the
+        // same references
+        if (models && !_isEmpty(models)) {
+          this.getPage(state.currentPage);
+          models.splice.apply(models, [0, models.length].concat(this.models));
+        }
+      }
+
+      this._initState = _clone(this.state);
+    },
+
+    /**
+       Makes a Backbone.Collection that contains all the pages.
+
+       @private
+       @param {Array.<Object|Backbone.Model>} models
+       @param {Object} options Options for Backbone.Collection constructor.
+       @return {Backbone.Collection}
+    */
+    _makeFullCollection: function (models, options) {
+
+      var properties = ["url", "model", "sync", "comparator"];
+      var thisProto = this.constructor.prototype;
+      var i, length, prop;
+
+      var proto = {};
+      for (i = 0, length = properties.length; i < length; i++) {
+        prop = properties[i];
+        if (!_isUndefined(thisProto[prop])) {
+          proto[prop] = thisProto[prop];
+        }
+      }
+
+      var fullCollection = new (Backbone.Collection.extend(proto))(models, options);
+
+      for (i = 0, length = properties.length; i < length; i++) {
+        prop = properties[i];
+        if (this[prop] !== thisProto[prop]) {
+          fullCollection[prop] = this[prop];
+        }
+      }
+
+      return fullCollection;
+    },
+
+    /**
+       Factory method that returns a Backbone event handler that responses to
+       the `add`, `remove`, `reset`, and the `sort` events. The returned event
+       handler will synchronize the current page collection and the full
+       collection's models.
+
+       @private
+
+       @param {Backbone.PageableCollection} pageCol
+       @param {Backbone.Collection} fullCol
+
+       @return {function(string, Backbone.Model, Backbone.Collection, Object)}
+       Collection event handler
+    */
+    _makeCollectionEventHandler: function (pageCol, fullCol) {
+
+      return function collectionEventHandler (event, model, collection, options) {
+
+        var handlers = pageCol._handlers;
+        _each(_keys(handlers), function (event) {
+          var handler = handlers[event];
+          pageCol.off(event, handler);
+          fullCol.off(event, handler);
+        });
+
+        var state = _clone(pageCol.state);
+        var firstPage = state.firstPage;
+        var currentPage = firstPage === 0 ?
+          state.currentPage :
+          state.currentPage - 1;
+        var pageSize = state.pageSize;
+        var pageStart = currentPage * pageSize, pageEnd = pageStart + pageSize;
+
+        if (event == "add") {
+          var pageIndex, fullIndex, addAt, colToAdd, options = options || {};
+          if (collection == fullCol) {
+            fullIndex = fullCol.indexOf(model);
+            if (fullIndex >= pageStart && fullIndex < pageEnd) {
+              colToAdd = pageCol;
+              pageIndex = addAt = fullIndex - pageStart;
+            }
+          }
+          else {
+            pageIndex = pageCol.indexOf(model);
+            fullIndex = pageStart + pageIndex;
+            colToAdd = fullCol;
+            var addAt = !_isUndefined(options.at) ?
+              options.at + pageStart :
+              fullIndex;
+          }
+
+          ++state.totalRecords;
+          pageCol.state = pageCol._checkState(state);
+
+          if (colToAdd) {
+            colToAdd.add(model, _extend({}, options || {}, {at: addAt}));
+            var modelToRemove = pageIndex >= pageSize ?
+              model :
+              !_isUndefined(options.at) && addAt < pageEnd && pageCol.length > pageSize ?
+              pageCol.at(pageSize) :
+              null;
+            if (modelToRemove) {
+              var addHandlers = collection._events.add || [],
+              popOptions = {onAdd: true};
+              if (addHandlers.length) {
+                var lastAddHandler = addHandlers[addHandlers.length - 1];
+                var oldCallback = lastAddHandler.callback;
+                lastAddHandler.callback = function () {
+                  try {
+                    oldCallback.apply(this, arguments);
+                    pageCol.remove(modelToRemove, popOptions);
+                  }
+                  finally {
+                    lastAddHandler.callback = oldCallback;
+                  }
+                };
+              }
+              else pageCol.remove(modelToRemove, popOptions);
+            }
+          }
+        }
+
+        // remove the model from the other collection as well
+        if (event == "remove") {
+          if (!options.onAdd) {
+            // decrement totalRecords and update totalPages and lastPage
+            if (!--state.totalRecords) {
+              state.totalRecords = null;
+              state.totalPages = null;
+            }
+            else {
+              var totalPages = state.totalPages = ceil(state.totalRecords / pageSize);
+              state.lastPage = firstPage === 0 ? totalPages - 1 : totalPages;
+              if (state.currentPage > totalPages) state.currentPage = state.lastPage;
+            }
+            pageCol.state = pageCol._checkState(state);
+
+            var nextModel, removedIndex = options.index;
+            if (collection == pageCol) {
+              if (nextModel = fullCol.at(pageEnd)) pageCol.push(nextModel);
+              fullCol.remove(model);
+            }
+            else if (removedIndex >= pageStart && removedIndex < pageEnd) {
+              pageCol.remove(model);
+              nextModel = fullCol.at(currentPage * (pageSize + removedIndex));
+              if (nextModel) pageCol.push(nextModel);
+            }
+          }
+          else delete options.onAdd;
+        }
+
+        if (event == "reset") {
+          options = collection;
+          collection = model;
+
+          // Reset that's not a result of getPage
+          if (collection === pageCol && options.from == null &&
+              options.to == null) {
+            var head = fullCol.models.slice(0, pageStart);
+            var tail = fullCol.models.slice(pageStart + pageCol.models.length);
+            fullCol.reset(head.concat(pageCol.models).concat(tail), options);
+          }
+          else if (collection === fullCol) {
+            if (!(state.totalRecords = fullCol.models.length)) {
+              state.totalRecords = null;
+              state.totalPages = null;
+            }
+            if (pageCol.mode == "client") {
+              state.lastPage = state.currentPage = state.firstPage;
+            }
+            pageCol.state = pageCol._checkState(state);
+            pageCol.reset(fullCol.models.slice(pageStart, pageEnd),
+                          _extend({}, options, {parse: false}));
+          }
+        }
+
+        if (event == "sort") {
+          options = collection;
+          collection = model;
+          if (collection === fullCol) {
+            pageCol.reset(fullCol.models.slice(pageStart, pageEnd),
+                          _extend({}, options, {parse: false}));
+          }
+        }
+
+        _each(_keys(handlers), function (event) {
+          var handler = handlers[event];
+          _each([pageCol, fullCol], function (col) {
+            col.on(event, handler);
+            var callbacks = col._events[event] || [];
+            callbacks.unshift(callbacks.pop());
+          });
+        });
+      };
+    },
+
+    /**
+       Sanity check this collection's pagination states. Only perform checks
+       when all the required pagination state values are defined and not null.
+       If `totalPages` is undefined or null, it is set to `totalRecords` /
+       `pageSize`. `lastPage` is set according to whether `firstPage` is 0 or 1
+       when no error occurs.
+
+       @private
+
+       @throws {TypeError} If `totalRecords`, `pageSize`, `currentPage` or
+       `firstPage` is not a finite integer.
+
+       @throws {RangeError} If `pageSize`, `currentPage` or `firstPage` is out
+       of bounds.
+
+       @return {Object} Returns the `state` object if no error was found.
+    */
+    _checkState: function (state) {
+
+      var mode = this.mode;
+      var links = this.links;
+      var totalRecords = state.totalRecords;
+      var pageSize = state.pageSize;
+      var currentPage = state.currentPage;
+      var firstPage = state.firstPage;
+      var totalPages = state.totalPages;
+
+      if (totalRecords != null && pageSize != null && currentPage != null &&
+          firstPage != null && (mode == "infinite" ? links : true)) {
+
+        totalRecords = finiteInt(totalRecords, "totalRecords");
+        pageSize = finiteInt(pageSize, "pageSize");
+        currentPage = finiteInt(currentPage, "currentPage");
+        firstPage = finiteInt(firstPage, "firstPage");
+
+        if (pageSize < 1) {
+          throw new RangeError("`pageSize` must be >= 1");
+        }
+
+        totalPages = state.totalPages = ceil(totalRecords / pageSize);
+
+        if (firstPage < 0 || firstPage > 1) {
+          throw new RangeError("`firstPage must be 0 or 1`");
+        }
+
+        state.lastPage = firstPage === 0 ? max(0, totalPages - 1) : totalPages;
+
+        if (mode == "infinite") {
+          if (!links[currentPage + '']) {
+            throw new RangeError("No link found for page " + currentPage);
+          }
+        }
+        else if (currentPage < firstPage ||
+                 (totalPages > 0 &&
+                  (firstPage ? currentPage > totalPages : currentPage >= totalPages))) {
+          throw new RangeError("`currentPage` must be firstPage <= currentPage " +
+                               (firstPage ? ">" : ">=") +
+                               " totalPages if " + firstPage + "-based. Got " +
+                               currentPage + '.');
+        }
+      }
+
+      return state;
+    },
+
+    /**
+       Change the page size of this collection.
+
+       Under most if not all circumstances, you should call this method to
+       change the page size of a pageable collection because it will keep the
+       pagination state sane. By default, the method will recalculate the
+       current page number to one that will retain the current page's models
+       when increasing the page size. When decreasing the page size, this method
+       will retain the last models to the current page that will fit into the
+       smaller page size.
+
+       If `options.first` is true, changing the page size will also reset the
+       current page back to the first page instead of trying to be smart.
+
+       For server mode operations, changing the page size will trigger a #fetch
+       and subsequently a `reset` event.
+
+       For client mode operations, changing the page size will `reset` the
+       current page by recalculating the current page boundary on the client
+       side.
+
+       If `options.fetch` is true, a fetch can be forced if the collection is in
+       client mode.
+
+       @param {number} pageSize The new page size to set to #state.
+       @param {Object} [options] {@link #fetch} options.
+       @param {boolean} [options.first=false] Reset the current page number to
+       the first page if `true`.
+       @param {boolean} [options.fetch] If `true`, force a fetch in client mode.
+
+       @throws {TypeError} If `pageSize` is not a finite integer.
+       @throws {RangeError} If `pageSize` is less than 1.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    setPageSize: function (pageSize, options) {
+      pageSize = finiteInt(pageSize, "pageSize");
+
+      options = options || {first: false};
+
+      var state = this.state;
+      var totalPages = ceil(state.totalRecords / pageSize);
+      var currentPage = totalPages ?
+        max(state.firstPage,
+            floor(totalPages *
+                  (state.firstPage ?
+                   state.currentPage :
+                   state.currentPage + 1) /
+                  state.totalPages)) :
+        state.firstPage;
+
+      state = this.state = this._checkState(_extend({}, state, {
+        pageSize: pageSize,
+        currentPage: options.first ? state.firstPage : currentPage,
+        totalPages: totalPages
+      }));
+
+      if(!options.fetch)
+    	  return;
+      return this.getPage(state.currentPage, _omit(options, ["first"]));
+    },
+
+    /**
+       Switching between client, server and infinite mode.
+
+       If switching from client to server mode, the #fullCollection is emptied
+       first and then deleted and a fetch is immediately issued for the current
+       page from the server. Pass `false` to `options.fetch` to skip fetching.
+
+       If switching to infinite mode, and if `options.models` is given for an
+       array of models, #links will be populated with a URL per page, using the
+       default URL for this collection.
+
+       If switching from server to client mode, all of the pages are immediately
+       refetched. If you have too many pages, you can pass `false` to
+       `options.fetch` to skip fetching.
+
+       If switching to any mode from infinite mode, the #links will be deleted.
+
+       @param {"server"|"client"|"infinite"} [mode] The mode to switch to.
+
+       @param {Object} [options]
+
+       @param {boolean} [options.fetch=true] If `false`, no fetching is done.
+
+       @param {boolean} [options.resetState=true] If 'false', the state is not
+       reset, but checked for sanity instead.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this if `options.fetch` is `false`.
+    */
+    switchMode: function (mode, options) {
+
+      if (!_contains(["server", "client", "infinite"], mode)) {
+        throw new TypeError('`mode` must be one of "server", "client" or "infinite"');
+      }
+
+      options = options || {fetch: true, resetState: true};
+
+      var state = this.state = options.resetState ?
+        _clone(this._initState) :
+        this._checkState(_extend({}, this.state));
+
+      this.mode = mode;
+
+      var self = this;
+      var fullCollection = this.fullCollection;
+      var handlers = this._handlers = this._handlers || {}, handler;
+      if (mode != "server" && !fullCollection) {
+        fullCollection = this._makeFullCollection(options.models || []);
+        fullCollection.pageableCollection = this;
+        this.fullCollection = fullCollection;
+        var allHandler = this._makeCollectionEventHandler(this, fullCollection);
+        _each(["add", "remove", "reset", "sort"], function (event) {
+          handlers[event] = handler = _.bind(allHandler, {}, event);
+          self.on(event, handler);
+          fullCollection.on(event, handler);
+        });
+        fullCollection.comparator = this._fullComparator;
+      }
+      else if (mode == "server" && fullCollection) {
+        _each(_keys(handlers), function (event) {
+          handler = handlers[event];
+          self.off(event, handler);
+          fullCollection.off(event, handler);
+        });
+        delete this._handlers;
+        this._fullComparator = fullCollection.comparator;
+        delete this.fullCollection;
+      }
+
+      if (mode == "infinite") {
+        var links = this.links = {};
+        var firstPage = state.firstPage;
+        var totalPages = ceil(state.totalRecords / state.pageSize);
+        var lastPage = firstPage === 0 ? max(0, totalPages - 1) : totalPages || firstPage;
+        for (var i = state.firstPage; i <= lastPage; i++) {
+          links[i] = this.url;
+        }
+      }
+      else if (this.links) delete this.links;
+
+      return options.fetch ?
+        this.fetch(_omit(options, "fetch", "resetState")) :
+        this;
+    },
+
+    /**
+       @return {boolean} `true` if this collection can page backward, `false`
+       otherwise.
+    */
+    hasPrevious: function () {
+      var state = this.state;
+      var currentPage = state.currentPage;
+      if (this.mode != "infinite") return currentPage > state.firstPage;
+      return !!this.links[currentPage - 1];
+    },
+
+    /**
+       @return {boolean} `true` if this collection can page forward, `false`
+       otherwise.
+    */
+    hasNext: function () {
+      var state = this.state;
+      var currentPage = this.state.currentPage;
+      if (this.mode != "infinite") return currentPage < state.lastPage;
+      return !!this.links[currentPage + 1];
+    },
+
+    /**
+       Fetch the first page in server mode, or reset the current page of this
+       collection to the first page in client or infinite mode.
+
+       @param {Object} options {@link #getPage} options.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getFirstPage: function (options) {
+      return this.getPage("first", options);
+    },
+
+    /**
+       Fetch the previous page in server mode, or reset the current page of this
+       collection to the previous page in client or infinite mode.
+
+       @param {Object} options {@link #getPage} options.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getPreviousPage: function (options) {
+      return this.getPage("prev", options);
+    },
+
+    /**
+       Fetch the next page in server mode, or reset the current page of this
+       collection to the next page in client mode.
+
+       @param {Object} options {@link #getPage} options.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getNextPage: function (options) {
+      return this.getPage("next", options);
+    },
+
+    /**
+       Fetch the last page in server mode, or reset the current page of this
+       collection to the last page in client mode.
+
+       @param {Object} options {@link #getPage} options.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getLastPage: function (options) {
+      return this.getPage("last", options);
+    },
+
+    /**
+       Given a page index, set #state.currentPage to that index. If this
+       collection is in server mode, fetch the page using the updated state,
+       otherwise, reset the current page of this collection to the page
+       specified by `index` in client mode. If `options.fetch` is true, a fetch
+       can be forced in client mode before resetting the current page. Under
+       infinite mode, if the index is less than the current page, a reset is
+       done as in client mode. If the index is greater than the current page
+       number, a fetch is made with the results **appended** to #fullCollection.
+       The current page will then be reset after fetching.
+
+       @param {number|string} index The page index to go to, or the page name to
+       look up from #links in infinite mode.
+       @param {Object} [options] {@link #fetch} options or
+       [reset](http://backbonejs.org/#Collection-reset) options for client mode
+       when `options.fetch` is `false`.
+       @param {boolean} [options.fetch=false] If true, force a {@link #fetch} in
+       client mode.
+
+       @throws {TypeError} If `index` is not a finite integer under server or
+       client mode, or does not yield a URL from #links under infinite mode.
+
+       @throws {RangeError} If `index` is out of bounds.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getPage: function (index, options) {
+
+      var mode = this.mode, fullCollection = this.fullCollection;
+
+      options = options || {fetch: false};
+
+      var state = this.state,
+      firstPage = state.firstPage,
+      currentPage = state.currentPage,
+      lastPage = state.lastPage,
+      pageSize = state.pageSize;
+
+      var pageNum = index;
+      switch (index) {
+        case "first": pageNum = firstPage; break;
+        case "prev": pageNum = currentPage - 1; break;
+        case "next": pageNum = currentPage + 1; break;
+        case "last": pageNum = lastPage; break;
+        default: pageNum = finiteInt(index, "index");
+      }
+
+      this.state = this._checkState(_extend({}, state, {currentPage: pageNum}));
+
+      options.from = currentPage, options.to = pageNum;
+
+      var pageStart = (firstPage === 0 ? pageNum : pageNum - 1) * pageSize;
+      var pageModels = fullCollection && fullCollection.length ?
+        fullCollection.models.slice(pageStart, pageStart + pageSize) :
+        [];
+      if ((mode == "client" || (mode == "infinite" && !_isEmpty(pageModels))) &&
+          !options.fetch) {
+        return this.reset(pageModels, _omit(options, "fetch"));
+      }
+
+      if (mode == "infinite") options.url = this.links[pageNum];
+
+      return this.fetch(_omit(options, "fetch"));
+    },
+
+    /**
+       Fetch the page for the provided item offset in server mode, or reset the current page of this
+       collection to the page for the provided item offset in client mode.
+
+       @param {Object} options {@link #getPage} options.
+
+       @chainable
+       @return {XMLHttpRequest|Backbone.PageableCollection} The XMLHttpRequest
+       from fetch or this.
+    */
+    getPageByOffset: function (offset, options) {
+      if (offset < 0) {
+        throw new RangeError("`offset must be > 0`");
+      }
+      offset = finiteInt(offset);
+
+      var page = floor(offset / this.state.pageSize);
+      if (this.state.firstPage !== 0) page++;
+      if (page > this.state.lastPage) page = this.state.lastPage;
+      return this.getPage(page, options);
+    },
+
+    /**
+       Overidden to make `getPage` compatible with Zepto.
+
+       @param {string} method
+       @param {Backbone.Model|Backbone.Collection} model
+       @param {Object} [options]
+
+       @return {XMLHttpRequest}
+    */
+    sync: function (method, model, options) {
+      var self = this;
+      if (self.mode == "infinite") {
+        var success = options.success;
+        var currentPage = self.state.currentPage;
+        options.success = function (resp, status, xhr) {
+          var links = self.links;
+          var newLinks = self.parseLinks(resp, _extend({xhr: xhr}, options));
+          if (newLinks.first) links[self.state.firstPage] = newLinks.first;
+          if (newLinks.prev) links[currentPage - 1] = newLinks.prev;
+          if (newLinks.next) links[currentPage + 1] = newLinks.next;
+          if (success) success(resp, status, xhr);
+        };
+      }
+
+      return (BBColProto.sync || Backbone.sync).call(self, method, model, options);
+    },
+
+    /**
+       Parse pagination links from the server response. Only valid under
+       infinite mode.
+
+       Given a response body and a XMLHttpRequest object, extract pagination
+       links from them for infinite paging.
+
+       This default implementation parses the RFC 5988 `Link` header and extract
+       3 links from it - `first`, `prev`, `next`. If a `previous` link is found,
+       it will be found in the `prev` key in the returned object hash. Any
+       subclasses overriding this method __must__ return an object hash having
+       only the keys above. If `first` is missing, the collection's default URL
+       is assumed to be the `first` URL. If `prev` or `next` is missing, it is
+       assumed to be `null`. An empty object hash must be returned if there are
+       no links found. If either the response or the header contains information
+       pertaining to the total number of records on the server, #state.totalRecords
+       must be set to that number. The default implementation uses the `last`
+       link from the header to calculate it.
+
+       @param {*} resp The deserialized response body.
+       @param {Object} [options]
+       @param {XMLHttpRequest} [options.xhr] The XMLHttpRequest object for this
+       response.
+       @return {Object}
+    */
+    parseLinks: function (resp, options) {
+      var links = {};
+      var linkHeader = options.xhr.getResponseHeader("Link");
+      if (linkHeader) {
+        var relations = ["first", "prev", "previous", "next", "last"];
+        _each(linkHeader.split(","), function (linkValue) {
+          var linkParts = linkValue.split(";");
+          var url = linkParts[0].replace(URL_TRIM_RE, '');
+          var params = linkParts.slice(1);
+          _each(params, function (param) {
+            var paramParts = param.split("=");
+            var key = paramParts[0].replace(PARAM_TRIM_RE, '');
+            var value = paramParts[1].replace(PARAM_TRIM_RE, '');
+            if (key == "rel" && _contains(relations, value)) {
+              if (value == "previous") links.prev = url;
+              else links[value] = url;
+            }
+          });
+        });
+
+        var last = links.last || '', qsi, qs;
+        if (qs = (qsi = last.indexOf('?')) ? last.slice(qsi + 1) : '') {
+          var params = queryStringToParams(qs);
+
+          var state = _clone(this.state);
+          var queryParams = this.queryParams;
+          var pageSize = state.pageSize;
+
+          var totalRecords = params[queryParams.totalRecords] * 1;
+          var pageNum = params[queryParams.currentPage] * 1;
+          var totalPages = params[queryParams.totalPages];
+
+          if (!totalRecords) {
+            if (pageNum) totalRecords = (state.firstPage === 0 ?
+                                         pageNum + 1 :
+                                         pageNum) * pageSize;
+            else if (totalPages) totalRecords = totalPages * pageSize;
+          }
+
+          if (totalRecords) state.totalRecords = totalRecords;
+
+          this.state = this._checkState(state);
+        }
+      }
+
+      delete links.last;
+
+      return links;
+    },
+
+    /**
+       Parse server response data.
+
+       This default implementation assumes the response data is in one of two
+       structures:
+
+           [
+             {}, // Your new pagination state
+             [{}, ...] // An array of JSON objects
+           ]
+
+       Or,
+
+           [{}] // An array of JSON objects
+
+       The first structure is the preferred form because the pagination states
+       may have been updated on the server side, sending them down again allows
+       this collection to update its states. If the response has a pagination
+       state object, it is checked for errors.
+
+       The second structure is the
+       [Backbone.Collection#parse](http://backbonejs.org/#Collection-parse)
+       default.
+
+       **Note:** this method has been further simplified since 1.1.7. While
+       existing #parse implementations will continue to work, new code is
+       encouraged to override #parseState and #parseRecords instead.
+
+       @param {Object} resp The deserialized response data from the server.
+       @param {Object} the options for the ajax request
+
+       @return {Array.<Object>} An array of model objects
+    */
+    parse: function (resp, options) {
+      var newState = this.parseState(resp, _clone(this.queryParams), _clone(this.state), options);
+      if (newState) this.state = this._checkState(_extend({}, this.state, newState));
+      return this.parseRecords(resp, options);
+    },
+
+    /**
+       Parse server response for server pagination state updates.
+
+       This default implementation first checks whether the response has any
+       state object as documented in #parse. If it exists, a state object is
+       returned by mapping the server state keys to this pageable collection
+       instance's query parameter keys using `queryParams`.
+
+       It is __NOT__ neccessary to return a full state object complete with all
+       the mappings defined in #queryParams. Any state object resulted is merged
+       with a copy of the current pageable collection state and checked for
+       sanity before actually updating. Most of the time, simply providing a new
+       `totalRecords` value is enough to trigger a full pagination state
+       recalculation.
+
+           parseState: function (resp, queryParams, state, options) {
+             return {totalRecords: resp.total_entries};
+           }
+
+       If you want to use header fields use:
+
+           parseState: function (resp, queryParams, state, options) {
+               return {totalRecords: options.xhr.getResponseHeader("X-total")};
+           }
+
+       This method __MUST__ return a new state object instead of directly
+       modifying the #state object. The behavior of directly modifying #state is
+       undefined.
+
+       @param {Object} resp The deserialized response data from the server.
+       @param {Object} queryParams A copy of #queryParams.
+       @param {Object} state A copy of #state.
+       @param {Object} [options] The options passed through from
+       `parse`. (backbone >= 0.9.10 only)
+
+       @return {Object} A new (partial) state object.
+     */
+    parseState: function (resp, queryParams, state, options) {
+      if (resp && resp.length === 2 && _isObject(resp[0]) && _isArray(resp[1])) {
+
+        var newState = _clone(state);
+        var serverState = resp[0];
+
+        _each(_pairs(_omit(queryParams, "directions")), function (kvp) {
+          var k = kvp[0], v = kvp[1];
+          var serverVal = serverState[v];
+          if (!_isUndefined(serverVal) && !_.isNull(serverVal)) newState[k] = serverState[v];
+        });
+
+        if (serverState.order) {
+          newState.order = _invert(queryParams.directions)[serverState.order] * 1;
+        }
+
+        return newState;
+      }
+    },
+
+    /**
+       Parse server response for an array of model objects.
+
+       This default implementation first checks whether the response has any
+       state object as documented in #parse. If it exists, the array of model
+       objects is assumed to be the second element, otherwise the entire
+       response is returned directly.
+
+       @param {Object} resp The deserialized response data from the server.
+       @param {Object} [options] The options passed through from the
+       `parse`. (backbone >= 0.9.10 only)
+
+       @return {Array.<Object>} An array of model objects
+     */
+    parseRecords: function (resp, options) {
+      if (resp && resp.length === 2 && _isObject(resp[0]) && _isArray(resp[1])) {
+        return resp[1];
+      }
+
+      return resp;
+    },
+
+    /**
+       Fetch a page from the server in server mode, or all the pages in client
+       mode. Under infinite mode, the current page is refetched by default and
+       then reset.
+
+       The query string is constructed by translating the current pagination
+       state to your server API query parameter using #queryParams.  The current
+       page will reset after fetch.
+
+       @param {Object} [options] Accepts all
+       [Backbone.Collection#fetch](http://backbonejs.org/#Collection-fetch)
+       options.
+
+       @return {XMLHttpRequest}
+    */
+    fetch: function (options) {
+
+      options = options || {};
+
+      var state = this._checkState(this.state);
+
+      var mode = this.mode;
+
+      if (mode == "infinite" && !options.url) {
+        options.url = this.links[state.currentPage];
+      }
+
+      var data = options.data || {};
+
+      // dedup query params
+      var url = _result(options, "url") || _result(this, "url") || '';
+      var qsi = url.indexOf('?');
+      if (qsi != -1) {
+        _extend(data, queryStringToParams(url.slice(qsi + 1)));
+        url = url.slice(0, qsi);
+      }
+
+      options.url = url;
+      options.data = data;
+
+      // map params except directions
+      var queryParams = this.mode == "client" ?
+        _pick(this.queryParams, "sortKey", "order") :
+        _omit(_pick(this.queryParams, _keys(PageableProto.queryParams)),
+              "directions");
+
+      var i, kvp, k, v, kvps = _pairs(queryParams), thisCopy = _clone(this);
+      for (i = 0; i < kvps.length; i++) {
+        kvp = kvps[i], k = kvp[0], v = kvp[1];
+        v = _isFunction(v) ? v.call(thisCopy) : v;
+        if (state[k] != null && v != null) {
+          data[v] = state[k];
+        }
+      }
+
+      // fix up sorting parameters
+      if (state.sortKey && state.order) {
+        data[queryParams.order] = this.queryParams.directions[state.order + ""];
+      }
+      else if (!state.sortKey) delete data[queryParams.order];
+
+      // map extra query parameters
+      var extraKvps = _pairs(_omit(this.queryParams,
+                                   _keys(PageableProto.queryParams)));
+      for (i = 0; i < extraKvps.length; i++) {
+        kvp = extraKvps[i];
+        v = kvp[1];
+        v = _isFunction(v) ? v.call(thisCopy) : v;
+        if (v != null) data[kvp[0]] = v;
+      }
+
+      if (mode != "server") {
+        var self = this, fullCol = this.fullCollection;
+        var success = options.success;
+        options.success = function (col, resp, opts) {
+
+          // make sure the caller's intent is obeyed
+          opts = opts || {};
+          if (_isUndefined(options.silent)) delete opts.silent;
+          else opts.silent = options.silent;
+
+          var models = col.models;
+          if (mode == "client") fullCol.reset(models, opts);
+          else fullCol.add(models, _extend({at: fullCol.length}, opts));
+
+          if (success) success(col, resp, opts);
+        };
+
+        // silent the first reset from backbone
+        return BBColProto.fetch.call(self, _extend({}, options, {silent: true}));
+      }
+
+      return BBColProto.fetch.call(this, options);
+    },
+
+    /**
+       Convenient method for making a `comparator` sorted by a model attribute
+       identified by `sortKey` and ordered by `order`.
+
+       Like a Backbone.Collection, a Backbone.PageableCollection will maintain
+       the __current page__ in sorted order on the client side if a `comparator`
+       is attached to it. If the collection is in client mode, you can attach a
+       comparator to #fullCollection to have all the pages reflect the global
+       sorting order by specifying an option `full` to `true`. You __must__ call
+       `sort` manually or #fullCollection.sort after calling this method to
+       force a resort.
+
+       While you can use this method to sort the current page in server mode,
+       the sorting order may not reflect the global sorting order due to the
+       additions or removals of the records on the server since the last
+       fetch. If you want the most updated page in a global sorting order, it is
+       recommended that you set #state.sortKey and optionally #state.order, and
+       then call #fetch.
+
+       @protected
+
+       @param {string} [sortKey=this.state.sortKey] See `state.sortKey`.
+       @param {number} [order=this.state.order] See `state.order`.
+       @param {(function(Backbone.Model, string): Object) | string} [sortValue] See #setSorting.
+
+       See [Backbone.Collection.comparator](http://backbonejs.org/#Collection-comparator).
+    */
+    _makeComparator: function (sortKey, order, sortValue) {
+      var state = this.state;
+
+      sortKey = sortKey || state.sortKey;
+      order = order || state.order;
+
+      if (!sortKey || !order) return;
+
+      if (!sortValue) sortValue = function (model, attr) {
+        return model.get(attr);
+      };
+
+      return function (left, right) {
+        var l = sortValue(left, sortKey), r = sortValue(right, sortKey), t;
+        if (order === 1) t = l, l = r, r = t;
+        if (l === r) return 0;
+        else if (l < r) return -1;
+        return 1;
+      };
+    },
+
+    /**
+       Adjusts the sorting for this pageable collection.
+
+       Given a `sortKey` and an `order`, sets `state.sortKey` and
+       `state.order`. A comparator can be applied on the client side to sort in
+       the order defined if `options.side` is `"client"`. By default the
+       comparator is applied to the #fullCollection. Set `options.full` to
+       `false` to apply a comparator to the current page under any mode. Setting
+       `sortKey` to `null` removes the comparator from both the current page and
+       the full collection.
+
+       If a `sortValue` function is given, it will be passed the `(model,
+       sortKey)` arguments and is used to extract a value from the model during
+       comparison sorts. If `sortValue` is not given, `model.get(sortKey)` is
+       used for sorting.
+
+       @chainable
+
+       @param {string} sortKey See `state.sortKey`.
+       @param {number} [order=this.state.order] See `state.order`.
+       @param {Object} [options]
+       @param {"server"|"client"} [options.side] By default, `"client"` if
+       `mode` is `"client"`, `"server"` otherwise.
+       @param {boolean} [options.full=true]
+       @param {(function(Backbone.Model, string): Object) | string} [options.sortValue]
+    */
+    setSorting: function (sortKey, order, options) {
+
+      var state = this.state;
+
+      state.sortKey = sortKey;
+      state.order = order = order || state.order;
+
+      var fullCollection = this.fullCollection;
+
+      var delComp = false, delFullComp = false;
+
+      if (!sortKey) delComp = delFullComp = true;
+
+      var mode = this.mode;
+      options = _extend({side: mode == "client" ? mode : "server", full: true},
+                        options);
+
+      var comparator = this._makeComparator(sortKey, order, options.sortValue);
+
+      var full = options.full, side = options.side;
+
+      if (side == "client") {
+        if (full) {
+          if (fullCollection) fullCollection.comparator = comparator;
+          delComp = true;
+        }
+        else {
+          this.comparator = comparator;
+          delFullComp = true;
+        }
+      }
+      else if (side == "server" && !full) {
+        this.comparator = comparator;
+      }
+
+      if (delComp) delete this.comparator;
+      if (delFullComp && fullCollection) delete fullCollection.comparator;
+
+      return this;
+    }
+
+  });
+
+  var PageableProto = PageableCollection.prototype;
+
+  return PageableCollection;
+
+}));


[24/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.js
new file mode 100644
index 0000000..b79ab8b
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/bower/backbone.marionette/js/backbone.marionette.js
@@ -0,0 +1,2473 @@
+// MarionetteJS (Backbone.Marionette)
+// ----------------------------------
+// v1.8.8
+//
+// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
+// Distributed under MIT license
+//
+// http://marionettejs.com
+
+(function (root, factory) {
+  if (typeof exports === 'object') {
+
+    var underscore = require('underscore');
+    var backbone = require('backbone');
+    var wreqr = require('backbone.wreqr');
+    var babysitter = require('backbone.babysitter');
+
+    module.exports = factory(underscore, backbone, wreqr, babysitter);
+
+  } else if (typeof define === 'function' && define.amd) {
+
+    define(['underscore', 'backbone', 'backbone.wreqr', 'backbone.babysitter'], factory);
+
+  }
+}(this, function (_, Backbone) {
+
+  var Marionette = (function(global, Backbone, _){
+    "use strict";
+  
+    // Define and export the Marionette namespace
+    var Marionette = {};
+    Backbone.Marionette = Marionette;
+  
+    // Get the DOM manipulator for later use
+    Marionette.$ = Backbone.$;
+  
+  // Helpers
+  // -------
+  
+  // For slicing `arguments` in functions
+  var slice = Array.prototype.slice;
+  
+  function throwError(message, name) {
+    var error = new Error(message);
+    error.name = name || 'Error';
+    throw error;
+  }
+  
+  // Marionette.extend
+  // -----------------
+  
+  // Borrow the Backbone `extend` method so we can use it as needed
+  Marionette.extend = Backbone.Model.extend;
+  
+  // Marionette.getOption
+  // --------------------
+  
+  // Retrieve an object, function or other value from a target
+  // object or its `options`, with `options` taking precedence.
+  Marionette.getOption = function(target, optionName){
+    if (!target || !optionName){ return; }
+    var value;
+  
+    if (target.options && (optionName in target.options) && (target.options[optionName] !== undefined)){
+      value = target.options[optionName];
+    } else {
+      value = target[optionName];
+    }
+  
+    return value;
+  };
+  
+  // Marionette.normalizeMethods
+  // ----------------------
+  
+  // Pass in a mapping of events => functions or function names
+  // and return a mapping of events => functions
+  Marionette.normalizeMethods = function(hash) {
+    var normalizedHash = {}, method;
+    _.each(hash, function(fn, name) {
+      method = fn;
+      if (!_.isFunction(method)) {
+        method = this[method];
+      }
+      if (!method) {
+        return;
+      }
+      normalizedHash[name] = method;
+    }, this);
+    return normalizedHash;
+  };
+  
+  
+  // allows for the use of the @ui. syntax within
+  // a given key for triggers and events
+  // swaps the @ui with the associated selector
+  Marionette.normalizeUIKeys = function(hash, ui) {
+    if (typeof(hash) === "undefined") {
+      return;
+    }
+  
+    _.each(_.keys(hash), function(v) {
+      var pattern = /@ui.[a-zA-Z_$0-9]*/g;
+      if (v.match(pattern)) {
+        hash[v.replace(pattern, function(r) {
+          return ui[r.slice(4)];
+        })] = hash[v];
+        delete hash[v];
+      }
+    });
+  
+    return hash;
+  };
+  
+  // Mix in methods from Underscore, for iteration, and other
+  // collection related features.
+  // Borrowing this code from Backbone.Collection:
+  // http://backbonejs.org/docs/backbone.html#section-106
+  Marionette.actAsCollection = function(object, listProperty) {
+    var methods = ['forEach', 'each', 'map', 'find', 'detect', 'filter',
+      'select', 'reject', 'every', 'all', 'some', 'any', 'include',
+      'contains', 'invoke', 'toArray', 'first', 'initial', 'rest',
+      'last', 'without', 'isEmpty', 'pluck'];
+  
+    _.each(methods, function(method) {
+      object[method] = function() {
+        var list = _.values(_.result(this, listProperty));
+        var args = [list].concat(_.toArray(arguments));
+        return _[method].apply(_, args);
+      };
+    });
+  };
+  
+  // Trigger an event and/or a corresponding method name. Examples:
+  //
+  // `this.triggerMethod("foo")` will trigger the "foo" event and
+  // call the "onFoo" method.
+  //
+  // `this.triggerMethod("foo:bar")` will trigger the "foo:bar" event and
+  // call the "onFooBar" method.
+  Marionette.triggerMethod = (function(){
+  
+    // split the event name on the ":"
+    var splitter = /(^|:)(\w)/gi;
+  
+    // take the event section ("section1:section2:section3")
+    // and turn it in to uppercase name
+    function getEventName(match, prefix, eventName) {
+      return eventName.toUpperCase();
+    }
+  
+    // actual triggerMethod implementation
+    var triggerMethod = function(event) {
+      // get the method name from the event name
+      var methodName = 'on' + event.replace(splitter, getEventName);
+      var method = this[methodName];
+  
+      // trigger the event, if a trigger method exists
+      if(_.isFunction(this.trigger)) {
+        this.trigger.apply(this, arguments);
+      }
+  
+      // call the onMethodName if it exists
+      if (_.isFunction(method)) {
+        // pass all arguments, except the event name
+        return method.apply(this, _.tail(arguments));
+      }
+    };
+  
+    return triggerMethod;
+  })();
+  
+  // DOMRefresh
+  // ----------
+  //
+  // Monitor a view's state, and after it has been rendered and shown
+  // in the DOM, trigger a "dom:refresh" event every time it is
+  // re-rendered.
+  
+  Marionette.MonitorDOMRefresh = (function(documentElement){
+    // track when the view has been shown in the DOM,
+    // using a Marionette.Region (or by other means of triggering "show")
+    function handleShow(view){
+      view._isShown = true;
+      triggerDOMRefresh(view);
+    }
+  
+    // track when the view has been rendered
+    function handleRender(view){
+      view._isRendered = true;
+      triggerDOMRefresh(view);
+    }
+  
+    // Trigger the "dom:refresh" event and corresponding "onDomRefresh" method
+    function triggerDOMRefresh(view){
+      if (view._isShown && view._isRendered && isInDOM(view)){
+        if (_.isFunction(view.triggerMethod)){
+          view.triggerMethod("dom:refresh");
+        }
+      }
+    }
+  
+    function isInDOM(view) {
+      return documentElement.contains(view.el);
+    }
+  
+    // Export public API
+    return function(view){
+      view.listenTo(view, "show", function(){
+        handleShow(view);
+      });
+  
+      view.listenTo(view, "render", function(){
+        handleRender(view);
+      });
+    };
+  })(document.documentElement);
+  
+  
+  // Marionette.bindEntityEvents & unbindEntityEvents
+  // ---------------------------
+  //
+  // These methods are used to bind/unbind a backbone "entity" (collection/model)
+  // to methods on a target object.
+  //
+  // The first parameter, `target`, must have a `listenTo` method from the
+  // EventBinder object.
+  //
+  // The second parameter is the entity (Backbone.Model or Backbone.Collection)
+  // to bind the events from.
+  //
+  // The third parameter is a hash of { "event:name": "eventHandler" }
+  // configuration. Multiple handlers can be separated by a space. A
+  // function can be supplied instead of a string handler name.
+  
+  (function(Marionette){
+    "use strict";
+  
+    // Bind the event to handlers specified as a string of
+    // handler names on the target object
+    function bindFromStrings(target, entity, evt, methods){
+      var methodNames = methods.split(/\s+/);
+  
+      _.each(methodNames, function(methodName) {
+  
+        var method = target[methodName];
+        if(!method) {
+          throwError("Method '"+ methodName +"' was configured as an event handler, but does not exist.");
+        }
+  
+        target.listenTo(entity, evt, method);
+      });
+    }
+  
+    // Bind the event to a supplied callback function
+    function bindToFunction(target, entity, evt, method){
+        target.listenTo(entity, evt, method);
+    }
+  
+    // Bind the event to handlers specified as a string of
+    // handler names on the target object
+    function unbindFromStrings(target, entity, evt, methods){
+      var methodNames = methods.split(/\s+/);
+  
+      _.each(methodNames, function(methodName) {
+        var method = target[methodName];
+        target.stopListening(entity, evt, method);
+      });
+    }
+  
+    // Bind the event to a supplied callback function
+    function unbindToFunction(target, entity, evt, method){
+        target.stopListening(entity, evt, method);
+    }
+  
+  
+    // generic looping function
+    function iterateEvents(target, entity, bindings, functionCallback, stringCallback){
+      if (!entity || !bindings) { return; }
+  
+      // allow the bindings to be a function
+      if (_.isFunction(bindings)){
+        bindings = bindings.call(target);
+      }
+  
+      // iterate the bindings and bind them
+      _.each(bindings, function(methods, evt){
+  
+        // allow for a function as the handler,
+        // or a list of event names as a string
+        if (_.isFunction(methods)){
+          functionCallback(target, entity, evt, methods);
+        } else {
+          stringCallback(target, entity, evt, methods);
+        }
+  
+      });
+    }
+  
+    // Export Public API
+    Marionette.bindEntityEvents = function(target, entity, bindings){
+      iterateEvents(target, entity, bindings, bindToFunction, bindFromStrings);
+    };
+  
+    Marionette.unbindEntityEvents = function(target, entity, bindings){
+      iterateEvents(target, entity, bindings, unbindToFunction, unbindFromStrings);
+    };
+  
+  })(Marionette);
+  
+  
+  // Callbacks
+  // ---------
+  
+  // A simple way of managing a collection of callbacks
+  // and executing them at a later point in time, using jQuery's
+  // `Deferred` object.
+  Marionette.Callbacks = function(){
+    this._deferred = Marionette.$.Deferred();
+    this._callbacks = [];
+  };
+  
+  _.extend(Marionette.Callbacks.prototype, {
+  
+    // Add a callback to be executed. Callbacks added here are
+    // guaranteed to execute, even if they are added after the
+    // `run` method is called.
+    add: function(callback, contextOverride){
+      this._callbacks.push({cb: callback, ctx: contextOverride});
+  
+      this._deferred.done(function(context, options){
+        if (contextOverride){ context = contextOverride; }
+        callback.call(context, options);
+      });
+    },
+  
+    // Run all registered callbacks with the context specified.
+    // Additional callbacks can be added after this has been run
+    // and they will still be executed.
+    run: function(options, context){
+      this._deferred.resolve(context, options);
+    },
+  
+    // Resets the list of callbacks to be run, allowing the same list
+    // to be run multiple times - whenever the `run` method is called.
+    reset: function(){
+      var callbacks = this._callbacks;
+      this._deferred = Marionette.$.Deferred();
+      this._callbacks = [];
+  
+      _.each(callbacks, function(cb){
+        this.add(cb.cb, cb.ctx);
+      }, this);
+    }
+  });
+  
+  // Marionette Controller
+  // ---------------------
+  //
+  // A multi-purpose object to use as a controller for
+  // modules and routers, and as a mediator for workflow
+  // and coordination of other objects, views, and more.
+  Marionette.Controller = function(options){
+    this.triggerMethod = Marionette.triggerMethod;
+    this.options = options || {};
+  
+    if (_.isFunction(this.initialize)){
+      this.initialize(this.options);
+    }
+  };
+  
+  Marionette.Controller.extend = Marionette.extend;
+  
+  // Controller Methods
+  // --------------
+  
+  // Ensure it can trigger events with Backbone.Events
+  _.extend(Marionette.Controller.prototype, Backbone.Events, {
+    close: function(){
+      this.stopListening();
+      var args = Array.prototype.slice.call(arguments);
+      this.triggerMethod.apply(this, ["close"].concat(args));
+      this.off();
+    }
+  });
+  
+  // Region
+  // ------
+  //
+  // Manage the visual regions of your composite application. See
+  // http://lostechies.com/derickbailey/2011/12/12/composite-js-apps-regions-and-region-managers/
+  
+  Marionette.Region = function(options){
+    this.options = options || {};
+    this.el = Marionette.getOption(this, "el");
+  
+    if (!this.el){
+      throwError("An 'el' must be specified for a region.", "NoElError");
+    }
+  
+    if (this.initialize){
+      var args = Array.prototype.slice.apply(arguments);
+      this.initialize.apply(this, args);
+    }
+  };
+  
+  
+  // Region Type methods
+  // -------------------
+  
+  _.extend(Marionette.Region, {
+  
+    // Build an instance of a region by passing in a configuration object
+    // and a default region type to use if none is specified in the config.
+    //
+    // The config object should either be a string as a jQuery DOM selector,
+    // a Region type directly, or an object literal that specifies both
+    // a selector and regionType:
+    //
+    // ```js
+    // {
+    //   selector: "#foo",
+    //   regionType: MyCustomRegion
+    // }
+    // ```
+    //
+    buildRegion: function(regionConfig, defaultRegionType){
+      var regionIsString = _.isString(regionConfig);
+      var regionSelectorIsString = _.isString(regionConfig.selector);
+      var regionTypeIsUndefined = _.isUndefined(regionConfig.regionType);
+      var regionIsType = _.isFunction(regionConfig);
+  
+      if (!regionIsType && !regionIsString && !regionSelectorIsString) {
+        throwError("Region must be specified as a Region type, a selector string or an object with selector property");
+      }
+  
+      var selector, RegionType;
+  
+      // get the selector for the region
+  
+      if (regionIsString) {
+        selector = regionConfig;
+      }
+  
+      if (regionConfig.selector) {
+        selector = regionConfig.selector;
+        delete regionConfig.selector;
+      }
+  
+      // get the type for the region
+  
+      if (regionIsType){
+        RegionType = regionConfig;
+      }
+  
+      if (!regionIsType && regionTypeIsUndefined) {
+        RegionType = defaultRegionType;
+      }
+  
+      if (regionConfig.regionType) {
+        RegionType = regionConfig.regionType;
+        delete regionConfig.regionType;
+      }
+  
+      if (regionIsString || regionIsType) {
+        regionConfig = {};
+      }
+  
+      regionConfig.el = selector;
+  
+      // build the region instance
+      var region = new RegionType(regionConfig);
+  
+      // override the `getEl` function if we have a parentEl
+      // this must be overridden to ensure the selector is found
+      // on the first use of the region. if we try to assign the
+      // region's `el` to `parentEl.find(selector)` in the object
+      // literal to build the region, the element will not be
+      // guaranteed to be in the DOM already, and will cause problems
+      if (regionConfig.parentEl){
+        region.getEl = function(selector) {
+          var parentEl = regionConfig.parentEl;
+          if (_.isFunction(parentEl)){
+            parentEl = parentEl();
+          }
+          return parentEl.find(selector);
+        };
+      }
+  
+      return region;
+    }
+  
+  });
+  
+  // Region Instance Methods
+  // -----------------------
+  
+  _.extend(Marionette.Region.prototype, Backbone.Events, {
+  
+    // Displays a backbone view instance inside of the region.
+    // Handles calling the `render` method for you. Reads content
+    // directly from the `el` attribute. Also calls an optional
+    // `onShow` and `close` method on your view, just after showing
+    // or just before closing the view, respectively.
+    // The `preventClose` option can be used to prevent a view from being destroyed on show.
+    show: function(view, options){
+      this.ensureEl();
+  
+      var showOptions = options || {};
+      var isViewClosed = view.isClosed || _.isUndefined(view.$el);
+      var isDifferentView = view !== this.currentView;
+      var preventClose =  !!showOptions.preventClose;
+  
+      // only close the view if we don't want to preventClose and the view is different
+      var _shouldCloseView = !preventClose && isDifferentView;
+  
+      if (_shouldCloseView) {
+        this.close();
+      }
+  
+      view.render();
+      Marionette.triggerMethod.call(this, "before:show", view);
+  
+      if (_.isFunction(view.triggerMethod)) {
+        view.triggerMethod("before:show");
+      } else {
+        Marionette.triggerMethod.call(view, "before:show");
+      }
+  
+      if (isDifferentView || isViewClosed) {
+        this.open(view);
+      }
+  
+      this.currentView = view;
+  
+      Marionette.triggerMethod.call(this, "show", view);
+  
+      if (_.isFunction(view.triggerMethod)) {
+        view.triggerMethod("show");
+      } else {
+        Marionette.triggerMethod.call(view, "show");
+      }
+  
+      return this;
+    },
+  
+    ensureEl: function(){
+      if (!this.$el || this.$el.length === 0){
+        this.$el = this.getEl(this.el);
+      }
+    },
+  
+    // Override this method to change how the region finds the
+    // DOM element that it manages. Return a jQuery selector object.
+    getEl: function(selector){
+      return Marionette.$(selector);
+    },
+  
+    // Override this method to change how the new view is
+    // appended to the `$el` that the region is managing
+    open: function(view){
+      this.$el.empty().append(view.el);
+    },
+  
+    // Close the current view, if there is one. If there is no
+    // current view, it does nothing and returns immediately.
+    close: function(){
+      var view = this.currentView;
+      if (!view || view.isClosed){ return; }
+  
+      // call 'close' or 'remove', depending on which is found
+      if (view.close) { view.close(); }
+      else if (view.remove) { view.remove(); }
+  
+      Marionette.triggerMethod.call(this, "close", view);
+  
+      delete this.currentView;
+    },
+  
+    // Attach an existing view to the region. This
+    // will not call `render` or `onShow` for the new view,
+    // and will not replace the current HTML for the `el`
+    // of the region.
+    attachView: function(view){
+      this.currentView = view;
+    },
+  
+    // Reset the region by closing any existing view and
+    // clearing out the cached `$el`. The next time a view
+    // is shown via this region, the region will re-query the
+    // DOM for the region's `el`.
+    reset: function(){
+      this.close();
+      delete this.$el;
+    }
+  });
+  
+  // Copy the `extend` function used by Backbone's classes
+  Marionette.Region.extend = Marionette.extend;
+  
+  // Marionette.RegionManager
+  // ------------------------
+  //
+  // Manage one or more related `Marionette.Region` objects.
+  Marionette.RegionManager = (function(Marionette){
+  
+    var RegionManager = Marionette.Controller.extend({
+      constructor: function(options){
+        this._regions = {};
+        Marionette.Controller.prototype.constructor.call(this, options);
+      },
+  
+      // Add multiple regions using an object literal, where
+      // each key becomes the region name, and each value is
+      // the region definition.
+      addRegions: function(regionDefinitions, defaults){
+        var regions = {};
+  
+        _.each(regionDefinitions, function(definition, name){
+          if (_.isString(definition)){
+            definition = { selector: definition };
+          }
+  
+          if (definition.selector){
+            definition = _.defaults({}, definition, defaults);
+          }
+  
+          var region = this.addRegion(name, definition);
+          regions[name] = region;
+        }, this);
+  
+        return regions;
+      },
+  
+      // Add an individual region to the region manager,
+      // and return the region instance
+      addRegion: function(name, definition){
+        var region;
+  
+        var isObject = _.isObject(definition);
+        var isString = _.isString(definition);
+        var hasSelector = !!definition.selector;
+  
+        if (isString || (isObject && hasSelector)){
+          region = Marionette.Region.buildRegion(definition, Marionette.Region);
+        } else if (_.isFunction(definition)){
+          region = Marionette.Region.buildRegion(definition, Marionette.Region);
+        } else {
+          region = definition;
+        }
+  
+        this._store(name, region);
+        this.triggerMethod("region:add", name, region);
+        return region;
+      },
+  
+      // Get a region by name
+      get: function(name){
+        return this._regions[name];
+      },
+  
+      // Remove a region by name
+      removeRegion: function(name){
+        var region = this._regions[name];
+        this._remove(name, region);
+      },
+  
+      // Close all regions in the region manager, and
+      // remove them
+      removeRegions: function(){
+        _.each(this._regions, function(region, name){
+          this._remove(name, region);
+        }, this);
+      },
+  
+      // Close all regions in the region manager, but
+      // leave them attached
+      closeRegions: function(){
+        _.each(this._regions, function(region, name){
+          region.close();
+        }, this);
+      },
+  
+      // Close all regions and shut down the region
+      // manager entirely
+      close: function(){
+        this.removeRegions();
+        Marionette.Controller.prototype.close.apply(this, arguments);
+      },
+  
+      // internal method to store regions
+      _store: function(name, region){
+        this._regions[name] = region;
+        this._setLength();
+      },
+  
+      // internal method to remove a region
+      _remove: function(name, region){
+        region.close();
+        region.stopListening();
+        delete this._regions[name];
+        this._setLength();
+        this.triggerMethod("region:remove", name, region);
+      },
+  
+      // set the number of regions current held
+      _setLength: function(){
+        this.length = _.size(this._regions);
+      }
+  
+    });
+  
+    Marionette.actAsCollection(RegionManager.prototype, '_regions');
+  
+    return RegionManager;
+  })(Marionette);
+  
+  
+  // Template Cache
+  // --------------
+  
+  // Manage templates stored in `<script>` blocks,
+  // caching them for faster access.
+  Marionette.TemplateCache = function(templateId){
+    this.templateId = templateId;
+  };
+  
+  // TemplateCache object-level methods. Manage the template
+  // caches from these method calls instead of creating
+  // your own TemplateCache instances
+  _.extend(Marionette.TemplateCache, {
+    templateCaches: {},
+  
+    // Get the specified template by id. Either
+    // retrieves the cached version, or loads it
+    // from the DOM.
+    get: function(templateId){
+      var cachedTemplate = this.templateCaches[templateId];
+  
+      if (!cachedTemplate){
+        cachedTemplate = new Marionette.TemplateCache(templateId);
+        this.templateCaches[templateId] = cachedTemplate;
+      }
+  
+      return cachedTemplate.load();
+    },
+  
+    // Clear templates from the cache. If no arguments
+    // are specified, clears all templates:
+    // `clear()`
+    //
+    // If arguments are specified, clears each of the
+    // specified templates from the cache:
+    // `clear("#t1", "#t2", "...")`
+    clear: function(){
+      var i;
+      var args = slice.call(arguments);
+      var length = args.length;
+  
+      if (length > 0){
+        for(i=0; i<length; i++){
+          delete this.templateCaches[args[i]];
+        }
+      } else {
+        this.templateCaches = {};
+      }
+    }
+  });
+  
+  // TemplateCache instance methods, allowing each
+  // template cache object to manage its own state
+  // and know whether or not it has been loaded
+  _.extend(Marionette.TemplateCache.prototype, {
+  
+    // Internal method to load the template
+    load: function(){
+      // Guard clause to prevent loading this template more than once
+      if (this.compiledTemplate){
+        return this.compiledTemplate;
+      }
+  
+      // Load the template and compile it
+      var template = this.loadTemplate(this.templateId);
+      this.compiledTemplate = this.compileTemplate(template);
+  
+      return this.compiledTemplate;
+    },
+  
+    // Load a template from the DOM, by default. Override
+    // this method to provide your own template retrieval
+    // For asynchronous loading with AMD/RequireJS, consider
+    // using a template-loader plugin as described here:
+    // https://github.com/marionettejs/backbone.marionette/wiki/Using-marionette-with-requirejs
+    loadTemplate: function(templateId){
+      var template = Marionette.$(templateId).html();
+  
+      if (!template || template.length === 0){
+        throwError("Could not find template: '" + templateId + "'", "NoTemplateError");
+      }
+  
+      return template;
+    },
+  
+    // Pre-compile the template before caching it. Override
+    // this method if you do not need to pre-compile a template
+    // (JST / RequireJS for example) or if you want to change
+    // the template engine used (Handebars, etc).
+    compileTemplate: function(rawTemplate){
+      return _.template(rawTemplate);
+    }
+  });
+  
+  // Renderer
+  // --------
+  
+  // Render a template with data by passing in the template
+  // selector and the data to render.
+  Marionette.Renderer = {
+  
+    // Render a template with data. The `template` parameter is
+    // passed to the `TemplateCache` object to retrieve the
+    // template function. Override this method to provide your own
+    // custom rendering and template handling for all of Marionette.
+    render: function(template, data){
+  
+      if (!template) {
+        throwError("Cannot render the template since it's false, null or undefined.", "TemplateNotFoundError");
+      }
+  
+      var templateFunc;
+      if (typeof template === "function"){
+        templateFunc = template;
+      } else {
+        templateFunc = Marionette.TemplateCache.get(template);
+      }
+  
+      return templateFunc(data);
+    }
+  };
+  
+  
+  // Marionette.View
+  // ---------------
+  
+  // The core view type that other Marionette views extend from.
+  Marionette.View = Backbone.View.extend({
+  
+    constructor: function(options){
+      _.bindAll(this, "render");
+  
+      // this exposes view options to the view initializer
+      // this is a backfill since backbone removed the assignment
+      // of this.options
+      // at some point however this may be removed
+      this.options = _.extend({}, _.result(this, 'options'), _.isFunction(options) ? options.call(this) : options);
+  
+      // parses out the @ui DSL for events
+      this.events = this.normalizeUIKeys(_.result(this, 'events'));
+  
+      if (_.isObject(this.behaviors)) {
+        new Marionette.Behaviors(this);
+      }
+  
+      Backbone.View.prototype.constructor.apply(this, arguments);
+  
+      Marionette.MonitorDOMRefresh(this);
+      this.listenTo(this, "show", this.onShowCalled);
+    },
+  
+    // import the "triggerMethod" to trigger events with corresponding
+    // methods if the method exists
+    triggerMethod: Marionette.triggerMethod,
+  
+    // Imports the "normalizeMethods" to transform hashes of
+    // events=>function references/names to a hash of events=>function references
+    normalizeMethods: Marionette.normalizeMethods,
+  
+    // Get the template for this view
+    // instance. You can set a `template` attribute in the view
+    // definition or pass a `template: "whatever"` parameter in
+    // to the constructor options.
+    getTemplate: function(){
+      return Marionette.getOption(this, "template");
+    },
+  
+    // Mix in template helper methods. Looks for a
+    // `templateHelpers` attribute, which can either be an
+    // object literal, or a function that returns an object
+    // literal. All methods and attributes from this object
+    // are copies to the object passed in.
+    mixinTemplateHelpers: function(target){
+      target = target || {};
+      var templateHelpers = Marionette.getOption(this, "templateHelpers");
+      if (_.isFunction(templateHelpers)){
+        templateHelpers = templateHelpers.call(this);
+      }
+      return _.extend(target, templateHelpers);
+    },
+  
+  
+    normalizeUIKeys: function(hash) {
+      var ui = _.result(this, 'ui');
+      return Marionette.normalizeUIKeys(hash, ui);
+    },
+  
+    // Configure `triggers` to forward DOM events to view
+    // events. `triggers: {"click .foo": "do:foo"}`
+    configureTriggers: function(){
+      if (!this.triggers) { return; }
+  
+      var triggerEvents = {};
+  
+      // Allow `triggers` to be configured as a function
+      var triggers = this.normalizeUIKeys(_.result(this, "triggers"));
+  
+      // Configure the triggers, prevent default
+      // action and stop propagation of DOM events
+      _.each(triggers, function(value, key){
+  
+        var hasOptions = _.isObject(value);
+        var eventName = hasOptions ? value.event : value;
+  
+        // build the event handler function for the DOM event
+        triggerEvents[key] = function(e){
+  
+          // stop the event in its tracks
+          if (e) {
+            var prevent = e.preventDefault;
+            var stop = e.stopPropagation;
+  
+            var shouldPrevent = hasOptions ? value.preventDefault : prevent;
+            var shouldStop = hasOptions ? value.stopPropagation : stop;
+  
+            if (shouldPrevent && prevent) { prevent.apply(e); }
+            if (shouldStop && stop) { stop.apply(e); }
+          }
+  
+          // build the args for the event
+          var args = {
+            view: this,
+            model: this.model,
+            collection: this.collection
+          };
+  
+          // trigger the event
+          this.triggerMethod(eventName, args);
+        };
+  
+      }, this);
+  
+      return triggerEvents;
+    },
+  
+    // Overriding Backbone.View's delegateEvents to handle
+    // the `triggers`, `modelEvents`, and `collectionEvents` configuration
+    delegateEvents: function(events){
+      this._delegateDOMEvents(events);
+      Marionette.bindEntityEvents(this, this.model, Marionette.getOption(this, "modelEvents"));
+      Marionette.bindEntityEvents(this, this.collection, Marionette.getOption(this, "collectionEvents"));
+    },
+  
+    // internal method to delegate DOM events and triggers
+    _delegateDOMEvents: function(events){
+      events = events || this.events;
+      if (_.isFunction(events)){ events = events.call(this); }
+  
+      var combinedEvents = {};
+  
+      // look up if this view has behavior events
+      var behaviorEvents = _.result(this, 'behaviorEvents') || {};
+      var triggers = this.configureTriggers();
+  
+      // behavior events will be overriden by view events and or triggers
+      _.extend(combinedEvents, behaviorEvents, events, triggers);
+  
+      Backbone.View.prototype.delegateEvents.call(this, combinedEvents);
+    },
+  
+    // Overriding Backbone.View's undelegateEvents to handle unbinding
+    // the `triggers`, `modelEvents`, and `collectionEvents` config
+    undelegateEvents: function(){
+      var args = Array.prototype.slice.call(arguments);
+      Backbone.View.prototype.undelegateEvents.apply(this, args);
+  
+      Marionette.unbindEntityEvents(this, this.model, Marionette.getOption(this, "modelEvents"));
+      Marionette.unbindEntityEvents(this, this.collection, Marionette.getOption(this, "collectionEvents"));
+    },
+  
+    // Internal method, handles the `show` event.
+    onShowCalled: function(){},
+  
+    // Default `close` implementation, for removing a view from the
+    // DOM and unbinding it. Regions will call this method
+    // for you. You can specify an `onClose` method in your view to
+    // add custom code that is called after the view is closed.
+    close: function(){
+      if (this.isClosed) { return; }
+  
+      var args = Array.prototype.slice.call(arguments);
+  
+      // allow the close to be stopped by returning `false`
+      // from the `onBeforeClose` method
+      var shouldClose = this.triggerMethod.apply(this, ["before:close"].concat(args));
+      if (shouldClose === false){
+        return;
+      }
+  
+      // mark as closed before doing the actual close, to
+      // prevent infinite loops within "close" event handlers
+      // that are trying to close other views
+      this.isClosed = true;
+      this.triggerMethod.apply(this, ["close"].concat(args));
+  
+      // unbind UI elements
+      this.unbindUIElements();
+  
+      // remove the view from the DOM
+      this.remove();
+    },
+  
+    // This method binds the elements specified in the "ui" hash inside the view's code with
+    // the associated jQuery selectors.
+    bindUIElements: function(){
+      if (!this.ui) { return; }
+  
+      // store the ui hash in _uiBindings so they can be reset later
+      // and so re-rendering the view will be able to find the bindings
+      if (!this._uiBindings){
+        this._uiBindings = this.ui;
+      }
+  
+      // get the bindings result, as a function or otherwise
+      var bindings = _.result(this, "_uiBindings");
+  
+      // empty the ui so we don't have anything to start with
+      this.ui = {};
+  
+      // bind each of the selectors
+      _.each(_.keys(bindings), function(key) {
+        var selector = bindings[key];
+        this.ui[key] = this.$(selector);
+      }, this);
+    },
+  
+    // This method unbinds the elements specified in the "ui" hash
+    unbindUIElements: function(){
+      if (!this.ui || !this._uiBindings){ return; }
+  
+      // delete all of the existing ui bindings
+      _.each(this.ui, function($el, name){
+        delete this.ui[name];
+      }, this);
+  
+      // reset the ui element to the original bindings configuration
+      this.ui = this._uiBindings;
+      delete this._uiBindings;
+    }
+  });
+  
+  // Item View
+  // ---------
+  
+  // A single item view implementation that contains code for rendering
+  // with underscore.js templates, serializing the view's model or collection,
+  // and calling several methods on extended views, such as `onRender`.
+  Marionette.ItemView = Marionette.View.extend({
+  
+    // Setting up the inheritance chain which allows changes to
+    // Marionette.View.prototype.constructor which allows overriding
+    constructor: function(){
+      Marionette.View.prototype.constructor.apply(this, arguments);
+    },
+  
+    // Serialize the model or collection for the view. If a model is
+    // found, `.toJSON()` is called. If a collection is found, `.toJSON()`
+    // is also called, but is used to populate an `items` array in the
+    // resulting data. If both are found, defaults to the model.
+    // You can override the `serializeData` method in your own view
+    // definition, to provide custom serialization for your view's data.
+    serializeData: function(){
+      var data = {};
+  
+      if (this.model) {
+        data = this.model.toJSON();
+      }
+      else if (this.collection) {
+        data = { items: this.collection.toJSON() };
+      }
+  
+      return data;
+    },
+  
+    // Render the view, defaulting to underscore.js templates.
+    // You can override this in your view definition to provide
+    // a very specific rendering for your view. In general, though,
+    // you should override the `Marionette.Renderer` object to
+    // change how Marionette renders views.
+    render: function(){
+      this.isClosed = false;
+  
+      this.triggerMethod("before:render", this);
+      this.triggerMethod("item:before:render", this);
+  
+      var data = this.serializeData();
+      data = this.mixinTemplateHelpers(data);
+  
+      var template = this.getTemplate();
+      var html = Marionette.Renderer.render(template, data);
+  
+      this.$el.html(html);
+      this.bindUIElements();
+  
+      this.triggerMethod("render", this);
+      this.triggerMethod("item:rendered", this);
+  
+      return this;
+    },
+  
+    // Override the default close event to add a few
+    // more events that are triggered.
+    close: function(){
+      if (this.isClosed){ return; }
+  
+      this.triggerMethod('item:before:close');
+  
+      Marionette.View.prototype.close.apply(this, arguments);
+  
+      this.triggerMethod('item:closed');
+    }
+  });
+  
+  // Collection View
+  // ---------------
+  
+  // A view that iterates over a Backbone.Collection
+  // and renders an individual ItemView for each model.
+  Marionette.CollectionView = Marionette.View.extend({
+    // used as the prefix for item view events
+    // that are forwarded through the collectionview
+    itemViewEventPrefix: "itemview",
+  
+    // constructor
+    constructor: function(options){
+      this._initChildViewStorage();
+  
+      Marionette.View.prototype.constructor.apply(this, arguments);
+  
+      this._initialEvents();
+      this.initRenderBuffer();
+    },
+  
+    // Instead of inserting elements one by one into the page,
+    // it's much more performant to insert elements into a document
+    // fragment and then insert that document fragment into the page
+    initRenderBuffer: function() {
+      this.elBuffer = document.createDocumentFragment();
+      this._bufferedChildren = [];
+    },
+  
+    startBuffering: function() {
+      this.initRenderBuffer();
+      this.isBuffering = true;
+    },
+  
+    endBuffering: function() {
+      this.isBuffering = false;
+      this.appendBuffer(this, this.elBuffer);
+      this._triggerShowBufferedChildren();
+      this.initRenderBuffer();
+    },
+  
+    _triggerShowBufferedChildren: function () {
+      if (this._isShown) {
+        _.each(this._bufferedChildren, function (child) {
+          if (_.isFunction(child.triggerMethod)) {
+            child.triggerMethod('show');
+          } else {
+            Marionette.triggerMethod.call(child, 'show');
+          }
+        });
+        this._bufferedChildren = [];
+      }
+    },
+  
+    // Configured the initial events that the collection view
+    // binds to.
+    _initialEvents: function(){
+      if (this.collection){
+        this.listenTo(this.collection, "add", this.addChildView);
+        this.listenTo(this.collection, "remove", this.removeItemView);
+        this.listenTo(this.collection, "reset", this.render);
+      }
+    },
+  
+    // Handle a child item added to the collection
+    addChildView: function(item, collection, options){
+      this.closeEmptyView();
+      var ItemView = this.getItemView(item);
+      var index = this.collection.indexOf(item);
+      this.addItemView(item, ItemView, index);
+    },
+  
+    // Override from `Marionette.View` to guarantee the `onShow` method
+    // of child views is called.
+    onShowCalled: function(){
+      this.children.each(function(child){
+        if (_.isFunction(child.triggerMethod)) {
+          child.triggerMethod('show');
+        } else {
+          Marionette.triggerMethod.call(child, 'show');
+        }
+      });
+    },
+  
+    // Internal method to trigger the before render callbacks
+    // and events
+    triggerBeforeRender: function(){
+      this.triggerMethod("before:render", this);
+      this.triggerMethod("collection:before:render", this);
+    },
+  
+    // Internal method to trigger the rendered callbacks and
+    // events
+    triggerRendered: function(){
+      this.triggerMethod("render", this);
+      this.triggerMethod("collection:rendered", this);
+    },
+  
+    // Render the collection of items. Override this method to
+    // provide your own implementation of a render function for
+    // the collection view.
+    render: function(){
+      this.isClosed = false;
+      this.triggerBeforeRender();
+      this._renderChildren();
+      this.triggerRendered();
+      return this;
+    },
+  
+    // Internal method. Separated so that CompositeView can have
+    // more control over events being triggered, around the rendering
+    // process
+    _renderChildren: function(){
+      this.startBuffering();
+  
+      this.closeEmptyView();
+      this.closeChildren();
+  
+      if (!this.isEmpty(this.collection)) {
+        this.showCollection();
+      } else {
+        this.showEmptyView();
+      }
+  
+      this.endBuffering();
+    },
+  
+    // Internal method to loop through each item in the
+    // collection view and show it
+    showCollection: function(){
+      var ItemView;
+      this.collection.each(function(item, index){
+        ItemView = this.getItemView(item);
+        this.addItemView(item, ItemView, index);
+      }, this);
+    },
+  
+    // Internal method to show an empty view in place of
+    // a collection of item views, when the collection is
+    // empty
+    showEmptyView: function(){
+      var EmptyView = this.getEmptyView();
+  
+      if (EmptyView && !this._showingEmptyView){
+        this._showingEmptyView = true;
+        var model = new Backbone.Model();
+        this.addItemView(model, EmptyView, 0);
+      }
+    },
+  
+    // Internal method to close an existing emptyView instance
+    // if one exists. Called when a collection view has been
+    // rendered empty, and then an item is added to the collection.
+    closeEmptyView: function(){
+      if (this._showingEmptyView){
+        this.closeChildren();
+        delete this._showingEmptyView;
+      }
+    },
+  
+    // Retrieve the empty view type
+    getEmptyView: function(){
+      return Marionette.getOption(this, "emptyView");
+    },
+  
+    // Retrieve the itemView type, either from `this.options.itemView`
+    // or from the `itemView` in the object definition. The "options"
+    // takes precedence.
+    getItemView: function(item){
+      var itemView = Marionette.getOption(this, "itemView");
+  
+      if (!itemView){
+        throwError("An `itemView` must be specified", "NoItemViewError");
+      }
+  
+      return itemView;
+    },
+  
+    // Render the child item's view and add it to the
+    // HTML for the collection view.
+    addItemView: function(item, ItemView, index){
+      // get the itemViewOptions if any were specified
+      var itemViewOptions = Marionette.getOption(this, "itemViewOptions");
+      if (_.isFunction(itemViewOptions)){
+        itemViewOptions = itemViewOptions.call(this, item, index);
+      }
+  
+      // build the view
+      var view = this.buildItemView(item, ItemView, itemViewOptions);
+  
+      // set up the child view event forwarding
+      this.addChildViewEventForwarding(view);
+  
+      // this view is about to be added
+      this.triggerMethod("before:item:added", view);
+  
+      // Store the child view itself so we can properly
+      // remove and/or close it later
+      this.children.add(view);
+  
+      // Render it and show it
+      this.renderItemView(view, index);
+  
+      // call the "show" method if the collection view
+      // has already been shown
+      if (this._isShown && !this.isBuffering){
+        if (_.isFunction(view.triggerMethod)) {
+          view.triggerMethod('show');
+        } else {
+          Marionette.triggerMethod.call(view, 'show');
+        }
+      }
+  
+      // this view was added
+      this.triggerMethod("after:item:added", view);
+  
+      return view;
+    },
+  
+    // Set up the child view event forwarding. Uses an "itemview:"
+    // prefix in front of all forwarded events.
+    addChildViewEventForwarding: function(view){
+      var prefix = Marionette.getOption(this, "itemViewEventPrefix");
+  
+      // Forward all child item view events through the parent,
+      // prepending "itemview:" to the event name
+      this.listenTo(view, "all", function(){
+        var args = slice.call(arguments);
+        var rootEvent = args[0];
+        var itemEvents = this.normalizeMethods(this.getItemEvents());
+  
+        args[0] = prefix + ":" + rootEvent;
+        args.splice(1, 0, view);
+  
+        // call collectionView itemEvent if defined
+        if (typeof itemEvents !== "undefined" && _.isFunction(itemEvents[rootEvent])) {
+          itemEvents[rootEvent].apply(this, args);
+        }
+  
+        Marionette.triggerMethod.apply(this, args);
+      }, this);
+    },
+  
+    // returns the value of itemEvents depending on if a function
+    getItemEvents: function() {
+      if (_.isFunction(this.itemEvents)) {
+        return this.itemEvents.call(this);
+      }
+  
+      return this.itemEvents;
+    },
+  
+    // render the item view
+    renderItemView: function(view, index) {
+      view.render();
+      this.appendHtml(this, view, index);
+    },
+  
+    // Build an `itemView` for every model in the collection.
+    buildItemView: function(item, ItemViewType, itemViewOptions){
+      var options = _.extend({model: item}, itemViewOptions);
+      return new ItemViewType(options);
+    },
+  
+    // get the child view by item it holds, and remove it
+    removeItemView: function(item){
+      var view = this.children.findByModel(item);
+      this.removeChildView(view);
+      this.checkEmpty();
+    },
+  
+    // Remove the child view and close it
+    removeChildView: function(view){
+  
+      // shut down the child view properly,
+      // including events that the collection has from it
+      if (view){
+        // call 'close' or 'remove', depending on which is found
+        if (view.close) { view.close(); }
+        else if (view.remove) { view.remove(); }
+  
+        this.stopListening(view);
+        this.children.remove(view);
+      }
+  
+      this.triggerMethod("item:removed", view);
+    },
+  
+    // helper to check if the collection is empty
+    isEmpty: function(collection){
+      // check if we're empty now
+      return !this.collection || this.collection.length === 0;
+    },
+  
+    // If empty, show the empty view
+    checkEmpty: function (){
+      if (this.isEmpty(this.collection)){
+        this.showEmptyView();
+      }
+    },
+  
+    // You might need to override this if you've overridden appendHtml
+    appendBuffer: function(collectionView, buffer) {
+      collectionView.$el.append(buffer);
+    },
+  
+    // Append the HTML to the collection's `el`.
+    // Override this method to do something other
+    // than `.append`.
+    appendHtml: function(collectionView, itemView, index){
+      if (collectionView.isBuffering) {
+        // buffering happens on reset events and initial renders
+        // in order to reduce the number of inserts into the
+        // document, which are expensive.
+        collectionView.elBuffer.appendChild(itemView.el);
+        collectionView._bufferedChildren.push(itemView);
+      }
+      else {
+        // If we've already rendered the main collection, just
+        // append the new items directly into the element.
+        collectionView.$el.append(itemView.el);
+      }
+    },
+  
+    // Internal method to set up the `children` object for
+    // storing all of the child views
+    _initChildViewStorage: function(){
+      this.children = new Backbone.ChildViewContainer();
+    },
+  
+    // Handle cleanup and other closing needs for
+    // the collection of views.
+    close: function(){
+      if (this.isClosed){ return; }
+  
+      this.triggerMethod("collection:before:close");
+      this.closeChildren();
+      this.triggerMethod("collection:closed");
+  
+      Marionette.View.prototype.close.apply(this, arguments);
+    },
+  
+    // Close the child views that this collection view
+    // is holding on to, if any
+    closeChildren: function(){
+      this.children.each(function(child){
+        this.removeChildView(child);
+      }, this);
+      this.checkEmpty();
+    }
+  });
+  
+  // Composite View
+  // --------------
+  
+  // Used for rendering a branch-leaf, hierarchical structure.
+  // Extends directly from CollectionView and also renders an
+  // an item view as `modelView`, for the top leaf
+  Marionette.CompositeView = Marionette.CollectionView.extend({
+  
+    // Setting up the inheritance chain which allows changes to
+    // Marionette.CollectionView.prototype.constructor which allows overriding
+    constructor: function(){
+      Marionette.CollectionView.prototype.constructor.apply(this, arguments);
+    },
+  
+    // Configured the initial events that the composite view
+    // binds to. Override this method to prevent the initial
+    // events, or to add your own initial events.
+    _initialEvents: function(){
+  
+      // Bind only after composite view is rendered to avoid adding child views
+      // to nonexistent itemViewContainer
+      this.once('render', function () {
+        if (this.collection){
+          this.listenTo(this.collection, "add", this.addChildView);
+          this.listenTo(this.collection, "remove", this.removeItemView);
+          this.listenTo(this.collection, "reset", this._renderChildren);
+        }
+      });
+  
+    },
+  
+    // Retrieve the `itemView` to be used when rendering each of
+    // the items in the collection. The default is to return
+    // `this.itemView` or Marionette.CompositeView if no `itemView`
+    // has been defined
+    getItemView: function(item){
+      var itemView = Marionette.getOption(this, "itemView") || this.constructor;
+  
+      if (!itemView){
+        throwError("An `itemView` must be specified", "NoItemViewError");
+      }
+  
+      return itemView;
+    },
+  
+    // Serialize the collection for the view.
+    // You can override the `serializeData` method in your own view
+    // definition, to provide custom serialization for your view's data.
+    serializeData: function(){
+      var data = {};
+  
+      if (this.model){
+        data = this.model.toJSON();
+      }
+  
+      return data;
+    },
+  
+    // Renders the model once, and the collection once. Calling
+    // this again will tell the model's view to re-render itself
+    // but the collection will not re-render.
+    render: function(){
+      this.isRendered = true;
+      this.isClosed = false;
+      this.resetItemViewContainer();
+  
+      this.triggerBeforeRender();
+      var html = this.renderModel();
+      this.$el.html(html);
+      // the ui bindings is done here and not at the end of render since they
+      // will not be available until after the model is rendered, but should be
+      // available before the collection is rendered.
+      this.bindUIElements();
+      this.triggerMethod("composite:model:rendered");
+  
+      this._renderChildren();
+  
+      this.triggerMethod("composite:rendered");
+      this.triggerRendered();
+      return this;
+    },
+  
+    _renderChildren: function(){
+      if (this.isRendered){
+        this.triggerMethod("composite:collection:before:render");
+        Marionette.CollectionView.prototype._renderChildren.call(this);
+        this.triggerMethod("composite:collection:rendered");
+      }
+    },
+  
+    // Render an individual model, if we have one, as
+    // part of a composite view (branch / leaf). For example:
+    // a treeview.
+    renderModel: function(){
+      var data = {};
+      data = this.serializeData();
+      data = this.mixinTemplateHelpers(data);
+  
+      var template = this.getTemplate();
+      return Marionette.Renderer.render(template, data);
+    },
+  
+  
+    // You might need to override this if you've overridden appendHtml
+    appendBuffer: function(compositeView, buffer) {
+      var $container = this.getItemViewContainer(compositeView);
+      $container.append(buffer);
+    },
+  
+    // Appends the `el` of itemView instances to the specified
+    // `itemViewContainer` (a jQuery selector). Override this method to
+    // provide custom logic of how the child item view instances have their
+    // HTML appended to the composite view instance.
+    appendHtml: function(compositeView, itemView, index){
+      if (compositeView.isBuffering) {
+        compositeView.elBuffer.appendChild(itemView.el);
+        compositeView._bufferedChildren.push(itemView);
+      }
+      else {
+        // If we've already rendered the main collection, just
+        // append the new items directly into the element.
+        var $container = this.getItemViewContainer(compositeView);
+        $container.append(itemView.el);
+      }
+    },
+  
+    // Internal method to ensure an `$itemViewContainer` exists, for the
+    // `appendHtml` method to use.
+    getItemViewContainer: function(containerView){
+      if ("$itemViewContainer" in containerView){
+        return containerView.$itemViewContainer;
+      }
+  
+      var container;
+      var itemViewContainer = Marionette.getOption(containerView, "itemViewContainer");
+      if (itemViewContainer){
+  
+        var selector = _.isFunction(itemViewContainer) ? itemViewContainer.call(containerView) : itemViewContainer;
+  
+        if (selector.charAt(0) === "@" && containerView.ui) {
+          container = containerView.ui[selector.substr(4)];
+        } else {
+          container = containerView.$(selector);
+        }
+  
+        if (container.length <= 0) {
+          throwError("The specified `itemViewContainer` was not found: " + containerView.itemViewContainer, "ItemViewContainerMissingError");
+        }
+  
+      } else {
+        container = containerView.$el;
+      }
+  
+      containerView.$itemViewContainer = container;
+      return container;
+    },
+  
+    // Internal method to reset the `$itemViewContainer` on render
+    resetItemViewContainer: function(){
+      if (this.$itemViewContainer){
+        delete this.$itemViewContainer;
+      }
+    }
+  });
+  
+  // Layout
+  // ------
+  
+  // Used for managing application layouts, nested layouts and
+  // multiple regions within an application or sub-application.
+  //
+  // A specialized view type that renders an area of HTML and then
+  // attaches `Region` instances to the specified `regions`.
+  // Used for composite view management and sub-application areas.
+  Marionette.Layout = Marionette.ItemView.extend({
+    regionType: Marionette.Region,
+  
+    // Ensure the regions are available when the `initialize` method
+    // is called.
+    constructor: function (options) {
+      options = options || {};
+  
+      this._firstRender = true;
+      this._initializeRegions(options);
+  
+      Marionette.ItemView.prototype.constructor.call(this, options);
+    },
+  
+    // Layout's render will use the existing region objects the
+    // first time it is called. Subsequent calls will close the
+    // views that the regions are showing and then reset the `el`
+    // for the regions to the newly rendered DOM elements.
+    render: function(){
+  
+      if (this.isClosed){
+        // a previously closed layout means we need to
+        // completely re-initialize the regions
+        this._initializeRegions();
+      }
+      if (this._firstRender) {
+        // if this is the first render, don't do anything to
+        // reset the regions
+        this._firstRender = false;
+      } else if (!this.isClosed){
+        // If this is not the first render call, then we need to
+        // re-initializing the `el` for each region
+        this._reInitializeRegions();
+      }
+  
+      return Marionette.ItemView.prototype.render.apply(this, arguments);
+    },
+  
+    // Handle closing regions, and then close the view itself.
+    close: function () {
+      if (this.isClosed){ return; }
+      this.regionManager.close();
+      Marionette.ItemView.prototype.close.apply(this, arguments);
+    },
+  
+    // Add a single region, by name, to the layout
+    addRegion: function(name, definition){
+      var regions = {};
+      regions[name] = definition;
+      return this._buildRegions(regions)[name];
+    },
+  
+    // Add multiple regions as a {name: definition, name2: def2} object literal
+    addRegions: function(regions){
+      this.regions = _.extend({}, this.regions, regions);
+      return this._buildRegions(regions);
+    },
+  
+    // Remove a single region from the Layout, by name
+    removeRegion: function(name){
+      delete this.regions[name];
+      return this.regionManager.removeRegion(name);
+    },
+  
+    // Provides alternative access to regions
+    // Accepts the region name
+    // getRegion('main')
+    getRegion: function(region) {
+      return this.regionManager.get(region);
+    },
+  
+    // internal method to build regions
+    _buildRegions: function(regions){
+      var that = this;
+  
+      var defaults = {
+        regionType: Marionette.getOption(this, "regionType"),
+        parentEl: function(){ return that.$el; }
+      };
+  
+      return this.regionManager.addRegions(regions, defaults);
+    },
+  
+    // Internal method to initialize the regions that have been defined in a
+    // `regions` attribute on this layout.
+    _initializeRegions: function (options) {
+      var regions;
+      this._initRegionManager();
+  
+      if (_.isFunction(this.regions)) {
+        regions = this.regions(options);
+      } else {
+        regions = this.regions || {};
+      }
+  
+      this.addRegions(regions);
+    },
+  
+    // Internal method to re-initialize all of the regions by updating the `el` that
+    // they point to
+    _reInitializeRegions: function(){
+      this.regionManager.closeRegions();
+      this.regionManager.each(function(region){
+        region.reset();
+      });
+    },
+  
+    // Internal method to initialize the region manager
+    // and all regions in it
+    _initRegionManager: function(){
+      this.regionManager = new Marionette.RegionManager();
+  
+      this.listenTo(this.regionManager, "region:add", function(name, region){
+        this[name] = region;
+        this.trigger("region:add", name, region);
+      });
+  
+      this.listenTo(this.regionManager, "region:remove", function(name, region){
+        delete this[name];
+        this.trigger("region:remove", name, region);
+      });
+    }
+  });
+  
+  
+  // Behavior
+  // -----------
+  
+  // A Behavior is an isolated set of DOM /
+  // user interactions that can be mixed into any View.
+  // Behaviors allow you to blackbox View specific interactions
+  // into portable logical chunks, keeping your views simple and your code DRY.
+  
+  Marionette.Behavior = (function(_, Backbone){
+    function Behavior(options, view){
+      // Setup reference to the view.
+      // this comes in handle when a behavior
+      // wants to directly talk up the chain
+      // to the view.
+      this.view = view;
+      this.defaults = _.result(this, "defaults") || {};
+      this.options  = _.extend({}, this.defaults, options);
+  
+      // proxy behavior $ method to the view
+      // this is useful for doing jquery DOM lookups
+      // scoped to behaviors view.
+      this.$ = function() {
+        return this.view.$.apply(this.view, arguments);
+      };
+  
+      // Call the initialize method passing
+      // the arguments from the instance constructor
+      this.initialize.apply(this, arguments);
+    }
+  
+    _.extend(Behavior.prototype, Backbone.Events, {
+      initialize: function(){},
+  
+      // stopListening to behavior `onListen` events.
+      close: function() {
+        this.stopListening();
+      },
+  
+      // Setup class level proxy for triggerMethod.
+      triggerMethod: Marionette.triggerMethod
+    });
+  
+    // Borrow Backbones extend implementation
+    // this allows us to setup a proper
+    // inheritence pattern that follow in suite
+    // with the rest of Marionette views.
+    Behavior.extend = Marionette.extend;
+  
+    return Behavior;
+  })(_, Backbone);
+  
+  // Marionette.Behaviors
+  // --------
+  
+  // Behaviors is a utility class that takes care of
+  // glueing your behavior instances to their given View.
+  // The most important part of this class is that you
+  // **MUST** override the class level behaviorsLookup
+  // method for things to work properly.
+  
+  Marionette.Behaviors = (function(Marionette, _) {
+  
+    function Behaviors(view) {
+      // Behaviors defined on a view can be a flat object literal
+      // or it can be a function that returns an object.
+      this.behaviors = Behaviors.parseBehaviors(view, _.result(view, 'behaviors'));
+  
+      // Wraps several of the view's methods
+      // calling the methods first on each behavior
+      // and then eventually calling the method on the view.
+      Behaviors.wrap(view, this.behaviors, [
+        'bindUIElements', 'unbindUIElements',
+        'delegateEvents', 'undelegateEvents',
+        'behaviorEvents', 'triggerMethod',
+        'setElement', 'close'
+      ]);
+    }
+  
+    var methods = {
+      setElement: function(setElement, behaviors) {
+        setElement.apply(this, _.tail(arguments, 2));
+  
+        // proxy behavior $el to the view's $el.
+        // This is needed because a view's $el proxy
+        // is not set until after setElement is called.
+        _.each(behaviors, function(b) {
+          b.$el = this.$el;
+        }, this);
+      },
+  
+      close: function(close, behaviors) {
+        var args = _.tail(arguments, 2);
+        close.apply(this, args);
+  
+        // Call close on each behavior after
+        // closing down the view.
+        // This unbinds event listeners
+        // that behaviors have registerd for.
+        _.invoke(behaviors, 'close', args);
+      },
+  
+      bindUIElements: function(bindUIElements, behaviors) {
+        bindUIElements.apply(this);
+        _.invoke(behaviors, bindUIElements);
+      },
+  
+      unbindUIElements: function(unbindUIElements, behaviors) {
+        unbindUIElements.apply(this);
+        _.invoke(behaviors, unbindUIElements);
+      },
+  
+      triggerMethod: function(triggerMethod, behaviors) {
+        var args = _.tail(arguments, 2);
+        triggerMethod.apply(this, args);
+  
+        _.each(behaviors, function(b) {
+          triggerMethod.apply(b, args);
+        });
+      },
+  
+      delegateEvents: function(delegateEvents, behaviors) {
+        var args = _.tail(arguments, 2);
+        delegateEvents.apply(this, args);
+  
+        _.each(behaviors, function(b){
+          Marionette.bindEntityEvents(b, this.model, Marionette.getOption(b, "modelEvents"));
+          Marionette.bindEntityEvents(b, this.collection, Marionette.getOption(b, "collectionEvents"));
+        }, this);
+      },
+  
+      undelegateEvents: function(undelegateEvents, behaviors) {
+        var args = _.tail(arguments, 2);
+        undelegateEvents.apply(this, args);
+  
+        _.each(behaviors, function(b) {
+          Marionette.unbindEntityEvents(b, this.model, Marionette.getOption(b, "modelEvents"));
+          Marionette.unbindEntityEvents(b, this.collection, Marionette.getOption(b, "collectionEvents"));
+        }, this);
+      },
+  
+      behaviorEvents: function(behaviorEvents, behaviors) {
+        var _behaviorsEvents = {};
+        var viewUI = _.result(this, 'ui');
+  
+        _.each(behaviors, function(b, i) {
+          var _events = {};
+          var behaviorEvents = _.clone(_.result(b, 'events')) || {};
+          var behaviorUI = _.result(b, 'ui');
+  
+          // Construct an internal UI hash first using
+          // the views UI hash and then the behaviors UI hash.
+          // This allows the user to use UI hash elements
+          // defined in the parent view as well as those
+          // defined in the given behavior.
+          var ui = _.extend({}, viewUI, behaviorUI);
+  
+          // Normalize behavior events hash to allow
+          // a user to use the @ui. syntax.
+          behaviorEvents = Marionette.normalizeUIKeys(behaviorEvents, ui);
+  
+          _.each(_.keys(behaviorEvents), function(key) {
+            // append white-space at the end of each key to prevent behavior key collisions
+            // this is relying on the fact backbone events considers "click .foo" the same  "click .foo "
+            // starts with an array of two so the first behavior has one space
+  
+            // +2 is uses becauce new Array(1) or 0 is "" and not " "
+            var whitespace = (new Array(i+2)).join(" ");
+            var eventKey   = key + whitespace;
+            var handler    = _.isFunction(behaviorEvents[key]) ? behaviorEvents[key] : b[behaviorEvents[key]];
+  
+            _events[eventKey] = _.bind(handler, b);
+          });
+  
+          _behaviorsEvents = _.extend(_behaviorsEvents, _events);
+        });
+  
+        return _behaviorsEvents;
+      }
+    };
+  
+    _.extend(Behaviors, {
+  
+      // placeholder method to be extended by the user
+      // should define the object that stores the behaviors
+      // i.e.
+      //
+      // Marionette.Behaviors.behaviorsLookup: function() {
+      //   return App.Behaviors
+      // }
+      behaviorsLookup: function() {
+        throw new Error("You must define where your behaviors are stored. See https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.behaviors.md#behaviorslookup");
+      },
+  
+      // Takes care of getting the behavior class
+      // given options and a key.
+      // If a user passes in options.behaviorClass
+      // default to using that. Otherwise delegate
+      // the lookup to the users behaviorsLookup implementation.
+      getBehaviorClass: function(options, key) {
+        if (options.behaviorClass) {
+          return options.behaviorClass;
+        }
+  
+        // Get behavior class can be either a flat object or a method
+        return _.isFunction(Behaviors.behaviorsLookup) ? Behaviors.behaviorsLookup.apply(this, arguments)[key] : Behaviors.behaviorsLookup[key];
+      },
+  
+      // Maps over a view's behaviors. Performing
+      // a lookup on each behavior and the instantiating
+      // said behavior passing its options and view.
+      parseBehaviors: function(view, behaviors){
+        return _.map(behaviors, function(options, key){
+          var BehaviorClass = Behaviors.getBehaviorClass(options, key);
+          return new BehaviorClass(options, view);
+        });
+      },
+  
+      // wrap view internal methods so that they delegate to behaviors.
+      // For example, onClose should trigger close on all of the behaviors and then close itself.
+      // i.e.
+      //
+      // view.delegateEvents = _.partial(methods.delegateEvents, view.delegateEvents, behaviors);
+      wrap: function(view, behaviors, methodNames) {
+        _.each(methodNames, function(methodName) {
+          view[methodName] = _.partial(methods[methodName], view[methodName], behaviors);
+        });
+      }
+    });
+  
+    return Behaviors;
+  
+  })(Marionette, _);
+  
+  
+  // AppRouter
+  // ---------
+  
+  // Reduce the boilerplate code of handling route events
+  // and then calling a single method on another object.
+  // Have your routers configured to call the method on
+  // your object, directly.
+  //
+  // Configure an AppRouter with `appRoutes`.
+  //
+  // App routers can only take one `controller` object.
+  // It is recommended that you divide your controller
+  // objects in to smaller pieces of related functionality
+  // and have multiple routers / controllers, instead of
+  // just one giant router and controller.
+  //
+  // You can also add standard routes to an AppRouter.
+  
+  Marionette.AppRouter = Backbone.Router.extend({
+  
+    constructor: function(options){
+      Backbone.Router.prototype.constructor.apply(this, arguments);
+  
+      this.options = options || {};
+  
+      var appRoutes = Marionette.getOption(this, "appRoutes");
+      var controller = this._getController();
+      this.processAppRoutes(controller, appRoutes);
+      this.on("route", this._processOnRoute, this);
+    },
+  
+    // Similar to route method on a Backbone Router but
+    // method is called on the controller
+    appRoute: function(route, methodName) {
+      var controller = this._getController();
+      this._addAppRoute(controller, route, methodName);
+    },
+  
+    // process the route event and trigger the onRoute
+    // method call, if it exists
+    _processOnRoute: function(routeName, routeArgs){
+      // find the path that matched
+      var routePath = _.invert(this.appRoutes)[routeName];
+  
+      // make sure an onRoute is there, and call it
+      if (_.isFunction(this.onRoute)){
+        this.onRoute(routeName, routePath, routeArgs);
+      }
+    },
+  
+    // Internal method to process the `appRoutes` for the
+    // router, and turn them in to routes that trigger the
+    // specified method on the specified `controller`.
+    processAppRoutes: function(controller, appRoutes) {
+      if (!appRoutes){ return; }
+  
+      var routeNames = _.keys(appRoutes).reverse(); // Backbone requires reverted order of routes
+  
+      _.each(routeNames, function(route) {
+        this._addAppRoute(controller, route, appRoutes[route]);
+      }, this);
+    },
+  
+    _getController: function(){
+      return Marionette.getOption(this, "controller");
+    },
+  
+    _addAppRoute: function(controller, route, methodName){
+      var method = controller[methodName];
+  
+      if (!method) {
+        throwError("Method '" + methodName + "' was not found on the controller");
+      }
+  
+      this.route(route, methodName, _.bind(method, controller));
+    }
+  });
+  
+  // Application
+  // -----------
+  
+  // Contain and manage the composite application as a whole.
+  // Stores and starts up `Region` objects, includes an
+  // event aggregator as `app.vent`
+  Marionette.Application = function(options){
+    this._initRegionManager();
+    this._initCallbacks = new Marionette.Callbacks();
+    this.vent = new Backbone.Wreqr.EventAggregator();
+    this.commands = new Backbone.Wreqr.Commands();
+    this.reqres = new Backbone.Wreqr.RequestResponse();
+    this.submodules = {};
+  
+    _.extend(this, options);
+  
+    this.triggerMethod = Marionette.triggerMethod;
+  };
+  
+  _.extend(Marionette.Application.prototype, Backbone.Events, {
+    // Command execution, facilitated by Backbone.Wreqr.Commands
+    execute: function(){
+      this.commands.execute.apply(this.commands, arguments);
+    },
+  
+    // Request/response, facilitated by Backbone.Wreqr.RequestResponse
+    request: function(){
+      return this.reqres.request.apply(this.reqres, arguments);
+    },
+  
+    // Add an initializer that is either run at when the `start`
+    // method is called, or run immediately if added after `start`
+    // has already been called.
+    addInitializer: function(initializer){
+      this._initCallbacks.add(initializer);
+    },
+  
+    // kick off all of the application's processes.
+    // initializes all of the regions that have been added
+    // to the app, and runs all of the initializer functions
+    start: function(options){
+      this.triggerMethod("initialize:before", options);
+      this._initCallbacks.run(options, this);
+      this.triggerMethod("initialize:after", options);
+  
+      this.triggerMethod("start", options);
+    },
+  
+    // Add regions to your app.
+    // Accepts a hash of named strings or Region objects
+    // addRegions({something: "#someRegion"})
+    // addRegions({something: Region.extend({el: "#someRegion"}) });
+    addRegions: function(regions){
+      return this._regionManager.addRegions(regions);
+    },
+  
+    // Close all regions in the app, without removing them
+    closeRegions: function(){
+      this._regionManager.closeRegions();
+    },
+  
+    // Removes a region from your app, by name
+    // Accepts the regions name
+    // removeRegion('myRegion')
+    removeRegion: function(region) {
+      this._regionManager.removeRegion(region);
+    },
+  
+    // Provides alternative access to regions
+    // Accepts the region name
+    // getRegion('main')
+    getRegion: function(region) {
+      return this._regionManager.get(region);
+    },
+  
+    // Create a module, attached to the application
+    module: function(moduleNames, moduleDefinition){
+  
+      // Overwrite the module class if the user specifies one
+      var ModuleClass = Marionette.Module.getClass(moduleDefinition);
+  
+      // slice the args, and add this application object as the
+      // first argument of the array
+      var args = slice.call(arguments);
+      args.unshift(this);
+  
+      // see the Marionette.Module object for more information
+      return ModuleClass.create.apply(ModuleClass, args);
+    },
+  
+    // Internal method to set up the region manager
+    _initRegionManager: function(){
+      this._regionManager = new Marionette.RegionManager();
+  
+      this.listenTo(this._regionManager, "region:add", function(name, region){
+        this[name] = region;
+      });
+  
+      this.listenTo(this._regionManager, "region:remove", function(name, region){
+        delete this[name];
+      });
+    }
+  });
+  
+  // Copy the `extend` function used by Backbone's classes
+  Marionette.Application.extend = Marionette.extend;
+  
+  // Module
+  // ------
+  
+  // A simple module system, used to create privacy and encapsulation in
+  // Marionette applications
+  Marionette.Module = function(moduleName, app, options){
+    this.moduleName = moduleName;
+    this.options = _.extend({}, this.options, options);
+    // Allow for a user to overide the initialize
+    // for a given module instance.
+    this.initialize = options.initialize || this.initialize;
+  
+    // Set up an internal store for sub-modules.
+    this.submodules = {};
+  
+    this._setupInitializersAndFinalizers();
+  
+    // Set an internal reference to the app
+    // within a module.
+    this.app = app;
+  
+    // By default modules start with their parents.
+    this.startWithParent = true;
+  
+    // Setup a proxy to the trigger method implementation.
+    this.triggerMethod = Marionette.triggerMethod;
+  
+    if (_.isFunction(this.initialize)){
+      this.initialize(this.options, moduleName, app);
+    }
+  };
+  
+  Marionette.Module.extend = Marionette.extend;
+  
+  // Extend the Module prototype with events / listenTo, so that the module
+  // can be used as an event aggregator or pub/sub.
+  _.extend(Marionette.Module.prototype, Backbone.Events, {
+  
+    // Initialize is an empty function by default. Override it with your own
+    // initialization logic when extending Marionette.Module.
+    initialize: function(){},
+  
+    // Initializer for a specific module. Initializers are run when the
+    // module's `start` method is called.
+    addInitializer: function(callback){
+      this._initializerCallbacks.add(callback);
+    },
+  
+    // Finalizers are run when a module is stopped. They are used to teardown
+    // and finalize any variables, references, events and other code that the
+    // module had set up.
+    addFinalizer: function(callback){
+      this._finalizerCallbacks.add(callback);
+    },
+  
+    // Start the module, and run all of its initializers
+    start: function(options){
+      // Prevent re-starting a module that is already started
+      if (this._isInitialized){ return; }
+  
+      // start the sub-modules (depth-first hierarchy)
+      _.each(this.submodules, function(mod){
+        // check to see if we should start the sub-module with this parent
+        if (mod.startWithParent){
+          mod.start(options);
+        }
+      });
+  
+      // run the callbacks to "start" the current module
+      this.triggerMethod("before:start", options);
+  
+      this._initializerCallbacks.run(options, this);
+      this._isInitialized = true;
+  
+      this.triggerMethod("start", options);
+    },
+  
+    // Stop this module by running its finalizers and then stop all of
+    // the sub-modules for this module
+    stop: function(){
+      // if we are not initialized, don't bother finalizing
+      if (!this._isInitialized){ return; }
+      this._isInitialized = false;
+  
+      Marionette.triggerMethod.call(this, "before:stop");
+  
+      // stop the sub-modules; depth-first, to make sure the
+      // sub-modules are stopped / finalized before parents
+      _.each(this.submodules, function(mod){ mod.stop(); });
+  
+      // run the finalizers
+      this._finalizerCallbacks.run(undefined,this);
+  
+      // reset the initializers and finalizers
+      this._initializerCallbacks.reset();
+      this._finalizerCallbacks.reset();
+  
+      Marionette.triggerMethod.call(this, "stop");
+    },
+  
+    // Configure the module with a definition function and any custom args
+    // that are to be passed in to the definition function
+    addDefinition: function(moduleDefinition, customArgs){
+      this._runModuleDefinition(moduleDefinition, customArgs);
+    },
+  
+    // Internal method: run the module definition function with the correct
+    // arguments
+    _runModuleDefinition: function(definition, customArgs){
+      // If there is no definition short circut the method.
+      if (!definition){ return; }
+  
+      // build the correct list of arguments for the module definition
+      var args = _.flatten([
+        this,
+        this.app,
+        Backbone,
+        Marionette,
+        Marionette.$, _,
+        customArgs
+      ]);
+  
+      definition.apply(this, args);
+    },
+  
+    // Internal method: set up new copies of initializers and finalizers.
+    // Calling this method will wipe out all existing initializers and
+    // finalizers.
+    _setupInitializersAndFinalizers: function(){
+      this._initializerCallbacks = new Marionette.Callbacks();
+      this._finalizerCallbacks = new Marionette.Callbacks();
+    }
+  });
+  
+  // Type methods to create modules
+  _.extend(Marionette.Module, {
+  
+    // Create a module, hanging off the app parameter as the parent object.
+    create: function(app, moduleNames, moduleDefinition){
+      var module = app;
+  
+      // get the custom args passed in after the module definition and
+      // get rid of the module name and definition function
+      var customArgs = slice.call(arguments);
+      customArgs.splice(0, 3);
+  
+      // Split the module names and get the number of submodules.
+      // i.e. an example module name of `Doge.Wow.Amaze` would
+      // then have the potential for 3 module definitions.
+      moduleNames = moduleNames.split(".");
+      var length = moduleNames.length;
+  
+      // store the module definition for the last module in the chain
+      var moduleDefinitions = [];
+      moduleDefinitions[length-1] = moduleDefinition;
+  
+      // Loop through all the parts of the module definition
+      _.each(moduleNames, function(moduleName, i){
+        var parentModule = module;
+        module = this._getModule(parentModule, moduleName, app, moduleDefinition);
+        this._addModuleDefinition(parentModule, module, moduleDefinitions[i], customArgs);
+      }, this);
+  
+      // Return the last module in the definition chain
+      return module;
+    },
+  
+    _getModule: function(parentModule, moduleName, app, def, args){
+      var options = _.extend({}, def);
+      var ModuleClass = this.getClass(def);
+  
+      // Get an existing module of this name if we have one
+      var module = parentModule[moduleName];
+  
+      if (!module){
+        // Create a new module if we don't have one
+        module = new ModuleClass(moduleName, app, options);
+        parentModule[moduleName] = module;
+        // store the module on the parent
+        parentModule.submodules[moduleName] = module;
+      }
+  
+      return module;
+    },
+  
+    // ## Module Classes
+    //
+    // Module classes can be used as an alternative to the define pattern.
+    // The extend function of a Module is identical to the extend functions
+    // on other Backbone and Marionette classes.
+    // This allows module lifecyle events like `onStart` and `onStop` to be called directly.
+    getClass: function(moduleDefinition) {
+      var ModuleClass = Marionette.Module;
+  
+      if (!moduleDefinition) {
+        return ModuleClass;
+      }
+  
+      // If all of the module's functionality is defined inside its class,
+      // then the class can be passed in directly. `MyApp.module("Foo", FooModule)`.
+      if (moduleDefinition.prototype instanceof ModuleClass) {
+        return moduleDefinition;
+      }
+  
+      return moduleDefinition.moduleClass || ModuleClass;
+    },
+  
+    // Add the module definition and add a startWithParent initializer function.
+    // This is complicated because module definitions are heavily overloaded
+    // and support an anonymous function, module class, or options object
+    _addModuleDefinition: function(parentModule, module, def, args){
+      var fn = this._getDefine(def);
+      var startWithParent = this._getStartWithParent(def, module);
+  
+      if (fn){
+        module.addDefinition(fn, args);
+      }
+  
+      this._addStartWithParent(parentModule, module, startWithParent);
+    },
+  
+    _getStartWithParent: function(def, module) {
+      var swp;
+  
+      if (_.isFunction(def) && (def.prototype instanceof Marionette.Module)) {
+        swp = module.constructor.prototype.startWithParent;
+        return _.isUndefined(swp) ? true : swp;
+      }
+  
+      if (_.isObject(def)){
+        swp = def.startWithParent;
+        return _.isUndefined(swp) ? true : swp;
+      }
+  
+      return true;
+    },
+  
+    _getDefine: function(def) {
+      if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)) {
+        return def;
+      }
+  
+      if (_.isObject(def)){
+        return def.define;
+      }
+  
+      return null;
+    },
+  
+    _addStartWithParent: function(parentModule, module, startWithParent) {
+      module.startWithParent = module.startWithParent && startWithParent;
+  
+      if (!module.startWithParent || !!module.startWithParentIsConfigured){
+        return;
+      }
+  
+      module.startWithParentIsConfigured = true;
+  
+      parentModule.addInitializer(function(options){
+        if (module.startWithParent){
+          module.start(options);
+        }
+      });
+    }
+  });
+  
+  
+    return Marionette;
+  })(this, Backbone, _);
+  
+  return Backbone.Marionette;
+
+}));


[51/61] [abbrv] [partial] ambari git commit: AMBARI-15679. Initial commit for LogSearch service definition (oleewre)

Posted by ol...@apache.org.
AMBARI-15679. Initial commit for LogSearch service definition (oleewre)


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

Branch: refs/heads/branch-dev-logsearch
Commit: f72946941c5522aece769499f9d5e09684c314f9
Parents: 03d2cdb
Author: oleewere <ol...@gmail.com>
Authored: Sat Apr 9 11:27:32 2016 +0200
Committer: oleewere <ol...@gmail.com>
Committed: Sat Apr 9 11:27:32 2016 +0200

----------------------------------------------------------------------
 ambari-logsearch/README.md                      |    16 +
 .../ambari-logsearch-appender/.gitignore        |     2 +
 .../ambari-logsearch-appender/build.properties  |    13 +
 .../ambari-logsearch-appender/build.xml         |    40 +
 .../ambari-logsearch-appender/pom.xml           |    84 +
 .../logsearch/appender/LogsearchAppender.java   |    50 +
 .../logsearch/appender/LogsearchConversion.java |    73 +
 .../apache/ambari/logsearch/appender/VBase.java |    63 +
 .../ambari/logsearch/appender/VOutput.java      |    88 +
 .../ambari/logsearch/appender/AppTest.java      |    41 +
 .../src/test/resources/log4j.properties         |    23 +
 .../ambari-logsearch-assembly/pom.xml           |   510 +
 .../src/main/package/deb/appender/control       |    21 +
 .../src/main/package/deb/appender/postinst      |    15 +
 .../src/main/package/deb/appender/postrm        |    15 +
 .../src/main/package/deb/appender/posttrm       |    15 +
 .../src/main/package/deb/appender/preinst       |    15 +
 .../src/main/package/deb/appender/prerm         |    15 +
 .../src/main/package/deb/logfeeder/control      |    21 +
 .../src/main/package/deb/logfeeder/postinst     |    15 +
 .../src/main/package/deb/logfeeder/postrm       |    15 +
 .../src/main/package/deb/logfeeder/posttrm      |    15 +
 .../src/main/package/deb/logfeeder/preinst      |    15 +
 .../src/main/package/deb/logfeeder/prerm        |    15 +
 .../src/main/package/deb/portal/control         |    22 +
 .../src/main/package/deb/portal/postinst        |    15 +
 .../src/main/package/deb/portal/postrm          |    15 +
 .../src/main/package/deb/portal/preinst         |    15 +
 .../src/main/package/deb/portal/prerm           |    15 +
 .../src/main/package/deb/solr/control           |    22 +
 .../src/main/package/deb/solr/postinst          |    15 +
 .../src/main/package/deb/solr/postrm            |    15 +
 .../src/main/package/deb/solr/preinst           |    15 +
 .../src/main/package/deb/solr/prerm             |    15 +
 .../ambari-logsearch-logfeeder/README.md        |    36 +
 .../ambari-logsearch-logfeeder/build.properties |    18 +
 .../ambari-logsearch-logfeeder/build.xml        |    60 +
 .../ambari-logsearch-logfeeder/pom.xml          |   201 +
 .../ambari-logsearch-logfeeder/run.sh           |    19 +
 .../org/apache/ambari/logfeeder/AliasUtil.java  |   110 +
 .../apache/ambari/logfeeder/ConfigBlock.java    |   262 +
 .../org/apache/ambari/logfeeder/InputMgr.java   |   545 +
 .../org/apache/ambari/logfeeder/LogFeeder.java  |   570 +
 .../ambari/logfeeder/LogFeederAMSClient.java    |    74 +
 .../apache/ambari/logfeeder/LogFeederUtil.java  |   480 +
 .../apache/ambari/logfeeder/MetricCount.java    |    33 +
 .../org/apache/ambari/logfeeder/MetricsMgr.java |   185 +
 .../org/apache/ambari/logfeeder/MurmurHash.java |   163 +
 .../org/apache/ambari/logfeeder/OutputMgr.java  |   272 +
 .../apache/ambari/logfeeder/filter/Filter.java  |   223 +
 .../ambari/logfeeder/filter/FilterGrok.java     |   351 +
 .../ambari/logfeeder/filter/FilterKeyValue.java |   132 +
 .../ambari/logfeeder/filter/JSONFilterCode.java |    49 +
 .../apache/ambari/logfeeder/input/Input.java    |   321 +
 .../ambari/logfeeder/input/InputFile.java       |   562 +
 .../ambari/logfeeder/input/InputMarker.java     |    39 +
 .../logfeeder/input/reader/GZIPReader.java      |    81 +
 .../input/reader/LogsearchReaderFactory.java    |    48 +
 .../logconfig/FetchConfigFromSolr.java          |   171 +
 .../logfeeder/logconfig/LogFeederConstants.java |    39 +
 .../logfeeder/logconfig/LogfeederScheduler.java |    58 +
 .../logconfig/filter/ApplyLogFilter.java        |    60 +
 .../logconfig/filter/DefaultDataFilter.java     |    56 +
 .../logconfig/filter/FilterLogData.java         |    53 +
 .../apache/ambari/logfeeder/mapper/Mapper.java  |    52 +
 .../ambari/logfeeder/mapper/MapperDate.java     |    99 +
 .../logfeeder/mapper/MapperFieldName.java       |    72 +
 .../logfeeder/mapper/MapperFieldValue.java      |    76 +
 .../apache/ambari/logfeeder/output/Output.java  |   119 +
 .../ambari/logfeeder/output/OutputData.java     |    48 +
 .../ambari/logfeeder/output/OutputFile.java     |   138 +
 .../ambari/logfeeder/output/OutputKafka.java    |   313 +
 .../ambari/logfeeder/output/OutputSolr.java     |   475 +
 .../apache/ambari/logfeeder/util/SolrUtil.java  |   202 +
 .../ambari/logfeeder/view/VLogfeederFilter.java |    90 +
 .../logfeeder/view/VLogfeederFilterWrapper.java |    55 +
 .../timeline/AbstractTimelineMetricsSink.java   |    95 +
 .../metrics2/sink/timeline/Precision.java       |    79 +
 .../PrecisionLimitExceededException.java        |    36 +
 .../timeline/SingleValuedTimelineMetric.java    |   107 +
 .../metrics2/sink/timeline/TimelineMetric.java  |   188 +
 .../metrics2/sink/timeline/TimelineMetrics.java |   123 +
 .../sink/timeline/UnableToConnectException.java |    46 +
 .../timeline/cache/TimelineMetricsCache.java    |   175 +
 .../timeline/configuration/Configuration.java   |    62 +
 .../hadoop/metrics2/sink/util/Servers.java      |   106 +
 .../src/main/package/deb/control/control        |    22 +
 .../src/main/package/deb/control/postinst       |    15 +
 .../src/main/package/deb/control/postrm         |    15 +
 .../src/main/package/deb/control/preinst        |    15 +
 .../src/main/package/deb/control/prerm          |    15 +
 .../src/main/resources/alias_config.json        |    42 +
 .../src/main/resources/config.json.j2           |   995 +
 .../src/main/resources/filters.config.json      |   626 +
 .../src/main/resources/global.config.json.j2    |    28 +
 .../src/main/resources/grok-patterns            |   145 +
 .../src/main/resources/input.config.json.j2     |   284 +
 .../src/main/resources/log4j.xml                |    62 +
 .../src/main/resources/log4j.xml.j2             |    60 +
 .../src/main/resources/logfeeder.properties     |    25 +
 .../src/main/resources/output.config.json.j2    |    97 +
 .../src/main/scripts/run.sh                     |    87 +
 .../src/main/scripts/run.sh.j2                  |    83 +
 .../org/apache/ambari/logfeeder/AppTest.java    |   116 +
 .../src/test/resources/sample_filter.json       |   166 +
 .../resources/samples/config/config_audit.json  |   173 +
 .../samples/config/config_service.json          |    43 +
 .../resources/samples/jsonlogs/audit_log.json   |     9 +
 .../resources/samples/jsonlogs/service_log.json |     7 +
 .../ambari-logsearch-portal/.gitignore          |     9 +
 .../ambari-logsearch-portal/README.md           |    55 +
 .../ambari-logsearch-portal/build.properties    |    23 +
 .../ambari-logsearch-portal/build.xml           |    68 +
 .../ambari-logsearch-portal/gulpfile.js         |   136 +
 .../ambari-logsearch-portal/package.json        |    21 +
 .../ambari-logsearch-portal/pom.xml             |   547 +
 .../ambari-logsearch-portal/production/build.js |    28 +
 .../ambari-logsearch-portal/production/r.js     | 32140 +++++++++++++++++
 ambari-logsearch/ambari-logsearch-portal/run.sh |    22 +
 .../configsets/audit_logs/conf/admin-extra.html |    24 +
 .../conf/admin-extra.menu-bottom.html           |    25 +
 .../audit_logs/conf/admin-extra.menu-top.html   |    25 +
 .../main/configsets/audit_logs/conf/elevate.xml |    38 +
 .../configsets/audit_logs/conf/enumsConfig.xml  |    28 +
 .../configsets/audit_logs/conf/managed-schema   |   119 +
 .../configsets/audit_logs/conf/solrconfig.xml   |  1887 +
 .../audit_logs/conf/solrconfig.xml.j2           |  1887 +
 .../configsets/audit_logs/core.properties.j2    |    20 +
 .../hadoop_logs/conf/admin-extra.html           |    24 +
 .../conf/admin-extra.menu-bottom.html           |    25 +
 .../hadoop_logs/conf/admin-extra.menu-top.html  |    25 +
 .../configsets/hadoop_logs/conf/elevate.xml     |    38 +
 .../configsets/hadoop_logs/conf/enumsConfig.xml |    28 +
 .../configsets/hadoop_logs/conf/managed-schema  |   125 +
 .../configsets/hadoop_logs/conf/solrconfig.xml  |  1887 +
 .../hadoop_logs/conf/solrconfig.xml.j2          |  1887 +
 .../configsets/history/conf/admin-extra.html    |    24 +
 .../history/conf/admin-extra.menu-bottom.html   |    25 +
 .../history/conf/admin-extra.menu-top.html      |    25 +
 .../main/configsets/history/conf/elevate.xml    |    38 +
 .../src/main/configsets/history/conf/schema.xml |    49 +
 .../main/configsets/history/conf/solrconfig.xml |    48 +
 .../src/main/configsets/solr.xml                |    19 +
 .../src/main/dev/solrcloud/README.md            |    35 +
 .../src/main/dev/solrcloud/reset_collections.sh |    28 +
 .../src/main/dev/solrcloud/restart_solr.sh      |    37 +
 .../src/main/dev/solrcloud/update_config.sh     |    49 +
 .../org/apache/ambari/logsearch/LogSearch.java  |    56 +
 .../logsearch/common/LogSearchConstants.java    |   106 +
 .../logsearch/common/LogsearchContextUtil.java  |    60 +
 .../logsearch/common/ManageStartEndTime.java    |    73 +
 .../ambari/logsearch/common/MessageEnums.java   |    73 +
 .../ambari/logsearch/common/RequestContext.java |   143 +
 .../ambari/logsearch/common/SearchCriteria.java |   336 +
 .../logsearch/common/UserSessionInfo.java       |    46 +
 .../ambari/logsearch/dao/AuditSolrDao.java      |    60 +
 .../logsearch/dao/ServiceLogsSolrDao.java       |    60 +
 .../ambari/logsearch/dao/SolrDaoBase.java       |   541 +
 .../ambari/logsearch/dao/UserConfigSolrDao.java |    60 +
 .../apache/ambari/logsearch/dao/UserDao.java    |   199 +
 .../logsearch/dao/UserInfoAttributes.java       |    28 +
 .../logsearch/graph/GraphDataGeneratorBase.java |   184 +
 .../logsearch/graph/GraphDataGnerator.java      |   397 +
 .../ambari/logsearch/manager/AuditMgr.java      |   810 +
 .../ambari/logsearch/manager/LogFileMgr.java    |   170 +
 .../ambari/logsearch/manager/LogsMgr.java       |  1977 +
 .../ambari/logsearch/manager/MgrBase.java       |   167 +
 .../ambari/logsearch/manager/PublicMgr.java     |    55 +
 .../ambari/logsearch/manager/SessionMgr.java    |    90 +
 .../ambari/logsearch/manager/UserConfigMgr.java |   382 +
 .../ambari/logsearch/query/QueryGeneration.java |   442 +
 .../logsearch/query/QueryGenerationBase.java    |   389 +
 .../apache/ambari/logsearch/rest/AuditREST.java |   168 +
 .../ambari/logsearch/rest/DashboardREST.java    |   309 +
 .../ambari/logsearch/rest/LogFileREST.java      |    63 +
 .../ambari/logsearch/rest/PublicREST.java       |    42 +
 .../ambari/logsearch/rest/UserConfigREST.java   |   116 +
 .../context/LogsearchContextHolder.java         |    41 +
 .../context/LogsearchSecurityContext.java       |    55 +
 .../ambari/logsearch/service/UserService.java   |    43 +
 .../apache/ambari/logsearch/util/BizUtil.java   |   304 +
 .../ambari/logsearch/util/CommonUtil.java       |    66 +
 .../ambari/logsearch/util/ConfigUtil.java       |   177 +
 .../apache/ambari/logsearch/util/DateUtil.java  |   206 +
 .../apache/ambari/logsearch/util/FileUtil.java  |   144 +
 .../apache/ambari/logsearch/util/JSONUtil.java  |   261 +
 .../util/LogsearchPropertiesConfiguration.java  |    89 +
 .../ambari/logsearch/util/PropertiesUtil.java   |   150 +
 .../apache/ambari/logsearch/util/QueryBase.java |   127 +
 .../ambari/logsearch/util/RESTErrorUtil.java    |    66 +
 .../apache/ambari/logsearch/util/SolrUtil.java  |   202 +
 .../ambari/logsearch/util/StringUtil.java       |    37 +
 .../logsearch/util/XMLPropertiesUtil.java       |    86 +
 .../ambari/logsearch/view/VBarDataList.java     |    42 +
 .../ambari/logsearch/view/VBarGraphData.java    |    50 +
 .../apache/ambari/logsearch/view/VCount.java    |    62 +
 .../ambari/logsearch/view/VCountList.java       |    67 +
 .../ambari/logsearch/view/VGraphData.java       |    79 +
 .../ambari/logsearch/view/VGraphInfo.java       |    62 +
 .../ambari/logsearch/view/VGroupList.java       |    65 +
 .../org/apache/ambari/logsearch/view/VHost.java |    44 +
 .../org/apache/ambari/logsearch/view/VList.java |   243 +
 .../apache/ambari/logsearch/view/VLogFile.java  |    56 +
 .../ambari/logsearch/view/VLogFileList.java     |    70 +
 .../ambari/logsearch/view/VLogfeederFilter.java |    91 +
 .../logsearch/view/VLogfeederFilterWrapper.java |    55 +
 .../apache/ambari/logsearch/view/VMessage.java  |   165 +
 .../ambari/logsearch/view/VNameValue.java       |   122 +
 .../ambari/logsearch/view/VNameValueList.java   |    78 +
 .../org/apache/ambari/logsearch/view/VNode.java |   122 +
 .../apache/ambari/logsearch/view/VNodeList.java |    55 +
 .../apache/ambari/logsearch/view/VResponse.java |   164 +
 .../ambari/logsearch/view/VSolrLogList.java     |    65 +
 .../apache/ambari/logsearch/view/VString.java   |    52 +
 .../apache/ambari/logsearch/view/VSummary.java  |   103 +
 .../ambari/logsearch/view/VSummaryCount.java    |    66 +
 .../logsearch/view/VSummaryCountList.java       |    37 +
 .../ambari/logsearch/view/VUserConfig.java      |   105 +
 .../ambari/logsearch/view/VUserConfigList.java  |    66 +
 .../LogsearchAuthFailureHandler.java            |    50 +
 .../LogsearchAuthSuccessHandler.java            |    42 +
 .../LogsearchLogoutSuccessHandler.java          |    42 +
 .../LogsearchAuthenticationEntryPoint.java      |    56 +
 ...LogsearchSecurityContextFormationFilter.java |   119 +
 ...rchUsernamePasswordAuthenticationFilter.java |    46 +
 .../web/listeners/SpringEventListener.java      |    32 +
 .../ambari/logsearch/web/model/Privilege.java   |    42 +
 .../apache/ambari/logsearch/web/model/Role.java |    64 +
 .../apache/ambari/logsearch/web/model/User.java |   167 +
 .../logsearch/web/security/LdapProperties.java  |   365 +
 .../web/security/LdapPropertyName.java          |    58 +
 .../ambari/logsearch/web/security/LdapUtil.java |   115 +
 ...LogsearchAbstractAuthenticationProvider.java |    88 +
 .../LogsearchAuthenticationProvider.java        |   141 +
 .../LogsearchFileAuthenticationProvider.java    |    89 +
 .../LogsearchLdapAuthenticationProvider.java    |   175 +
 .../LogsearchLdapBindAuthenticator.java         |   108 +
 .../LogsearchSimpleAuthenticationProvider.java  |    71 +
 .../src/main/resources/HadoopServiceConfig.json |   407 +
 .../src/main/resources/default.properties       |    44 +
 .../src/main/resources/log4j.xml                |    85 +
 .../src/main/resources/log4j.xml.j2             |    82 +
 .../src/main/resources/logsearch-admin-site.xml |   116 +
 .../src/main/resources/logsearch.properties     |    36 +
 .../src/main/resources/logsearch.properties.j2  |    33 +
 .../src/main/resources/user_pass.json           |     8 +
 .../src/main/scripts/add_config_set.sh          |    43 +
 .../src/main/scripts/create_collections.sh      |    37 +
 .../src/main/scripts/run.sh                     |    86 +
 .../src/main/scripts/run.sh.j2                  |    86 +
 .../src/main/scripts/stop.sh                    |    44 +
 .../src/main/webapp/404.html                    |   170 +
 .../main/webapp/META-INF/applicationContext.xml |    52 +
 .../META-INF/security-applicationContext.xml    |    74 +
 .../src/main/webapp/WEB-INF/web.xml             |    72 +
 .../src/main/webapp/ajax_failure.jsp            |    31 +
 .../src/main/webapp/ajax_success.html           |    26 +
 .../src/main/webapp/favicon.ico                 |   Bin 0 -> 1150 bytes
 .../webapp/fonts/fontawesome/FontAwesome.otf    |   Bin 0 -> 61896 bytes
 .../fonts/fontawesome/fontawesome-webfont.eot   |   Bin 0 -> 37405 bytes
 .../fonts/fontawesome/fontawesome-webfont.svg   |   415 +
 .../fonts/fontawesome/fontawesome-webfont.ttf   |   Bin 0 -> 79076 bytes
 .../fonts/fontawesome/fontawesome-webfont.woff  |   Bin 0 -> 43572 bytes
 .../fonts/fontopensans/open-sans-300.woff       |   Bin 0 -> 22656 bytes
 .../fonts/fontopensans/open-sans-300i.woff      |   Bin 0 -> 21524 bytes
 .../fonts/fontopensans/open-sans-400.woff       |   Bin 0 -> 21956 bytes
 .../fonts/fontopensans/open-sans-400i.woff      |   Bin 0 -> 21092 bytes
 .../fonts/fontopensans/open-sans-600.woff       |   Bin 0 -> 22604 bytes
 .../fonts/fontopensans/open-sans-600i.woff      |   Bin 0 -> 21252 bytes
 .../fonts/fontopensans/open-sans-700.woff       |   Bin 0 -> 22748 bytes
 .../fonts/fontopensans/open-sans-700i.woff      |   Bin 0 -> 21184 bytes
 .../main/webapp/images/System-Settings-icon.png |   Bin 0 -> 17540 bytes
 .../src/main/webapp/images/avatar.png           |   Bin 0 -> 761 bytes
 .../src/main/webapp/images/blank.gif            |   Bin 0 -> 43 bytes
 .../src/main/webapp/images/blockLoading.gif     |   Bin 0 -> 3209 bytes
 .../src/main/webapp/images/body-bg.png          |   Bin 0 -> 3375 bytes
 .../src/main/webapp/images/cancel_search.png    |   Bin 0 -> 541 bytes
 .../src/main/webapp/images/clear.png            |   Bin 0 -> 509 bytes
 .../src/main/webapp/images/comp.png             |   Bin 0 -> 1603 bytes
 .../src/main/webapp/images/data-grey.png        |   Bin 0 -> 1468 bytes
 .../main/webapp/images/database_table_32.png    |   Bin 0 -> 1329 bytes
 .../src/main/webapp/images/error-404-icon.png   |   Bin 0 -> 2529 bytes
 .../src/main/webapp/images/error-500-icon.png   |   Bin 0 -> 2986 bytes
 .../src/main/webapp/images/folder-grey.png      |   Bin 0 -> 1372 bytes
 .../src/main/webapp/images/folder.png           |   Bin 0 -> 920 bytes
 .../src/main/webapp/images/folder2.png          |   Bin 0 -> 946 bytes
 .../src/main/webapp/images/form.png             |   Bin 0 -> 3329 bytes
 .../src/main/webapp/images/hbase.jpg            |   Bin 0 -> 4575 bytes
 .../src/main/webapp/images/hdfs.jpg             |   Bin 0 -> 5232 bytes
 .../src/main/webapp/images/hive.png             |   Bin 0 -> 20483 bytes
 .../src/main/webapp/images/hline.png            |   Bin 0 -> 99 bytes
 .../src/main/webapp/images/icon-collapse.png    |   Bin 0 -> 18815 bytes
 .../src/main/webapp/images/icon-expand.png      |   Bin 0 -> 20092 bytes
 .../src/main/webapp/images/knox.gif             |   Bin 0 -> 2347 bytes
 .../src/main/webapp/images/knox1.png            |   Bin 0 -> 34126 bytes
 .../src/main/webapp/images/loading.gif          |   Bin 0 -> 1849 bytes
 .../src/main/webapp/images/loading_game.gif     |   Bin 0 -> 16098 bytes
 .../src/main/webapp/images/logo.png             |   Bin 0 -> 1168 bytes
 .../src/main/webapp/images/router-grey.png      |   Bin 0 -> 1533 bytes
 .../src/main/webapp/images/search_glyph.png     |   Bin 0 -> 420 bytes
 .../src/main/webapp/images/sortingCollapse.png  |   Bin 0 -> 13320 bytes
 .../src/main/webapp/images/sortingExpand.png    |   Bin 0 -> 13283 bytes
 .../src/main/webapp/images/storm.png            |   Bin 0 -> 6174 bytes
 .../src/main/webapp/images/storm1.png           |   Bin 0 -> 19620 bytes
 .../src/main/webapp/images/task-grey.png        |   Bin 0 -> 1187 bytes
 .../src/main/webapp/images/timezone.png         |   Bin 0 -> 353544 bytes
 .../src/main/webapp/index.html                  |   146 +
 .../libs/bower/backbone-amd/js/backbone-min.js  |     2 +
 .../libs/bower/backbone-amd/js/backbone.js      |  1608 +
 .../libs/bower/backbone-forms/css/bootstrap.css |    43 +
 .../bower/backbone-forms/js/backbone-forms.js   |  2365 ++
 .../backbone-forms/js/backbone-forms.min.js     |     1 +
 .../libs/bower/backbone-forms/js/bootstrap.js   |    66 +
 .../webapp/libs/bower/backbone-forms/js/list.js |   655 +
 .../libs/bower/backbone-forms/js/list.min.js    |     1 +
 .../webapp/libs/bower/backbone-forms/js/old.js  |    91 +
 .../backbone-pageable/js/backbone-pageable.js   |  1327 +
 .../js/backbone-pageable.min.js                 |     8 +
 .../js/backbone.babysitter.js                   |   178 +
 .../js/backbone.babysitter.min.js               |    10 +
 .../js/backbone.bootstrap-modal.js              |   275 +
 .../backbone.localStorage.js                    |   222 +
 .../js/backbone.marionette.js                   |  2473 ++
 .../js/backbone.marionette.min.js               |    20 +
 .../bower/backbone.wreqr/js/backbone.wreqr.js   |   277 +
 .../backbone.wreqr/js/backbone.wreqr.min.js     |    11 +
 .../libs/bower/backbone/js/backbone-min.js      |     4 +
 .../webapp/libs/bower/backbone/js/backbone.js   |  1608 +
 .../Backgrid.ColumnManager.css                  |   115 +
 .../Backgrid.ColumnManager.js                   |  1045 +
 .../Backgrid.ColumnManager.min.js               |     1 +
 .../backgrid-filter/css/backgrid-filter.css     |   193 +
 .../bower/backgrid-filter/js/backgrid-filter.js |   487 +
 .../backgrid-filter/js/backgrid-filter.min.js   |     8 +
 .../css/backgrid-paginator.css                  |    58 +
 .../backgrid-paginator/js/backgrid-paginator.js |   427 +
 .../js/backgrid-paginator.min.js                |     8 +
 .../js/backgrid-select-all.js                   |   274 +
 .../js/backgrid-select-all.min.js               |     8 +
 .../backgrid-orderable-columns.css              |    34 +
 .../backgrid-orderable-columns.js               |   680 +
 .../css/backgrid-sizeable-columns.css           |    35 +
 .../js/backgrid-sizeable-columns.js             |   480 +
 .../webapp/libs/bower/backgrid/css/backgrid.css |   240 +
 .../libs/bower/backgrid/css/backgrid.min.css    |     1 +
 .../webapp/libs/bower/backgrid/js/backgrid.js   |  2883 ++
 .../libs/bower/backgrid/js/backgrid.min.js      |     8 +
 .../webapp/libs/bower/bootbox/js/bootbox.js     |   660 +
 .../webapp/libs/bower/bootbox/js/bootbox.min.js |     6 +
 .../bootstrap-notify/css/bootstrap-notify.css   |    31 +
 .../bootstrap-notify/js/bootstrap-notify.js     |    97 +
 .../libs/bower/bootstrap/bootstrap-theme.css    |   442 +
 .../bower/bootstrap/bootstrap-theme.css.map     |     1 +
 .../bower/bootstrap/bootstrap-theme.min.css     |     5 +
 .../webapp/libs/bower/bootstrap/bootstrap.css   |  6203 ++++
 .../libs/bower/bootstrap/bootstrap.css.map      |     1 +
 .../webapp/libs/bower/bootstrap/bootstrap.js    |  2114 ++
 .../libs/bower/bootstrap/bootstrap.min.css      |     5 +
 .../libs/bower/bootstrap/bootstrap.min.js       |     6 +
 .../webapp/libs/bower/globalize/.bower.json     |    15 +
 .../main/webapp/libs/bower/globalize/.gitignore |     9 +
 .../main/webapp/libs/bower/globalize/.npmignore |     1 +
 .../main/webapp/libs/bower/globalize/LICENSE    |    21 +
 .../main/webapp/libs/bower/globalize/README.md  |   865 +
 .../globalize/examples/browser/browser.css      |    80 +
 .../bower/globalize/examples/browser/browser.js |   115 +
 .../bower/globalize/examples/browser/index.html |   265 +
 .../globalize/examples/browser/jquery-1.4.4.js  |  7179 ++++
 .../globalize/examples/browser/jquery.tmpl.js   |   131 +
 .../bower/globalize/generator/HijriCalendar.js  |    70 +
 .../libs/bower/globalize/generator/Program.cs   |   672 +
 .../generator/Properties/AssemblyInfo.cs        |    36 +
 .../libs/bower/globalize/generator/StringExt.cs |    43 +
 .../globalize/generator/UmAlQuraCalendar.js     |   190 +
 .../bower/globalize/generator/generator.csproj  |    61 +
 .../main/webapp/libs/bower/globalize/grunt.js   |    36 +
 .../webapp/libs/bower/globalize/js/globalize.js |  1586 +
 .../lib/cultures/globalize.culture.af-ZA.js     |    67 +
 .../lib/cultures/globalize.culture.af.js        |    67 +
 .../lib/cultures/globalize.culture.am-ET.js     |    74 +
 .../lib/cultures/globalize.culture.am.js        |    74 +
 .../lib/cultures/globalize.culture.ar-AE.js     |   457 +
 .../lib/cultures/globalize.culture.ar-BH.js     |   462 +
 .../lib/cultures/globalize.culture.ar-DZ.js     |   458 +
 .../lib/cultures/globalize.culture.ar-EG.js     |   484 +
 .../lib/cultures/globalize.culture.ar-IQ.js     |   457 +
 .../lib/cultures/globalize.culture.ar-JO.js     |   462 +
 .../lib/cultures/globalize.culture.ar-KW.js     |   462 +
 .../lib/cultures/globalize.culture.ar-LB.js     |   457 +
 .../lib/cultures/globalize.culture.ar-LY.js     |   462 +
 .../lib/cultures/globalize.culture.ar-MA.js     |   458 +
 .../lib/cultures/globalize.culture.ar-OM.js     |   458 +
 .../lib/cultures/globalize.culture.ar-QA.js     |   457 +
 .../lib/cultures/globalize.culture.ar-SA.js     |   457 +
 .../lib/cultures/globalize.culture.ar-SY.js     |   457 +
 .../lib/cultures/globalize.culture.ar-TN.js     |   463 +
 .../lib/cultures/globalize.culture.ar-YE.js     |   457 +
 .../lib/cultures/globalize.culture.ar.js        |   457 +
 .../lib/cultures/globalize.culture.arn-CL.js    |    78 +
 .../lib/cultures/globalize.culture.arn.js       |    78 +
 .../lib/cultures/globalize.culture.as-IN.js     |    78 +
 .../lib/cultures/globalize.culture.as.js        |    78 +
 .../cultures/globalize.culture.az-Cyrl-AZ.js    |    81 +
 .../lib/cultures/globalize.culture.az-Cyrl.js   |    81 +
 .../cultures/globalize.culture.az-Latn-AZ.js    |    81 +
 .../lib/cultures/globalize.culture.az-Latn.js   |    81 +
 .../lib/cultures/globalize.culture.az.js        |    81 +
 .../lib/cultures/globalize.culture.ba-RU.js     |    81 +
 .../lib/cultures/globalize.culture.ba.js        |    81 +
 .../lib/cultures/globalize.culture.be-BY.js     |    80 +
 .../lib/cultures/globalize.culture.be.js        |    80 +
 .../lib/cultures/globalize.culture.bg-BG.js     |    79 +
 .../lib/cultures/globalize.culture.bg.js        |    79 +
 .../lib/cultures/globalize.culture.bn-BD.js     |    74 +
 .../lib/cultures/globalize.culture.bn-IN.js     |    74 +
 .../lib/cultures/globalize.culture.bn.js        |    74 +
 .../lib/cultures/globalize.culture.bo-CN.js     |    77 +
 .../lib/cultures/globalize.culture.bo.js        |    77 +
 .../lib/cultures/globalize.culture.br-FR.js     |    79 +
 .../lib/cultures/globalize.culture.br.js        |    79 +
 .../cultures/globalize.culture.bs-Cyrl-BA.js    |    78 +
 .../lib/cultures/globalize.culture.bs-Cyrl.js   |    78 +
 .../cultures/globalize.culture.bs-Latn-BA.js    |    76 +
 .../lib/cultures/globalize.culture.bs-Latn.js   |    76 +
 .../lib/cultures/globalize.culture.bs.js        |    76 +
 .../lib/cultures/globalize.culture.ca-ES.js     |    79 +
 .../lib/cultures/globalize.culture.ca.js        |    79 +
 .../lib/cultures/globalize.culture.co-FR.js     |    79 +
 .../lib/cultures/globalize.culture.co.js        |    79 +
 .../lib/cultures/globalize.culture.cs-CZ.js     |    85 +
 .../lib/cultures/globalize.culture.cs.js        |    85 +
 .../lib/cultures/globalize.culture.cy-GB.js     |    70 +
 .../lib/cultures/globalize.culture.cy.js        |    70 +
 .../lib/cultures/globalize.culture.da-DK.js     |    78 +
 .../lib/cultures/globalize.culture.da.js        |    78 +
 .../lib/cultures/globalize.culture.de-AT.js     |    81 +
 .../lib/cultures/globalize.culture.de-CH.js     |    78 +
 .../lib/cultures/globalize.culture.de-DE.js     |    81 +
 .../lib/cultures/globalize.culture.de-LI.js     |    78 +
 .../lib/cultures/globalize.culture.de-LU.js     |    81 +
 .../lib/cultures/globalize.culture.de.js        |    81 +
 .../lib/cultures/globalize.culture.dsb-DE.js    |    84 +
 .../lib/cultures/globalize.culture.dsb.js       |    84 +
 .../lib/cultures/globalize.culture.dv-MV.js     |   164 +
 .../lib/cultures/globalize.culture.dv.js        |   164 +
 .../lib/cultures/globalize.culture.el-GR.js     |    82 +
 .../lib/cultures/globalize.culture.el.js        |    82 +
 .../lib/cultures/globalize.culture.en-029.js    |    47 +
 .../lib/cultures/globalize.culture.en-AU.js     |    52 +
 .../lib/cultures/globalize.culture.en-BZ.js     |    54 +
 .../lib/cultures/globalize.culture.en-CA.js     |    49 +
 .../lib/cultures/globalize.culture.en-GB.js     |    55 +
 .../lib/cultures/globalize.culture.en-IE.js     |    57 +
 .../lib/cultures/globalize.culture.en-IN.js     |    60 +
 .../lib/cultures/globalize.culture.en-JM.js     |    51 +
 .../lib/cultures/globalize.culture.en-MY.js     |    56 +
 .../lib/cultures/globalize.culture.en-NZ.js     |    54 +
 .../lib/cultures/globalize.culture.en-PH.js     |    39 +
 .../lib/cultures/globalize.culture.en-SG.js     |    53 +
 .../lib/cultures/globalize.culture.en-TT.js     |    54 +
 .../lib/cultures/globalize.culture.en-US.js     |    33 +
 .../lib/cultures/globalize.culture.en-ZA.js     |    61 +
 .../lib/cultures/globalize.culture.en-ZW.js     |    39 +
 .../lib/cultures/globalize.culture.es-AR.js     |    77 +
 .../lib/cultures/globalize.culture.es-BO.js     |    78 +
 .../lib/cultures/globalize.culture.es-CL.js     |    78 +
 .../lib/cultures/globalize.culture.es-CO.js     |    77 +
 .../lib/cultures/globalize.culture.es-CR.js     |    77 +
 .../lib/cultures/globalize.culture.es-DO.js     |    69 +
 .../lib/cultures/globalize.culture.es-EC.js     |    77 +
 .../lib/cultures/globalize.culture.es-ES.js     |    79 +
 .../lib/cultures/globalize.culture.es-GT.js     |    69 +
 .../lib/cultures/globalize.culture.es-HN.js     |    71 +
 .../lib/cultures/globalize.culture.es-MX.js     |    69 +
 .../lib/cultures/globalize.culture.es-NI.js     |    71 +
 .../lib/cultures/globalize.culture.es-PA.js     |    70 +
 .../lib/cultures/globalize.culture.es-PE.js     |    70 +
 .../lib/cultures/globalize.culture.es-PR.js     |    70 +
 .../lib/cultures/globalize.culture.es-PY.js     |    79 +
 .../lib/cultures/globalize.culture.es-SV.js     |    69 +
 .../lib/cultures/globalize.culture.es-US.js     |    62 +
 .../lib/cultures/globalize.culture.es-UY.js     |    79 +
 .../lib/cultures/globalize.culture.es-VE.js     |    78 +
 .../lib/cultures/globalize.culture.es.js        |    79 +
 .../lib/cultures/globalize.culture.et-EE.js     |    79 +
 .../lib/cultures/globalize.culture.et.js        |    79 +
 .../lib/cultures/globalize.culture.eu-ES.js     |    78 +
 .../lib/cultures/globalize.culture.eu.js        |    78 +
 .../lib/cultures/globalize.culture.fa-IR.js     |   213 +
 .../lib/cultures/globalize.culture.fa.js        |   213 +
 .../lib/cultures/globalize.culture.fi-FI.js     |    78 +
 .../lib/cultures/globalize.culture.fi.js        |    78 +
 .../lib/cultures/globalize.culture.fil-PH.js    |    54 +
 .../lib/cultures/globalize.culture.fil.js       |    54 +
 .../lib/cultures/globalize.culture.fo-FO.js     |    79 +
 .../lib/cultures/globalize.culture.fo.js        |    79 +
 .../lib/cultures/globalize.culture.fr-BE.js     |    79 +
 .../lib/cultures/globalize.culture.fr-CA.js     |    77 +
 .../lib/cultures/globalize.culture.fr-CH.js     |    77 +
 .../lib/cultures/globalize.culture.fr-FR.js     |    79 +
 .../lib/cultures/globalize.culture.fr-LU.js     |    79 +
 .../lib/cultures/globalize.culture.fr-MC.js     |    79 +
 .../lib/cultures/globalize.culture.fr.js        |    79 +
 .../lib/cultures/globalize.culture.fy-NL.js     |    76 +
 .../lib/cultures/globalize.culture.fy.js        |    76 +
 .../lib/cultures/globalize.culture.ga-IE.js     |    67 +
 .../lib/cultures/globalize.culture.ga.js        |    67 +
 .../lib/cultures/globalize.culture.gd-GB.js     |    69 +
 .../lib/cultures/globalize.culture.gd.js        |    69 +
 .../lib/cultures/globalize.culture.gl-ES.js     |    79 +
 .../lib/cultures/globalize.culture.gl.js        |    79 +
 .../lib/cultures/globalize.culture.gsw-FR.js    |    79 +
 .../lib/cultures/globalize.culture.gsw.js       |    79 +
 .../lib/cultures/globalize.culture.gu-IN.js     |    72 +
 .../lib/cultures/globalize.culture.gu.js        |    72 +
 .../cultures/globalize.culture.ha-Latn-NG.js    |    60 +
 .../lib/cultures/globalize.culture.ha-Latn.js   |    60 +
 .../lib/cultures/globalize.culture.ha.js        |    60 +
 .../lib/cultures/globalize.culture.he-IL.js     |    97 +
 .../lib/cultures/globalize.culture.he.js        |    97 +
 .../lib/cultures/globalize.culture.hi-IN.js     |    72 +
 .../lib/cultures/globalize.culture.hi.js        |    72 +
 .../lib/cultures/globalize.culture.hr-BA.js     |    80 +
 .../lib/cultures/globalize.culture.hr-HR.js     |    81 +
 .../lib/cultures/globalize.culture.hr.js        |    81 +
 .../lib/cultures/globalize.culture.hsb-DE.js    |    84 +
 .../lib/cultures/globalize.culture.hsb.js       |    84 +
 .../lib/cultures/globalize.culture.hu-HU.js     |    80 +
 .../lib/cultures/globalize.culture.hu.js        |    80 +
 .../lib/cultures/globalize.culture.hy-AM.js     |    67 +
 .../lib/cultures/globalize.culture.hy.js        |    67 +
 .../lib/cultures/globalize.culture.id-ID.js     |    75 +
 .../lib/cultures/globalize.culture.id.js        |    75 +
 .../lib/cultures/globalize.culture.ig-NG.js     |    60 +
 .../lib/cultures/globalize.culture.ig.js        |    60 +
 .../lib/cultures/globalize.culture.ii-CN.js     |    76 +
 .../lib/cultures/globalize.culture.ii.js        |    76 +
 .../lib/cultures/globalize.culture.is-IS.js     |    80 +
 .../lib/cultures/globalize.culture.is.js        |    80 +
 .../lib/cultures/globalize.culture.it-CH.js     |    78 +
 .../lib/cultures/globalize.culture.it-IT.js     |    80 +
 .../lib/cultures/globalize.culture.it.js        |    80 +
 .../cultures/globalize.culture.iu-Cans-CA.js    |    65 +
 .../lib/cultures/globalize.culture.iu-Cans.js   |    65 +
 .../cultures/globalize.culture.iu-Latn-CA.js    |    60 +
 .../lib/cultures/globalize.culture.iu-Latn.js   |    60 +
 .../lib/cultures/globalize.culture.iu.js        |    60 +
 .../lib/cultures/globalize.culture.ja-JP.js     |   100 +
 .../lib/cultures/globalize.culture.ja.js        |   100 +
 .../lib/cultures/globalize.culture.ka-GE.js     |    76 +
 .../lib/cultures/globalize.culture.ka.js        |    76 +
 .../lib/cultures/globalize.culture.kk-KZ.js     |    77 +
 .../lib/cultures/globalize.culture.kk.js        |    77 +
 .../lib/cultures/globalize.culture.kl-GL.js     |    81 +
 .../lib/cultures/globalize.culture.kl.js        |    81 +
 .../lib/cultures/globalize.culture.km-KH.js     |    99 +
 .../lib/cultures/globalize.culture.km.js        |    99 +
 .../lib/cultures/globalize.culture.kn-IN.js     |    72 +
 .../lib/cultures/globalize.culture.kn.js        |    72 +
 .../lib/cultures/globalize.culture.ko-KR.js     |    96 +
 .../lib/cultures/globalize.culture.ko.js        |    96 +
 .../lib/cultures/globalize.culture.kok-IN.js    |    72 +
 .../lib/cultures/globalize.culture.kok.js       |    72 +
 .../lib/cultures/globalize.culture.ky-KG.js     |    77 +
 .../lib/cultures/globalize.culture.ky.js        |    77 +
 .../lib/cultures/globalize.culture.lb-LU.js     |    79 +
 .../lib/cultures/globalize.culture.lb.js        |    79 +
 .../lib/cultures/globalize.culture.lo-LA.js     |    72 +
 .../lib/cultures/globalize.culture.lo.js        |    72 +
 .../lib/cultures/globalize.culture.lt-LT.js     |    83 +
 .../lib/cultures/globalize.culture.lt.js        |    83 +
 .../lib/cultures/globalize.culture.lv-LV.js     |    83 +
 .../lib/cultures/globalize.culture.lv.js        |    83 +
 .../lib/cultures/globalize.culture.mi-NZ.js     |    67 +
 .../lib/cultures/globalize.culture.mi.js        |    67 +
 .../lib/cultures/globalize.culture.mk-MK.js     |    76 +
 .../lib/cultures/globalize.culture.mk.js        |    76 +
 .../lib/cultures/globalize.culture.ml-IN.js     |    72 +
 .../lib/cultures/globalize.culture.ml.js        |    72 +
 .../lib/cultures/globalize.culture.mn-Cyrl.js   |    80 +
 .../lib/cultures/globalize.culture.mn-MN.js     |    80 +
 .../cultures/globalize.culture.mn-Mong-CN.js    |    77 +
 .../lib/cultures/globalize.culture.mn-Mong.js   |    77 +
 .../lib/cultures/globalize.culture.mn.js        |    80 +
 .../lib/cultures/globalize.culture.moh-CA.js    |    52 +
 .../lib/cultures/globalize.culture.moh.js       |    52 +
 .../lib/cultures/globalize.culture.mr-IN.js     |    72 +
 .../lib/cultures/globalize.culture.mr.js        |    72 +
 .../lib/cultures/globalize.culture.ms-BN.js     |    74 +
 .../lib/cultures/globalize.culture.ms-MY.js     |    67 +
 .../lib/cultures/globalize.culture.ms.js        |    67 +
 .../lib/cultures/globalize.culture.mt-MT.js     |    68 +
 .../lib/cultures/globalize.culture.mt.js        |    68 +
 .../lib/cultures/globalize.culture.nb-NO.js     |    78 +
 .../lib/cultures/globalize.culture.nb.js        |    78 +
 .../lib/cultures/globalize.culture.ne-NP.js     |    68 +
 .../lib/cultures/globalize.culture.ne.js        |    68 +
 .../lib/cultures/globalize.culture.nl-BE.js     |    79 +
 .../lib/cultures/globalize.culture.nl-NL.js     |    76 +
 .../lib/cultures/globalize.culture.nl.js        |    76 +
 .../lib/cultures/globalize.culture.nn-NO.js     |    78 +
 .../lib/cultures/globalize.culture.nn.js        |    78 +
 .../lib/cultures/globalize.culture.no.js        |    78 +
 .../lib/cultures/globalize.culture.nso-ZA.js    |    67 +
 .../lib/cultures/globalize.culture.nso.js       |    67 +
 .../lib/cultures/globalize.culture.oc-FR.js     |    83 +
 .../lib/cultures/globalize.culture.oc.js        |    83 +
 .../lib/cultures/globalize.culture.or-IN.js     |    70 +
 .../lib/cultures/globalize.culture.or.js        |    70 +
 .../lib/cultures/globalize.culture.pa-IN.js     |    72 +
 .../lib/cultures/globalize.culture.pa.js        |    72 +
 .../lib/cultures/globalize.culture.pl-PL.js     |    84 +
 .../lib/cultures/globalize.culture.pl.js        |    84 +
 .../lib/cultures/globalize.culture.prs-AF.js    |   174 +
 .../lib/cultures/globalize.culture.prs.js       |   174 +
 .../lib/cultures/globalize.culture.ps-AF.js     |   176 +
 .../lib/cultures/globalize.culture.ps.js        |   176 +
 .../lib/cultures/globalize.culture.pt-BR.js     |    79 +
 .../lib/cultures/globalize.culture.pt-PT.js     |    81 +
 .../lib/cultures/globalize.culture.pt.js        |    79 +
 .../lib/cultures/globalize.culture.qut-GT.js    |    69 +
 .../lib/cultures/globalize.culture.qut.js       |    69 +
 .../lib/cultures/globalize.culture.quz-BO.js    |    74 +
 .../lib/cultures/globalize.culture.quz-EC.js    |    73 +
 .../lib/cultures/globalize.culture.quz-PE.js    |    68 +
 .../lib/cultures/globalize.culture.quz.js       |    74 +
 .../lib/cultures/globalize.culture.rm-CH.js     |    77 +
 .../lib/cultures/globalize.culture.rm.js        |    77 +
 .../lib/cultures/globalize.culture.ro-RO.js     |    77 +
 .../lib/cultures/globalize.culture.ro.js        |    77 +
 .../lib/cultures/globalize.culture.ru-RU.js     |    82 +
 .../lib/cultures/globalize.culture.ru.js        |    82 +
 .../lib/cultures/globalize.culture.rw-RW.js     |    65 +
 .../lib/cultures/globalize.culture.rw.js        |    65 +
 .../lib/cultures/globalize.culture.sa-IN.js     |    71 +
 .../lib/cultures/globalize.culture.sa.js        |    71 +
 .../lib/cultures/globalize.culture.sah-RU.js    |    83 +
 .../lib/cultures/globalize.culture.sah.js       |    83 +
 .../lib/cultures/globalize.culture.se-FI.js     |    80 +
 .../lib/cultures/globalize.culture.se-NO.js     |    81 +
 .../lib/cultures/globalize.culture.se-SE.js     |    80 +
 .../lib/cultures/globalize.culture.se.js        |    81 +
 .../lib/cultures/globalize.culture.si-LK.js     |    72 +
 .../lib/cultures/globalize.culture.si.js        |    72 +
 .../lib/cultures/globalize.culture.sk-SK.js     |    85 +
 .../lib/cultures/globalize.culture.sk.js        |    85 +
 .../lib/cultures/globalize.culture.sl-SI.js     |    79 +
 .../lib/cultures/globalize.culture.sl.js        |    79 +
 .../lib/cultures/globalize.culture.sma-NO.js    |    81 +
 .../lib/cultures/globalize.culture.sma-SE.js    |    80 +
 .../lib/cultures/globalize.culture.sma.js       |    80 +
 .../lib/cultures/globalize.culture.smj-NO.js    |    81 +
 .../lib/cultures/globalize.culture.smj-SE.js    |    80 +
 .../lib/cultures/globalize.culture.smj.js       |    80 +
 .../lib/cultures/globalize.culture.smn-FI.js    |    76 +
 .../lib/cultures/globalize.culture.smn.js       |    76 +
 .../lib/cultures/globalize.culture.sms-FI.js    |    80 +
 .../lib/cultures/globalize.culture.sms.js       |    80 +
 .../lib/cultures/globalize.culture.sq-AL.js     |    77 +
 .../lib/cultures/globalize.culture.sq.js        |    77 +
 .../cultures/globalize.culture.sr-Cyrl-BA.js    |    78 +
 .../cultures/globalize.culture.sr-Cyrl-CS.js    |    80 +
 .../cultures/globalize.culture.sr-Cyrl-ME.js    |    80 +
 .../cultures/globalize.culture.sr-Cyrl-RS.js    |    80 +
 .../lib/cultures/globalize.culture.sr-Cyrl.js   |    80 +
 .../cultures/globalize.culture.sr-Latn-BA.js    |    79 +
 .../cultures/globalize.culture.sr-Latn-CS.js    |    80 +
 .../cultures/globalize.culture.sr-Latn-ME.js    |    80 +
 .../cultures/globalize.culture.sr-Latn-RS.js    |    80 +
 .../lib/cultures/globalize.culture.sr-Latn.js   |    80 +
 .../lib/cultures/globalize.culture.sr.js        |    80 +
 .../lib/cultures/globalize.culture.sv-FI.js     |    78 +
 .../lib/cultures/globalize.culture.sv-SE.js     |    78 +
 .../lib/cultures/globalize.culture.sv.js        |    78 +
 .../lib/cultures/globalize.culture.sw-KE.js     |    53 +
 .../lib/cultures/globalize.culture.sw.js        |    53 +
 .../lib/cultures/globalize.culture.syr-SY.js    |    67 +
 .../lib/cultures/globalize.culture.syr.js       |    67 +
 .../lib/cultures/globalize.culture.ta-IN.js     |    73 +
 .../lib/cultures/globalize.culture.ta.js        |    73 +
 .../lib/cultures/globalize.culture.te-IN.js     |    72 +
 .../lib/cultures/globalize.culture.te.js        |    72 +
 .../cultures/globalize.culture.tg-Cyrl-TJ.js    |    84 +
 .../lib/cultures/globalize.culture.tg-Cyrl.js   |    84 +
 .../lib/cultures/globalize.culture.tg.js        |    84 +
 .../lib/cultures/globalize.culture.th-TH.js     |    90 +
 .../lib/cultures/globalize.culture.th.js        |    90 +
 .../lib/cultures/globalize.culture.tk-TM.js     |    78 +
 .../lib/cultures/globalize.culture.tk.js        |    78 +
 .../lib/cultures/globalize.culture.tn-ZA.js     |    67 +
 .../lib/cultures/globalize.culture.tn.js        |    67 +
 .../lib/cultures/globalize.culture.tr-TR.js     |    77 +
 .../lib/cultures/globalize.culture.tr.js        |    77 +
 .../lib/cultures/globalize.culture.tt-RU.js     |    81 +
 .../lib/cultures/globalize.culture.tt.js        |    81 +
 .../cultures/globalize.culture.tzm-Latn-DZ.js   |    77 +
 .../lib/cultures/globalize.culture.tzm-Latn.js  |    77 +
 .../lib/cultures/globalize.culture.tzm.js       |    77 +
 .../lib/cultures/globalize.culture.ug-CN.js     |    75 +
 .../lib/cultures/globalize.culture.ug.js        |    75 +
 .../lib/cultures/globalize.culture.uk-UA.js     |    83 +
 .../lib/cultures/globalize.culture.uk.js        |    83 +
 .../lib/cultures/globalize.culture.ur-PK.js     |   157 +
 .../lib/cultures/globalize.culture.ur.js        |   157 +
 .../cultures/globalize.culture.uz-Cyrl-UZ.js    |    81 +
 .../lib/cultures/globalize.culture.uz-Cyrl.js   |    81 +
 .../cultures/globalize.culture.uz-Latn-UZ.js    |    77 +
 .../lib/cultures/globalize.culture.uz-Latn.js   |    77 +
 .../lib/cultures/globalize.culture.uz.js        |    77 +
 .../lib/cultures/globalize.culture.vi-VN.js     |    73 +
 .../lib/cultures/globalize.culture.vi.js        |    73 +
 .../lib/cultures/globalize.culture.wo-SN.js     |    79 +
 .../lib/cultures/globalize.culture.wo.js        |    79 +
 .../lib/cultures/globalize.culture.xh-ZA.js     |    65 +
 .../lib/cultures/globalize.culture.xh.js        |    65 +
 .../lib/cultures/globalize.culture.yo-NG.js     |    60 +
 .../lib/cultures/globalize.culture.yo.js        |    60 +
 .../lib/cultures/globalize.culture.zh-CHS.js    |    73 +
 .../lib/cultures/globalize.culture.zh-CHT.js    |    72 +
 .../lib/cultures/globalize.culture.zh-CN.js     |    73 +
 .../lib/cultures/globalize.culture.zh-HK.js     |    72 +
 .../lib/cultures/globalize.culture.zh-Hans.js   |    73 +
 .../lib/cultures/globalize.culture.zh-Hant.js   |    72 +
 .../lib/cultures/globalize.culture.zh-MO.js     |    72 +
 .../lib/cultures/globalize.culture.zh-SG.js     |    63 +
 .../lib/cultures/globalize.culture.zh-TW.js     |    99 +
 .../lib/cultures/globalize.culture.zh.js        |    73 +
 .../lib/cultures/globalize.culture.zu-ZA.js     |    66 +
 .../lib/cultures/globalize.culture.zu.js        |    66 +
 .../lib/cultures/globalize.cultures.js          | 24063 ++++++++++++
 .../libs/bower/globalize/lib/globalize.js       |  1586 +
 .../webapp/libs/bower/globalize/package.json    |    56 +
 .../webapp/libs/bower/globalize/test/culture.js |    18 +
 .../libs/bower/globalize/test/cultures.js       |    15 +
 .../bower/globalize/test/findClosestCulture.js  |    62 +
 .../webapp/libs/bower/globalize/test/format.js  |    74 +
 .../webapp/libs/bower/globalize/test/index.html |    26 +
 .../libs/bower/globalize/test/instance.js       |    13 +
 .../webapp/libs/bower/globalize/test/parse.js   |    57 +
 .../libs/bower/globalize/test/qunit/qunit.css   |   226 +
 .../libs/bower/globalize/test/qunit/qunit.js    |  1506 +
 .../libs/bower/globalize/test/testsuite.js      |    19 +
 .../libs/bower/jquery-toggles/css/toggles.css   |    22 +
 .../libs/bower/jquery-toggles/js/toggles.min.js |    11 +
 .../libs/bower/jquery-ui/1.11.4/jquery-ui.css   |   403 +
 .../libs/bower/jquery-ui/1.11.4/jquery-ui.js    |  1356 +
 .../bower/jquery-ui/1.11.4/jquery-ui.min.css    |     7 +
 .../bower/jquery-ui/1.11.4/jquery-ui.min.js     |     6 +
 .../bower/jquery-ui/i18n/jquery-ui-i18n.min.js  |     6 +
 .../i18n/jquery.ui.datepicker-af.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ar-DZ.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-ar.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-az.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-be.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-bg.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-bs.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ca.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-cs.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-cy-GB.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-da.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-de.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-el.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-en-AU.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-en-GB.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-en-NZ.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-eo.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-es.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-et.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-eu.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-fa.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-fi.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-fo.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-fr-CA.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-fr-CH.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-fr.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-gl.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-he.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-hi.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-hr.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-hu.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-hy.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-id.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-is.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-it.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ja.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ka.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-kk.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-km.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ko.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ky.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-lb.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-lt.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-lv.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-mk.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ml.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ms.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-nb.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-nl-BE.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-nl.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-nn.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-no.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-pl.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-pt-BR.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-pt.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-rm.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ro.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ru.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-sk.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-sl.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-sq.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-sr-SR.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-sr.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-sv.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-ta.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-th.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-tj.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-tr.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-uk.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-vi.min.js         |     4 +
 .../i18n/jquery.ui.datepicker-zh-CN.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-zh-HK.min.js      |     4 +
 .../i18n/jquery.ui.datepicker-zh-TW.min.js      |     4 +
 .../ui-bg_diagonals-thick_18_b81900_40x40.png   |   Bin 0 -> 457 bytes
 .../ui-bg_diagonals-thick_20_666666_40x40.png   |   Bin 0 -> 351 bytes
 .../images/ui-bg_flat_10_000000_40x100.png      |   Bin 0 -> 244 bytes
 .../images/ui-bg_glass_100_f6f6f6_1x400.png     |   Bin 0 -> 301 bytes
 .../images/ui-bg_glass_100_fdf5ce_1x400.png     |   Bin 0 -> 387 bytes
 .../images/ui-bg_glass_65_ffffff_1x400.png      |   Bin 0 -> 246 bytes
 .../ui-bg_gloss-wave_35_f6a828_500x100.png      |   Bin 0 -> 5854 bytes
 .../ui-bg_highlight-soft_100_eeeeee_1x100.png   |   Bin 0 -> 317 bytes
 .../ui-bg_highlight-soft_75_ffe45c_1x100.png    |   Bin 0 -> 367 bytes
 .../images/ui-icons_222222_256x240.png          |   Bin 0 -> 7006 bytes
 .../images/ui-icons_228ef1_256x240.png          |   Bin 0 -> 4599 bytes
 .../images/ui-icons_ef8c08_256x240.png          |   Bin 0 -> 4599 bytes
 .../images/ui-icons_ffd27a_256x240.png          |   Bin 0 -> 4599 bytes
 .../images/ui-icons_ffffff_256x240.png          |   Bin 0 -> 6468 bytes
 .../webapp/libs/bower/jquery-ui/jquery-ui.css   |  1225 +
 .../webapp/libs/bower/jquery-ui/jquery-ui.js    | 16375 +++++++++
 .../libs/bower/jquery-ui/jquery-ui.min.css      |     7 +
 .../libs/bower/jquery-ui/jquery-ui.min.js       |    13 +
 .../libs/bower/jquery/js/jquery-1.10.2.js       |  9789 +++++
 .../libs/bower/jquery/js/jquery-migrate.js      |   511 +
 .../libs/bower/jquery/js/jquery-migrate.min.js  |     3 +
 .../main/webapp/libs/bower/jquery/js/jquery.js  |  9789 +++++
 .../webapp/libs/bower/jquery/js/jquery.min.js   |     6 +
 .../webapp/libs/bower/jquery/js/jquery.min.map  |     1 +
 .../moment/js/moment-timezone-with-data.min.js  |     7 +
 .../bower/moment/js/moment-with-langs.min.js    |     9 +
 .../bower/moment/js/moment-with-locales.min.js  |    81 +
 .../webapp/libs/bower/moment/js/moment.min.js   |     7 +
 .../require-handlebars-plugin/js/Handlebars.js  |  2752 ++
 .../bower/require-handlebars-plugin/js/hbs.js   |   458 +
 .../js/i18nprecompile.js                        |    45 +
 .../bower/require-handlebars-plugin/js/json2.js |   365 +
 .../webapp/libs/bower/requirejs/js/require.js   |  2053 ++
 .../libs/bower/select2/select2-spinner.gif      |   Bin 0 -> 1849 bytes
 .../main/webapp/libs/bower/select2/select2.css  |   615 +
 .../main/webapp/libs/bower/select2/select2.js   |  3508 ++
 .../main/webapp/libs/bower/select2/select2.png  |   Bin 0 -> 613 bytes
 .../webapp/libs/bower/select2/select2x2.png     |   Bin 0 -> 845 bytes
 .../libs/bower/tag-it/css/jquery.tagit.css      |    69 +
 .../main/webapp/libs/bower/tag-it/js/tag-it.js  |   591 +
 .../webapp/libs/bower/tag-it/js/tag-it.min.js   |    17 +
 .../bower/underscore-amd/js/underscore-min.js   |     6 +
 .../libs/bower/underscore-amd/js/underscore.js  |  1284 +
 .../libs/bower/underscore/js/underscore-min.js  |     6 +
 .../libs/bower/underscore/js/underscore.js      |  1276 +
 .../bower/x-editable/css/bootstrap-editable.css |   655 +
 .../webapp/libs/bower/x-editable/img/clear.png  |   Bin 0 -> 509 bytes
 .../bower/x-editable/js/bootstrap-editable.js   |  6901 ++++
 .../x-editable/js/bootstrap-editable.min.js     |     7 +
 .../webapp/libs/fsOverrides/BBFOverrides.js     |   367 +
 .../webapp/libs/other/backbone.fetch-cache.js   |   326 +
 .../webapp/libs/other/backgrid/backgrid.css     |   240 +
 .../main/webapp/libs/other/backgrid/backgrid.js |  2884 ++
 .../src/main/webapp/libs/other/d3/d3.js         |  9504 +++++
 .../src/main/webapp/libs/other/d3/d3.min.js     |     5 +
 .../src/main/webapp/libs/other/d3/d3.tip.js     |   293 +
 .../webapp/libs/other/dashboard/dashboard.js    |   383 +
 .../libs/other/datepicker/css/datepicker.css    |   224 +
 .../other/datepicker/js/bootstrap-datepicker.js |   834 +
 .../libs/other/datepicker/less/datepicker.less  |   122 +
 .../daterangepicker/css/daterangepicker.css     |   336 +
 .../other/daterangepicker/js/daterangepicker.js |  1370 +
 .../other/font-awesome/css/font-awesome.css     |  1801 +
 .../other/font-awesome/css/font-awesome.min.css |     4 +
 .../other/font-awesome/fonts/FontAwesome.otf    |   Bin 0 -> 93888 bytes
 .../font-awesome/fonts/fontawesome-webfont.eot  |   Bin 0 -> 60767 bytes
 .../font-awesome/fonts/fontawesome-webfont.svg  |   565 +
 .../font-awesome/fonts/fontawesome-webfont.ttf  |   Bin 0 -> 122092 bytes
 .../font-awesome/fonts/fontawesome-webfont.woff |   Bin 0 -> 71508 bytes
 .../fonts/fontawesome-webfont.woff2             |   Bin 0 -> 56780 bytes
 .../libs/other/font-awesome/less/animated.less  |    34 +
 .../font-awesome/less/bordered-pulled.less      |    16 +
 .../libs/other/font-awesome/less/core.less      |    13 +
 .../other/font-awesome/less/fixed-width.less    |     6 +
 .../other/font-awesome/less/font-awesome.less   |    17 +
 .../libs/other/font-awesome/less/icons.less     |   596 +
 .../libs/other/font-awesome/less/larger.less    |    13 +
 .../libs/other/font-awesome/less/list.less      |    19 +
 .../libs/other/font-awesome/less/mixins.less    |    27 +
 .../libs/other/font-awesome/less/path.less      |    15 +
 .../font-awesome/less/rotated-flipped.less      |    20 +
 .../libs/other/font-awesome/less/stacked.less   |    20 +
 .../libs/other/font-awesome/less/variables.less |   606 +
 .../libs/other/font-awesome/scss/_animated.scss |    34 +
 .../font-awesome/scss/_bordered-pulled.scss     |    16 +
 .../libs/other/font-awesome/scss/_core.scss     |    13 +
 .../other/font-awesome/scss/_fixed-width.scss   |     6 +
 .../libs/other/font-awesome/scss/_icons.scss    |   596 +
 .../libs/other/font-awesome/scss/_larger.scss   |    13 +
 .../libs/other/font-awesome/scss/_list.scss     |    19 +
 .../libs/other/font-awesome/scss/_mixins.scss   |    27 +
 .../libs/other/font-awesome/scss/_path.scss     |    15 +
 .../font-awesome/scss/_rotated-flipped.scss     |    20 +
 .../libs/other/font-awesome/scss/_stacked.scss  |    20 +
 .../other/font-awesome/scss/_variables.scss     |   606 +
 .../other/font-awesome/scss/font-awesome.scss   |    17 +
 .../libs/other/gridster/css/jquery.gridster.css |   121 +
 .../libs/other/gridster/js/jquery.gridster.js   |  3987 ++
 .../libs/other/intro/css/introjs-rtl.min.css    |     1 +
 .../webapp/libs/other/intro/css/introjs.min.css |     1 +
 .../webapp/libs/other/intro/js/intro.min.js     |    34 +
 .../libs/other/jquery-cookie/js/bower.json      |    18 +
 .../other/jquery-cookie/js/cookie.jquery.json   |    32 +
 .../other/jquery-cookie/js/jquery.cookie.js     |   117 +
 .../libs/other/jquery-cookie/js/package.json    |    31 +
 .../jquery-ui/css/images/animated-overlay.gif   |   Bin 0 -> 1738 bytes
 .../ui-bg_diagonals-thick_18_b81900_40x40.png   |   Bin 0 -> 418 bytes
 .../ui-bg_diagonals-thick_20_666666_40x40.png   |   Bin 0 -> 312 bytes
 .../css/images/ui-bg_flat_0_aaaaaa_40x100.png   |   Bin 0 -> 180 bytes
 .../css/images/ui-bg_flat_10_000000_40x100.png  |   Bin 0 -> 205 bytes
 .../css/images/ui-bg_glass_100_f6f6f6_1x400.png |   Bin 0 -> 262 bytes
 .../css/images/ui-bg_glass_100_fdf5ce_1x400.png |   Bin 0 -> 348 bytes
 .../css/images/ui-bg_glass_65_ffffff_1x400.png  |   Bin 0 -> 207 bytes
 .../ui-bg_gloss-wave_35_f6a828_500x100.png      |   Bin 0 -> 5815 bytes
 .../ui-bg_highlight-soft_100_eeeeee_1x100.png   |   Bin 0 -> 278 bytes
 .../ui-bg_highlight-soft_75_ffe45c_1x100.png    |   Bin 0 -> 328 bytes
 .../css/images/ui-icons_222222_256x240.png      |   Bin 0 -> 6922 bytes
 .../css/images/ui-icons_228ef1_256x240.png      |   Bin 0 -> 4549 bytes
 .../css/images/ui-icons_454545_256x240.png      |   Bin 0 -> 4369 bytes
 .../css/images/ui-icons_888888_256x240.png      |   Bin 0 -> 4369 bytes
 .../css/images/ui-icons_ef8c08_256x240.png      |   Bin 0 -> 4549 bytes
 .../css/images/ui-icons_ffd27a_256x240.png      |   Bin 0 -> 4549 bytes
 .../css/images/ui-icons_ffffff_256x240.png      |   Bin 0 -> 6299 bytes
 .../other/jquery-ui/css/jquery-ui-1.11.4.css    |   850 +
 .../jquery-ui/css/jquery-ui-1.11.4.min.css      |     7 +
 .../other/jquery-ui/css/jquery-ui-bootstrap.css |  2549 ++
 .../libs/other/jquery-ui/js/jquery-ui-1.11.4.js |  8772 +++++
 .../other/jquery-ui/js/jquery-ui-1.11.4.min.js  |    10 +
 .../src/main/webapp/libs/other/loadCSS.js       |    73 +
 .../main/webapp/libs/other/noty/css/animate.css |  3158 ++
 .../libs/other/noty/jquery.noty.packaged.js     |  1436 +
 .../libs/other/noty/jquery.noty.packaged.min.js |     1 +
 .../webapp/libs/other/nvd3/css/nv.d3.min.css    |     1 +
 .../src/main/webapp/libs/other/nvd3/js/nv.d3.js | 13304 +++++++
 .../main/webapp/libs/other/nvd3/js/nv.d3.min.js |     8 +
 .../libs/other/sparkline/jquery.sparkline.js    |  3054 ++
 .../webapp/libs/other/timeline/css/timeline.css |  3100 ++
 .../webapp/libs/other/timeline/css/timeline.png |   Bin 0 -> 15922 bytes
 .../libs/other/timeline/js/storyjs-embed.js     |   529 +
 .../webapp/libs/other/timeline/js/timeline.js   | 10116 ++++++
 .../libs/other/timezone/WorldMapGenerator.js    |  3471 ++
 .../libs/other/timezone/jstz-1.0.4.min.js       |     2 +
 .../webapp/libs/other/timezone/mapdata.json     |  3158 ++
 .../webapp/libs/other/visualsearch/.bower.json  |    45 +
 .../other/visualsearch/models/search_facets.js  |    67 +
 .../other/visualsearch/models/search_query.js   |    70 +
 .../other/visualsearch/templates/search_box.jst |     8 +
 .../visualsearch/templates/search_facet.jst     |     9 +
 .../visualsearch/templates/search_input.jst     |     1 +
 .../other/visualsearch/templates/templates.js   |     7 +
 .../visualsearch/utils/backbone_extensions.js   |    17 +
 .../libs/other/visualsearch/utils/hotkeys.js    |    99 +
 .../libs/other/visualsearch/utils/inflector.js  |    21 +
 .../visualsearch/utils/jquery_extensions.js     |   197 +
 .../other/visualsearch/utils/search_parser.js   |    87 +
 .../libs/other/visualsearch/views/search_box.js |   458 +
 .../other/visualsearch/views/search_facet.js    |   442 +
 .../other/visualsearch/views/search_input.js    |   418 +
 .../libs/other/visualsearch/visualsearch.js     |  1970 +
 .../src/main/webapp/login.jsp                   |   148 +
 .../src/main/webapp/robots.txt                  |     3 +
 .../src/main/webapp/scripts/App.js              |    89 +
 .../src/main/webapp/scripts/Init.js             |   243 +
 .../src/main/webapp/scripts/Main.js             |    42 +
 .../src/main/webapp/scripts/RegionManager.js    |    83 +
 .../collection_bases/VAuditLogListBase.js       |    75 +
 .../collection_bases/VEventHistoryListBase.js   |    87 +
 .../scripts/collection_bases/VGroupListBase.js  |    84 +
 .../collection_bases/VLogLevelListBase.js       |    96 +
 .../scripts/collection_bases/VLogListBase.js    |   128 +
 .../collection_bases/VNameValueListBase.js      |    59 +
 .../scripts/collection_bases/VNodeListBase.js   |    74 +
 .../scripts/collections/BaseCollection.js       |   163 +
 .../webapp/scripts/collections/VAuditLogList.js |    36 +
 .../scripts/collections/VEventHistoryList.js    |    33 +
 .../webapp/scripts/collections/VGroupList.js    |    36 +
 .../webapp/scripts/collections/VLogLevelList.js |    36 +
 .../main/webapp/scripts/collections/VLogList.js |    36 +
 .../scripts/collections/VNameValueList.js       |    36 +
 .../webapp/scripts/collections/VNodeList.js     |    36 +
 .../src/main/webapp/scripts/communicator.js     |    61 +
 .../webapp/scripts/controllers/Controller.js    |   240 +
 .../src/main/webapp/scripts/mgrs/SessionMgr.js  |   137 +
 .../webapp/scripts/model_bases/VAuditLogBase.js |    61 +
 .../scripts/model_bases/VCommonModelBase.js     |    51 +
 .../scripts/model_bases/VEventHistoryBase.js    |    51 +
 .../scripts/model_bases/VGraphInfoBase.js       |    62 +
 .../webapp/scripts/model_bases/VGroupBase.js    |    51 +
 .../main/webapp/scripts/model_bases/VLogBase.js |    51 +
 .../webapp/scripts/model_bases/VLogLevelBase.js |    51 +
 .../scripts/model_bases/VNameValueBase.js       |    51 +
 .../webapp/scripts/model_bases/VNodeBase.js     |    51 +
 .../scripts/model_bases/VUserFilterBase.js      |    51 +
 .../src/main/webapp/scripts/models/BaseModel.js |   110 +
 .../src/main/webapp/scripts/models/VAppState.js |    44 +
 .../src/main/webapp/scripts/models/VAuditLog.js |    47 +
 .../main/webapp/scripts/models/VCommonModel.js  |    48 +
 .../main/webapp/scripts/models/VEventHistory.js |    48 +
 .../main/webapp/scripts/models/VGraphInfo.js    |    53 +
 .../src/main/webapp/scripts/models/VGroup.js    |    53 +
 .../src/main/webapp/scripts/models/VLog.js      |    66 +
 .../src/main/webapp/scripts/models/VLogLevel.js |    47 +
 .../main/webapp/scripts/models/VNameValue.js    |    47 +
 .../src/main/webapp/scripts/models/VNode.js     |    48 +
 .../main/webapp/scripts/models/VUserFilter.js   |    51 +
 .../main/webapp/scripts/modules/Overrides.js    |   234 +
 .../src/main/webapp/scripts/modules/Vent.js     |    26 +
 .../scripts/modules/globalize/message/en.js     |    79 +
 .../main/webapp/scripts/prelogin/Prelogin.js    |   130 +
 .../src/main/webapp/scripts/utils/Enums.js      |    32 +
 .../src/main/webapp/scripts/utils/Globals.js    |    84 +
 .../src/main/webapp/scripts/utils/Intro.js      |   291 +
 .../main/webapp/scripts/utils/LangSupport.js    |   151 +
 .../src/main/webapp/scripts/utils/Utils.js      |  1150 +
 .../src/main/webapp/scripts/utils/ViewUtils.js  |   225 +
 .../webapp/scripts/utils/XATemplateHelpers.js   |   170 +
 .../scripts/views/audit/AuditAggregatedView.js  |   412 +
 .../scripts/views/audit/AuditTabLayoutView.js   |   466 +
 .../scripts/views/common/AdvanceSearchLayout.js |   146 +
 .../webapp/scripts/views/common/BreadCrumbs.js  |    83 +
 .../scripts/views/common/CustomBackgrid.js      |   285 +
 .../scripts/views/common/DashboardLayout.js     |    80 +
 .../scripts/views/common/DatePickerLayout.js    |   223 +
 .../webapp/scripts/views/common/ErrorView.js    |   100 +
 .../main/webapp/scripts/views/common/Footer.js  |    80 +
 .../main/webapp/scripts/views/common/Header.js  |   417 +
 .../webapp/scripts/views/common/JBDialog.js     |   211 +
 .../scripts/views/common/LogSnapShotLayout.js   |   140 +
 .../webapp/scripts/views/common/ProfileBar.js   |   106 +
 .../main/webapp/scripts/views/common/Spinner.js |    85 +
 .../webapp/scripts/views/common/TableLayout.js  |   405 +
 .../webapp/scripts/views/common/TimerView.js    |   124 +
 .../main/webapp/scripts/views/common/TopNav.js  |    93 +
 .../dashboard/BubbleGraphTableLayoutView.js     |   800 +
 .../views/dashboard/ComponentListView.js        |   319 +
 .../scripts/views/dashboard/ComponentsView.js   |    98 +
 .../views/dashboard/DashboardLayoutView.js      |   354 +
 .../scripts/views/dashboard/DashboardView.js    |   188 +
 .../views/dashboard/GridTableLayoutView.js      |   219 +
 .../scripts/views/dashboard/HostListView.js     |   364 +
 .../webapp/scripts/views/dashboard/HostsView.js |    98 +
 .../scripts/views/dashboard/LogDetailView.js    |   249 +
 .../scripts/views/dashboard/LogLevelBoxView.js  |   154 +
 .../scripts/views/dashboard/LogLevelView.js     |   117 +
 .../scripts/views/dashboard/MainLayoutView.js   |   631 +
 .../views/dialog/ApplySearchFilterView.js       |   219 +
 .../scripts/views/dialog/DetailLogFileView.js   |   167 +
 .../dialog/GlobalExclusionCompositeView.js      |   141 +
 .../views/dialog/GlobalExclusionItemView.js     |    84 +
 .../views/dialog/GridGraphSettingView.js        |   476 +
 .../views/dialog/SaveSearchFilterView.js        |   119 +
 .../scripts/views/dialog/TimeZoneChangeView.js  |    98 +
 .../views/filter/CreateLogfeederFilterView.js   |   275 +
 .../scripts/views/graphs/GraphLayoutView.js     |   531 +
 .../scripts/views/graphs/GridGraphLayoutView.js |   593 +
 .../scripts/views/tabs/ComparisonLayoutView.js  |    93 +
 .../webapp/scripts/views/tabs/ComparisonView.js |   251 +
 .../views/tabs/EventHistoryLayoutView.js        |   501 +
 .../scripts/views/tabs/ExportLogFileView.js     |    50 +
 .../views/tabs/HierarchyTabLayoutView.js        |   487 +
 .../scripts/views/tabs/HostInfoTabLayoutView.js |   178 +
 .../webapp/scripts/views/tabs/LogFileView.js    |   872 +
 .../main/webapp/scripts/views/tabs/TreeView.js  |   368 +
 .../scripts/views/tabs/VisualSearchView.js      |   255 +
 .../troubleshoot/TroubleShootLayoutView.js      |   488 +
 .../src/main/webapp/styles/animate.css          |  3272 ++
 .../src/main/webapp/styles/app-font.css         |    64 +
 .../src/main/webapp/styles/bootstrap.css        |  6422 ++++
 .../src/main/webapp/styles/bootstrap.min.css    |  6422 ++++
 .../src/main/webapp/styles/style.css            |  2017 ++
 .../src/main/webapp/styles/style_v2.css         |  2306 ++
 .../src/main/webapp/styles/visualsearch.css     |   341 +
 .../audit/AuditAggregatedView_tmpl.html         |    54 +
 .../audit/AuditTabLayoutView_tmpl.html          |   103 +
 .../common/AdvanceSearchLayout_tmpl.html        |    30 +
 .../templates/common/DatePickerLayout_tmpl.html |    29 +
 .../webapp/templates/common/ErrorView_tmpl.html |    28 +
 .../webapp/templates/common/Footer_tmpl.html    |    42 +
 .../webapp/templates/common/Header_tmpl.html    |    87 +
 .../common/LogSnapShotLayout_tmpl.html          |    23 +
 .../templates/common/TableLayout_tmpl.html      |    37 +
 .../webapp/templates/common/TimerView_tmpl.html |    25 +
 .../webapp/templates/common/TopNav_tmpl.html    |    52 +
 .../webapp/templates/common/breadcrumbs.html    |    46 +
 .../webapp/templates/common/formInputItem.html  |    54 +
 .../templates/common/formInputItemList.html     |    42 +
 .../webapp/templates/common/loading_tmpl.html   |    45 +
 .../BubbleGraphTableLayoutView_tmpl.html        |    79 +
 .../dashboard/ComponentListView_tmpl.html       |    35 +
 .../dashboard/ComponentsView_tmpl.html          |    57 +
 .../dashboard/DashboardLayoutView_tmpl.html     |    28 +
 .../templates/dashboard/DashboardView_tmpl.html |   122 +
 .../dashboard/GridTableLayoutView_tmpl.html     |    28 +
 .../templates/dashboard/HostListView_tmpl.html  |    48 +
 .../templates/dashboard/HostsView_tmpl.html     |    56 +
 .../templates/dashboard/LogDetailView_tmpl.html |    75 +
 .../dashboard/LogLevelBoxView_tmpl.html         |    44 +
 .../templates/dashboard/LogLevelView_tmpl.html  |   110 +
 .../dashboard/MainLayoutView_tmpl.html          |   232 +
 .../dialog/ApplySearchFilterView_tmpl.html      |    30 +
 .../dialog/DetailLogFileView_tmpl.html          |    22 +
 .../GlobalExclusionCompositeView_tmpl.html      |    32 +
 .../dialog/GlobalExclusionItemView_tmpl.html    |    26 +
 .../dialog/GridGraphSettingView_tmpl.html       |   284 +
 .../dialog/SaveSearchFilterView_tmpl.html       |    70 +
 .../dialog/TimeZoneChangeView_tmpl.html         |   475 +
 .../filter/CreateLogfeederFilter_tmpl.html      |    51 +
 .../templates/graphs/GraphLayoutView_tmpl.html  |    49 +
 .../graphs/GridGraphLayoutView_tmpl.html        |    28 +
 .../src/main/webapp/templates/graphs/backup.js  |   586 +
 .../main/webapp/templates/helpers/Helpers.js    |   559 +
 .../tabs/ComparisonLayoutView_tmpl.html         |    20 +
 .../templates/tabs/ComparisonView_tmpl.html     |    56 +
 .../tabs/EventHistoryLayoutView_tmpl.html       |    45 +
 .../templates/tabs/ExportLogFileView_tmpl.html  |    46 +
 .../tabs/HierarchyTabLayoutView_tmpl.html       |   124 +
 .../tabs/HostInfoTabLayoutView_tmpl.html        |    46 +
 .../webapp/templates/tabs/LogFileView_tmpl.html |   168 +
 .../webapp/templates/tabs/TreeView_tmpl.html    |    97 +
 .../templates/tabs/VisualSearchView_tmpl.html   |    20 +
 .../TroubleShootLayoutView_tmpl.html            |   149 +
 .../main/webapp/themejs/1.3.0/bootstrap.min.js  |    19 +
 ambari-logsearch/pom.xml                        |   170 +
 pom.xml                                         |     3 +
 1146 files changed, 359829 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/README.md
----------------------------------------------------------------------
diff --git a/ambari-logsearch/README.md b/ambari-logsearch/README.md
new file mode 100644
index 0000000..04fdf2f
--- /dev/null
+++ b/ambari-logsearch/README.md
@@ -0,0 +1,16 @@
+# logsearch
+RPM/DPKG Build Process
+=============
+
+1. Check out the code from GIT repository
+
+2. On the logsearch root folder, please execute the following Maven command to build RPM/DPKG:
+
+  $ mvn -Dbuild-rpm clean package
+
+  or
+
+  $ mvn -Dbuild-deb clean package
+
+3. Generated RPM/DPKG files will be found in ambari-logsearch-assembly/target folder
+  

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/.gitignore
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/.gitignore b/ambari-logsearch/ambari-logsearch-appender/.gitignore
new file mode 100644
index 0000000..a8ab5af
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/.gitignore
@@ -0,0 +1,2 @@
+logs/*
+target

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/build.properties
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/build.properties b/ambari-logsearch/ambari-logsearch-appender/build.properties
new file mode 100644
index 0000000..95ea4ac
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/build.properties
@@ -0,0 +1,13 @@
+#   Licensed 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.
+
+# log4j configuration used during build and unit tests

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/build.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/build.xml b/ambari-logsearch/ambari-logsearch-appender/build.xml
new file mode 100644
index 0000000..37708be
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/build.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+   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.
+-->
+<project basedir="." default="build" name="logfeeder">
+  <property environment="env" />
+  <property name="debuglevel" value="source,lines,vars" />
+  <dirname property="builddir" file="build.xml" />
+  <property name="target" value="1.7" />
+  <property name="source" value="1.7" />
+  <property file="local.properties" />
+  <property file="build.properties" />
+  <target name="init">
+  </target>
+  <target name="build" />
+  
+  <target name="package">
+    <delete dir="target/package" />
+    <copy todir="target/package/libs" includeEmptyDirs="no">
+      <fileset file="target/ambari-logsearch-appender.jar" />
+    </copy>
+    <tar compression="gzip" destfile="target/ambari-logsearch-appender.tar.gz">
+      <tarfileset dir="target/package" />
+    </tar>
+  </target>
+  <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects" />
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/pom.xml b/ambari-logsearch/ambari-logsearch-appender/pom.xml
new file mode 100644
index 0000000..85852f6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/pom.xml
@@ -0,0 +1,84 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <groupId>org.apache.ambari</groupId>
+  <artifactId>ambari-logsearch-appender</artifactId>
+  <version>2.0.0.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>Ambari Logsearch Appender</name>
+
+  <url>http://maven.apache.org</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+    <jar.finalName>ambari-logsearch-appender</jar.finalName>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.7</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <ant antfile="build.xml">
+                  <target name="package"/>
+                </ant>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.17</version>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.6.2</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchAppender.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchAppender.java b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchAppender.java
new file mode 100644
index 0000000..4339a21
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchAppender.java
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.appender;
+
+import org.apache.log4j.DailyRollingFileAppender;
+import org.apache.log4j.Layout;
+import org.apache.log4j.Logger;
+import org.apache.log4j.spi.LoggingEvent;
+
+public class LogsearchAppender extends DailyRollingFileAppender {
+  private static Logger logger = Logger.getLogger(LogsearchAppender.class);
+
+  public LogsearchAppender() {
+    logger.debug("Initializing LogsearchAppender........... ");
+  }
+
+  @Override
+  public void append(LoggingEvent event) {
+    super.append(event);
+  }
+
+  @Override
+  public void setLayout(Layout layout) {
+    super.setLayout(layout);
+  }
+
+  protected void subAppend(LoggingEvent event) {
+    this.qw.write(this.layout.format(event));
+    if (shouldFlush(event)) {
+      this.qw.flush();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchConversion.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchConversion.java b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchConversion.java
new file mode 100644
index 0000000..b9e7527
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/LogsearchConversion.java
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.appender;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.apache.log4j.EnhancedPatternLayout;
+import org.apache.log4j.spi.LoggingEvent;
+
+public class LogsearchConversion extends EnhancedPatternLayout {
+  //
+  protected final int BUF_SIZE = 256;
+  protected final int MAX_CAPACITY = 1024;
+
+  private StringBuffer sbuf = new StringBuffer(BUF_SIZE);
+
+  private String newLine = System.getProperty("line.separator");
+
+  public LogsearchConversion() {
+  }
+
+  public String format(LoggingEvent event) {
+    if (sbuf.capacity() > MAX_CAPACITY) {
+      sbuf = new StringBuffer(BUF_SIZE);
+    } else {
+      sbuf.setLength(0);
+    }
+    String outputStr = createOutput(event);
+    sbuf.append(outputStr + newLine);
+    return sbuf.toString();
+  }
+
+  public String createOutput(LoggingEvent event) {
+    VOutput vOutput = new VOutput();
+    vOutput.setLevel(event.getLevel().toString());
+    vOutput.setFile(event.getLocationInformation().getFileName());
+    vOutput.setLine_number(Integer.parseInt(event.getLocationInformation().getLineNumber()));
+    String logmsg = event.getMessage() != null ? event.getMessage().toString() : "";
+    if (event.getThrowableInformation() != null && event.getThrowableInformation().getThrowable() != null) {
+      logmsg += newLine + stackTraceToString(event.getThrowableInformation().getThrowable());
+    }
+    vOutput.setLog_message(logmsg);
+    vOutput.setLogtime("" + event.getTimeStamp());
+    vOutput.setLogger_name("" + event.getLoggerName());
+    vOutput.setThread_name(event.getThreadName());
+    return vOutput.toJson();
+  }
+
+  public String stackTraceToString(Throwable e) {
+    StringWriter sw = new StringWriter();
+    PrintWriter pw = new PrintWriter(sw);
+    e.printStackTrace(pw);
+    return sw.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VBase.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VBase.java b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VBase.java
new file mode 100644
index 0000000..4e91ccc
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VBase.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.appender;
+
+import java.lang.reflect.Field;
+
+import org.apache.log4j.Logger;
+
+import com.google.gson.Gson;
+
+public class VBase {
+  private static Logger logger = Logger.getLogger(VBase.class);
+
+  /**
+   *
+   */
+  @Override
+  public String toString() {
+    @SuppressWarnings("rawtypes")
+    Class klass = this.getClass();
+    Field[] fields = klass.getDeclaredFields();
+    StringBuilder builder = new StringBuilder(klass.getSimpleName() + "={");
+    for (Field field : fields) {
+      try {
+        field.setAccessible(true);
+        Object fieldValue = field.get(this);
+        String fieldName = field.getName();
+        if (!fieldName.equalsIgnoreCase("serialVersionUID")) {
+          builder.append(fieldName + "={" + fieldValue + "} ");
+        }
+
+      } catch (Exception e) {
+        logger.error(e.getLocalizedMessage(), e);
+      }
+    }
+    builder.append("}");
+
+    return builder.toString();
+  }
+
+  public String toJson() {
+    Gson gson = new Gson();
+    String json = gson.toJson(this);
+    return json;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/f7294694/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VOutput.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VOutput.java b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VOutput.java
new file mode 100644
index 0000000..61da1da
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-appender/src/main/java/org/apache/ambari/logsearch/appender/VOutput.java
@@ -0,0 +1,88 @@
+/*
+ * 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.
+ */
+
+package org.apache.ambari.logsearch.appender;
+
+public class VOutput extends VBase {
+
+  private String level;
+  private String file;
+  private String thread_name;
+  private int line_number;
+  private String log_message;
+  private String logger_name;
+  private String logtime;
+
+  public String getLevel() {
+    return level;
+  }
+
+  public void setLevel(String level) {
+    this.level = level;
+  }
+
+  public String getFile() {
+    return file;
+  }
+
+  public void setFile(String file) {
+    this.file = file;
+  }
+
+  public String getThread_name() {
+    return thread_name;
+  }
+
+  public void setThread_name(String thread_name) {
+    this.thread_name = thread_name;
+  }
+
+  public int getLine_number() {
+    return line_number;
+  }
+
+  public void setLine_number(int line_number) {
+    this.line_number = line_number;
+  }
+
+  public String getLog_message() {
+    return log_message;
+  }
+
+  public void setLog_message(String log_message) {
+    this.log_message = log_message;
+  }
+
+  public String getLogger_name() {
+    return logger_name;
+  }
+
+  public void setLogger_name(String logger_name) {
+    this.logger_name = logger_name;
+  }
+
+  public String getLogtime() {
+    return logtime;
+  }
+
+  public void setLogtime(String logtime) {
+    this.logtime = logtime;
+  }
+
+}