Examples of MutateDocument


Examples of com.google.walkaround.proto.ProtocolWaveletOperation.MutateDocument

   * @return MutateDocument
   */
  public static MutateDocument createMutateDocumentMessage(String blipId, DocOp mutationOp) {
    final ProtocolDocumentOperation mutation = createMutationOp(mutationOp);

    MutateDocument operation = MessageFactoryHelper.createBlipContentMutation();

    operation.setDocumentId(blipId);
    operation.setDocumentOperation(mutation);
    return operation;
  }
View Full Code Here

Examples of com.google.walkaround.proto.ProtocolWaveletOperation.MutateDocument

    long version = intermediateVersion;
    for (String mutation : tailMutations) {
      ProtocolWaveletOperation op = serializer.deserializeDelta(mutation).getOperation();

      if (op.hasMutateDocument()) {
        MutateDocument mutateDocument = op.getMutateDocument();
        String documentId = mutateDocument.getDocumentId();

        DocDiff docDiff = documentDiffMap.get(documentId);
        if (docDiff == null) {
          docDiff = new DocDiff(lastReadVersions.get(documentId, 0L));
          documentDiffMap.put(documentId, docDiff);
        }

        docDiff.addOperation(mutateDocument.getDocumentId(), version,
            OperationFactory.createDocumentOperation(mutateDocument.getDocumentOperation()));
      }

      version++;
    }
View Full Code Here

Examples of com.google.walkaround.proto.ProtocolWaveletOperation.MutateDocument

  private static WaveletBlipOperation createBlipOperation(WaveletOperationContext context,
      ProtocolWaveletOperation message, boolean checkWellFormed)
      throws InvalidInputException {

    if (message.getMutateDocument() != null) {
      MutateDocument opMessage = message.getMutateDocument();
      return new WaveletBlipOperation(opMessage.getDocumentId(), new BlipContentOperation(
          context, createDocumentOperation(opMessage.getDocumentOperation(), checkWellFormed)));
    }
    throw new InvalidInputException("Failed to create blip operation for message " + message);
  }
View Full Code Here

Examples of org.waveprotocol.wave.federation.Proto.ProtocolWaveletOperation.MutateDocument

  public static Set<AttachmentId> getAttachemntIds(ProtocolWaveletDelta delta) {
    Set<AttachmentId> ids = new HashSet<AttachmentId>();
    for (int i=0; i < delta.getOperationCount(); i++) {
      ProtocolWaveletOperation op = delta.getOperation(i);
      if (op.hasMutateDocument()) {
        MutateDocument doc = op.getMutateDocument();
        for (int c = 0; c < doc.getDocumentOperation().getComponentCount(); c++) {
          Component comp = doc.getDocumentOperation().getComponent(c);
          ElementStart start = comp.getElementStart();
          if (ImageConstants.TAGNAME.equals(start.getType())) {
            for (int a=0; a < start.getAttributeCount(); a++) {
              Component.KeyValuePair attr = start.getAttribute(a);
              if (ImageConstants.ATTACHMENT_ATTRIBUTE.equals(attr.getKey())) {
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolWaveletOperation.MutateDocument

      return this;
    }

    /** Builds a {@link MutateDocument} using this builder and a factory. */
    public MutateDocument build(Factory factory) {
      MutateDocument message = factory.create();
      message.setDocumentId(documentId);
      message.setDocumentOperation(documentOperation);
      return message;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.