Package com.vdoc.sdk.commons.utils
Class DirectoryUtils
java.lang.Object
com.vdoc.sdk.commons.utils.DirectoryUtils
Directory utility class
- Author:
- famaridon
-
Method Summary
Modifier and TypeMethodDescriptionstatic IOrganizationcopyOrganization(IDirectoryModule directoryModule, IOrganization source, IOrganization parent, String type) Copy an organizationstatic IOrganizationcreateUniqueOrganization(IDirectoryModule directoryModule, IContext context, IOrganization parent, String label) Create an organization with unique system name (the system name can end with index)static IOrganizationgetRootParent(IOrganization organization) get to level organizationstatic booleanhaveParent(IOrganization organization, String parentName) check if an organization have a parent with the given name.
-
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 modulecontext- the contextparent- the parent organizationlabel- the organization name- Returns:
- a new and unique organization.
- Throws:
DirectoryModuleException- on error
-
haveParent
check if an organization have a parent with the given name. (organization name is unique into directory)- Parameters:
organization- the child to checkparentName- the parent to found- Returns:
- true only if parent is found.
-
getRootParent
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 modulesource- the source organizationparent- the parent organizationtype- the type- Returns:
- the copied organization
-