Package org.archive.wayback

Examples of org.archive.wayback.ResultURIConverter


    String existingBaseHref = TagMagix.getBaseHref(sb);
    if (existingBaseHref != null) {
      pageUrl = existingBaseHref;
    }
    ResultURIConverter ruc = new SpecialResultURIConverter(uriConverter);
   
    // TODO: forms...?
    String markups[][] = {
        {"FRAME","SRC"},
        {"META","URL"},
View Full Code Here


    // running other rewrites besides JSStringTransformer.  We are
    // only testing JSStringTransformer here.
    JSStringTransformer transformer = new JSStringTransformer();
    renderer.setTransformer(transformer);
   
    ResultURIConverter proxyURIConverter = new ProxyHttpsResultURIConverter();
    ContextResultURIConverterFactory converterFactory =
        new IdentityResultURIConverterFactory(proxyURIConverter);
    renderer.setConverterFactory(converterFactory);
    renderer.setRewriteHttpsOnly(true);
   
View Full Code Here

      }
    });
    EasyMock.expect(request.getRequestURI()).andStubReturn(REQUEST_URI);
    EasyMock.expect(request.getQueryString()).andStubReturn(QUERY_STRING);

    ResultURIConverter archivalToProxy = EasyMock.createMock(ResultURIConverter.class);
    EasyMock.expect(
        archivalToProxy.makeReplayURI("20140430194857",
            "http://www.example.edu/index.php?id=860233"))
        .andReturn("http://got-it-right/");
    HttpServletResponse response = EasyMock.createMock(HttpServletResponse.class);
    response.sendRedirect("http://got-it-right/");
View Full Code Here

   * @return ResultURIConverter for translating URL
   */
  public ResultURIConverter getConverter(String flags) {
    // TODO: caching should be a responsibility of ContextResultURIConverterFactory.
    // but it's a API-breaking change as converters is exposed through getter.
    ResultURIConverter converter = converters.get(flags);
    if(converter == null) {
      converter = makeConverter(flags);
      converters.put(flags,converter);
    }
    return converter;
View Full Code Here

      }
      // XXX do this in getConverter
    if (flags == null) {
        flags = "";
      }
      ResultURIConverter converter = getConverter(flags);
    return converter.makeReplayURI(datespec, absurl);
  }
View Full Code Here

  protected void doRedirection(WaybackRequest wbRequest,
      CaptureSearchResult closest) throws BetterRequestException {
    // redirect to the better version:
    String url = closest.getOriginalUrl();
    String captureDate = closest.getCaptureTimestamp();
    ResultURIConverter uriConverter =
      wbRequest.getAccessPoint().getUriConverter();
    String betterURI = uriConverter.makeReplayURI(captureDate,url);
    throw new BetterRequestException(betterURI);
  }
View Full Code Here

        httpHeadersResource, result, uriConverter, httpHeaderProcessor);

    String charSet = charsetDetector.getCharset(httpHeadersResource,
        decodedResource, wbRequest);

    ResultURIConverter pageConverter = uriConverter;
    if (pageConverterFactory != null) {
      // XXX: ad-hoc code - ContextResultURIConverterFactory should take ResultURIConverter
      // as argument, so that it can simply wrap the original.
      String replayURIPrefix = (uriConverter instanceof ArchivalUrlResultURIConverter ?
          ((ArchivalUrlResultURIConverter)uriConverter).getReplayURIPrefix() : "");
      ResultURIConverter ruc = pageConverterFactory.getContextConverter(replayURIPrefix);
      if (ruc != null)
        pageConverter = ruc;
    }
    // Load content into an HTML page, and resolve load-time URLs:
    TextDocument page = new TextDocument(decodedResource, result,
View Full Code Here

    String existingBaseHref = TagMagix.getBaseHref(sb);
    if (existingBaseHref != null) {
      pageUrl = existingBaseHref;
    }
    ResultURIConverter ruc = new SpecialResultURIConverter(uriConverter);
   
    // TODO: forms...?
    String markups[][] = {
        {"FRAME","SRC"},
        {"META","URL"},
View Full Code Here

  public void resolveASXRefUrls() {

    // TODO: get url from Resource instead of SearchResult?
    String pageUrl = result.getOriginalUrl();
    String captureDate = result.getCaptureTimestamp();
    ResultURIConverter ruc = new MMSToHTTPResultURIConverter(uriConverter);
   
    TagMagix.markupTagREURIC(sb, ruc, captureDate, pageUrl,
        "REF", "HREF");
  }
View Full Code Here

              // Calendar -> redirect to collection-less proxy query
              redirUrl = "/" + requestUrl;
            } else {
              // specific timestamp -> redirect to collection-less
              // proxy replay.
              ResultURIConverter converter = getArchivalToProxyConverter();
              if (converter == null) {
                converter = this.getUriConverter();
              }
              redirUrl = converter.makeReplayURI(timestamp, replayUrl);
            }
           
            response.sendRedirect(redirUrl);
         
            return true;
View Full Code Here

TOP

Related Classes of org.archive.wayback.ResultURIConverter

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.