Package org.apache.openmeetings.db.entity.basic

Examples of org.apache.openmeetings.db.entity.basic.Configuration


      List<Configuration> list = readList(serializer, f, "configs.xml", "configs", Configuration.class, true);
      for (Configuration c : list) {
        if (c.getConf_key() == null || c.getDeleted()) {
          continue;
        }
        Configuration cfg = configurationDao.forceGet(c.getConf_key());
        if (cfg != null && !cfg.getDeleted()) {
          log.warn("Non deleted configuration with same key is found! old value: {}, new value: {}", cfg.getConf_value(), c.getConf_value());
        }
        c.setConfiguration_id(cfg == null ? null : cfg.getConfiguration_id());
        if (c.getUser() != null && c.getUser().getUser_id() == null) {
          c.setUser(null);
        }
        if (CONFIG_CRYPT_KEY.equals(c.getConf_key())) {
          try {
View Full Code Here


  }

  /**
   */
  public Configuration add(String key, String value, Long userId, String comment) {
    Configuration c = new Configuration();
    c.setConf_key(key);
    c.setConf_value(value);
    c.setComment(comment);
    return update(c, userId);
  }
View Full Code Here

      List<Configuration> list = readList(serializer, f, "configs.xml", "configs", Configuration.class, true);
      for (Configuration c : list) {
        if (c.getConf_key() == null || c.getDeleted()) {
          continue;
        }
        Configuration cfg = configurationDao.forceGet(c.getConf_key());
        if (cfg != null && !cfg.getDeleted()) {
          log.warn("Non deleted configuration with same key is found! old value: {}, new value: {}", cfg.getConf_value(), c.getConf_value());
        }
        c.setConfiguration_id(cfg == null ? null : cfg.getConfiguration_id());
        if (c.getUser() != null && c.getUser().getUser_id() == null) {
          c.setUser(null);
        }
        if (CONFIG_CRYPT_KEY.equals(c.getConf_key())) {
          try {
View Full Code Here

  @Test
  public void getConfigKey() {
    System.err.println("THIS");

    Configuration smtp_server = configurationDao.get("smtp_server").get(0);

    System.err.println("smtp_server " + smtp_server.getUser());

    assertNull(smtp_server.getUser());
  }
View Full Code Here

  }

  /**
   */
  public Configuration add(String key, String value, Long userId, String comment) {
    Configuration c = new Configuration();
    c.setConf_key(key);
    c.setConf_value(value);
    c.setComment(comment);
    return update(c, userId);
  }
View Full Code Here

      , new SearchableDataProvider<Configuration>(ConfigurationDao.class)) {
      private static final long serialVersionUID = 8715559628755439596L;

      @Override
      protected void populateItem(final Item<Configuration> item) {
        final Configuration c = item.getModelObject();
        item.add(new Label("configuration_id", c.getConfiguration_id()));
        item.add(new Label("conf_key", c.getConf_key()));
        item.add(new Label("conf_value", c.getConf_value()));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = -8069413566800571061L;

          protected void onEvent(AjaxRequestTarget target) {
            form.hideNewRecord();
            form.setModelObject(c);
            target.add(form, listContainer);
            target.appendJavaScript("omConfigPanelInit();");
          }
        });
        item.add(AttributeModifier.replace("class", "clickable "
            + (item.getIndex() % 2 == 1 ? "even" : "odd")
            + (c.getConfiguration_id().equals(form.getModelObject().getConfiguration_id()) ? " selected" : "")));
      }
    };
    add(listContainer.add(dataView).setOutputMarkupId(true));
    PagedEntityListPanel navigator = new PagedEntityListPanel("navigator", dataView) {
      private static final long serialVersionUID = 5097048616003411362L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    };
    DataViewContainer<Configuration> container = new DataViewContainer<Configuration>(listContainer, dataView, navigator);
    container.setLinks(new OmOrderByBorder<Configuration>("orderById", "configuration_id", container)
        , new OmOrderByBorder<Configuration>("orderByKey", "conf_key", container)
        , new OmOrderByBorder<Configuration>("orderByValue", "conf_value", container));
    add(container.orderLinks);
    add(navigator);
   
    form = new ConfigForm("form", listContainer, new Configuration());
    form.showNewRecord();
        add(form);
   
  }
View Full Code Here

    this.listContainer = listContainer;
    add(new RequiredTextField<String>("conf_key").setLabel(Model.of(WebSession.getString(267))).add(new IValidator<String>(){
      private static final long serialVersionUID = -3371792361118941958L;

      public void validate(IValidatable<String> validatable) {
        Configuration c = getBean(ConfigurationDao.class).forceGet(validatable.getValue());
        if (c != null && !c.getConfiguration_id().equals(ConfigForm.this.getModelObject().getConfiguration_id())) {
          error(WebSession.getString(1544L));
        }
      }
    }));
    add(new TextField<String>("conf_value").setLabel(Model.of(WebSession.getString(271))));
View Full Code Here

    refresh(target);
  }

  @Override
  protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
    this.setModelObject(new Configuration());
    refresh(target);
  }
View Full Code Here

    refresh(target);
  }
 
  @Override
  protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
    Configuration conf = getModelObject();
    if (conf.getConfiguration_id() != null) {
      conf = getBean(ConfigurationDao.class).get(conf.getConfiguration_id());
    } else {
      conf = new Configuration();
    }
    setModelObject(conf);
    refresh(target);
  }
View Full Code Here

  }
 
  @Override
  protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
    getBean(ConfigurationDao.class).delete(getModelObject(), WebSession.getUserId());
    setModelObject(new Configuration());
    target.add(listContainer);
    refresh(target);
  }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.db.entity.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.