Beispiel #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;
  }
Beispiel #2
0
  public boolean saveUserConfiguration(HttpServletRequest req, Configuration conf, User user) {
    if (conf == null || user == null) {
      return false;
    }

    req.getSession().setAttribute("idSimulation", Integer.toString(conf.getId()));

    // Save configuration properties
    ConfigurationDAO simDAO = new ConfigurationDAO();

    return simDAO.saveConfiguration(conf, user);
  }
Beispiel #3
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;
  }