Add or update a record of collaborator file annotation and request to update UI

@param {string} clientId
@param {string} url
@param {boolean} editing
514169
function(clientId, contextP, url, editing) {
			var peer = this.getPeer(clientId);
			// Peer might be loading. Once it is loaded, this annotation will be automatically updated,
			// so we can safely leave it blank.
			var name = (peer && peer.name) ? peer.name : 'Unknown';
			var color = (peer && peer.color) ? peer.color : '#000000';
			if (url) {
				url = contextP + this.getFileSystemPrefix() + url;
			}
			this.collabFileAnnotations[clientId] = new CollabFileAnnotation(name, color, url, this.projectRelativeLocation(url), editing);
			this._requestFileAnnotationUpdate();
		}
498238
private void _idAdded(String clientId)
  {
    // An id to visit has been added, update our other
    // collections to reflect this.

    // Update the ids collection
    _ids.add(_getIdFromClientId(clientId));

    // Update the unvisited ids collection
    _unvisitedClientIds.add(clientId);

    // Update the subtree ids collection
    _addSubtreeClientId(clientId);
  }
1187388
@Override
  public void updateFromUIDL(UIDL uidl, ApplicationConnection client)
  {

    // This call should be made first.
    // It handles sizes, captions, tooltips, etc. automatically.
    if (client.updateComponent(this, uidl, true))
    {
      // If client.updateComponent returns true there has been no changes and we
      // do not need to update anything.
      return;
    }

    // Save reference to server connection object to be able to send
    // user interaction later
    this.gClient = client;

    // Save the client side identifier (paintable id) for the widget
    paintableId = uidl.getId();

    try
    {
      if (uidl.hasAttribute("escapeHTML")){
        this.escapeHTML = uidl.getBooleanAttribute("escapeHTML");
      }

      UIDL rows = uidl.getChildByTagName("rows");
      if (rows != null)
      {
        // clear all old table cells
        table.removeAllRows();
        highlighted.clear();
        position2id.clear();

        for (int i = 0; i < rows.getChildCount(); i++)
        {
          UIDL row = rows.getChildUIDL(i);
          if ("row".equals(row.getTag()))
          {
            addRow(row, i);
          }
        }
      }// end if rows not null

      // add end events if necessary to have a nicely aligned regular grid
      int maxCellCount = 0;
      for (int row = 0; row < table.getRowCount(); row++)
      {
        maxCellCount = Math.max(maxCellCount, getRealColumnCount(row));
      }

      for (int row = 0; row < table.getRowCount(); row++)
      {
        int isValue = getRealColumnCount(row);

        if (isValue < maxCellCount)
        {
          int diff = maxCellCount - isValue;
          table.setHTML(row, table.getCellCount(row) + diff - 1, "");
        }
      }

    }
    catch (Exception ex)
    {
      Logger.getLogger(VAnnotationGrid.class.getName()).log(Level.SEVERE, ex.getMessage(), ex);
    }
  }
1044448
public void updateServiceInstanceUri(String serviceName, String instanceId, String uri){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.UpdateServiceInstanceUri);

        UpdateServiceInstanceUriProtocol p = new UpdateServiceInstanceUriProtocol(serviceName, instanceId, uri);
        connection.submitRequest(header, p, null);
    }
480958
public void prepareForEdit(
        final String clientId,
        final String editOption,
        final I_CmsSimpleCallback<CmsUUID> callback) {

        CmsRpcAction<CmsUUID> action = new CmsRpcAction<CmsUUID>() {

            @Override
            public void execute() {

                getContainerpageService().prepareForEdit(
                    clientId,
                    editOption,
                    getData().getRpcContext().getPageStructureId(),
                    getData().getRequestParams(),
                    this);
            }

            @Override
            protected void onResponse(CmsUUID result) {

                callback.execute(result);
            }
        };
        action.execute();
    }
1066281
function _onRemoteEdit(event, res) {
        // res = {nodeId, name, value}

        // detach from DOM change events
        if (res.value === "0") {
            Inspector.DOM.off(".EditAgent");
            return;
        }

        // find and store the edited node
        var node = DOMAgent.nodeWithId(res.nodeId);
        node = node.children[0];
        if (!node.location) {
            return;
        }
        _editedNode = node;

        // attach to character data modified events
        Inspector.DOM.on("characterDataModified.EditAgent", _onCharacterDataModified);
    }
699261
function update(client) {
  var id = client.id;

  // Auto-remove when this client is closed.
  client.once('closed', function() {
    remove(id);
  });

  var info = find(client);
  if(!info) {
    log.warn('No ClientInfo object found for client.id=%s', id);
    return;
  }
  info.username = client.username;
}
628985
def edit(self, obj_id, parameters, create_if_not_exists=False):
        
        if create_if_not_exists:
            response = self._client.session.put(
                '{url}/{id}/edit'.format(
                    url=self.endpoint_url, id=obj_id
                ),
                data=parameters
            )
        else:
            response = self._client.session.patch(
                '{url}/{id}/edit'.format(
                    url=self.endpoint_url, id=obj_id
                ),
                data=parameters
            )
        return self.process_response(response)
