Exemplo n.º 1
0
  public Configuration reloadConfiguration(HttpServletRequest req, int idConfiguration) {
    // Load configuration properties
    ConfigurationDAO confDAO = new ConfigurationDAO();

    Configuration conf = confDAO.getConfiguration(idConfiguration);

    req.getSession().setAttribute("configuration", conf);

    return conf;
  }
Exemplo n.º 2
0
  public Configuration loadConfiguration(HttpServletRequest req, int idConfiguration) {
    User user = getUser(req);

    if (idConfiguration < 0) {
      idConfiguration = user.getIdConfigurationDefault();
    }

    Simulation sim = getSimulation(req, idConfiguration);
    Configuration conf = null;

    if (sim != null) conf = sim.getConfiguration();

    // Load configuration properties
    if (conf == null) {
      ConfigurationDAO confDAO = new ConfigurationDAO();

      conf = confDAO.getConfiguration(idConfiguration);
    }

    req.getSession().setAttribute("configuration", conf);

    return conf;
  }