atg.portal.admin.userdirectory
Class PortalUserDirectoryTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.userdirectory.UserDirectoryTools
              extended by atg.portal.admin.userdirectory.PortalUserDirectoryTools
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class PortalUserDirectoryTools
extends UserDirectoryTools

Provides specific Portal user directory methods. These methods include adding and removing users (guests, members, leaders) to communities. removing roles from a community.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
PortalUserDirectoryTools()
          Constructs an instanceof PortalUserDirectoryTools
 
Method Summary
 void addUserToCommunity(java.lang.String pProfileId, java.lang.String pCommunityId, java.lang.String pUserType)
          Adds a user to the community with the specified membership level.
 void createCommunityRole(Community pCommunity, java.lang.String pRoleName)
          Creates a community-relative role.
 void createGearRole(Gear pGear, java.lang.String pRoleName)
          Creates a gear-relative role.
 void createRole(java.lang.String pRolePath)
          Creates a role from a fully-qualified path name.
 java.util.Collection getOrganizationItems()
          Deprecated.  
 java.util.Collection getOrganizations()
          Returns a Collection of all Organizations from the Portal Repository.
 java.util.Collection getOrganizations(int pStartIndex, int pEndIndex)
          Returns a Collection of Organizations from the Portal Repository.
 java.util.Collection getRoles()
          Returns a Collection of all Roles from the Portal Repository.
 java.util.Collection getRoles(int pStartIndex, int pEndIndex)
          Returns a Collection of Roles from the Portal Repository.
 void removeRoleFolder(java.lang.String pName)
          removeRoleFolder searches the user directory repository for the role with the name passed in.
 void removeRoleFromCommunity(java.lang.String pCommunityId, java.lang.String pUserType)
          removeRoleFromCommunity removes the role from the community.
 void removeUserFromCommunity(java.lang.String pProfileId, java.lang.String pCommunityId, java.lang.String pUserType)
          Revokes a community membership level from a user.
 void setRoleDescription(java.lang.String pRolePath, java.lang.String pValue)
          Sets the "description" field of a role.
 void updateRoleFolderName(java.lang.String pOldName, java.lang.String pNewName)
          update all the roles which have name as pOldName to have a name of pNewName
 
Methods inherited from class atg.userdirectory.UserDirectoryTools
addUserToOrganization, assignRolesToUser, assignRolesToUser, doStartService, getUserDirectory, removeAllRolesFromUser, removeRolesFromUser, removeRolesFromUser, removeUserFromOrganization, removeUserFromParentOrganization, setUserDirectory
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

PortalUserDirectoryTools

public PortalUserDirectoryTools()
Constructs an instanceof PortalUserDirectoryTools

Method Detail

getOrganizations

public java.util.Collection getOrganizations(int pStartIndex,
                                             int pEndIndex)
Returns a Collection of Organizations from the Portal Repository.

Returns:
The Collection of Organizations
Throws:
java.lang.IllegalArgumentException - endpoint indices out of order (fromIndex > toIndex)

getOrganizations

public java.util.Collection getOrganizations()
Returns a Collection of all Organizations from the Portal Repository.

Returns:
The Collection of Organizations

getRoles

public java.util.Collection getRoles(int pStartIndex,
                                     int pEndIndex)
Returns a Collection of Roles from the Portal Repository.

Returns:
The Collection of Roles

getRoles

public java.util.Collection getRoles()
Returns a Collection of all Roles from the Portal Repository.

Returns:
The Collection of Roles

getOrganizationItems

public java.util.Collection getOrganizationItems()
Deprecated. 

Returns a collection of RepositoryItems that represent Organizations. This method should not be used; use getOrganizations() instead.


addUserToCommunity

public void addUserToCommunity(java.lang.String pProfileId,
                               java.lang.String pCommunityId,
                               java.lang.String pUserType)
Adds a user to the community with the specified membership level.


removeUserFromCommunity

public void removeUserFromCommunity(java.lang.String pProfileId,
                                    java.lang.String pCommunityId,
                                    java.lang.String pUserType)
Revokes a community membership level from a user.


removeRoleFromCommunity

public void removeRoleFromCommunity(java.lang.String pCommunityId,
                                    java.lang.String pUserType)
removeRoleFromCommunity removes the role from the community. This method builds the role from the community id passed in and the user type by concatenating the two string values (e.g. hr-leader). It looks up the role in the user directory and if it finds it, it removes the role from the community. If it doesn't find the role, it displays an error message. This is typically used during the deletion of a community. When the community is deleted, the roles are no longer needed.

Parameters:
pCommunityId - the community Id
pUserType - the type of user to remove (e.g. guest, member, leader)

removeRoleFolder

public void removeRoleFolder(java.lang.String pName)
                      throws DirectoryModificationException
removeRoleFolder searches the user directory repository for the role with the name passed in. If it finds the role folder, it tries to delete it. If it fails, an error message is thrown. When the community is deleted, the roles are no longer needed so they are deleted. The empty folder is deleted last.

Parameters:
pName - the name of the folder to delete
Throws:
DirectoryModificationException

createCommunityRole

public void createCommunityRole(Community pCommunity,
                                java.lang.String pRoleName)
                         throws DirectoryModificationException
Creates a community-relative role.

Throws:
DirectoryModificationException

createGearRole

public void createGearRole(Gear pGear,
                           java.lang.String pRoleName)
                    throws DirectoryModificationException
Creates a gear-relative role.

Throws:
DirectoryModificationException

createRole

public void createRole(java.lang.String pRolePath)
                throws DirectoryModificationException
Creates a role from a fully-qualified path name. If you think this should be part of the user directory API, you're RIGHT!

Throws:
DirectoryModificationException

setRoleDescription

public void setRoleDescription(java.lang.String pRolePath,
                               java.lang.String pValue)
Sets the "description" field of a role.


updateRoleFolderName

public void updateRoleFolderName(java.lang.String pOldName,
                                 java.lang.String pNewName)
                          throws RepositoryException
update all the roles which have name as pOldName to have a name of pNewName

Throws:
RepositoryException