Ejemplo n.º 1
0
  /**
   * When the "update geo data" button is clicked. <br>
   * Updates the login records with geodata for their IP's if found.<br>
   * This is done by a calling a web service from Hostinfo.org.<br>
   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$button_SecLoginlogList_UpdateGeoData(Event event)
      throws InterruptedException {

    final String str =
        InputConfirmBox.show(
            this.secLoginlogListWindow,
            Labels.getLabel("message.Information.InputSupervisorPassword"));

    if (StringUtils.equalsIgnoreCase(str, "yes we can")) {
      final int recCount = getGuiLoginLoggingService().updateFromHostLookUpMain();

      final String message =
          Labels.getLabel("message.Information.CountRecordsInsertedUpdated") + " " + recCount;
      final String title = Labels.getLabel("message.Information");
      MultiLineMessageBox.doSetTemplate();
      MultiLineMessageBox.show(message, title, MultiLineMessageBox.OK, "INFORMATION", true);

      // ++ create the searchObject and init sorting ++//
      final HibernateSearchObject<SecLoginlog> soSecLoginlog =
          new HibernateSearchObject<SecLoginlog>(SecLoginlog.class, getCountRows());
      // deeper loading of the relations to prevent the lazy
      // loading problem.
      soSecLoginlog.addFetch("ip2Country.countryCode");
      soSecLoginlog.addSort("lglLogtime", true);

      // Set the ListModel
      getPagedListWrapper().init(soSecLoginlog, this.listBoxSecUserlog, this.paging_SecUserLogList);

    } else {
      final String message = Labels.getLabel("message.error.falsePassword");
      final String title = Labels.getLabel("message.Error");
      MultiLineMessageBox.doSetTemplate();
      MultiLineMessageBox.show(message, title, MultiLineMessageBox.OK, "INFORMATION", true);
    }
  }
Ejemplo n.º 2
0
  /**
   * When the "import IpToCountry data" button is clicked. <br>
   * Updates the IpToCountry table by importing the newest data <br>
   * from a CSV file from the web server Hostinfo.org.<br>
   *
   * @param event
   * @throws InterruptedException
   */
  public void onClick$button_SecLoginlogList_ImportIPToCountryCSV(Event event)
      throws InterruptedException {

    final String str =
        InputConfirmBox.show(
            this.secLoginlogListWindow,
            Labels.getLabel("message.Information.InputSupervisorPassword"));

    if (StringUtils.equalsIgnoreCase(str, "yes we can")) {
      final int recCount = getGuiLoginLoggingService().importIP2CountryCSV();

      final String message =
          Labels.getLabel("message.Information.CountRecordsInsertedUpdated") + " " + recCount;
      final String title = Labels.getLabel("message.Information");
      MultiLineMessageBox.doSetTemplate();
      MultiLineMessageBox.show(message, title, MultiLineMessageBox.OK, "INFORMATION", true);
    } else {
      final String message = Labels.getLabel("message.error.falsePassword");
      final String title = Labels.getLabel("message.Error");
      MultiLineMessageBox.doSetTemplate();
      MultiLineMessageBox.show(message, title, MultiLineMessageBox.OK, "INFORMATION", true);
    }
  }