コード例 #1
0
 /**
  * Used for bind and update.
  *
  * @param person
  * @return
  * @see org.projectforge.ldap.LdapDao#getModificationItems(org.projectforge.ldap.LdapObject)
  */
 @Override
 protected List<ModificationItem> getModificationItems(
     final List<ModificationItem> list, final LdapGroup group) {
   createAndAddModificationItems(list, "businessCategory", group.getBusinessCategory());
   createAndAddModificationItems(list, "o", group.getOrganization());
   createAndAddModificationItems(list, "description", group.getDescription());
   if (CollectionUtils.isNotEmpty(group.getMembers()) == true) {
     createAndAddModificationItems(list, "uniqueMember", group.getMembers());
   } else {
     createAndAddModificationItems(list, "uniqueMember", NONE_UNIQUE_MEMBER_ID);
   }
   final boolean modifyPosixAccount =
       isPosixAccountsConfigured() == true
           && GroupDOConverter.isPosixAccountValuesEmpty(group) == false;
   if (modifyPosixAccount == true) {
     if (group.getObjectClasses() != null) {
       final List<String> missedObjectClasses =
           LdapUtils.getMissedObjectClasses(
               getAdditionalObjectClasses(group), getObjectClass(), group.getObjectClasses());
       if (CollectionUtils.isNotEmpty(missedObjectClasses) == true) {
         for (final String missedObjectClass : missedObjectClasses) {
           list.add(
               createModificationItem(DirContext.ADD_ATTRIBUTE, "objectClass", missedObjectClass));
         }
       }
     }
   }
   if (modifyPosixAccount == true) {
     createAndAddModificationItems(list, "gidNumber", String.valueOf(group.getGidNumber()));
   }
   return list;
 }
コード例 #2
0
 /**
  * @see org.projectforge.ldap.LdapDao#getAdditionalObjectClasses(org.projectforge.ldap.LdapObject)
  */
 @Override
 protected String[] getAdditionalObjectClasses(final LdapGroup obj) {
   final boolean posixAccount =
       isPosixAccountsConfigured() == true
           && GroupDOConverter.isPosixAccountValuesEmpty(obj) == false;
   if (posixAccount == true) {
     return ADDITIONAL_OBJECT_CLASSES_WITH_POSIX_SUPPORT;
   }
   return ADDITIONAL_OBJECT_CLASSES;
 }