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
_cacheManager
The cache managerprotected Context
_context
The contextprotected ContentTypeExtensionPoint
_cTypeEP
The content type extension pointprotected LanguagesManager
_languagesManager
The languages managerprotected AmetysObjectResolver
_resolver
The ametys object resolverstatic String
ORGUNITS_ATTRIBUTE
The orgUnit parent attributestatic String
ROLE
The avalon role.static String
USER_DIRECTORY_ROOT_NODE
The 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 idvoid
contextualize(Context context)
List<Content>
getOrgUnits(Content user)
Get the list of orgunits contentContent
getUserContent(UserIdentity user, String givenLanguage)
Get user content from user identityAmetysObjectCollection
getUserDirectoryRootContent()
Gets the root of user directory contentsAmetysObjectCollection
getUserDirectoryRootContent(boolean create)
Gets the root of user directory contentsvoid
initialize()
void
invalidateUserContentCache(String lang)
Invalidate the user content cache for one language.void
service(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:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in 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
-true
to 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
-
-