コード例 #1
0
  public List<String> getLdapValue(List<String> names, String uid) {
    List<String> returnList = new ArrayList<String>();

    for (String name : names) {

      if (!nameOptions.contains(name)) {
        returnList.add(name + " is not currently supported.");
        continue;
      }

      String value = "";

      ContactDAO contactDAO = LdapService.getContactDAO();
      List<ContactDTO> contacts = contactDAO.findContact("uid=" + uid);
      ContactDTO contact = contacts.get(0);
      if (name.equals("cn")) {
        value = contact.getCommonName();
      }
      if (name.equals("mobile")) {
        value = contact.getMobile();
      }
      if (name.equals("employeeNumber")) {
        value = contact.getEmployeeNumber();
      }
      if (name.equals("displayName")) {
        value = contact.getDisplayName();
      }
      if (name.equals("gender")) {
        value = contact.getGender();
      }
      if (name.equals("email")) {
        List<ContactAcctDTO> accts =
            contactDAO.findContactAcct(contact.getCommonName(), ContactAcctDTO.CN_MAIL);
        value = accts.get(0).getUid();
      }
      returnList.add(value);
    }
    return returnList;
  }
コード例 #2
0
 public String getLdapByQuery(String query) {
   ContactDAO contactDAO = LdapService.getContactDAO();
   List<ContactDTO> dtos = contactDAO.findContact(query);
   return "";
 }