[1/3] zeppelin git commit: [Zeppelin-1496] Apply Zeppelin-Web Good Practice Guide #1 to the code

2016-10-03 Thread corneadoug
Repository: zeppelin
Updated Branches:
  refs/heads/master 23a7e1b45 -> a9e7bc381


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a9e7bc38/zeppelin-web/src/app/search/result-list.controller.js
--
diff --git a/zeppelin-web/src/app/search/result-list.controller.js 
b/zeppelin-web/src/app/search/result-list.controller.js
index cc07a99..5472ebc 100644
--- a/zeppelin-web/src/app/search/result-list.controller.js
+++ b/zeppelin-web/src/app/search/result-list.controller.js
@@ -12,11 +12,13 @@
  * limitations under the License.
  */
 'use strict';
+(function() {
 
-angular
-  .module('zeppelinWebApp')
-  .controller('SearchResultCtrl', function($scope, $routeParams, 
searchService) {
+  angular.module('zeppelinWebApp').controller('SearchResultCtrl', 
SearchResultCtrl);
 
+  SearchResultCtrl.$inject = ['$scope', '$routeParams', 'searchService'];
+
+  function SearchResultCtrl($scope, $routeParams, searchService) {
 $scope.isResult = true ;
 $scope.searchTerm = $routeParams.searchTerm;
 var results = searchService.search({'q': $routeParams.searchTerm}).query();
@@ -152,4 +154,6 @@ angular
 
   };
 };
-  });
+  }
+
+})();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a9e7bc38/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
--
diff --git 
a/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js 
b/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
index 00f827b..3f7d1b8 100644
--- a/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
+++ b/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
@@ -12,21 +12,24 @@
  * limitations under the License.
  */
 'use strict';
+(function() {
 
-angular.module('zeppelinWebApp').service('arrayOrderingSrv', function() {
+  angular.module('zeppelinWebApp').service('arrayOrderingSrv', 
arrayOrderingSrv);
 
-  var arrayOrderingSrv = this;
+  function arrayOrderingSrv() {
+var arrayOrderingSrv = this;
 
-  this.notebookListOrdering = function(note) {
-return arrayOrderingSrv.getNoteName(note);
-  };
+this.notebookListOrdering = function(note) {
+  return arrayOrderingSrv.getNoteName(note);
+};
 
-  this.getNoteName = function(note) {
-if (note.name === undefined || note.name.trim() === '') {
-  return 'Note ' + note.id;
-} else {
-  return note.name;
-}
-  };
+this.getNoteName = function(note) {
+  if (note.name === undefined || note.name.trim() === '') {
+return 'Note ' + note.id;
+  } else {
+return note.name;
+  }
+};
+  }
 
-});
+})();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a9e7bc38/zeppelin-web/src/components/baseUrl/baseUrl.service.js
--
diff --git a/zeppelin-web/src/components/baseUrl/baseUrl.service.js 
b/zeppelin-web/src/components/baseUrl/baseUrl.service.js
index 656df63..8452a93 100644
--- a/zeppelin-web/src/components/baseUrl/baseUrl.service.js
+++ b/zeppelin-web/src/components/baseUrl/baseUrl.service.js
@@ -12,36 +12,41 @@
  * limitations under the License.
  */
 'use strict';
