You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by jo...@apache.org on 2016/12/24 17:27:29 UTC

zeppelin git commit: [ZEPPELIN-1594] Support personalized mode

Repository: zeppelin
Updated Branches:
  refs/heads/master 4b5bee443 -> e673949c6


[ZEPPELIN-1594] Support personalized mode

### What is this PR for?
Enabling "Personalized Mode" for specific note

### What type of PR is it?
[Feature]

### Todos
* [x] - Backend work for supporting that feature
* [x] - Develop front-end UI

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

### How should this be tested?
1. config.personalizedMode = true in note.json
1. Navigate some jobs in two different browser

### Screenshots (if appropriate)

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

Author: Jongyoul Lee <jl...@Jongyouls-MacBook-Pro.local>
Author: CloverHearts <cl...@gmail.com>
Author: CloverHearts <cl...@users.noreply.github.com>

Closes #1753 from jongyoul/ZEPPELIN-1594 and squashes the following commits:

a9d8f7e [CloverHearts] change mode name shared to collaboration and dialog message (#5)
70f68d8 [Jongyoul Lee] Fixed dynamic forms Fixed NPE while broadcasting userParagraphsMap
2c7bd39 [CloverHearts] broadcast bugfix
f59d26a [CloverHearts] implement update personalized mode websocket event in backend
9fcb7f8 [CloverHearts] implement ui
20425e7 [CloverHearts] add toggleNotePersonalizedMode and ui
4fabd88 [Jongyoul Lee] Fixed style
a7c91f1 [Jongyoul Lee] Fixed the bug while not using personalized mode
f627278 [Jongyoul Lee] Supported personalized mode


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

Branch: refs/heads/master
Commit: e673949c61f4f4c65289ca2d6fc426fb4e90a8b2
Parents: 4b5bee4
Author: Jongyoul Lee <jo...@gmail.com>
Authored: Tue Dec 20 16:26:26 2016 +0900
Committer: Jongyoul Lee <jo...@apache.org>
Committed: Sun Dec 25 02:27:29 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/zeppelin/scheduler/Job.java |  4 +
 .../apache/zeppelin/socket/NotebookServer.java  | 93 ++++++++++++++++----
 .../src/app/notebook/notebook-actionBar.html    | 17 ++++
 .../src/app/notebook/notebook.controller.js     | 40 +++++++++
 .../notebook/paragraph/paragraph.controller.js  |  2 +-
 .../websocketEvents/websocketMsg.service.js     |  4 +
 .../java/org/apache/zeppelin/notebook/Note.java | 40 +++++++++
 .../org/apache/zeppelin/notebook/Paragraph.java | 43 ++++++++-
 .../zeppelin/notebook/socket/Message.java       |  3 +
 9 files changed, 225 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
index 9ae74ab..4be6da5 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
@@ -125,6 +125,10 @@ public abstract class Job {
     setStatus(Status.READY);
   }
 
+  public void setId(String id) {
+    this.id = id;
+  }
+
   public String getId() {
     return id;
   }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/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 7b29d05..81f466a 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
@@ -116,7 +116,7 @@ public class NotebookServer extends WebSocketServlet implements
    * is going on.
    */
   final Queue<NotebookSocket> watcherSockets = Queues.newConcurrentLinkedQueue();
-  
+
   private Notebook notebook() {
     return ZeppelinServer.notebook;
   }
@@ -196,7 +196,7 @@ public class NotebookServer extends WebSocketServlet implements
       if (StringUtils.isEmpty(conn.getUser())) {
         addUserConnection(messagereceived.principal, conn);
       }
-      AuthenticationInfo subject = 
+      AuthenticationInfo subject =
           new AuthenticationInfo(messagereceived.principal, messagereceived.ticket);
 
       /** Lets be elegant here */
@@ -261,6 +261,9 @@ public class NotebookServer extends WebSocketServlet implements
           case FOLDER_RENAME:
             renameFolder(conn, userAndRoles, notebook, messagereceived);
             break;
+          case UPDATE_PERSONALIZED_MODE:
+            updatePersonalizedMode(conn, userAndRoles, notebook, messagereceived);
+            break;
           case COMPLETION:
             completion(conn, userAndRoles, notebook, messagereceived);
             break;
@@ -585,7 +588,21 @@ public class NotebookServer extends WebSocketServlet implements
   }
 
   public void broadcastParagraph(Note note, Paragraph p) {
-    broadcast(note.getId(), new Message(OP.PARAGRAPH).put("paragraph", p));
+    if (note.isPersonalizedMode()) {
+      broadcastParagraphs(p.getUserParagraphMap(), p);
+    } else {
+      broadcast(note.getId(), new Message(OP.PARAGRAPH).put("paragraph", p));
+    }
+  }
+
+  public void broadcastParagraphs(Map<String, Paragraph> userParagraphMap,
+      Paragraph defaultParagraph) {
+    if (null != userParagraphMap) {
+      for (String user : userParagraphMap.keySet()) {
+        multicastToUser(user,
+            new Message(OP.PARAGRAPH).put("paragraph", userParagraphMap.get(user)));
+      }
+    }
   }
 
   private void broadcastNewParagraph(Note note, Paragraph para) {
@@ -642,7 +659,7 @@ public class NotebookServer extends WebSocketServlet implements
       multicastToUser(user, new Message(OP.NOTES_INFO).put("notes", notesInfo));
     }
   }
