Package org.waveprotocol.wave.model.supplement

Examples of org.waveprotocol.wave.model.supplement.SupplementedWave


        new TestingWaveletData(WAVE_ID, CONVERSATION_WAVELET_ID, PARTICIPANT, true);
    ObservableWaveletData observableWaveletData = data.copyWaveletData().get(0);
    ObservableWavelet wavelet = OpBasedWavelet.createReadOnly(observableWaveletData);
    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true);

    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals("", digest.getTitle());
    assertEquals(digest.getBlipCount(), 0);
View Full Code Here


    data.appendBlipWithText(title);
    ObservableWaveletData observableWaveletData = data.copyWaveletData().get(0);
    ObservableWavelet wavelet = OpBasedWavelet.createReadOnly(observableWaveletData);
    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true);

    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals(title, digest.getTitle());
    assertEquals(1, digest.getBlipCount());
View Full Code Here

    data.appendBlipWithText("blip number 3");
    ObservableWaveletData observableWaveletData = data.copyWaveletData().get(0);
    ObservableWavelet wavelet = OpBasedWavelet.createReadOnly(observableWaveletData);
    ObservableConversationView conversation = conversationUtil.buildConversation(wavelet);

    SupplementedWave supplement = mock(SupplementedWave.class);
    when(supplement.isUnread(any(ConversationBlip.class))).thenReturn(true, true, false);
    Digest digest = digester.generateDigest(conversation, supplement, observableWaveletData);

    assertEquals(3, digest.getBlipCount());
    assertEquals(2, digest.getUnreadCount());
  }
View Full Code Here

      ParticipantId participant) throws InvalidRequestException {

    String modifyHow = OperationUtil.getRequiredParameter(operation, ParamsProperty.MODIFY_HOW);
    String blipId = OperationUtil.getOptionalParameter(operation, ParamsProperty.BLIP_ID);

    SupplementedWave supplement = buildSupplement(operation, context, participant);

    if (modifyHow.equals(ModifyHowType.MARK_AS_READ.getValue())) {
      if (blipId == null || blipId.isEmpty()) {
        supplement.markAsRead();
      } else {
        ObservableConversation conversation =
            context.openConversation(operation, participant).getRoot();
        ConversationBlip blip = conversation.getBlip(blipId);
        supplement.markAsRead(blip);
      }
    } else if (modifyHow.equals(ModifyHowType.MARK_AS_UNREAD.getValue())) {
      supplement.markAsUnread();
    } else {
      throw new UnsupportedOperationException("Unsupported folder action: " + modifyHow);
    }
    // Construct empty response.
    Map<ParamsProperty, Object> data = Maps.newHashMap();
View Full Code Here

    }
    OpBasedWavelet udw = context.openWavelet(waveId, udwId, participant);

    PrimitiveSupplement udwState = WaveletBasedSupplement.create(udw);

    SupplementedWave supplement =
        SupplementedWaveImpl.create(udwState, conversationView, participant, DefaultFollow.ALWAYS);
    return supplement;
  }
View Full Code Here

        udw = waveletData;
      }
    }

    ObservableWaveletData convWavelet = root != null ? root : other;
    SupplementedWave supplement = null;
    ObservableConversationView conversations = null;
    if (convWavelet != null) {
      OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(convWavelet);
      if (WaveletBasedConversation.waveletHasConversation(wavelet)) {
        conversations = conversationUtil.buildConversation(wavelet);
View Full Code Here

          udw = waveletData;
        }
      }

      ObservableWaveletData convWavelet = root != null ? root : other;
      SupplementedWave supplement = null;
      ObservableConversationView conversations = null;
      if (convWavelet != null) {
        OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(convWavelet);
        if (WaveletBasedConversation.waveletHasConversation(wavelet)) {
          conversations = conversationUtil.buildConversation(wavelet);
View Full Code Here

      ParticipantId participant) throws InvalidRequestException {

    String modifyHow = OperationUtil.getRequiredParameter(operation, ParamsProperty.MODIFY_HOW);
    String blipId = OperationUtil.getOptionalParameter(operation, ParamsProperty.BLIP_ID);

    SupplementedWave supplement = buildSupplement(operation, context, participant);

    if (modifyHow.equals(ModifyHowType.MARK_AS_READ.getValue())) {
      if (blipId == null || blipId.isEmpty()) {
        supplement.markAsRead();
      } else {
        ObservableConversation conversation =
            context.openConversation(operation, participant).getRoot();
        ConversationBlip blip = conversation.getBlip(blipId);
        supplement.markAsRead(blip);
      }
    } else if (modifyHow.equals(ModifyHowType.MARK_AS_UNREAD.getValue())) {
      supplement.markAsUnread();
    } else {
      throw new UnsupportedOperationException("Unsupported folder action: " + modifyHow);
    }
    // Construct empty response.
    Map<ParamsProperty, Object> data = Maps.newHashMap();
View Full Code Here

    }
    OpBasedWavelet udw = context.openWavelet(waveId, udwId, participant);

    PrimitiveSupplement udwState = WaveletBasedSupplement.create(udw);

    SupplementedWave supplement =
      SupplementedWaveImpl.create(udwState, conversationView, participant, DefaultFollow.ALWAYS);
    return supplement;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.supplement.SupplementedWave

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.