+(function() {
 
-angular.module('zeppelinWebApp').service('baseUrlSrv', function() {
+  angular.module('zeppelinWebApp').service('baseUrlSrv', baseUrlSrv);
 
-  this.getPort = function() {
-var port = Number(location.port);
-if (!port) {
-  port = 80;
-  if (location.protocol === 'https:') {
-port = 443;
+  function baseUrlSrv() {
+this.getPort = function() {
+  var port = Number(location.port);
+  if (!port) {
+port = 80;
+if (location.protocol === 'https:') {
+  port = 443;
+}
   }
-}
-//Exception for when running locally via grunt
-if (port ===  || port === 9000) {
-  port = 8080;
-}
-return port;
-  };
+  //Exception for when running locally via grunt
+  if (port ===  || port === 9000) {
+port = 8080;
+  }
+  return port;
+};
 
-  this.getWebsocketUrl = function() {
-var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
-return wsProtocol + '//' + location.hostname + ':' + this.getPort() + 
skipTrailingSlash(location.pathname) + '/ws';
-  };
+this.getWebsocketUrl = function() {
+  var wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
+  return wsProtocol + '//' + location.hostname + ':' + this.getPort() +
+  skipTrailingSlash(location.pathname) + '/ws';
+};
 
-  this.getRestApiBase = function() {
-return location.protocol + '//' + location.hostname + ':' + this.getPort() 
+ skipTrailingSlash(location.pathname) +
-  '/api';
-  };
+this.getRestApiBase = function() {
+  return location.protocol + '//' + location.hostname + ':' +
+  this.getPort() + skipTrailingSlash(location.pathname) +

[2/3] zeppelin git commit: [Zeppelin-1496] Apply Zeppelin-Web Good Practice Guide #1 to the code

2016-10-03 Thread corneadoug
http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a9e7bc38/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
--
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 971f515..6eaba82 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -12,2740 +12,2762 @@
  * limitations under the License.
  */
 'use strict';
+(function() {
+
+  angular.module('zeppelinWebApp').controller('ParagraphCtrl', ParagraphCtrl);
+
+  ParagraphCtrl.$inject = [
+'$scope',
+'$rootScope',
+'$route',
+'$window',
+'$routeParams',
+'$location',
+'$timeout',
+'$compile',
+'$http',
+'$q',
+'websocketMsgSrv',
+'baseUrlSrv',
+'ngToast',
+'saveAsService',
+'esriLoader'
+  ];
+
+  function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, 
$location,
+ $timeout, $compile, $http, $q, websocketMsgSrv,
+ baseUrlSrv, ngToast, saveAsService, esriLoader) {
+var ANGULAR_FUNCTION_OBJECT_NAME_PREFIX = '_Z_ANGULAR_FUNC_';
+$scope.parentNote = null;
+$scope.paragraph = null;
+$scope.originalText = '';
+$scope.editor = null;
+$scope.magic = null;
+
+var paragraphScope = $rootScope.$new(true, $rootScope);
+
+// to keep backward compatibility
+$scope.compiledScope = paragraphScope;
+
+paragraphScope.z = {
+  // z.runParagraph('20150213-231621_168813393')
+  runParagraph: function(paragraphId) {
+if (paragraphId) {
+  var filtered = $scope.parentNote.paragraphs.filter(function(x) {
+return x.id === paragraphId;});
+  if (filtered.length === 1) {
+var paragraph = filtered[0];
+websocketMsgSrv.runParagraph(paragraph.id, paragraph.title, 
paragraph.text,
+paragraph.config, paragraph.settings.params);
+  } else {
+ngToast.danger({content: 'Cannot find a paragraph with id \'' + 
paragraphId + '\'',
+  verticalPosition: 'top', dismissOnTimeout: false});
+  }
+} else {
+  ngToast.danger({
+content: 'Please provide a \'paragraphId\' when calling 
z.runParagraph(paragraphId)',
+verticalPosition: 'top', dismissOnTimeout: false});
+}
+  },
 
-angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, 
$rootScope, $route, $window,
-  
$routeParams, $location, $timeout, $compile,
-  $http, 
$q, websocketMsgSrv, baseUrlSrv, ngToast,
-  
saveAsService, esriLoader) {
-  var ANGULAR_FUNCTION_OBJECT_NAME_PREFIX = '_Z_ANGULAR_FUNC_';
-  $scope.parentNote = null;
-  $scope.paragraph = null;
-  $scope.originalText = '';
-  $scope.editor = null;
-  $scope.magic = null;
-
-  var paragraphScope = $rootScope.$new(true, $rootScope);
-
-  // to keep backward compatibility
-  $scope.compiledScope = paragraphScope;
-
-  paragraphScope.z = {
-// z.runParagraph('20150213-231621_168813393')
-runParagraph: function(paragraphId) {
-  if (paragraphId) {
-var filtered = $scope.parentNote.paragraphs.filter(function(x) {
-  return x.id === paragraphId;});
-if (filtered.length === 1) {
-  var paragraph = filtered[0];
-  websocketMsgSrv.runParagraph(paragraph.id, paragraph.title, 
paragraph.text,
-  paragraph.config, paragraph.settings.params);
+  // Example: z.angularBind('my_var', 'Test Value', 
'20150213-231621_168813393')
+  angularBind: function(varName, value, paragraphId) {
+// Only push to server if there paragraphId is defined
+if (paragraphId) {
+  websocketMsgSrv.clientBindAngularObject($routeParams.noteId, 
varName, value, paragraphId);
 } else {
-  ngToast.danger({content: 'Cannot find a paragraph with id \'' + 
paragraphId + '\'',
+  ngToast.danger({
+content: 'Please provide a \'paragraphId\' when calling ' +
+'z.angularBind(varName, value, \'PUT_HERE_PARAGRAPH_ID\')',
+verticalPosition: 'top', dismissOnTimeout: false});
+}
+  },
+
+  // Example: z.angularUnBind('my_var', '20150213-231621_168813393')
+  angularUnbind: function(varName, paragraphId) {
+// Only push to server if paragraphId is defined
+if (paragraphId) {
+  websocketMsgSrv.clientUnbindAngularObject($routeParams.noteId, 
varName, paragraphId);
+} else {
+  ngToast.danger({
+content: 'Please provide a \'paragraphId\' when calling ' +
+

zeppelin git commit: [ZEPPELIN-1502] Highlights initialization code editor bugs

2016-10-03 Thread corneadoug
Repository: zeppelin
Updated Branches:
  refs/heads/master c3e05de8a -> 23a7e1b45


[ZEPPELIN-1502] Highlights initialization code editor bugs

### What is this PR for?
When there are a variety of para graph interpreter present,
When you refresh the page, the code highlights are incorrectly applied.

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

### Todos
- [x] - Create orderId key in getEditorMode function.

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

### How should this be tested?
1. Create a para-graph form below.
```
%spark
println("spark syn 01");
```
```
%spark
println("spark syn 02");
```
```
%spark
println("spark syn 03");
```
```
%spark
println("spark syn 04");
```
```
%spark
println("spark syn 05");
```
```
%pyspark
print ("pyspark syn);
```
```
%sql
SELECT * FROM SQL_HIGH WHERE ONMYCOM
```

2. Check the highlights of each of the para graphs.
3. Refresh the page and check the highlights again.

### Screenshots (if appropriate)
 bug (focus on pyspark)
![codeeidtorhigh](https://cloud.githubusercontent.com/assets/10525473/18906890/66b8ede0-85a4-11e6-96fb-6cc000edf477.png)

 this pr (focus on pyspark)
![code](https://cloud.githubusercontent.com/assets/10525473/18907220/bcc9f818-85a5-11e6-949c-db94fa753d3c.png)

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

Author: CloverHearts 

Closes #1468 from cloverhearts/dev/codeeditor-bugfixed and squashes the 
following commits:

ff43ce3 [CloverHearts] change payload key name for interpreter syntax property
de03a06 [CloverHearts] remove whitespace - jslint
eaa1b86 [CloverHearts] bug fixed for page refresh initialize editor mode


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

Branch: refs/heads/master
Commit: 23a7e1b45c8845946746252c354f2da66febbbcc
Parents: c3e05de
Author: CloverHearts 
Authored: Thu Sep 29 14:14:03 2016 +0900
Committer: Damien CORNEAU 
Committed: Mon Oct 3 16:53:51 2016 +0900

--
 .../main/java/org/apache/zeppelin/socket/NotebookServer.java  | 2 ++
 .../src/app/notebook/paragraph/paragraph.controller.js| 7 ---
 .../src/components/websocketEvents/websocketMsg.service.js| 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/23a7e1b4/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
--
diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java 
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
index 10c9410..ab7394b 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
@@ -1595,9 +1595,11 @@ public class NotebookServer extends WebSocketServlet 
implements
 
   private void getEditorSetting(NotebookSocket conn, Message fromMessage)
   throws IOException {
+String paragraphId = (String) fromMessage.get("paragraphId");
 String replName = (String) fromMessage.get("magic");
 String noteId = getOpenNoteId(conn);
 Message resp = new Message(OP.EDITOR_SETTING);
+resp.put("paragraphId", paragraphId);
 resp.put("editor", 
notebook().getInterpreterFactory().getEditorSetting(noteId, replName));
 conn.send(serializeMessage(resp));
 return;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/23a7e1b4/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
--
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js 
b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 824896a..971f515 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -705,13 +705,14 @@ 
angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
 
   var getAndSetEditorSetting = function(session, interpreterName) {
 var deferred = $q.defer();
-websocketMsgSrv.getEditorSetting(interpreterName);
+websocketMsgSrv.getEditorSetting($scope.paragraph.id, interpreterName);
 $timeout(
   $scope.$on('editorSetting', function(event, data) {
-deferred.resolve(data);
+if ($scope.paragraph.id === data.paragraphId) {
+  deferred.resolve(data);
+}
   }
 ), 1000);
-
 

svn commit: r1763121 - in /zeppelin/site/docs/0.7.0-SNAPSHOT: ./ development/ displaysystem/ install/ interpreter/ manual/ quickstart/ rest-api/ security/ storage/

2016-10-03 Thread corneadoug
Author: corneadoug
Date: Mon Oct  3 07:47:27 2016
New Revision: 1763121

URL: http://svn.apache.org/viewvc?rev=1763121=rev
Log:
Remove some files from search

Modified:
zeppelin/site/docs/0.7.0-SNAPSHOT/atom.xml
zeppelin/site/docs/0.7.0-SNAPSHOT/development/howtocontribute.html
zeppelin/site/docs/0.7.0-SNAPSHOT/development/howtocontributewebsite.html

zeppelin/site/docs/0.7.0-SNAPSHOT/development/writingzeppelinapplication.html

zeppelin/site/docs/0.7.0-SNAPSHOT/development/writingzeppelininterpreter.html
zeppelin/site/docs/0.7.0-SNAPSHOT/displaysystem/back-end-angular.html
zeppelin/site/docs/0.7.0-SNAPSHOT/displaysystem/basicdisplaysystem.html
zeppelin/site/docs/0.7.0-SNAPSHOT/displaysystem/front-end-angular.html
zeppelin/site/docs/0.7.0-SNAPSHOT/index.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/cdh.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/install.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/spark_cluster_mode.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/upgrade.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/virtual_machine.html
zeppelin/site/docs/0.7.0-SNAPSHOT/install/yarn_install.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/alluxio.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/beam.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/bigquery.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/cassandra.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/elasticsearch.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/flink.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/geode.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/hbase.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/hdfs.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/hive.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/ignite.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/jdbc.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/lens.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/livy.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/markdown.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/postgresql.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/python.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/r.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/scalding.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/shell.html
zeppelin/site/docs/0.7.0-SNAPSHOT/interpreter/spark.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/dependencymanagement.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/dynamicform.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/dynamicinterpreterload.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/interpreterinstallation.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/interpreters.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/notebookashomepage.html
zeppelin/site/docs/0.7.0-SNAPSHOT/manual/publish.html
zeppelin/site/docs/0.7.0-SNAPSHOT/pleasecontribute.html
zeppelin/site/docs/0.7.0-SNAPSHOT/quickstart/explorezeppelinui.html
zeppelin/site/docs/0.7.0-SNAPSHOT/quickstart/tutorial.html
zeppelin/site/docs/0.7.0-SNAPSHOT/rest-api/rest-configuration.html
zeppelin/site/docs/0.7.0-SNAPSHOT/rest-api/rest-credential.html
zeppelin/site/docs/0.7.0-SNAPSHOT/rest-api/rest-interpreter.html
zeppelin/site/docs/0.7.0-SNAPSHOT/rest-api/rest-notebook.html
zeppelin/site/docs/0.7.0-SNAPSHOT/rss.xml
zeppelin/site/docs/0.7.0-SNAPSHOT/screenshots.html
zeppelin/site/docs/0.7.0-SNAPSHOT/search.html
zeppelin/site/docs/0.7.0-SNAPSHOT/search_data.json
zeppelin/site/docs/0.7.0-SNAPSHOT/security/authentication.html
zeppelin/site/docs/0.7.0-SNAPSHOT/security/datasource_authorization.html
zeppelin/site/docs/0.7.0-SNAPSHOT/security/notebook_authorization.html
zeppelin/site/docs/0.7.0-SNAPSHOT/security/shiroauthentication.html
zeppelin/site/docs/0.7.0-SNAPSHOT/sitemap.txt
zeppelin/site/docs/0.7.0-SNAPSHOT/storage/storage.html

Modified: zeppelin/site/docs/0.7.0-SNAPSHOT/atom.xml
URL: 
http://svn.apache.org/viewvc/zeppelin/site/docs/0.7.0-SNAPSHOT/atom.xml?rev=1763121=1763120=1763121=diff
==
--- zeppelin/site/docs/0.7.0-SNAPSHOT/atom.xml (original)
+++ zeppelin/site/docs/0.7.0-SNAPSHOT/atom.xml Mon Oct  3 07:47:27 2016
@@ -4,7 +4,7 @@
  Apache Zeppelin
  http://zeppelin.apache.org/; rel="self"/>
  http://zeppelin.apache.org"/>
- 2016-09-30T13:57:27+09:00
+ 2016-10-03T16:30:05+09:00
  http://zeppelin.apache.org
  
The Apache Software Foundation

Modified: zeppelin/site/docs/0.7.0-SNAPSHOT/development/howtocontribute.html
URL: 
http://svn.apache.org/viewvc/zeppelin/site/docs/0.7.0-SNAPSHOT/development/howtocontribute.html?rev=1763121=1763120=1763121=diff
==
--- zeppelin/site/docs/0.7.0-SNAPSHOT/development/howtocontribute.html 

[3/3] zeppelin git commit: Closes #47

2016-10-03 Thread corneadoug
Closes #47


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

Branch: refs/heads/master
Commit: 7ef2e58c748a59dc033980dc59183f465b9c24d6
Parents: 47fb853
Author: Damien CORNEAU 
Authored: Mon Oct 3 16:14:26 2016 +0900
Committer: Damien CORNEAU 
Committed: Mon Oct 3 16:14:26 2016 +0900

--

--




[1/3] zeppelin git commit: Closes #152

2016-10-03 Thread corneadoug
Repository: zeppelin
Updated Branches:
  refs/heads/master 3017730b8 -> 7ef2e58c7


Closes #152


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

Branch: refs/heads/master
Commit: 39821848513889a5d532b8a43bfd98349247e2f3
Parents: 3017730
Author: Damien CORNEAU 
Authored: Mon Oct 3 16:14:10 2016 +0900
Committer: Damien CORNEAU 
Committed: Mon Oct 3 16:14:10 2016 +0900

--

--