Class DirectoryUtils

java.lang.Object
com.vdoc.sdk.commons.utils.DirectoryUtils

public class DirectoryUtils extends Object
Directory utility class
Author:
famaridon
  • Method Details

    • createUniqueOrganization

      public static IOrganization createUniqueOrganization(IDirectoryModule directoryModule, IContext context, IOrganization parent, String label) throws DirectoryModuleException
      Create an organization with unique system name (the system name can end with index)
      Parameters:
      directoryModule - the module
      context - the context
      parent - the parent organization
      label - the organization name
      Returns:
      a new and unique organization.
      Throws:
      DirectoryModuleException - on error
    • haveParent

      public static boolean haveParent(IOrganization organization, String parentName)
      check if an organization have a parent with the given name. (organization name is unique into directory)
      Parameters:
      organization - the child to check
      parentName - the parent to found
      Returns:
      true only if parent is found.
    • getRootParent

      public static IOrganization getRootParent(IOrganization organization)
      get to level organization
      Parameters:
      organization - start organization
      Returns:
      the root organization
    • copyOrganization

      public static IOrganization copyOrganization(IDirectoryModule directoryModule, IOrganization source, IOrganization parent, String type)
      Copy an organization
      Parameters:
      directoryModule - the module
      source - the source organization
      parent - the parent organization
      type - the type
      Returns:
      the copied organization