-  
+
   void permissionError(NotebookSocket conn, String op,
                        String userName,
                        Set<String> userAndRoles,
@@ -680,6 +697,10 @@ public class NotebookServer extends WebSocketServlet implements
         return;
       }
       addConnectionToNote(note.getId(), conn);
+
+      if (note.isPersonalizedMode()) {
+        note = note.getUserNote(user);
+      }
       conn.send(serializeMessage(new Message(OP.NOTE).put("note", note)));
       sendAllAngularObjects(note, user, conn);
     } else {
@@ -753,6 +774,32 @@ public class NotebookServer extends WebSocketServlet implements
     }
   }
 
+  private void updatePersonalizedMode(NotebookSocket conn, HashSet<String> userAndRoles,
+      Notebook notebook, Message fromMessage) throws SchedulerException, IOException {
+    String noteId = (String) fromMessage.get("id");
+    String personalized = (String) fromMessage.get("personalized");
+    boolean isPersonalized = personalized.equals("true") ? true : false;
+
+    if (noteId == null) {
+      return;
+    }
+
+    NotebookAuthorization notebookAuthorization = notebook.getNotebookAuthorization();
+    if (!notebookAuthorization.isOwner(noteId, userAndRoles)) {
+      permissionError(conn, "persoanlized ", fromMessage.principal,
+          userAndRoles, notebookAuthorization.getOwners(noteId));
+      return;
+    }
+
+    Note note = notebook.getNote(noteId);
+    if (note != null) {
+      note.setPersonalizedMode(isPersonalized);
+      AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal);
+      note.persist(subject);
+      broadcastNote(note);
+    }
+  }
+
   private void renameNote(NotebookSocket conn, HashSet<String> userAndRoles,
                           Notebook notebook, Message fromMessage)
       throws SchedulerException, IOException {
@@ -898,34 +945,44 @@ public class NotebookServer extends WebSocketServlet implements
     broadcastNoteList(subject, userAndRoles);
   }
 
