Package org.apache.openmeetings.persistence.beans.basic

Examples of org.apache.openmeetings.persistence.beans.basic.LdapConfig


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

      @Override
      protected void populateItem(final Item<LdapConfig> item) {
        final LdapConfig ldapConfig = item.getModelObject();
        item.add(new Label("ldapConfigId", "" + ldapConfig.getLdapConfigId()));
        item.add(new Label("name", "" + ldapConfig.getName()));
        item.add(new Label("configFileName", "" + ldapConfig.getConfigFileName()));
        item.add(new AjaxEventBehavior("onclick") {
          private static final long serialVersionUID = -8069413566800571061L;

          protected void onEvent(AjaxRequestTarget target) {
            form.setModelObject(ldapConfig);
            form.hideNewRecord();
            target.add(form);
            target.appendJavaScript("omLdapPanelInit();");
          }
        });
        item.add(AttributeModifier.replace("class", (item.getIndex() % 2 == 1) ? "even" : "odd"));
      }
    };
    final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
    add(listContainer.add(dataView).setOutputMarkupId(true));
    DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView);
    container.setLinks(new OrderByBorder<LdapConfig>("orderById", "ldapConfigId", container)
        , new OrderByBorder<LdapConfig>("orderByName", "name", container)
        , new OrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
    add(container.orderLinks);
    add(new PagedEntityListPanel("navigator", dataView) {
      private static final long serialVersionUID = -1L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    });
   
    form = new LdapForm("form", listContainer, new LdapConfig());
    form.showNewRecord();
        add(form);
   
  }
View Full Code Here


  @Override
  protected void onSaveSubmit(AjaxRequestTarget target, Form<?> form) {
    Application.getBean(LdapConfigDao.class).update(getModelObject(),
        WebSession.getUserId());
    LdapConfig ldapConfig = Application.getBean(LdapConfigDao.class)
        .get(getModelObject().getLdapConfigId());
    this.setModelObject(ldapConfig);
    hideNewRecord();
    target.add(this);
    target.add(listContainer);
View Full Code Here

    target.appendJavaScript("omLdapPanelInit();");
  }

  @Override
  protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
    this.setModelObject(new LdapConfig());
    target.add(this);
    target.appendJavaScript("omLdapPanelInit();");
  }
View Full Code Here

    target.appendJavaScript("omLdapPanelInit();");
  }

  @Override
  protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
    LdapConfig ldapConfig = this.getModelObject();
    if (ldapConfig.getLdapConfigId() <= 0) {
      ldapConfig = Application.getBean(LdapConfigDao.class).get(
          ldapConfig.getLdapConfigId());
    } else {
      ldapConfig = new LdapConfig();
    }
    this.setModelObject(ldapConfig);
    target.add(this);
    target.appendJavaScript("omLdapPanelInit();");
  }
View Full Code Here

  @Override
  protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
    Application.getBean(LdapConfigDao.class).delete(
        this.getModelObject(), WebSession.getUserId());
    this.setModelObject(new LdapConfig());
    target.add(listContainer);
    target.add(this);
    target.appendJavaScript("omLdapPanelInit();");
  }
View Full Code Here

  public Long addLdapConfig(String name, Boolean addDomainToUserName,
      String configFileName, String domain, Long insertedby,
      Boolean isActive) {
    try {

      LdapConfig ldapConfig = new LdapConfig();
      ldapConfig.setAddDomainToUserName(addDomainToUserName);
      ldapConfig.setConfigFileName(configFileName);
      ldapConfig.setDeleted(false);
      ldapConfig.setDomain(domain);
      ldapConfig.setIsActive(isActive);
      ldapConfig.setName(name);
      ldapConfig.setInserted(new Date());
      if (insertedby != null) {
        log.debug("addLdapConfig :1: " + usersDao.get(insertedby));
        ldapConfig.setInsertedby(usersDao.get(insertedby));
      }

      log.debug("addLdapConfig :2: " + insertedby);

      ldapConfig = em.merge(ldapConfig);
      Long ldapConfigId = ldapConfig.getLdapConfigId();

      if (ldapConfigId > 0) {
        return ldapConfigId;
      } else {
        throw new Exception("Could not store SOAPLogin");
View Full Code Here

  public Long updateLdapConfig(Long ldapConfigId, String name,
      Boolean addDomainToUserName, String configFileName, String domain,
      Long updatedby, Boolean isActive) {
    try {

      LdapConfig ldapConfig = this.get(ldapConfigId);

      if (ldapConfig == null) {
        return -1L;
      }

      ldapConfig.setAddDomainToUserName(addDomainToUserName);
      ldapConfig.setConfigFileName(configFileName);
      ldapConfig.setDeleted(false);
      ldapConfig.setDomain(domain);
      ldapConfig.setIsActive(isActive);
      ldapConfig.setName(name);
      ldapConfig.setUpdated(new Date());
      if (updatedby != null) {
        log.debug("updateLdapConfig :1: " + usersDao.get(updatedby));
        ldapConfig.setUpdatedby(usersDao.get(updatedby));
      }

      log.debug("updateLdapConfig :2: " + updatedby);

      ldapConfig = em.merge(ldapConfig);
      ldapConfigId = ldapConfig.getLdapConfigId();

      return ldapConfigId;

    } catch (Exception ex2) {
      log.error("[updateLdapConfig]: ", ex2);
View Full Code Here

      TypedQuery<LdapConfig> query = em
          .createQuery(hql, LdapConfig.class);
      query.setParameter("ldapConfigId", ldapConfigId);
      query.setParameter("deleted", false);

      LdapConfig ldapConfig = null;
      try {
        ldapConfig = query.getSingleResult();
      } catch (NoResultException ex) {
      }
View Full Code Here

  }

  public Long deleteLdapConfigById(Long ldapConfigId) {
    try {

      LdapConfig ldapConfig = this.get(ldapConfigId);

      if (ldapConfig == null) {
        return null;
      }

      ldapConfig = em
          .find(LdapConfig.class, ldapConfig.getLdapConfigId());
      em.remove(ldapConfig);

      return ldapConfigId;

    } catch (Exception ex2) {
View Full Code Here

  public List<LdapConfig> getActiveLdapConfigs() {
    try {
      List<LdapConfig> ldapConfigs = this.ldapConfigDaoImpl.getActiveLdapConfigs();
     
      //Add localhost Domain
      LdapConfig ldapConfig = new LdapConfig();
     
      ldapConfig.setName("local DB [internal]");
      ldapConfig.setLdapConfigId(-1);
     
      List<LdapConfig> returnldapConfigs = new LinkedList<LdapConfig>();
      returnldapConfigs.add(ldapConfig);
     
      for (LdapConfig ldapConfigStored : ldapConfigs) {
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.basic.LdapConfig

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.