Package org.waveprotocol.wave.model.waveref

Examples of org.waveprotocol.wave.model.waveref.WaveRef


   *
   * @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;
  }
View Full Code Here


      }
    }
  }

  private void createInsertAttachmentButton(ToolbarView toolbar, final ParticipantId user) {
    WaveRef waveRef = WaveRef.of(waveId);
    Preconditions.checkState(waveRef != null);
    final String waveRefToken = URL.encode(GwtWaverefEncoder.encodeToUriQueryString(waveRef));

    new ToolbarButtonViewBuilder().setIcon(css.insertAttachment()).setTooltip("Insert attachment")
        .applyTo(toolbar.addClickButton(), new ToolbarClickButton.Listener() {
View Full Code Here

      waveletId = DualIdSerialiser.MODERN.deserialiseWaveletId(blip.getConversation().getId());
    } catch (InvalidIdException e) {
      Window.alert(messages.invalidWaveletId(blip.getConversation().getId()));
      return;
    }
    WaveRef waveRef = WaveRef.of(waveId, waveletId, blip.getId());
    final String waveRefStringValue =
        WaveRefConstants.WAVE_URI_PREFIX + GwtWaverefEncoder.encodeToUriPathSegment(waveRef);
    BlipLinkPopupView blipLinkPopupView = blipUi.createLinkPopup();
    blipLinkPopupView.setLinkInfo(waveRefStringValue);
    blipLinkPopupView.show();
View Full Code Here

    } catch (InvalidIdException e) {
      Window.alert(
          "Unable to link to this blip, invalid conversation id " + blip.getConversation().getId());
      return;
    }
    WaveRef waveRef = WaveRef.of(waveId, waveletId, blip.getId());
    final String waveRefStringValue =
        WaveRefConstants.WAVE_URI_PREFIX + GwtWaverefEncoder.encodeToUriPathSegment(waveRef);
    BlipLinkPopupView blipLinkPopupView = blipUi.createLinkPopup();
    blipLinkPopupView.setLinkInfo(waveRefStringValue);
    blipLinkPopupView.show();
View Full Code Here

    }

    // If it's a wave link, use # for local navigation
    if (uri.startsWith(WaveRefConstants.WAVE_URI_PREFIX)) {
      try {
        WaveRef ref = GwtWaverefEncoder.decodeWaveRefFromPath(
            uri.substring(WaveRefConstants.WAVE_URI_PREFIX.length()));

        return "#" + GwtWaverefEncoder.encodeToUriPathSegment(ref);

      } catch (InvalidWaveRefException e) {
View Full Code Here

    // Try to interpret a wave URI or naked waveid/waveref
    try {
      // NOTE(danilatos): Pasting in the raw serialized form of a wave ref is
      // not supported here. In practice this doesn't really matter.
      WaveRef ref;
      if (WaveRefConstants.WAVE_SCHEME.equals(scheme)) {
        ref = GwtWaverefEncoder.decodeWaveRefFromPath(parts[1]);
      } else if (scheme == null) {
        ref = inferWaveRef(rawLinkValue);
      } else if (WaveRefConstants.WAVE_SCHEME_OLD.equals(scheme)) {
View Full Code Here

    // This path will look like "/example.com/w+abc123/foo.com/conv+root
    // Strip off the leading '/'.
    String urlPath = req.getPathInfo().substring(1);

    // Extract the name of the wavelet from the URL
    WaveRef waveref;
    try {
      waveref = JavaWaverefEncoder.decodeWaveRefFromPath(urlPath);
    } catch (InvalidWaveRefException e) {
      // The URL contains an invalid waveref. There's no document at this path.
      response.sendError(HttpServletResponse.SC_NOT_FOUND);
View Full Code Here

    String fileName = request.getParameter("fileName");
    return fileName != null ? fileName : "";
  }

  private 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;
  }
View Full Code Here

      }
    }
  }

  private void createInsertAttachmentButton(ToolbarView toolbar, final ParticipantId user) {
    WaveRef waveRef = WaveRef.of(waveId);
    Preconditions.checkState(waveRef != null);
    final String waveRefToken = URL.encode(GwtWaverefEncoder.encodeToUriQueryString(waveRef));

    new ToolbarButtonViewBuilder().setIcon(css.insertAttachment()).setTooltip("Insert attachment")
        .applyTo(toolbar.addClickButton(), new ToolbarClickButton.Listener() {
View Full Code Here

  public static String linkValueFromWaveValue(String rawString) throws InvalidWaveRefException {
    if (rawString == null) {
      return null;
    }
    WaveRef ref;
    try {
      ref = WaveRef.of(WaveId.checkedDeserialise(rawString));
    } catch (InvalidIdException e) {
      // Let's try decoding it as a wave ref instead
      ref = JavaWaverefEncoder.decodeWaveRefFromPath(rawString);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.waveref.WaveRef

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.