Package org.apache.wicket

Examples of org.apache.wicket.RestartResponseException


    if (user == null) {
      LOGGER.error("Unable to get user from hash");
      MavenArtifactNotifierSession.get().error(
          Application.get().getResourceSettings().getLocalizer().getString("common.error.noItem", null));

      throw new RestartResponseException(redirectPageClass);
    }
    return user;
  }
View Full Code Here


    if (emailAddress == null) {
      LOGGER.error("Unable to get email address from hash");
      MavenArtifactNotifierSession.get().error(
          Application.get().getResourceSettings().getLocalizer().getString("common.error.noItem", null));

      throw new RestartResponseException(redirectPageClass);
    }
    return emailAddress;
  }
View Full Code Here

          LOGGER.error("Erreur inconnue lors de l'authentification de l'utilisateur", e);
          session.error(getString("home.identification.error.unknown"));
        }
       
        if (success) {
          throw new RestartResponseException(LoginSuccessPage.class);
        } else {
          setResponsePage(Application.get().getHomePage());
        }
      }
    };
View Full Code Here

          session.error(getString("home.identification.error.unknown"));
        }
       
        if (success) {
          if (HomePage.class.equals(getPage().getClass()) || RegisterPage.class.equals(getPage().getClass())) {
            throw new RestartResponseException(LoginSuccessPage.class);
          } else {
            throw new RestartResponseException(getPage().getClass(), getPage().getPageParameters());
          }
        } else {
          throw HomePage.linkDescriptor().newRestartResponseException();
        }
      }
View Full Code Here

    User user = userService.getByUserName(ConsoleNotificationIndexPage.DEFAULT_USERNAME);
    if (user == null) {
      LOGGER.error("There is no user available");
      Session.get().error(getString("console.notifications.noDataAvailable"));
     
      throw new RestartResponseException(ConsoleNotificationIndexPage.class);
    }
    user.setNotificationHash(userService.getHash(user, user.getUserName()));
   
    add(new ConfirmRegistrationHtmlNotificationPanel("htmlPanel", Model.of(user)));
    user.setNotificationHash(null);
View Full Code Here

    User user = userService.getByUserName(ConsoleNotificationIndexPage.DEFAULT_USERNAME);
    if (user == null) {
      LOGGER.error("There is no user or email address available");
      Session.get().error(getString("console.notifications.noDataAvailable"));
     
      throw new RestartResponseException(ConsoleNotificationIndexPage.class);
    }
    List<ArtifactVersionNotification> notifications = userService.listRecentNotifications(user);
   
    IModel<List<ArtifactVersionNotification>> notificationsModel = new ListModel<ArtifactVersionNotification>(notifications);
    add(new NewVersionsHtmlNotificationPanel("htmlPanel", notificationsModel));
View Full Code Here

    User user = userService.getByUserName(ConsoleNotificationIndexPage.DEFAULT_USERNAME);
    if (user == null) {
      LOGGER.error("There is no user available");
      Session.get().error(getString("console.notifications.noDataAvailable"));
     
      throw new RestartResponseException(ConsoleNotificationIndexPage.class);
    }
   
    List<EmailAddress> emailAddresses = user.getAdditionalEmails();
    if (emailAddresses == null || emailAddresses.isEmpty()) {
      LOGGER.error("There is no additional email address available");
      Session.get().error(getString("console.notifications.noDataAvailable"));
     
      throw new RestartResponseException(ConsoleNotificationIndexPage.class);
    }
    EmailAddress additionalEmail = emailAddresses.get(0);
   
    List<ArtifactVersionNotification> notifications = userService.listRecentNotifications(user);
   
View Full Code Here

        {
            // Prevent redirecting to ourself if home page == LoginPage
            Class<? extends Page> home = getApplication().getHomePage();
            if(!getClass().equals(home))
            {
                throw new RestartResponseException(home);
            }
        }
        super.onBeforeRender();
    }
View Full Code Here

  {
    super(parameters);
    if (getMySession().isMobileUserAgent() == true
        && UserFilter.isUpdateRequiredFirst() == false
        && "true".equals(WicketUtils.getAsString(parameters, PARAMETER_KEY_FORCE_NON_MOBILE)) == false) {
      throw new RestartResponseException(LoginMobilePage.class);
    }
    final PFUserDO wicketSessionUser = getMySession().getUser();
    final PFUserDO sessionUser = UserFilter.getUser(WicketUtils.getHttpServletRequest(getRequest()));
    // Sometimes the wicket session user is given but the http session user is lost (re-login required).
    if (wicketSessionUser != null && sessionUser != null && wicketSessionUser.getId() == sessionUser.getId()) {
      throw new RestartResponseException(WicketUtils.getDefaultPage());
    }
    if (initDatabaseDao.isEmpty() == true) {
      log.info("Data-base is empty: redirect to SetupPage...");
      throw new RestartResponseException(SetupPage.class);
    }
    form = new LoginForm(this);
    body.add(AttributeModifier.replace("class", "loginpage"));
    body.add(form);
    form.init();
View Full Code Here

      return loginResult.getLoginResultStatus();
    }
    if (UserFilter.isUpdateRequiredFirst() == true) {
      internalLogin(page, user);
      log.info("Admin login for maintenance (data-base update) successful for user '" + username + "'.");
      throw new RestartResponseException(SystemUpdatePage.class);
    }
    log.info("User successfully logged in: " + user.getDisplayUsername());
    if (userWantsToStayLoggedIn == true) {
      final PFUserDO loggedInUser = userDao.internalGetById(user.getId());
      final Cookie cookie = new Cookie("stayLoggedIn", loggedInUser.getId()
          + ":"
          + loggedInUser.getUsername()
          + ":"
          + userDao.getStayLoggedInKey(user.getId()));
      UserFilter.addStayLoggedInCookie(WicketUtils.getHttpServletRequest(page.getRequest()),
          WicketUtils.getHttpServletResponse(page.getResponse()), cookie);
    }
    internalLogin(page, user);
    // Do not redirect to requested page in maintenance mode (update required first):
    if (UserFilter.isUpdateRequiredFirst() == true) {
      throw new RestartResponseException(SystemUpdatePage.class);
    }
    page.continueToOriginalDestination();
    // Redirect only if not a redirect is set by Wicket.
    throw new RestartResponseException(defaultPage);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.RestartResponseException

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.