     @rtm.getFile file.result.items.first.id
 
     @rtm.on 'FileLoaded', (doc) =>
-      @rtm.create 'string', doc, 'ACET', 'OSMAN'
-      @rtm.create 'list',   doc, 'LIST', [ 1, 2, 3, 4 ]
-      @rtm.create 'map',    doc, 'MAP',  { a: 1, b: 2 }
-
-      string = @rtm.getFromModel doc, 'ACET'
-      list   = @rtm.getFromModel doc, 'LIST'
-      map    = @rtm.getFromModel doc, 'MAP'
-
-      log '............', string.getText()
-      log '////////////', map.items(), map.values()
-      log '++++++++++++', list.asArray()
+      @realTimeDoc = doc
+
+      if @amIHost
+        @writeWorkspaceSnapshot()
+      else
+        @getWorkspaceSnaphot()
+        @rtm.on 'MapValueChanged', (map, v) ->
+          log '.................', map, v
+
+
+  writeWorkspaceSnapshot: ->
+    return  unless @realTimeDoc
+
+    @rtm.create 'map', @realTimeDoc, 'snapshot', @createWorkspaceSnapshot()
+
+
+  getWorkspaceSnaphot: ->
+    return  unless @realTimeDoc
+
+    snapshot = @rtm.getFromModel @realTimeDoc, 'snapshot'
+    log 'workspace snapshot is', snapshot.values()
+    return snapshot
+
+
+  createWorkspaceSnapshot: ->
+    panes = {}
+
+    @forEachSubViewInIDEViews_ (pane) ->
+      if pane.options.paneType is 'editor'
+        unless pane.file.path is 'localfile:/Untitled.txt'
+          data = pane.serialize()
+          panes[data.hash] = data
+      else
+        data = pane.serialize()
+        panes[data.hash] = data
+
+    return panes
+
+
+  handleChange: (change) ->
+    return  unless @realTimeDoc
+
+    if change.type in [ 'NewPaneCreated', 'PaneRemoved' ]
+      if @amIHost
+        log 'change detected', change.context
+        @writeWorkspaceSnapshot()


    @generatedPanes or= {}
    @generatedPanes[view.hash] = yes
    @serialize()

    view.on 'ChangeHappened', (change) =>
      @logChange change


  forEachSubViewInIDEViews_: (callback = noop, paneType) ->

      ideViewLength  = 0
      ideViewLength += ideView.tabView.panes.length  for ideView in @ideViews
      delete @generatedPanes[pane.view.hash]

      @statusBar.showInformation()  if ideViewLength is 0

    ideView.tabView.on 'PaneAdded', (pane) =>
      @registerPane pane

    ideView.on 'ChangeHappened', (change) =>
      @handleChange change

  registerPane: (pane) ->
    {view} = pane
