コード例 #1
0
ファイル: MainAction.java プロジェクト: vitorchaud/ReMoto
  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;
  }
コード例 #2
0
ファイル: MainAction.java プロジェクト: vitorchaud/ReMoto
  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);
  }
コード例 #3
0
ファイル: MainAction.java プロジェクト: vitorchaud/ReMoto
  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;
  }