-  private void updateParagraph(NotebookSocket conn, HashSet<String> userAndRoles,
-                               Notebook notebook, Message fromMessage) throws IOException {
+  private void updateParagraph(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook,
+      Message fromMessage) throws IOException {
     String paragraphId = (String) fromMessage.get("id");
     if (paragraphId == null) {
       return;
     }
 
-    Map<String, Object> params = (Map<String, Object>) fromMessage
-        .get("params");
-    Map<String, Object> config = (Map<String, Object>) fromMessage
-        .get("config");
+    Map<String, Object> params = (Map<String, Object>) fromMessage.get("params");
+    Map<String, Object> config = (Map<String, Object>) fromMessage.get("config");
     String noteId = getOpenNoteId(conn);
     final Note note = notebook.getNote(noteId);
     NotebookAuthorization notebookAuthorization = notebook.getNotebookAuthorization();
     AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal);
     if (!notebookAuthorization.isWriter(noteId, userAndRoles)) {
-      permissionError(conn, "write", fromMessage.principal,
-          userAndRoles, notebookAuthorization.getWriters(noteId));
+      permissionError(conn, "write", fromMessage.principal, userAndRoles,
+          notebookAuthorization.getWriters(noteId));
       return;
     }
 
     Paragraph p = note.getParagraph(paragraphId);
+
+    if (note.isPersonalizedMode()) {
+      p = p.getUserParagraphMap().get(subject.getUser());
+    }
+
     p.settings.setParams(params);
     p.setConfig(config);
     p.setTitle((String) fromMessage.get("title"));
     p.setText((String) fromMessage.get("paragraph"));
     note.persist(subject);
-    broadcastParagraph(note, p);;
+
+    if (note.isPersonalizedMode()) {
+      Map<String, Paragraph> userParagraphMap =
+          note.getParagraph(paragraphId).getUserParagraphMap();
+      broadcastParagraphs(userParagraphMap, p);
+    } else {
+      broadcastParagraph(note, p);
+    }
   }
 
   private void cloneNote(NotebookSocket conn, HashSet<String> userAndRoles,
@@ -2006,7 +2063,7 @@ public class NotebookServer extends WebSocketServlet implements
     return;
   }
 