1028483
def updateFile( dbid, rid, filename, fileAttachmentFieldName, additionalFieldsToSet = nil )
      if dbid and rid and filename and fileAttachmentFieldName
         clearFieldValuePairList
         addFieldValuePair( fileAttachmentFieldName, nil, filename, nil )
         if additionalFieldsToSet and additionalFieldsToSet.is_a?( Hash )
            additionalFieldsToSet.each{ |fieldName,fieldValue|
               addFieldValuePair( fieldName, nil, nil, fieldValue )
            }
         end
         return editRecord( dbid, rid, @fvlist )
      end
      nil
   end
1233218
function updateMulti( viewer ) {
    updateOnce( viewer );

    // Request the next frame, unless we've been closed
    if ( viewer.isOpen() ) {
        viewer._updateRequestId = scheduleUpdate( viewer, updateMulti );
    } else {
        viewer._updateRequestId = false;
    }
}
738665
function layoutEditorUpdateData( divId, paramsObj ) {
	log( "layout-editor", "start '"+JSON.stringify(paramsObj)+"'");
	//alert(divId+": ... try to load "+paramsObj.rowId ); 
	if ( ( paramsObj != null ) && ( paramsObj.page_id != null ) ) {
		moduleConfig[ divId ].page_id = paramsObj.page_id;
	} else { 
		paramsObj = { "page_id":moduleConfig[ divId ].page_id };
	}
	pongLayoutBackendCall( "GET", divId, paramsObj, false );
	log( "layout-editor", "end.");
}
888239
function addFilesToCache(updateObject) {
    var fileList = updateObject.fileList || [],
        filesInSearchScope = updateObject.filesInSearchScope || [],
        i = 0,
        changedFilesAlreadyInList = [],
        newFiles = [];
    for (i = 0; i < fileList.length; i++) {
        // We just add a null entry indicating the precense of the file in the project list.
        // The file will be later read when required.
        projectCache[fileList[i]] = null;
    }

    //Now update the search scope
    function isInChangedFileList(path) {
        return (filesInSearchScope.indexOf(path) !== -1) ? true : false;
    }
    changedFilesAlreadyInList = files ? files.filter(isInChangedFileList) : [];
    function isNotAlreadyInList(path) {
        return (changedFilesAlreadyInList.indexOf(path) === -1) ? true : false;
    }
    newFiles = changedFilesAlreadyInList.filter(isNotAlreadyInList);
    files.push.apply(files, newFiles);
}
199449
function CollabClient(editor, inputManager, fileClient, serviceRegistry, commandRegistry, preferences) {
		mCollabFileCommands.createFileCommands(serviceRegistry, commandRegistry, fileClient);
		this.editor = editor;
		this.inputManager = inputManager;
		this.fileClient = fileClient;
		this.preferences = preferences;
		this.textView = this.editor.getTextView();
		var self = this;
		this.collabMode = false;
		this.clientId = '';
		this.clientDisplayedName = '';
		this.fileClient.addEventListener('Changed', self.sendFileOperation.bind(self));
		this.serviceRegistry = serviceRegistry;
		this.editor.addEventListener('InputContentsSet', function(event) {self.viewInstalled.call(self, event);});
		this.editor.addEventListener('TextViewUninstalled', function(event) {self.viewUninstalled.call(self, event);});
		this.projectSessionID = '';
		this.inputManager.addEventListener('InputChanged', function(e) {
			self.onInputChanged(e)
		});
		this.ot = null;
		this.otOrionAdapter = null;
		this.otSocketAdapter = null;
		this.socketReconnectAttempt = 0;
		this.socketIntentionalyClosing = false;
		this.socketPingTimeout = 0;
		this.awaitingClients = false;
		this.collabFileAnnotations = {};
		// Timeout id to indicate whether a delayed update has already been assigned
		this.collabFileAnnotationsUpdateTimeoutId = 0;
		/**
		 * A map of clientid -> peer
		 * @type {Object.<string, CollabPeer>}
		 */
		this.peers = {};
		this.editing = false;
		this.guid = guid;
		// Initialize current project
		var file = this.inputManager.getInput();
		var metadata = this.inputManager.getFileMetadata();
		if (metadata) {
			this.onInputChanged({
				metadata: metadata,
				input: {
					resource: file
				}
			});
		}
	}
725794
def update(self, resource, id_or_uri):
        
        return self._client.update(resource=resource, uri=id_or_uri)
611634
private void addClient(String id, IClient client) {
        // check to see if the id already exists first
        if (!hasClient(id)) {
            clients.put(id, client);
        } else {
            log.debug("Client id: {} already registered", id);
        }
    }
824371
public BoxRequestsFile.UpdateFile getUpdateRequest(String id) {
        BoxRequestsFile.UpdateFile request = new BoxRequestsFile.UpdateFile(id, getFileInfoUrl(id), mSession);
        return request;
    }
969740
function codecastStream() {
    if (!(jsbin && jsbin.panels && jsbin.panels.panels)) return;
    var editors = jsbin.panels.panels;

    function setCode(event) {
      var panelId = event.type;
      if (!editors[panelId]) return;
      var cursor = editors[panelId].editor.getCursor();
      editors[panelId].setCode(event.data);
      editors[panelId].editor.setCursor(cursor);
    }

    // Update the url when the revision is bumped
    es.addEventListener('bump-revision', function (event) {
      window.location.pathname = cleanPath(event.data) + '/edit';
    });
    // on data, update the panels, which will cause an automatic render
    es.addEventListener('css', setCode);
    es.addEventListener('javascript', setCode);
    es.addEventListener('html', setCode);
  }