Package com.google.wave.api

Examples of com.google.wave.api.OperationRequest


    // Append the text markup to the newly created blip.
    DocInitialization blipInitContent = new DocInitializationBuilder().build();
    ConversationBlip markupBlip = conversation.getRootThread().appendBlip(blipInitContent);

    OperationRequest operation = operationRequest(OperationType.DOCUMENT_APPEND_MARKUP,
        markupBlip.getId(), Parameter.of(ParamsProperty.CONTENT, markup));

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
View Full Code Here


    ObservableConversation conversation =
        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    // Append the inline blip to the root blip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    OperationRequest operation = operationRequest(OperationType.DOCUMENT_APPEND_INLINE_BLIP,
        rootBlipId, Parameter.of(ParamsProperty.BLIP_DATA, blipData));

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
View Full Code Here

        new ApiView(conversation.getRootThread().getFirstBlip().getContent(), wavelet);
    int insertAtXmlLocation = apiView.transformToXmlOffset(insertAtApiLocation);

    // Append the inline blip to the root blip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    OperationRequest operation = operationRequest(OperationType.DOCUMENT_INSERT_INLINE_BLIP,
        rootBlipId, Parameter.of(ParamsProperty.BLIP_DATA, blipData),
        Parameter.of(ParamsProperty.INDEX, insertAtApiLocation));

    service.execute(operation, context, ALEX);
View Full Code Here

    // Append the inline blip to the root blip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    Element inlineBlipElement = new Element(ElementType.INLINE_BLIP);
    inlineBlipElement.setProperty("id", firstInlineBlip.getId());
    OperationRequest operation = operationRequest(
        OperationType.DOCUMENT_INSERT_INLINE_BLIP_AFTER_ELEMENT, rootBlipId,
        Parameter.of(ParamsProperty.BLIP_DATA, blipData),
        Parameter.of(ParamsProperty.ELEMENT, inlineBlipElement));

    service.execute(operation, context, ALEX);
View Full Code Here

    ObservableConversation conversation =
      context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    // Delete the root blip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    OperationRequest operation = operationRequest(OperationType.BLIP_DELETE, rootBlipId);

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
    assertFalse(response.isError());
View Full Code Here

    ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create());
    context = new OperationContextImpl(waveletProvider, converter, conversationUtil);

    operation =
        new OperationRequest(OperationType.ROBOT_CREATE_WAVELET.method(), OPERATION_ID,
            Parameter.of(ParamsProperty.WAVELET_DATA, waveletData),
            Parameter.of(ParamsProperty.MESSAGE, MESSAGE));
  }
View Full Code Here

        rootBlip.getContent(), XmlStringBuilder.createText(INITIAL_CONTENT));
  }

  public void testSetTitle() throws Exception {
    String title = "Some title";
    OperationRequest operation =
        new OperationRequest(OperationType.WAVELET_SET_TITLE.method(),
            WAVELET_ID.getId(),
            Parameter.of(
                ParamsProperty.WAVELET_TITLE, title),
            Parameter.of(
                ParamsProperty.WAVE_ID, LegacyIdSerialiser.INSTANCE.serialiseWaveId(WAVE_ID)),
View Full Code Here

    // Confirm alex is not on wave prior to operation.
    Set<ParticipantId> participants = conversation.getParticipantIds();
    assertFalse("Alex should not be a participant on wavelet prior to operation to add him.",
        participants.contains(ALEX));

    OperationRequest operation =
        operationRequest(OperationType.WAVELET_ADD_PARTICIPANT_NEWSYNTAX, rootBlipId,
            Parameter.of(ParamsProperty.PARTICIPANT_ID,ALEX.getAddress()));

    service.execute(operation, context, ROBOT);
View Full Code Here

    // Confirm robot is on wave prior to operation to re-add it.
    Set<ParticipantId> participants = conversation.getParticipantIds();
    assertTrue("Robot should be a participant on wavelet prior to test operation to add it.",
        participants.contains(ROBOT));

    OperationRequest operation =
        operationRequest(OperationType.WAVELET_ADD_PARTICIPANT_NEWSYNTAX, rootBlipId,
            Parameter.of(ParamsProperty.PARTICIPANT_ID, ROBOT.getAddress()));

    try {
      service.execute(operation, context, ROBOT);
View Full Code Here

    // Confirm alex is not on wave prior to operation.
    Set<ParticipantId> participants = conversation.getParticipantIds();
    assertFalse("Alex should not be a participant on wavelet prior to operation to add him.",
        participants.contains(ALEX));

    OperationRequest operation =
        new OperationRequest(OperationType.WAVELET_ADD_PARTICIPANT_NEWSYNTAX.method(), OPERATION_ID,
            s(WAVE_ID), s(WAVELET_ID), rootBlipId, Parameter.of(ParamsProperty.PARTICIPANT_ID,
                ALEX.getAddress()));

    service.execute(operation, context, ROBOT);

    // Verify Alex is now a participant on the wave.
    participants = conversation.getParticipantIds();
    assertTrue("Alex should now be a participant on the wavelet.", participants.contains(ALEX));

    // Attempt to remove Alex.
    OperationRequest operation2 =
        operationRequest(OperationType.WAVELET_REMOVE_PARTICIPANT_NEWSYNTAX, OPERATION2_ID,
            rootBlipId, Parameter.of(ParamsProperty.PARTICIPANT_ID, ALEX.getAddress()));

    service.execute(operation2, context, ROBOT);
View Full Code Here

TOP

Related Classes of com.google.wave.api.OperationRequest

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.