Package org.dbwiki.web.request

Examples of org.dbwiki.web.request.RequestURL


   * @throws org.dbwiki.exception.WikiException
   */
  protected void respondTo(Exchange<?> exchange) throws java.io.IOException, org.dbwiki.exception.WikiException {
    ServerResponseHandler responseHandler = null;
   
    HttpRequest request = new HttpRequest(new RequestURL(exchange,""), users());

    if (request.type().isIndex()) {
      responseHandler = this.getHomepageResponseHandler(request);
    } else if (request.type().isCreate()) {
      responseHandler = new ServerResponseHandler(request, _wikiTitle + " - Create Database Wiki");
View Full Code Here


          _server.sendFile(exchange);
        } else {
          if (_server.serverLog() != null) {
            _server.serverLog().logRequest(request);
          }
          RequestURL url = new RequestURL(exchange, _database.identifier().linkPrefix());
          if (url.isDataRequest()) {
            respondToDataRequest(new WikiDataRequest(this, url),
                exchange);
          } else if (url.isPageRequest()) {
            respondToPageRequest(new WikiPageRequest(this, url),
                exchange);
          } else if (url.isSchemaRequest()) {
            respondToSchemaRequest(new WikiSchemaRequest(this, url),
                exchange);
          }
        }
      } else {
View Full Code Here

      } else if ((path.startsWith(SpecialFolderDatabaseWikiStyle + "/")) && (path.endsWith(".css"))) {
        this.sendCSSFile(path.substring(SpecialFolderDatabaseWikiStyle.length() + 1, path.length() - 4), exchange);
      } else if (path.equals(SpecialFolderLogin)) {
        //FIXME: #request This is a convoluted way of parsing the request parameter!
        if(_authenticator.authenticate(request)) {
          exchange.send(new RedirectPage(new RequestURL(exchange,"").parameters().get(RequestParameter.ParameterResource).value()));
        } else {
          response.setHeader("WWW-Authenticate", "Basic realm=\"/login\"");
          response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "");
        }
      } else if (path.length() > 1) {
View Full Code Here

        this.respondTo(exchange);
      } else if ((path.startsWith(SpecialFolderDatabaseWikiStyle + "/")) && (path.endsWith(".css"))) {
          this.sendCSSFile(path.substring(SpecialFolderDatabaseWikiStyle.length() + 1, path.length() - 4), exchange);
      } else if (path.equals(SpecialFolderLogin)) {
        //FIXME: #request This is a convoluted way of parsing the request parameter!
        exchange.send(new RedirectPage(new RequestURL( exchange,"").parameters().get(RequestParameter.ParameterResource).value()));
        // The following code is necessary if using only a single HttpContext
        // instead of multiple ones (i.e., one per Database Wiki).
        //} else if (path.length() > 1) {
        //  int pos = path.indexOf('/', 1);
        //  DatabaseWiki wiki = null;
View Full Code Here

        if (_server.serverLog() != null) {
          _server.serverLog().logRequest(exchange.getRequestURI(),
              exchange.get().getRemoteAddress(),
              exchange.get().getResponseHeaders());
        }
        RequestURL url = new RequestURL(exchange, _database.identifier().linkPrefix());
        if (url.isDataRequest()) {
          respondToDataRequest(new WikiDataRequest(this, url),
              exchange);
        } else if (url.isPageRequest()) {
          respondToPageRequest(new WikiPageRequest(this, url),
              exchange);
        } else if (url.isSchemaRequest()) {
          respondToSchemaRequest(new WikiSchemaRequest(this, url),
              exchange);
        }
      }
    } catch (org.dbwiki.exception.WikiException wikiException) {
View Full Code Here

TOP

Related Classes of org.dbwiki.web.request.RequestURL

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.