Package org.dbwiki.web.html

Examples of org.dbwiki.web.html.RedirectPage


      } 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

            request.user());
        isGetRequest = !request.isRootRequest();
        isIndexRequest = !isGetRequest;
      } else if (action.actionInsert()) {
        DocumentNode insertNode = this.getInsertNode(request);
        page = new RedirectPage(request, database().insertNode(
            request.wri().resourceIdentifier(), insertNode,
            request.user()));
      } else if (action.actionUpdate()) {
        if (request.parameters().hasParameter(ParameterDatabaseID)) {
          // Updating a configuration file
          this.updateConfigurationFile(request);
          // Configuration files may be modified either while viewing
          // the
          // database index or and object. Make sure to display the
          // appropriate
          // page after the update.
          isGetRequest = !request.isRootRequest();
          isIndexRequest = !isGetRequest;
        } else {
          // Updating a data object
          Update update = this.getNodeUpdates(request);
          if (update != null) {
            database().update(request.wri().resourceIdentifier(),
                update, request.user());
            if (request.node().isText()) {
              page = new RedirectPage(request,
                  ((DatabaseTextNode) request.node())
                      .parent().identifier());
            }
          }
          isGetRequest = true;
        }
      }
    } else if (request.type().isActivate()) {
      database().activate(request.wri().resourceIdentifier(),
          request.user());
    } else if (request.type().isCopy()) {
      String sourceURL = "http://localhost" + ":"
          + exchange.getLocalPort()
          + request.wri().getURL();
      RequestParameterVersion version = RequestParameter
          .versionParameter(request.parameters().get(
              RequestParameter.ParameterVersion));
      if (version.versionSingle()) {
        sourceURL = sourceURL + "?" + version.toURLString();
      } else {
        sourceURL = sourceURL
            + "?"
            + new RequestParameterVersionSingle(this.database()
                .versionIndex().getLastVersion().number())
                .toURLString();
      }
      exchange.setResponseHeader("Set-Cookie", HttpRequest.CookiePropertyCopyBuffer + "=" + URLEncoder.encode(sourceURL, "UTF-8") + "; path=/; ");
   
    } else if (request.type().isDelete()) {
      database().delete(request.wri().resourceIdentifier(),
          request.user());
      if (request.node().parent() != null) {
        page = new RedirectPage(request, request.node().parent()
            .identifier());
      } else {
        isIndexRequest = true;
      }
    } else if (request.type().isPaste()) {
View Full Code Here

    boolean isIndexRequest = request.type().isIndex();

    RequestParameterAction action = new RequestParameterActionCancel();
    if (request.type().isDelete()) {
      wiki().delete((PageIdentifier) request.wri().resourceIdentifier());
      exchange.send(new RedirectPage(request.wri().databaseIdentifier()
          .databaseHomepage()));
      return;
    } else if (request.type().isAction()) {
      action = RequestParameter.actionParameter(request.parameters().get(
          RequestParameter.ParameterAction));
View Full Code Here

    if (request.type().isDelete()) {
      database().deleteSchemaNode(request.wri().resourceIdentifier(),
          request.user());

      if (request.schema().parent() != null) {
        exchange.send(new RedirectPage(request,
            request.schema().parent().identifier()));
        return;
      } else {
        isIndexRequest = true;
      }
View Full Code Here

TOP

Related Classes of org.dbwiki.web.html.RedirectPage

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.