Package org.openmeetings.app.persistence.beans.basic

Examples of org.openmeetings.app.persistence.beans.basic.Configuration


  public Long saveOrUpdateConfiguration(long user_level,
      LinkedHashMap<String, ?> values, Long users_id) {
    try {
      if (authLevelManagement.checkAdminLevel(user_level)) {
        Configuration conf = (Configuration) CastMapToObject
            .getInstance().castByGivenObject(values,
                Configuration.class);
        if (conf.getConfiguration_id().equals(null)
            || conf.getConfiguration_id() == 0) {
          log.info("add new Configuration");
          conf.setConfiguration_id(null);
          conf.setStarttime(new Date());
          conf.setDeleted("false");
          return this.addConfig(conf);
        } else {
          log.info("update Configuration ID: "
              + conf.getConfiguration_id());
          Configuration conf2 = this.getConfByConfigurationId(3L,
              conf.getConfiguration_id());
          conf2.setComment(conf.getComment());
          conf2.setConf_key(conf.getConf_key());
          conf2.setConf_value(conf.getConf_value());
          conf2.setUser_id(users_id);
          conf2.setDeleted("false");
          conf2.setUpdatetime(new Date());
          return this.updateConfig(conf2);
        }
      } else {
        log.error("[saveOrUpdateConfByConfigurationId] Error: Permission denied");
        return new Long(-100);
View Full Code Here


  public Long deleteConfByConfiguration(long user_level,
      LinkedHashMap<String, ?> values, Long users_id) {
    try {
      if (authLevelManagement.checkAdminLevel(user_level)) {
        Configuration conf = (Configuration) CastMapToObject
            .getInstance().castByGivenObject(values,
                Configuration.class);
        conf.setUsers(usersDao.getUser(users_id));
        conf.setUpdatetime(new Date());
        conf.setDeleted("true");

        Configuration conf2 = this.getConfByConfigurationId(3L,
            conf.getConfiguration_id());
        conf2.setComment(conf.getComment());
        conf2.setConf_key(conf.getConf_key());
        conf2.setConf_value(conf.getConf_value());
        conf2.setUser_id(users_id);
        conf2.setDeleted("true");
        conf2.setUpdatetime(new Date());

        this.updateConfig(conf2);
        return new Long(1);
      } else {
        log.error("Error: Permission denied");
View Full Code Here

      log.debug("webAppPath : " + webAppPath);
      log.debug("batchFileFir : " + batchFileDir);

      // Only load this Class one time
      // Initially this value might by empty, because the DB is empty yet
      Configuration conf = cfgManagement.getConfKey(3, "crypt_ClassName");
      if (conf != null) {
        ScopeApplicationAdapter.configKeyCryptClassName = conf
            .getConf_value();
      }

      // init your handler here
View Full Code Here

 
  public String getCryptKey() {
    try {

      if (ScopeApplicationAdapter.configKeyCryptClassName == null) {
        Configuration conf = cfgManagement.getConfKey(3,
            "crypt_ClassName");

        if (conf != null) {
          ScopeApplicationAdapter.configKeyCryptClassName = conf
              .getConf_value();
        }
      }

      return ScopeApplicationAdapter.configKeyCryptClassName;
View Full Code Here

    }
    return null;
  }

    public String getExclusiveAudioKeyCode() {
        Configuration conf = cfgManagement.getConfKey(3, "exclusive.audio.keycode");
        if (null != conf) {
            return conf.getConf_value();
        } else {
            return null;
        }
    }
View Full Code Here

      Iterator<Element> iter = configs.elementIterator("config"); iter.hasNext();) {
     
      Element cfgElem = iter.next();
      String key = cfgElem.elementText("key");
      try {
        Configuration cfg = cfgManagement.getConfKey(3L, key);
        if (cfg == null) {
          cfg = new Configuration();
          cfg.setConf_key(key);
        }
        cfg.setConf_value(cfgElem.elementText("value"));
        cfg.setUpdatetime(new Date());
        cfg.setDeleted(cfgElem.elementText("deleted"));
        cfg.setComment(cfgElem.elementText("comment"));
        cfgManagement.updateConfig(cfg);
      } catch (Exception e) {
        log.debug("failed to add/update configuration: " + key, e);
      }
    }
View Full Code Here

   * @return
   */
  public <T> T getConfValue(String CONF_KEY, Class<T> typeObject,
      String defaultValue) {
    try {
      Configuration conf_reminder = getConfKey(3L, CONF_KEY);

      if (conf_reminder == null) {
        log.warn("Could not find key in configuration CONF_KEY: "
            + CONF_KEY);
      } else {
        // Use the custom value as default value
        defaultValue = conf_reminder.getConf_value();
      }

      // Either this can be directly assigned or try to find a constructor
      // that handles it
      if (typeObject.isAssignableFrom(defaultValue.getClass())) {
View Full Code Here

  public Configuration getConfByConfigurationId(long user_level,
      long configuration_id) {
    try {
      log.debug("getConfByConfigurationId1: user_level " + user_level);
      if (authLevelManagement.checkAdminLevel(user_level)) {
        Configuration configuration = null;
        TypedQuery<Configuration> query = em
            .createQuery("select c from Configuration as c where c.configuration_id = :configuration_id", Configuration.class);
        query.setParameter("configuration_id", configuration_id);
        query.setMaxResults(1);
        try {
          configuration = query.getSingleResult();
        } catch (NoResultException e) {
        }
        log.debug("getConfByConfigurationId4: " + configuration);

        if (configuration != null && configuration.getUser_id() != null) {
          configuration.setUsers(usersDao.getUser(configuration
              .getUser_id()));
        }
        return configuration;
      } else {
        log.error("[getConfByConfigurationId] Permission denied "
View Full Code Here

  public String addConfByKey(long user_level, String CONF_KEY,
      String CONF_VALUE, Long USER_ID, String comment) {
    String ret = "Add Configuration";
    if (authLevelManagement.checkAdminLevel(user_level)) {
      Configuration configuration = new Configuration();
      configuration.setConf_key(CONF_KEY);
      configuration.setConf_value(CONF_VALUE);
      configuration.setStarttime(new Date());
      configuration.setDeleted("false");
      configuration.setComment(comment);
      if (USER_ID != null)
        configuration.setUser_id(USER_ID);
      try {
        configuration = em.merge(configuration);
        ret = "Erfolgreich";
      } catch (Exception ex2) {
        log.error("[addConfByKey]: ", ex2);
View Full Code Here

        ctx.put("codebase", codebase);
        ctx.put("red5-host", rtmphostlocal);
        ctx.put("red5-app", OpenmeetingsVariables.webAppRootKey + "/"
            + room);

        Configuration configuration = getCfgManagement().getConfKey(3L,
            "default.quality.screensharing");
        String default_quality_screensharing = "1";
        if (configuration != null) {
          default_quality_screensharing = configuration
              .getConf_value();
        }

        ctx.put("default_quality_screensharing",
            default_quality_screensharing);
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.basic.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.