Package org.wymiwyg.wrhapi.util

Examples of org.wymiwyg.wrhapi.util.EnhancedRequest


   * @see org.wymiwyg.wrhapi.filter.Filter#handle(org.wymiwyg.wrhapi.Request,
   *      org.wymiwyg.wrhapi.Response, org.wymiwyg.wrhapi.Handler)
   */
  public void handle(Request request, Response response, Handler rest)
      throws HandlerException {
    String requestURL = new EnhancedRequest(request)
        .getRequestURLWithoutParams().toString();
    if (infoDiscoBitURIs.containsKey(requestURL)) {
      InfoBit infoBit = infoDiscoBitURIs.get(requestURL);
      response.setHeader(HeaderName.CONTENT_TYPE, infoBit
          .getMimeTypeString());
View Full Code Here


   *      com.hp.hpl.jena.gvs.services.http.graphserver.TypedResponse)
   */
  public void handle(Request request, TypedResponse<Graph> response)
      throws HandlerException {
    Date moment = GVSHttpUtil.getMoment(request);
    EnhancedRequest ehRequest = new EnhancedRequest(request);
    String resourceURIString = ehRequest.getRequestURLWithoutParams()
        .toString();
    response.setDefaultStylesheet("/application/stylesheets/combined");
    Set<GroundedNode> resources = new HashSet<GroundedNode>();
    resources.add(new NamedNodeImpl(resourceURIString));
    FCAGraph completeGraph = trustedGOT.getGraph(moment);
View Full Code Here

    String[] resourceURIStrings = request.getRequestURI()
        .getParameterValues("resource");
    if (request.getRequestURI().getPath().equals("/gvs")) {
      gvsService(request, moment, resourceURIStrings, response);
    } else {
      EnhancedRequest ehRequest = new EnhancedRequest(request);
      URL sourceURL = ehRequest.getRequestURLWithoutParams();
      Source source = new SourceImpl(sourceURL.toString());
      if (request.getMethod().equals(Method.GET) && (!store.getSources().contains(source))) {
        unavailableSourceGetHandler.handle(request, response);
      } else {
        gvsSourceHandle(request, source, moment, resourceURIStrings,
View Full Code Here

  /**
   * @param request
   * @throws HandlerException
   */
  public CookieCallbackHandler(Request request) throws HandlerException {
    EnhancedRequest ehRequest = new EnhancedRequest(request);
    Cookie[] cookies = ehRequest.getCookies();
    for (Cookie cookie : cookies) {
      if (cookie.getName().equals("login")) {
        String value = cookie.getValue();
        StringTokenizer tokens = new StringTokenizer(value,":");
        userName = tokens.nextToken();
View Full Code Here

    }
    return false;
  }

  private boolean htmlPreferredInAccept(Request request) throws HandlerException {
    EnhancedRequest ehRequest = new EnhancedRequest(request);
    Iterator<AcceptHeaderEntry> iter = ehRequest.getAccept();
    while (iter.hasNext()) {
      AcceptHeaderEntry entry = iter.next();
      if (entry.getRange().match(xhtmlMimeType)) {
        return false;
      }
View Full Code Here

  }

  @Override
  public URI getAbsolutePath() {
    try {
      return new URI(new EnhancedRequest(this.request.getWrhapiRequest()).getRequestURLWithoutParams().toString());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

  }

  @Override
  public URI getRequestUri() {
    try {
      return new URI(new EnhancedRequest(this.request.getWrhapiRequest()).getFullRequestURL().toString());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

public class RedirectionsHandler implements Handler {

  private Model model;

  public void handle(Request request, Response response, HandlerChain chain) throws HandlerException {
    EnhancedRequest ehRequest = new EnhancedRequest(request);
        Resource resource = model.createResource(ehRequest.getRequestURLWithoutParams()
                .toString());
        Statement targetStatement = resource.getProperty(REDIRECTIONS.target);
        Statement statusStatement = resource.getProperty(REDIRECTIONS.statusCode);
        if(targetStatement == null || statusStatement == null){
            response.setResponseStatus(ResponseStatus.NOT_FOUND)
View Full Code Here

 
  public static void doRedirect(Request request, Response response, String targetString, boolean withResponseHeaders) throws HandlerException {
    URL targetURL;
    try {
      targetURL = new URL(new EnhancedRequest(request).getFullRequestURL(), targetString);
      HttpURLConnection connection = (HttpURLConnection) targetURL.openConnection();
      connection.setDoOutput(true);
      connection.setRequestMethod(request.getMethod().getName());
      Set<HeaderName> headerNames = request.getHeaderNames();
      for (HeaderName headerName : headerNames) {
View Full Code Here

public class RedirectionsEditHandler implements Handler {

  private Model model;

  public void handle(Request request, Response response, HandlerChain chain) throws HandlerException {
    EnhancedRequest ehRequest = new EnhancedRequest(request);
        Resource resource = model.createResource(ehRequest.getRequestURLWithoutParams()
                .toString());
        Model result = JenaUtil.getExpandedResource(resource, 4);
      //  ((Resource)resource.inModel(result)).addProperty(DC.title, "cigarette");
        response.setBody(result);
  }
View Full Code Here

TOP

Related Classes of org.wymiwyg.wrhapi.util.EnhancedRequest

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.