Package org.apache.openmeetings.db.entity.server

Examples of org.apache.openmeetings.db.entity.server.LdapConfig


   */
  public boolean getLdapPwdSynchStatus(Long ldapConfigId) { // TIBO
    // Retrieve Configuration Data
    HashMap<String, String> configData;

    LdapConfig ldapConfig = ldapConfigDao.get(ldapConfigId);

    try {
      configData = getLdapConfigData(ldapConfig.getConfigFileName());
    } catch (Exception e) {
      log.error("Error on getLdapPwdSynchStatus : " + e.getMessage());
      return true;
    }

View Full Code Here


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

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

          protected void onEvent(AjaxRequestTarget target) {
            form.setModelObject(lc);
            form.hideNewRecord();
            target.add(form, listContainer);
            target.appendJavaScript("omLdapPanelInit();");
          }
        });
        item.add(AttributeModifier.replace("class", "clickable ui-widget-content"
            + (lc.getLdapConfigId() == form.getModelObject().getLdapConfigId() ? " ui-state-active" : "")));
      }
    };
    add(listContainer.add(dataView).setOutputMarkupId(true));
    PagedEntityListPanel navigator = new PagedEntityListPanel("navigator", dataView) {
      private static final long serialVersionUID = -1L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    };
    DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView, navigator);
    container.addLink(new OmOrderByBorder<LdapConfig>("orderById", "ldapConfigId", container))
      .addLink(new OmOrderByBorder<LdapConfig>("orderByName", "name", container))
      .addLink(new OmOrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
    add(container.getLinks());
    add(navigator);
   
    form = new LdapForm("form", listContainer, new LdapConfig());
    form.showNewRecord();
        add(form);
   
  }
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

    return query.getResultList();
  }

  public List<LdapConfig> get() {
    //Add localhost Domain
    LdapConfig ldapConfig = new LdapConfig();
   
    ldapConfig.setName("local DB [internal]");
    ldapConfig.setLdapConfigId(-1);

    List<LdapConfig> result = new ArrayList<LdapConfig>();
    result.add(ldapConfig);
    result.addAll(getActive());
    return result;
View Full Code Here

    log.debug("LdapLoginmanagement.doLdapLogin");

    Properties config = new Properties();
    InputStream pis = null;
    try {
      LdapConfig ldapConfig = ldapConfigDao.get(domainId);
      pis = new FileInputStream(new File(OmFileHelper.getConfDir(), ldapConfig.getConfigFileName()));
      config.load(pis);
    } catch (Exception e) {
      log.error("Error on LdapLogin : Configurationdata couldnt be retrieved!");
      return null;
    } finally {
View Full Code Here

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

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

          protected void onEvent(AjaxRequestTarget target) {
            form.setModelObject(lc);
            form.hideNewRecord();
            target.add(form, listContainer);
            target.appendJavaScript("omLdapPanelInit();");
          }
        });
        item.add(AttributeModifier.replace("class", "clickable ui-widget-content"
            + (lc.getLdapConfigId() == form.getModelObject().getLdapConfigId() ? " selected" : "")));
      }
    };
    add(listContainer.add(dataView).setOutputMarkupId(true));
    PagedEntityListPanel navigator = new PagedEntityListPanel("navigator", dataView) {
      private static final long serialVersionUID = -1L;

      @Override
      protected void onEvent(AjaxRequestTarget target) {
        target.add(listContainer);
      }
    };
    DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView, navigator);
    container.setLinks(new OmOrderByBorder<LdapConfig>("orderById", "ldapConfigId", container)
        , new OmOrderByBorder<LdapConfig>("orderByName", "name", container)
        , new OmOrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
    add(container.orderLinks);
    add(navigator);
   
    form = new LdapForm("form", listContainer, new LdapConfig());
    form.showNewRecord();
        add(form);
   
  }
View Full Code Here

TOP

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