Package com.google.wave.api.impl

Examples of com.google.wave.api.impl.DocumentModifyAction


  public void execute(
      OperationRequest operation, OperationContext context, ParticipantId participant)
      throws InvalidRequestException {
    String blipId = OperationUtil.getRequiredParameter(operation, ParamsProperty.BLIP_ID);

    DocumentModifyAction modifyAction =
        OperationUtil.getRequiredParameter(operation, ParamsProperty.MODIFY_ACTION);

    OpBasedWavelet wavelet = context.openWavelet(operation, participant);
    ObservableConversation conversation =
        context.openConversation(operation, participant).getRoot();
    Document doc = context.getBlip(conversation, blipId).getContent();

    ApiView view = new ApiView(doc, wavelet);
    DocumentHitIterator hitIterator = getDocumentHitIterator(operation, view);

    switch (modifyAction.getModifyHow()) {
      case ANNOTATE:
        annotate(operation, doc, view, hitIterator, modifyAction);
        break;
      case CLEAR_ANNOTATION:
        clearAnnotation(operation, doc, view, hitIterator, modifyAction);
        break;
      case DELETE:
        delete(operation, view, hitIterator);
        break;
      case INSERT:
        insert(operation, doc, view, hitIterator, modifyAction);
        break;
      case INSERT_AFTER:
        insertAfter(operation, doc, view, hitIterator, modifyAction);
        break;
      case REPLACE:
        replace(operation, doc, view, hitIterator, modifyAction);
        break;
      case UPDATE_ELEMENT:
        updateElement(operation, doc, view, hitIterator, modifyAction);
        break;
      default:
        throw new UnsupportedOperationException(
            "Unsupported ModifyHow " + modifyAction.getModifyHow());
    }
  }
View Full Code Here


        }
        break;
    }

    op.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
        new DocumentModifyAction(
            modifyHow, values, annotationName, elements, bundledAnnotations, useMarkup)));

    iterator.reset();
    return this;
  }
View Full Code Here

TOP

Related Classes of com.google.wave.api.impl.DocumentModifyAction

Copyright © 2018 www.massapicom. 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.