zeppelin git commit: ZEPPELIN-1459: Zeppelin JDBC URL properties mangled

2016-09-22 Thread prabhjyotsingh
Repository: zeppelin
Updated Branches:
  refs/heads/master 6a90cacc1 -> 6f9012b40


ZEPPELIN-1459: Zeppelin JDBC URL properties mangled

### What is this PR for?
While creating connection `DriverManager.getConnection(url, properties);` for 
JDBC interpreter, phoenix driver is modifying the properties that is passed as 
parameter, which in modifies propertiesMap.

This all is resulting in, not able to execute any other paragraph with phoenix 
interpreter.

This only happens if JDBC URI is "jdbc:phoenix:thin:url"

### What type of PR is it?
[Bug Fix]

### Todos
* [x] - Pass a copy of `properties` to `DriverManager.getConnection(url, 
properties)`

### What is the Jira issue?
* [ZEPPELIN-1459](https://issues.apache.org/jira/browse/ZEPPELIN-1459)

### How should this be tested?
Use the example setting below
https://issues.apache.org/jira/browse/ZEPPELIN-1459?focusedCommentId=15505750=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15505750

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a

Author: Prabhjyot Singh 

Closes #1442 from prabhjyotsingh/ZEPPELIN-1459 and squashes the following 
commits:

906fe34 [Prabhjyot Singh] ZEPPELIN-1459: Zeppelin JDBC URL properties mangled


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

Branch: refs/heads/master
Commit: 6f9012b40a63a019723753b9eb171a3fd44a6f6e
Parents: 6a90cac
Author: Prabhjyot Singh 
Authored: Tue Sep 20 14:00:46 2016 +0530
Committer: Prabhjyot Singh 
Committed: Thu Sep 22 15:24:45 2016 +0530

--
 jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/6f9012b4/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
--
diff --git a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java 
b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
index bc473ea..0655f3a 100644
--- a/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
+++ b/jdbc/src/main/java/org/apache/zeppelin/jdbc/JDBCInterpreter.java
@@ -210,7 +210,7 @@ public class JDBCInterpreter extends Interpreter {
   }
 }
 if (null == connection) {
-  final Properties properties = propertiesMap.get(propertyKey);
+  final Properties properties = (Properties) 
propertiesMap.get(propertyKey).clone();
   logger.info(properties.getProperty(DRIVER_KEY));
   Class.forName(properties.getProperty(DRIVER_KEY));
   final String url = properties.getProperty(URL_KEY);



zeppelin git commit: ZEPPELIN-1454: Wrong property value on interpreter page

2016-09-22 Thread prabhjyotsingh
Repository: zeppelin
Updated Branches:
  refs/heads/branch-0.6 5600135a0 -> c2d38f170


ZEPPELIN-1454: Wrong property value on interpreter page

### What is this PR for?
If for some reason (for example permission issue in file system) while saving 
interpreter setting, UI shows wrong value till the next restart.
IMO interpreter.json should be the source of truth, that should always be 
reflected on UI

### What type of PR is it?
[Bug Fix]

### Todos
* [x] - read from file-system after saving

### What is the Jira issue?
* [ZEPPELIN-1454](https://issues.apache.org/jira/browse/ZEPPELIN-1454)

### How should this be tested?
Change file system permission of "interpreter.json", and make it readonly, then 
on interpreter setting page try and change any property and refresh the page, 
refer screenshot

### Screenshots (if appropriate)
Before
![fix-permission-before](https://cloud.githubusercontent.com/assets/674497/18627830/ced6673a-7e7a-11e6-88a6-426e1d2d2582.gif)

After
![fix-permission-after](https://cloud.githubusercontent.com/assets/674497/18627831/ceda24f6-7e7a-11e6-880b-4a7d1f9be3d8.gif)

### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a

Author: Prabhjyot Singh 

Closes #1437 from prabhjyotsingh/ZEPPELIN-1454 and squashes the following 
commits:

f94125c [Prabhjyot Singh] ZEPPELIN-1454: read from file-system after saving

(cherry picked from commit 6a90cacc150fba36803f7cb802d7c4e9355f77e3)
Signed-off-by: Prabhjyot Singh 


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

Branch: refs/heads/branch-0.6
Commit: c2d38f17020d558d38606e4d5d2304941f809d67
Parents: 5600135
Author: Prabhjyot Singh 
Authored: Mon Sep 19 15:05:11 2016 +0530
Committer: Prabhjyot Singh 
Committed: Thu Sep 22 15:23:03 2016 +0530

--
 .../interpreter/InterpreterFactory.java | 26 +++-
 1 file changed, 15 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/c2d38f17/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
--
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
index 9802275..9f30f50 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@@ -744,17 +744,21 @@ public class InterpreterFactory implements 
InterpreterGroupFactory {
 synchronized (interpreterSettings) {
   InterpreterSetting intpsetting = interpreterSettings.get(id);
   if (intpsetting != null) {
-
-stopJobAllInterpreter(intpsetting);
-
-intpsetting.closeAndRmoveAllInterpreterGroups();
-
-intpsetting.setOption(option);
-intpsetting.setProperties(properties);
-intpsetting.setDependencies(dependencies);
-
-loadInterpreterDependencies(intpsetting);
-saveToFile();
+try {
+  stopJobAllInterpreter(intpsetting);
+
+  intpsetting.closeAndRmoveAllInterpreterGroups();
+  intpsetting.setOption(option);
+  intpsetting.setProperties(properties);
+  intpsetting.setDependencies(dependencies);
+  loadInterpreterDependencies(intpsetting);
+
+  saveToFile();
+} catch (Exception e) {
+  throw e;
+} finally {
+  loadFromFile();
+}
   } else {
 throw new InterpreterException("Interpreter setting id " + id
 + " not found");



svn commit: r1761865 - in /zeppelin/site/contribution: contributions.html documentation.html webapplication.html zeppelinweb/goodPracticeGuide01.html zeppelinweb/goodPracticeGuide02.html zeppelinweb/g

2016-09-22 Thread corneadoug
Author: corneadoug
Date: Thu Sep 22 08:15:13 2016
New Revision: 1761865

URL: http://svn.apache.org/viewvc?rev=1761865=rev
Log:
Add zeppelinweb good practice 3

Added:
zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html
Modified:
zeppelin/site/contribution/contributions.html
zeppelin/site/contribution/documentation.html
zeppelin/site/contribution/webapplication.html
zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html
zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html

Modified: zeppelin/site/contribution/contributions.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/contributions.html?rev=1761865=1761864=1761865=diff
==
--- zeppelin/site/contribution/contributions.html (original)
+++ zeppelin/site/contribution/contributions.html Thu Sep 22 08:15:13 2016
@@ -118,12 +118,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 
@@ -284,12 +284,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 

Modified: zeppelin/site/contribution/documentation.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/documentation.html?rev=1761865=1761864=1761865=diff
==
--- zeppelin/site/contribution/documentation.html (original)
+++ zeppelin/site/contribution/documentation.html Thu Sep 22 08:15:13 2016
@@ -118,12 +118,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 
@@ -284,12 +284,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 

Modified: zeppelin/site/contribution/webapplication.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/webapplication.html?rev=1761865=1761864=1761865=diff
==
--- zeppelin/site/contribution/webapplication.html (original)
+++ zeppelin/site/contribution/webapplication.html Thu Sep 22 08:15:13 2016
@@ -118,12 +118,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 
@@ -284,12 +284,16 @@
   
 
   
+
+  
+3 
- Making A Controller
+  
+
+  
 
   
 
   
-
-  
 
   
 

Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html?rev=1761865=1761864=1761865=diff
==
--- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html (original)
+++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html Thu Sep 22 
08:15:13 2016
@@ -118,12 +118,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 
@@ -284,12 +284,16 @@
   
 
   
+
+  
+3 
- Making A Controller
+  
+
+  
 
   
 
   
-
-  
 
   
 

Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html?rev=1761865=1761864=1761865=diff
==
--- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html (original)
+++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html Thu Sep 22 
08:15:13 2016
@@ -118,12 +118,12 @@
   
 
   
+
+  
 
   
 
   
-
-  
 
   
 
@@ -284,12 +284,16 @@
   
 
   
+
+  
+3 
- Making A Controller
+  
+
+  
 
   
 
   
-
-  
 
   
 
@@ -402,6 +406,7 @@ $rootScope.$on(eventToCatch, f
 
 Usage of event dispatching should be limited if possible
 We only use $rootScope.$broadcast and $scope.$on 
for event dispatching/catching
+We are grouping all the $scope.$on functions at the end of 
the compponent using it (controller or service)
 
 
 Performances

Added: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html?rev=1761865=auto
==
--- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html (added)
+++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide03.html Thu Sep 22 
08:15:13 2016
@@ -0,0 +1,517 @@
+
+
+
+
+  
+
+3 - Making A Controller
+
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+
+
+
+https://code.jquery.com/jquery-1.10.2.min.js";>
+
+
+
+  
+
+
+

zeppelin git commit: [ZEPPELIN-1462] Zeppelin-Web Good Practices #3

2016-09-22 Thread corneadoug
Repository: zeppelin
Updated Branches:
  refs/heads/gh-pages 4280cba17 -> fd772df06


[ZEPPELIN-1462] Zeppelin-Web Good Practices #3

### What is this PR for?
This Good Practice Guide will focus on how to write a controller following the 
controller as vm concept, and how to provide a nice separation of the code.

### What type of PR is it?
Documentation

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1462

### How should this be tested?
Check the `.md` file, or build the website to see the full rendering

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Damien CORNEAU 

Closes #1443 from corneadoug/ZEPPELIN-1462 and squashes the following commits:

2dc04e0 [Damien CORNEAU] Address feedbacks
a4a2645 [Damien CORNEAU] Add the new Practive Guide Page


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

Branch: refs/heads/gh-pages
Commit: fd772df06ee2cd722349673185b4bc12a53c6d32
Parents: 4280cba
Author: Damien CORNEAU 
Authored: Thu Sep 22 10:06:12 2016 +0900
Committer: Damien CORNEAU 
Committed: Thu Sep 22 17:09:30 2016 +0900

--
 contribution/zeppelinweb/goodPracticeGuide02.md |   1 +
 contribution/zeppelinweb/goodPracticeGuide03.md | 143 +++
 2 files changed, 144 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/fd772df0/contribution/zeppelinweb/goodPracticeGuide02.md
--
diff --git a/contribution/zeppelinweb/goodPracticeGuide02.md 
b/contribution/zeppelinweb/goodPracticeGuide02.md
index b3d39f2..bf9a55f 100644
--- a/contribution/zeppelinweb/goodPracticeGuide02.md
+++ b/contribution/zeppelinweb/goodPracticeGuide02.md
@@ -56,6 +56,7 @@ Now, there are a few things to know about using it from 
`$rootScope`:
 
 * Usage of event dispatching should be limited if possible
 * We only use `$rootScope.$broadcast` and `$scope.$on` for event 
dispatching/catching
+* We are grouping all the `$scope.$on` functions at the end of the compponent 
using it (controller or service)
 
 
  Performances

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/fd772df0/contribution/zeppelinweb/goodPracticeGuide03.md
--
diff --git a/contribution/zeppelinweb/goodPracticeGuide03.md 
b/contribution/zeppelinweb/goodPracticeGuide03.md
new file mode 100644
index 000..836271f
--- /dev/null
+++ b/contribution/zeppelinweb/goodPracticeGuide03.md
@@ -0,0 +1,143 @@
+---
+layout: sideMenu
+title: "3 - Making A Controller"
+description: ""
+group: nav-contrib-front
+menu: nav-contrib-front
+---
+
+
+# How to Write a Controller
+
+
+Our main rule regarding writing a controller, is to use the `Controller as vm` 
style, however, we also have a few other style guidelines.
+
+You can see below a full example of what the controller would look like.
+
+```
+(function() {
+  'use strict';
+
+  angular.module('zeppelinWebApp')
+.controller('myNewController', myNewController);
+
+myNewController.$inject = ['$http'];
+
+function myNewController($http) {
+
+  var vm = this;
+
+  vm.publicVariable = {};
+
+  // Controller's public functions
+  vm.myControllerPublicFunction = myControllerPublicFunction;
+
+  _init();
+
+  /*
+  ** Public functions Implementation **
+  */
+
+  function myControllerPublicFunction() {
+
+...
+
+  }
+
+  function myOtherPublicFunction() {
+
+_utilFunction();
+...
+
+  }
+
+  /*
+  ** Private functions Implementation **
+  */
+
+  function _init() {
+
+vm.myControllerPublicFunction();
+...
+
+  }
+
+  function _utilFunction() {
+
+...
+
+  }
+
+  /***
+  ** $scope.$on catchers Implementation **
+  ***/
+
+  $scope.$on('eventName', function(event) {
+
+...
+
+  })
+}
+})();
+```
+
+This might look like a lot of lines, but it is mainly to show all the rules at 
once.
+
+
+ Using the controller in a view
+
+Now let's see how we can use it inside our `.html` view in normal situations.
+
+```
+
+  {{ newCtrl.publicVariable 
}}
+
+```
+
+ Using the controller in a page
+
+In the case where your controller will be used on a view