Esempio n. 1
0
  public String getCdSimulation(HttpServletRequest req, int idConfiguration) {
    User user = getUser(req);

    if (user == null) return null;

    String cdUser = "";

    if (!user.getCdUser().equals(ReMoto.cdGuestUser)) cdUser = user.getCdUser();
    else cdUser = req.getSession().getId();

    return cdUser + "_" + idConfiguration;
  }
Esempio 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;
  }