• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IdConstants类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.waveprotocol.wave.model.id.IdConstants的典型用法代码示例。如果您正苦于以下问题:Java IdConstants类的具体用法?Java IdConstants怎么用?Java IdConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IdConstants类属于org.waveprotocol.wave.model.id包,在下文中一共展示了IdConstants类的38个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAttachmentDocs

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private Map<String, GoogleDocument> getAttachmentDocs(List<GoogleDocument> docs) {
  Map<String, GoogleDocument> out = Maps.newHashMap();
  for (GoogleDocument doc : docs) {
    String docId = doc.getDocumentId();
    Assert.check(!out.containsKey(docId), "Duplicate doc id %s: %s", docId, docs);
    if (IdUtil.isAttachmentDataDocument(docId)) {
      String[] components = IdUtil.split(docId);
      if (components == null) {
        throw new RuntimeException("Failed to split attachment doc id: " + docId);
      }
      if (components.length != 2) {
        throw new RuntimeException("Bad number of components in attachment doc id " + docId
            + ": " + Arrays.toString(components));
      }
      if (!IdConstants.ATTACHMENT_METADATA_PREFIX.equals(components[0])) {
        throw new RuntimeException("Bad first component in attachment doc id " + docId
            + ": " + Arrays.toString(components));
      }
      String attachmentId = components[1];
      out.put(attachmentId, doc);
    }
  }
  return ImmutableMap.copyOf(out);
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:25,
代码来源:ImportWaveletProcessor.java

示例2: extractTitle

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
static String extractTitle(WaveletDataImpl conv) {
  checkNotNull(conv, "Null conv");
  Document manifest = getDoc(conv, IdConstants.MANIFEST_DOCUMENT_ID);
  if (manifest == null) {
    return "";
  }
  E blipElem = DocHelper.getElementWithTagName(manifest, "blip");
  if (blipElem == null) {
    return "";
  }
  String rootBlipId = manifest.getAttribute(blipElem, "id");

  Document rootDoc = getDoc(conv, rootBlipId);
  if (rootDoc == null) {
    return "";
  }

  String title = TitleHelper.extractTitle(rootDoc).trim();
  if (!title.isEmpty()) {
    log.info("Got title");
    return title;
  }
  Range range = TitleHelper.findImplicitTitle(rootDoc);
  log.info("No title, inferring...");
  return DocHelper.getText(rootDoc, range.getStart(), range.getEnd());
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:27,
代码来源:Util.java

示例3: fetchWave

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Fetches and builds the core waveViewImpl state.
 *
 * @param whenReady command to execute when the waveViewImpl is built
 * @param whenError command to execute when error is happened.
 */
private void fetchWave(final Accessor<WaveViewData> whenReady, final Accessor<ReturnStatus> whenError) {
  final Timer timer = Timing.start("StageOneProvider.fetchWave");
  WaveletId udwId = idGenerator.newUserDataWaveletId(signedInUser.getAddress());
  IdFilter filter = IdFilter.of(Collections.singleton(udwId), Collections.singleton(IdConstants.CONVERSATION_WAVELET_PREFIX));
  getViewChannel().fetchWaveView(filter, fromLastRead,
    FragmentRequester.MIN_FETCH_REPLY_SIZE, FragmentRequester.MAX_FETCH_REPLY_SIZE, FragmentRequester.MAX_FETCH_BLIPS_COUNT,
    new ViewChannel.FetchWaveViewCallback() {

    @Override
    public void onWaveViewFetch(WaveViewData waveView) {
      Timing.stop(timer);
      whenReady.use(waveView);
    }

    @Override
    public void onFailure(ReturnStatus status) {
      Timing.stop(timer);
      whenError.use(status);
    }
  });
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:28,
代码来源:StageOneProvider.java

示例4: moveToFolder

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public void moveToFolder(WaveId waveId, String folder, ParticipantId participant)
    throws WaveletStateException, InterruptedException, ExecutionException, InvalidRequestException, OperationException {

  OperationContextImpl context = new OperationContextImpl(waveletProvider,
      converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);

  OpBasedWavelet wavelet = context.openWavelet(waveId,
      WaveletId.of(waveId.getDomain(), IdConstants.CONVERSATION_ROOT_WAVELET), participant);
  ConversationView conversationView = context.getConversationUtil().buildConversation(wavelet);

  WaveletId udwId =
    WaveletId.of(waveId.getDomain(),
        IdUtil.join(IdConstants.USER_DATA_WAVELET_PREFIX, participant.getAddress()));
  OpBasedWavelet udw = context.openWavelet(waveId, udwId, participant);

  PrimitiveSupplement udwState = WaveletBasedSupplement.create(udw);

  SupplementedWave supplement =
    SupplementedWaveImpl.create(udwState, conversationView, participant, DefaultFollow.ALWAYS);
  if ("archive".equals(folder)) {
    supplement.archive();
  } else if ("inbox".equals(folder)) {
    supplement.inbox();
  }
  OperationUtil.submitDeltas(context, waveletProvider, LOGGING_REQUEST_LISTENER);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:27,
代码来源:FolderServlet.java

示例5: waveRef2WaveletName

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Decode wavelet name.
 *
 * @param waveRefStr encoded name.
 * @return WaveletName object.
 */
public static WaveletName waveRef2WaveletName(String waveRefStr) {
  WaveRef waveRef;
  try {
    waveRef = JavaWaverefEncoder.decodeWaveRefFromPath(waveRefStr);
  } catch (InvalidWaveRefException e) {
    LOG.warning("Cannot decode: " + waveRefStr, e);
    return null;
  }

  WaveId waveId = waveRef.getWaveId();
  WaveletId waveletId =
      waveRef.getWaveletId() != null ? waveRef.getWaveletId() : WaveletId.of(waveId.getDomain(),
          IdConstants.CONVERSATION_ROOT_WAVELET);

  WaveletName waveletName = WaveletName.of(waveId, waveletId);
  return waveletName;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:24,
代码来源:AttachmentUtil.java

示例6: doApply

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Applies this operation to a blip by applying its document operation to the blip's content.
 */
@Override
protected void doApply(BlipData blip) throws OperationException {
  // Apply document mutation
  Preconditions.checkNotNull(context, "WaveletOperationContext is null!");
  contentOp.setContext(context);
  blip.getContent().consume(contentOp);

  if (isWorthyOfAttribution(blip.getId())) {
    blip.onRemoteContentModified();
  }

  if (IdConstants.TAGS_DOCUMENT_ID.equals(blip.getId())) {
    notifyTagsModified(blip);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:19,
代码来源:BlipContentOperation.java

示例7: getStartVersion

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Gets start version of segment, from which changes are displayed.
 *
 * @param waveletId the Id of wavelet.
 * @param segmentId the Id of segment.
 * @param segmentCreationVersion the creation segment version.
 * @return last look version of segment or {@link #NO_VERSION}.
 */
public long getStartVersion(WaveletId waveletId, SegmentId segmentId, long segmentCreationVersion) {
  long version = PrimitiveSupplement.NO_VERSION;
  if (supplement != null) {
    if (segmentId.isIndex()) {
      version = getLookWaveletVersion(waveletId);
    } else if (segmentId.isParticipants()) {
      version = getLookParticipantsVersion(waveletId, segmentCreationVersion);
    } else if (segmentId.isBlip()) {
      if (IdConstants.TAGS_DOCUMENT_ID.equals(segmentId.getBlipId())) {
        version = getLookTagsVersion(waveletId, segmentCreationVersion);
      } else {
        version = getLookBlipVersion(waveletId, segmentId.getBlipId(), segmentCreationVersion);
      }
    } else {
      Preconditions.illegalArgument("Invalid segment " + segmentId.toString());
    }
  }
  return version != PrimitiveSupplement.NO_VERSION && version != 0 && version >= segmentCreationVersion ? version : NO_VERSION;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:28,
代码来源:StartVersionHelper.java

示例8: screenPositionToScrollPosition

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
protected int screenPositionToScrollPosition(ScreenPosition screenPosition) {
  int scrollPosition = -1;
  String blipId = screenPosition.getBlipId();
  switch (blipId) {
    case IdConstants.FIRST_BLIP_ID:
      scrollPosition = 0;
      break;
    case IdConstants.LAST_BLIP_ID:
      scrollPosition = scroller.getMaxPosition();
      break;
    default:
      ConversationBlip blip = conversationView.getRoot().getBlip(blipId);
      if (blip != null) {
        T blipElement = renderer.getElementByBlip(blip);
        if (blipElement != null) {
          scrollPosition = measurer.getTop(blipElement) + scroller.getPosition()
              - scroller.getPanelTop();
        }  
      }
  }
  return scrollPosition;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:23,
代码来源:ScreenPositionScrollerImpl.java

示例9: getScreenPosition

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public ScreenPosition getScreenPosition() {
  String topBlipId = null;
  int paragraphOffset = -1;
  double relativeOffset = 0;
  if (scroller.isAtBegin()) {
    topBlipId = IdConstants.FIRST_BLIP_ID;
  } else if (scroller.isAtEnd()) {
    topBlipId = IdConstants.LAST_BLIP_ID;
  } else {
    ConversationThread rootThread = conversationView.getRoot().getRootThread();
    ConversationBlip topBlip = findScreenPositionBlip(rootThread, scroller.getPanelTop());
    if (topBlip == null) {
      topBlip = rootThread.getFirstBlip();
    }
    if (topBlip != null) {
      topBlipId = topBlip.getId();
      Pair<Integer, Double> offsets = findScreenPositionOffsets(topBlip, scroller.getPanelTop());
      paragraphOffset = offsets.getFirst();
      relativeOffset = offsets.getSecond();
    }
  }
  return new ScreenPosition(topBlipId, paragraphOffset, relativeOffset);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:25,
代码来源:ScreenPositionDomScroller.java

示例10: screenPositionToScrollPosition

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
protected int screenPositionToScrollPosition(ScreenPosition position) {
  String blipId = position.getBlipId();
  if (blipId.equals(IdConstants.FIRST_BLIP_ID) || blipId.equals(IdConstants.LAST_BLIP_ID)) {
    return super.screenPositionToScrollPosition(position);
  }
  
  int scrollPosition = -1;
  ConversationBlip blip = conversationView.getRoot().getBlip(blipId);
  if (blip != null) {
    Element baseElement = findScreenPositionElement(blip, position.getParagraphOffset());
    double relativeOffset = position.getRelativeOffset();
    int pixelOffset = (int) Math.round(relativeOffset * DomUtil.getElementHeight(baseElement));    
    scrollPosition = baseElement.getAbsoluteTop() + scroller.getPosition() - scroller.getPanelTop()
        + pixelOffset;
  }
  return scrollPosition;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:19,
代码来源:ScreenPositionDomScroller.java

示例11: checkRenderingOrder

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private void checkRenderingOrder(StartPosition position, String correctRenderingOrder) {

    renderer = DynamicTestRenderer.create(0.0, navigator);
    renderer.setScreenDimension(200, 500);
    renderer.init(conversationView);

    String startBlipId = null;
    switch (position) {
      case BEGIN:   startBlipId = IdConstants.FIRST_BLIP_ID;  break;
      case MIDDLE:  startBlipId = getMiddleBlipId();          break;
      case END:     startBlipId = IdConstants.LAST_BLIP_ID;   break;
    }
    ScreenPositionScrollerImpl sps = ScreenPositionScrollerImpl.create(renderer,
        renderer.getScroller(), renderer.getElementMeasurer());
    sps.initialize(new ScreenPosition(startBlipId), conversationView);
    renderer.startRendering(startBlipId);

    List<ConversationBlip> renderedBlips = renderer.getRenderedBlipList();
    String renderingOrder = blipListToNames(renderedBlips);
    assertEquals(correctRenderingOrder, renderingOrder);
    assertEquals(true, checkZIndexesDescending(conversation.getRootThread()));
  }
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:23,
代码来源:DynamicRendererTest.java

示例12: waveRef2WaveletName

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Decode wavelet name.
 *
 * @param waveRefStr encoded name.
 * @return WaveletName object.
 */
public static WaveletName waveRef2WaveletName(String waveRefStr) {
  WaveRef waveRef = null;
  try {
    waveRef = JavaWaverefEncoder.decodeWaveRefFromPath(waveRefStr);
  } catch (InvalidWaveRefException e) {
    LOG.warning("Cannot decode: " + waveRefStr, e);
    return null;
  }

  WaveId waveId = waveRef.getWaveId();
  WaveletId waveletId =
      waveRef.getWaveletId() != null ? waveRef.getWaveletId() : WaveletId.of(waveId.getDomain(),
          IdConstants.CONVERSATION_ROOT_WAVELET);

  WaveletName waveletName = WaveletName.of(waveId, waveletId);
  return waveletName;
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:24,
代码来源:AttachmentUtil.java

示例13: createContainer

点赞 3

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Creates and stores a conversation container. If the container has a
 * conversation then initializes that too.
 */
private ConversationContainer createContainer(ObservableWavelet wavelet) {
  ObservableDocument manifestDoc = wavelet.getDocument(IdConstants.MANIFEST_DOCUMENT_ID);
  DocEventRouter router = DefaultDocEventRouter.create(manifestDoc);
  ObservableSingleton<DocumentBasedManifest, Void> manifestContainer =
      DocumentBasedSingleton.create(router, manifestDoc.getDocumentElement(),
         DocumentBasedManifest.MANIFEST_TOP_TAG, DocumentBasedManifest.FACTORY);
  ConversationContainer container = new ConversationContainer(wavelet, manifestContainer);
  manifestContainer.addListener(container);
  containers.put(wavelet, container);

  WaveletBasedConversation conversation = container.getConversation();
  if (conversation != null) {
    conversations.put(wavelet, conversation);
    triggerOnConversationAdded(conversation);
  }

  return container;
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:23,
代码来源:WaveBasedConversationView.java

示例14: objectIdFromWaveletId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public static SlobId objectIdFromWaveletId(WaveletId waveletId) {
  String[] tokens = splitTokens(waveletId.getId());
  Preconditions.checkArgument(tokens.length == 2,
      "Wavelet id does not consist of two tokens: %s", waveletId);
  if (IdConstants.CONVERSATION_WAVELET_PREFIX.equals(tokens[0])
      || IdConstants.USER_DATA_WAVELET_PREFIX.equals(tokens[0])) {
    return new SlobId(tokens[1]);
  } else {
    throw new RuntimeException("Unknown prefix in wavelet id: " + waveletId);
  }
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:12,
代码来源:IdHack.java

示例15: onWaveViewDataCreated

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private void onWaveViewDataCreated(Accessor<StageOne> whenReady) {
  // Initialize base segments.
  initializeBlip(IdConstants.MANIFEST_DOCUMENT_ID);
  initializeBlip(IdConstants.TAGS_DOCUMENT_ID);

  // Initialize the conversation.
  getQuasiConversationView().initialize(getConversationView(), getSupplementWave());
  if (newWave) {
    Conversation conversation = getQuasiConversationView().createRoot();

    // For a new wave, initial state comes from local initialization.
    conversation.getRootThread().appendBlip();

    // Adds any initial participant to the new wave.
    conversation.addParticipantIds(participants);
  }

  // Process diff operations on manifest.
  processDiffsOnBlip(IdConstants.MANIFEST_DOCUMENT_ID);

  // Look unlooked blips.
  getBlipReader().look(getQuasiConversationView());

  // Start rendering.
  startRendering();

  // Process diff operations on participants and tags.
  processDiffsOnParticipants();
  processDiffsOnBlip(IdConstants.TAGS_DOCUMENT_ID);

  // Wait for complete of rendering.
  waitForRenderingFinished(whenReady);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:34,
代码来源:StageOneProvider.java

示例16: updateHtml

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private void updateHtml(WaveId waveId) throws IOException {
  LOG.info("Rendering HTML of wave " + waveId.serialise());
  String html = fetchRenderedWavelet(waveId, WaveletId.of(waveDomain, IdConstants.CONVERSATION_ROOT_WAVELET),
      null, sharedParticipant);
  if (html == null) {
    html = HtmlRenderer.NO_CONVERSATIONS;
  }
  waveHtmlStore.writeHtml(waveId, html);
  LOG.info("HTML of wave " + waveId.serialise() + " was rendered");
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:11,
代码来源:WaveHtmlRendererImpl.java

示例17: buildUserDataWaveletId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Builds user data wavelet id.
 */
public static WaveletId buildUserDataWaveletId(ParticipantId participant, String domain) {
  WaveletId udwId =
      WaveletId.of(domain,
          IdUtil.join(IdConstants.USER_DATA_WAVELET_PREFIX, participant.getAddress()));
  return udwId;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:ServiceUtil.java

示例18: setSeenVersion

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public void setSeenVersion(WaveletName waveletName, ParticipantId participant)
  throws WaveletStateException, InterruptedException, ExecutionException,
  InvalidRequestException, WaveServerException, OperationException {

  OperationContextImpl context = new OperationContextImpl(waveletProvider,        converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);

  OpBasedWavelet udw = context.openWavelet(waveletName.waveId, waveletName.waveletId, participant);
  PrimitiveSupplement udwState = WaveletBasedSupplement.create(udw);

  WaveletId rootWavelet = WaveletId.of(waveletName.waveId.getDomain(), IdConstants.CONVERSATION_ROOT_WAVELET);
  HashedVersion seenVersion = udwState.getSeenVersion(rootWavelet);
  if (seenVersion.getVersion() == 0) {
    long lastReadVersion = PrimitiveSupplement.NO_VERSION;
    for (String blipId : udwState.getReadBlips(rootWavelet)) {
      long version = udwState.getLastReadBlipVersion(rootWavelet, blipId);
      if (version > lastReadVersion) {
        lastReadVersion = version;
      }
    }
    if (lastReadVersion != PrimitiveSupplement.NO_VERSION) {
      seenVersion = waveletProvider.getNearestHashedVersion(WaveletName.of(
          waveletName.waveId, rootWavelet), lastReadVersion);
      if (seenVersion.getVersion() != 0) {
        LOG.info("Set initial seen on " + waveletName.toString() + " to " + seenVersion.toString());
        udwState.setSeenVersion(rootWavelet, seenVersion);
      }
    }
  }

  OperationUtil.submitDeltas(context, waveletProvider, LOGGING_REQUEST_LISTENER);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:32,
代码来源:InitSeensWavelet.java

示例19: buildUserDataWaveletId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Builds user data wavelet id.
 */
public static WaveletId buildUserDataWaveletId(ParticipantId participant, String domain) {
  WaveletId udwId =
    WaveletId.of(domain,
        IdUtil.join(IdConstants.USER_DATA_WAVELET_PREFIX, participant.getAddress()));
  return udwId;
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:OperationUtil.java

示例20: createContainer

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Creates and stores a conversation container. If the container has a
 * conversation then initializes that too.
 */
private ConversationContainer createContainer(ObservableWavelet wavelet) {
  Timer timer = Timing.start("WaveBasedConversationView.createContainer");
  try {
    Blip manifestBlip = wavelet.getBlip(IdConstants.MANIFEST_DOCUMENT_ID);
    if (manifestBlip == null) {
      manifestBlip = wavelet.createBlip(IdConstants.MANIFEST_DOCUMENT_ID);
    }
    ObservableDocument manifestDoc = (ObservableDocument)manifestBlip.getDocument();
    DocEventRouter router = DefaultDocEventRouter.create(manifestDoc);
    ObservableSingleton<DocumentBasedManifest, Void> manifestContainer =
        DocumentBasedSingleton.create(router, manifestDoc.getDocumentElement(),
           DocumentBasedManifest.MANIFEST_TOP_TAG, DocumentBasedManifest.FACTORY);
    ConversationContainer container = new ConversationContainer(wavelet, manifestContainer);
    manifestContainer.addListener(container);
    containers.put(wavelet, container);

    WaveletBasedConversation conversation = container.getConversation();
    if (conversation != null) {
      conversations.put(wavelet, conversation);
      triggerOnConversationAdded(conversation);
    }
    return container;
  } finally {
    Timing.stop(timer);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:31,
代码来源:WaveBasedConversationView.java

示例21: getDataDocument

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public ObservableDocument getDataDocument(String name) {
  if (IdUtil.isBlipId(name)) {
    Preconditions.illegalArgument("Cannot fetch blip document " + name + " as a data document");
  } else if (IdConstants.MANIFEST_DOCUMENT_ID.equals(name)) {
    Preconditions.illegalArgument("Cannot fetch conversation manifest as a data document");
  }
  return wavelet.getDocument(name);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:WaveletBasedConversation.java

示例22: getTags

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public ImmutableSet<String> getTags() {
  LazyContentBlipDataImpl blipDoc = blips.get(IdConstants.TAGS_DOCUMENT_ID);
  if (blipDoc != null && blipDoc.isConsistent()) {
    return TagsDocument.getTags(blipDoc.getContent().getMutableDocument());
  }
  return ImmutableSet.of();
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:WaveletFragmentDataImpl.java

示例23: getTags

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public ImmutableSet<String> getTags() {
  BlipData blipDoc = blips.get(IdConstants.TAGS_DOCUMENT_ID);
  if (blipDoc != null) {
    return TagsDocument.getTags(blipDoc.getContent().getMutableDocument());
  }
  return ImmutableSet.of();
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:WaveletDataImpl.java

示例24: getTags

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public ImmutableSet<String> getTags() {
  RawBlipData blipDoc = getBlip(IdConstants.TAGS_DOCUMENT_ID);
  if (blipDoc == null) {
    return ImmutableSet.of();
  }
  return TagsDocument.getTags(blipDoc.getContent().getMutableDocument());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:DataUtil.java

示例25: addTag

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addTag(String tag) {
  TagsDocument doc = new TagsDocument(getDocument(IdConstants.TAGS_DOCUMENT_ID));
  Object element = doc.addTag(tag);
  if (element != null) {
    doc.handleInsertedElement(element);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:OpBasedWavelet.java

示例26: removeTag

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void removeTag(String tag) {
  TagsDocument doc = new TagsDocument(getDocument(IdConstants.TAGS_DOCUMENT_ID));
  Object element = doc.deleteTag(tag);
  if (element != null) {
    doc.handleDeletedElement(element);
  }
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:10,
代码来源:OpBasedWavelet.java

示例27: getBlip

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * @return the blip by its id.
 *
 * @param blipId id to search the blip
 */
protected ConversationBlip getBlip(String blipId) {
  if (blipId == null || conversation == null) {
    return null;
  }
  switch (blipId) {
    case IdConstants.FIRST_BLIP_ID:
      return navigator.getFirstBlip(conversation.getRootThread());
    case IdConstants.LAST_BLIP_ID:
      return navigator.getLastBlipInThreadTree(conversation.getRootThread(), true);
  }
  return conversation.getBlip(blipId);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:18,
代码来源:DynamicRendererImpl.java

示例28: setUp

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public void setUp() {
  WaveId waveId = WaveId.of("example.com", "c+123");
  WaveletId waveletId = WaveletId.of("example.com", IdConstants.CONVERSATION_ROOT_WAVELET);
  wavelet = new WaveletDataImpl(waveletId, CREATOR, 0L, 0L,
      HashedVersion.unsigned(0), 0L, waveId,
      BasicFactories.pluggableMutableDocumentFactory());
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:9,
代码来源:AddParticipantTest.java

示例29: setUp

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
protected void setUp() {
  MockitoAnnotations.initMocks(this);
  blip = mockBlip();
  timer = new FakeTimerService();
  
  when(root.getId()).thenReturn(WaveletId.of("test", IdConstants.CONVERSATION_ROOT_WAVELET));
  doReturn(Collections.singleton(root)).when(wave).getWavelets();
  target = new LocalSupplementedWaveImpl(timer, wave, supplement);
  target.init();
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:12,
代码来源:LocalSupplementedWaveImplTest.java

示例30: ensureWavesHaveUserDataWavelet

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Ensures that each wave in the current waves view has the user data wavelet by always adding
 *  it to the view.
 */
protected void ensureWavesHaveUserDataWavelet(
    LinkedHashMultimap<WaveId, WaveletId> currentUserWavesView, ParticipantId user) {
  WaveletId udw =
      WaveletId.of(user.getDomain(),
          IdUtil.join(IdConstants.USER_DATA_WAVELET_PREFIX, user.getAddress()));
  Set<WaveId> waveIds = currentUserWavesView.keySet();
  for (WaveId waveId : waveIds) {
    Set<WaveletId> waveletIds = currentUserWavesView.get(waveId);
    waveletIds.add(udw);
  }
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:16,
代码来源:AbstractSearchProviderImpl.java

示例31: fromXml

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
@Override
public Element fromXml(Document doc, E element, Wavelet wavelet) {
  Map<String, String> properties = Maps.newHashMap();

  String attachmentId = doc.getAttribute(element, ATTACHMENT_STR);
  if (attachmentId != null) {
    properties.put(Attachment.ATTACHMENT_ID, attachmentId);
  }
  String caption = getCaption(doc, element);
  if (caption != null) {
    properties.put(Attachment.CAPTION, caption);
  }
  if (wavelet != null && attachmentId != null) {
    Document attachmentDataDoc =
      wavelet.getDocument(IdConstants.ATTACHMENT_METADATA_PREFIX + "+" + attachmentId);
    if (attachmentDataDoc != null) {
      String dataDocument = attachmentDataDoc.toXmlString();
      if (dataDocument != null) {
        properties.put(Attachment.MIME_TYPE, extractValue(dataDocument, MIME_TYPE_PATTERN));
        properties.put(Attachment.ATTACHMENT_URL,
            ElementSerializer.attachmentDownloadHostUrl
            + getAttachmentUrl(dataDocument));
      }
    }
  }
  return new Attachment(properties, null);
}
 

开发者ID:apache,
项目名称:incubator-wave,
代码行数:28,
代码来源:ElementSerializer.java

示例32: createBlipId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private String createBlipId() {
  return joinTokens(IdConstants.BLIP_PREFIX, random64.next(BLIP_ID_LENGTH_CHARS));
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:4,
代码来源:IdHack.java

示例33: joinTokens

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private static String joinTokens(String... tokens) {
  return SimplePrefixEscaper.DEFAULT_ESCAPER.join(IdConstants.TOKEN_SEPARATOR, tokens);
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:4,
代码来源:IdHack.java

示例34: splitTokens

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
private static String[] splitTokens(String s) {
  return SimplePrefixEscaper.DEFAULT_ESCAPER.split(IdConstants.TOKEN_SEPARATOR, s);
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:4,
代码来源:IdHack.java

示例35: waveIdFromConvObjectId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public static WaveId waveIdFromConvObjectId(SlobId convObjectId) {
  return WaveId.of(DOMAIN,
      joinTokens(IdConstants.WAVE_PREFIX, convObjectId.getId()));
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:5,
代码来源:IdHack.java

示例36: convWaveletIdFromObjectId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public static WaveletId convWaveletIdFromObjectId(SlobId objectId) {
  return WaveletId.of(DOMAIN,
      joinTokens(IdConstants.CONVERSATION_WAVELET_PREFIX, objectId.getId()));
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:5,
代码来源:IdHack.java

示例37: udwWaveletIdFromObjectId

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
public static WaveletId udwWaveletIdFromObjectId(SlobId objectId) {
  return WaveletId.of(DOMAIN,
      joinTokens(IdConstants.USER_DATA_WAVELET_PREFIX, objectId.getId()));
}
 

开发者ID:ArloJamesBarnes,
项目名称:walkaround,
代码行数:5,
代码来源:IdHack.java

示例38: getManifestDocument

点赞 2

import org.waveprotocol.wave.model.id.IdConstants; //导入依赖的package包/类
/**
 * Gets the document on which the conversation manifest is constructed.
 */
@VisibleForTesting
static ObservableDocument getManifestDocument(Wavelet wavelet) {
  return wavelet.getDocument(IdConstants.MANIFEST_DOCUMENT_ID);
}
 

开发者ID:jorkey,
项目名称:Wiab.pro,
代码行数:8,
代码来源:WaveletBasedConversation.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)