-  private void getInterpreterSettings(NotebookSocket conn, AuthenticationInfo subject) 
+  private void getInterpreterSettings(NotebookSocket conn, AuthenticationInfo subject)
       throws IOException {
     List<InterpreterSetting> availableSettings = notebook().getInterpreterFactory().get();
     conn.send(serializeMessage(new Message(OP.INTERPRETER_SETTINGS)
@@ -2019,7 +2076,7 @@ public class NotebookServer extends WebSocketServlet implements
         .get(settingId);
     interpreterSetting.setInfos(metaInfos);
   }
-  
+
   private void switchConnectionToWatcher(NotebookSocket conn, Message messagereceived)
       throws IOException {
     if (!isSessionAllowedToSwitchToWatcher(conn)) {
@@ -2033,19 +2090,19 @@ public class NotebookServer extends WebSocketServlet implements
       return;
     }
     watcherSockets.add(conn);
-    
+
     // remove this connection from regular zeppelin ws usage.
     removeConnectionFromAllNote(conn);
     connectedSockets.remove(conn);
     removeUserConnection(conn.getUser(), conn);
   }
-  
+
   private boolean isSessionAllowedToSwitchToWatcher(NotebookSocket session) {
     String watcherSecurityKey = session.getRequest().getHeader(WatcherSecurityKey.HTTP_HEADER);
     return !(StringUtils.isBlank(watcherSecurityKey)
         || !watcherSecurityKey.equals(WatcherSecurityKey.getKey()));
   }
-  
+
   private void broadcastToWatchers(String noteId, String subject, Message message) {
     synchronized (watcherSockets) {
       if (watcherSockets.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-web/src/app/notebook/notebook-actionBar.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook-actionBar.html b/zeppelin-web/src/app/notebook/notebook-actionBar.html
index aea18a6..88e47b9 100644
--- a/zeppelin-web/src/app/notebook/notebook-actionBar.html
+++ b/zeppelin-web/src/app/notebook/notebook-actionBar.html
@@ -66,6 +66,23 @@ limitations under the License.
               tooltip-placement="bottom" tooltip="Export this note">
         <i class="fa fa-download"></i>
       </button>
+
+      <button type="button"
+              class="btn btn-primary btn-xs"
+              ng-if="ticket.principal && ticket.principal !== 'anonymous'"
+              ng-hide="viewOnly || note.config.personalizedMode !== 'true'"
+              ng-click="toggleNotePersonalizedMode()"
+              tooltip-placement="bottom" tooltip="Personal mode {{isOwner ? '' : '(owner can change)'}}">
+        <i class="fa fa-user"></i>
+      </button>
+      <button type="button"
+              class="btn btn-default btn-xs"
+              ng-if="ticket.principal && ticket.principal !== 'anonymous'"
+              ng-hide="viewOnly || note.config.personalizedMode === 'true'"
+              ng-click="toggleNotePersonalizedMode()"
+              tooltip-placement="bottom" tooltip="Collaboration mode {{isOwner ? '' : '(owner can change)'}}">
+        <i class="fa fa-users"></i>
+      </button>
     </span>
 
     <span class="labelBtn btn-group" role="group">

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js b/zeppelin-web/src/app/notebook/notebook.controller.js
index 6f15d95..a5cd83e 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -614,6 +614,7 @@
           minimumInputLength: 3
         };
 
+        $scope.setIamOwner();
         angular.element('#selectOwners').select2(selectJson);
         angular.element('#selectReaders').select2(selectJson);
         angular.element('#selectWriters').select2(selectJson);
@@ -752,6 +753,39 @@
       }
     };
 
+    $scope.setIamOwner = function() {
+      if ($scope.permissions.owners.length > 0 &&
+          _.indexOf($scope.permissions.owners, $rootScope.ticket.principal) < 0) {
+        $scope.isOwner = false;
+        return false;
+      }
+      $scope.isOwner = true;
+      return true;
+    };
+
+    $scope.toggleNotePersonalizedMode = function() {
+      var personalizedMode = $scope.note.config.personalizedMode;
+      if ($scope.isOwner) {
+        BootstrapDialog.confirm({
+          closable: true,
+          title: 'Setting the result display',
+          message: function(dialog) {
+            var modeText = $scope.note.config.personalizedMode === 'true' ? 'collaborate' : 'personalize';
+            return 'Do you want to <span class="text-info">' + modeText + '</span> your analysis?';
+          },
+          callback: function(result) {
+            if (result) {
+              if ($scope.note.config.personalizedMode === undefined) {
+                $scope.note.config.personalizedMode = 'false';
+              }
+              $scope.note.config.personalizedMode = personalizedMode === 'true' ?  'false' : 'true';
+              websocketMsgSrv.updatePersonalizedMode($scope.note.id, $scope.note.config.personalizedMode);
+            }
+          }
+        });
+      }
+    };
+
     var isSettingDirty = function() {
       if (angular.equals($scope.interpreterBindings, $scope.interpreterBindingsOrig)) {
         return false;
@@ -896,10 +930,16 @@
 
       if ($scope.note === null) {
         $scope.note = note;
+      } else {
+        $scope.note.config.personalizedMode = note.config.personalizedMode;
       }
       initializeLookAndFeel();
       //open interpreter binding setting when there're none selected
       getInterpreterBindings();
+      getPermissions();
+      var isPersonalized = $scope.note.config.personalizedMode;
+      isPersonalized = isPersonalized === undefined ?  'false' : isPersonalized;
+      $scope.note.config.personalizedMode = isPersonalized;
     });
 
     $scope.$on('$destroy', function() {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/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 36a7ed6..651196c 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -970,7 +970,7 @@
               $scope.dirtyText = undefined;
               $scope.originalText = angular.copy(data.paragraph.text);
             } else { // if there're local update, keep it.
-              $scope.paragraph.text = $scope.dirtyText;
+              $scope.paragraph.text = data.paragraph.text;
             }
           } else {
             $scope.paragraph.text = data.paragraph.text;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
index 98193c0..29479e8 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
@@ -59,6 +59,10 @@
         websocketEvents.sendNewEvent({op: 'NOTE_UPDATE', data: {id: noteId, name: noteName, config: noteConfig}});
       },
 
+      updatePersonalizedMode: function(noteId, modeValue) {
+        websocketEvents.sendNewEvent({op: 'UPDATE_PERSONALIZED_MODE', data: {id: noteId, personalized: modeValue}});
+      },
+
       renameNote: function(noteId, noteName) {
         websocketEvents.sendNewEvent({op: 'NOTE_RENAME', data: {id: noteId, name: noteName}});
       },

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
index cd2e667..3daeda0 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Note.java
@@ -121,6 +121,21 @@ public class Note implements Serializable, ParagraphJobListener {
     return null != setting ? setting.getName() : StringUtils.EMPTY;
   }
 
+  public boolean isPersonalizedMode() {
+    Object v = getConfig().get("personalizedMode");
+    return null != v && "true".equals(v);
+  }
+
+  public void setPersonalizedMode(Boolean value) {
+    String valueString = StringUtils.EMPTY;
+    if (value) {
+      valueString = "true";
+    } else {
+      valueString = "false";
+    }
+    getConfig().put("personalizedMode", valueString);
+  }
+
   public String getId() {
     return id;
   }
@@ -664,6 +679,31 @@ public class Note implements Serializable, ParagraphJobListener {
   }
 
 
+  /**
+   * Return new note for specific user. this inserts and replaces user paragraph which doesn't
+   * exists in original paragraph
+   *
+   * @param user specific user
+   * @return new Note for the user
+   */
+  public Note getUserNote(String user) {
+    Note newNote = new Note();
+    newNote.id = getId();
+    newNote.config = getConfig();
+    newNote.angularObjects = getAngularObjects();
+
+    Paragraph newParagraph;
+    for (Paragraph p : paragraphs) {
+      newParagraph = p.getUserParagraph(user);
+      if (null == newParagraph) {
+        newParagraph = p.cloneParagraphForUser(user);
+      }
+      newNote.paragraphs.add(newParagraph);
+    }
+
+    return newNote;
+  }
+
   private void startDelayedPersistTimer(int maxDelaySec, final AuthenticationInfo subject) {
     synchronized (this) {
       if (delayedPersist != null) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Paragraph.java
----------------------------------------------------------------------
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 114babf..7e72564 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
@@ -17,6 +17,7 @@
 
 package org.apache.zeppelin.notebook;
 
+import com.google.common.collect.Maps;
 import com.google.common.base.Strings;
 import org.apache.commons.lang.StringUtils;
 import org.apache.zeppelin.display.AngularObject;
@@ -55,13 +56,14 @@ public class Paragraph extends Job implements Serializable, Cloneable {
   private transient InterpreterFactory factory;
   private transient Note note;
   private transient AuthenticationInfo authenticationInfo;
+  private transient Map<String, Paragraph> userParagraphMap = Maps.newHashMap(); // personalized
 
   String title;
   String text;
   String user;
   Date dateUpdated;
   private Map<String, Object> config; // paragraph configs like isOpen, colWidth, etc
-  public final GUI settings;          // form and parameter settings
+  public GUI settings;          // form and parameter settings
 
   /**
    * Applicaiton states in this paragraph
@@ -106,6 +108,30 @@ public class Paragraph extends Job implements Serializable, Cloneable {
            + new Random(System.currentTimeMillis()).nextInt();
   }
 
+  public Map<String, Paragraph> getUserParagraphMap() {
+    return userParagraphMap;
+  }
+
+  public Paragraph getUserParagraph(String user) {
+    return userParagraphMap.get(user);
+  }
+
+  public Paragraph cloneParagraphForUser(String user) {
+    Paragraph p = new Paragraph();
+    p.settings.setParams(Maps.newHashMap(settings.getParams()));
+    p.settings.setForms(Maps.newHashMap(settings.getForms()));
+    p.setConfig(Maps.newHashMap(config));
+    p.setTitle(getTitle());
+    p.setText(getText());
+    p.setResult(getReturn());
+    p.setStatus(getStatus());
+    p.setId(getId());
+
+    userParagraphMap.put(user, p);
+
+    return p;
+  }
+
   public String getUser() {
     return user;
   }
@@ -347,7 +373,20 @@ public class Paragraph extends Job implements Serializable, Cloneable {
       context.out.flush();
       List<InterpreterResultMessage> resultMessages = context.out.toInterpreterResultMessage();
       resultMessages.addAll(ret.message());
-      return new InterpreterResult(ret.code(), resultMessages);
+
+      for (Paragraph p : userParagraphMap.values()) {
+        p.setText(getText());
+      }
+
+      InterpreterResult res = new InterpreterResult(ret.code(), resultMessages);
+
+      Paragraph p = userParagraphMap.get(getUser());
+      if (null != p) {
+        p.setResult(res);
+        p.settings.setParams(settings.getParams());
+      }
+
+      return res;
     } finally {
       InterpreterContext.remove();
     }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/e673949c/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
index 362ddcd..6f36643 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/socket/Message.java
@@ -55,6 +55,9 @@ public class Message {
 
     NOTE_RENAME,
 
+    UPDATE_PERSONALIZED_MODE, // [c-s] update personalized mode (boolean)
+                              // @param note id and boolean personalized mode value
+
     FOLDER_RENAME,
 
     RUN_PARAGRAPH,    // [c-s] run paragraph