-
-
-
-
Note Permissions (Only note owners can change)
-
-
-
-
- Enter comma separated users and groups in the fields.
- Empty field (*) implies anyone can do the operation.
-
-
-
-
-
-
-
-
-
@@ -81,6 +57,31 @@ limitations under the License.
+
+
+
+
Note Permissions (Only note owners can change)
+
+
+
+
+ Enter comma separated users and groups in the fields.
+ Empty field (*) implies anyone can do the operation.
+
+
+
+
+
+
+
+
+
+
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index cb7265c920..097ee84fbb 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -23,11 +23,22 @@ angular.module('zeppelinWebApp')
$scope.editor = null;
var paragraphScope = $rootScope.$new(true, $rootScope);
+
// to keep backward compatibility
$scope.compiledScope = paragraphScope;
- var angularObjectRegistry = {};
+ paragraphScope.z = {
+ // 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);
+ }
+ }
+ };
+
+ var angularObjectRegistry = {};
var editorModes = {
'ace/mode/scala': /^%spark/,
diff --git a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
index 245ab77f16..3fba0f5e70 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
@@ -70,6 +70,18 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
});
},
+ clientBindAngularObject: function(noteId, name, value, paragraphId) {
+ websocketEvents.sendNewEvent({
+ op: 'ANGULAR_OBJECT_CLIENT_BIND',
+ data: {
+ noteId: noteId,
+ name: name,
+ value: value,
+ paragraphId: paragraphId
+ }
+ });
+ },
+
cancelParagraphRun: function(paragraphId) {
websocketEvents.sendNewEvent({op: 'CANCEL_PARAGRAPH', data: {id: paragraphId}});
},
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
index 09c9026c90..bb4d69b717 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
@@ -35,6 +35,8 @@ import java.io.IOException;
import java.io.Serializable;
import java.util.*;
+import com.google.common.annotations.VisibleForTesting;
+
/**
* Paragraph is a representation of an execution unit.
*
@@ -52,6 +54,13 @@ public class Paragraph extends Job implements Serializable, Cloneable {
private Map
config; // paragraph configs like isOpen, colWidth, etc
public final GUI settings; // form and parameter settings
+ @VisibleForTesting
+ Paragraph() {
+ super(generateId(), null);
+ config = new HashMap<>();
+ settings = new GUI();
+ }
+
public Paragraph(Note note, JobListener listener, NoteInterpreterLoader replLoader) {
super(generateId(), listener);
this.note = note;
@@ -163,6 +172,10 @@ public class Paragraph extends Job implements Serializable, Cloneable {
return replLoader.get(name);
}
+ public Interpreter getCurrentRepl() {
+ return getRepl(getRequiredReplName());
+ }
+
public List completion(String buffer, int cursor) {
String replName = getRequiredReplName(buffer);
if (replName != null) {