Package org.ametys.plugins.userdirectory
Class UserDirectoryHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.userdirectory.UserDirectoryHelper
-
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Contextualizable,Serviceable
public class UserDirectoryHelper extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable
Helper for user directory.
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractCacheManager_cacheManagerThe cache managerprotected Context_contextThe contextprotected ContentTypeExtensionPoint_cTypeEPThe content type extension pointprotected LanguagesManager_languagesManagerThe languages managerprotected AmetysObjectResolver_resolverThe ametys object resolverstatic StringORGUNITS_ATTRIBUTEThe orgUnit parent attributestatic StringROLEThe avalon role.static StringUSER_DIRECTORY_ROOT_NODEThe root node name of the plugin
-
Constructor Summary
Constructors Constructor Description UserDirectoryHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_requestUserContentId(UserIdentity user, String lang)Request the user content idvoidcontextualize(Context context)List<Content>getOrgUnits(Content user)Get the list of orgunits contentContentgetUserContent(UserIdentity user, String givenLanguage)Get user content from user identityAmetysObjectCollectiongetUserDirectoryRootContent()Gets the root of user directory contentsAmetysObjectCollectiongetUserDirectoryRootContent(boolean create)Gets the root of user directory contentsvoidinitialize()voidinvalidateUserContentCache(String lang)Invalidate the user content cache for one language.voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
USER_DIRECTORY_ROOT_NODE
public static final String USER_DIRECTORY_ROOT_NODE
The root node name of the plugin- See Also:
- Constant Field Values
-
ORGUNITS_ATTRIBUTE
public static final String ORGUNITS_ATTRIBUTE
The orgUnit parent attribute- See Also:
- Constant Field Values
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
_cTypeEP
protected ContentTypeExtensionPoint _cTypeEP
The content type extension point
-
_cacheManager
protected AbstractCacheManager _cacheManager
The cache manager
-
_languagesManager
protected LanguagesManager _languagesManager
The languages manager
-
-
Constructor Detail
-
UserDirectoryHelper
public UserDirectoryHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getUserDirectoryRootContent
public AmetysObjectCollection getUserDirectoryRootContent()
Gets the root of user directory contents- Returns:
- the root of user directory contents
-
getUserDirectoryRootContent
public AmetysObjectCollection getUserDirectoryRootContent(boolean create)
Gets the root of user directory contents- Parameters:
create-trueto create automatically the root when missing.- Returns:
- the root of user directory contents
-
getOrgUnits
public List<Content> getOrgUnits(Content user)
Get the list of orgunits content- Parameters:
user- the user content- Returns:
- the list of orgunits
-
getUserContent
public Content getUserContent(UserIdentity user, String givenLanguage)
Get user content from user identity- Parameters:
user- the user identitygivenLanguage- the given language- Returns:
- the user content (null if it not exist)
-
_requestUserContentId
protected String _requestUserContentId(UserIdentity user, String lang)
Request the user content id- Parameters:
user- the user identitylang- the lang- Returns:
- the user content id (null if it not exist)
-
invalidateUserContentCache
public void invalidateUserContentCache(String lang)
Invalidate the user content cache for one language. If lang isnull, invalidate all- Parameters:
lang- the lang. Can benull
-
-