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
Modifier and TypeFieldDescriptionprotected AbstractCacheManager
The cache managerprotected Context
The contextprotected ContentTypeExtensionPoint
The content type extension pointprotected LanguagesManager
The languages managerprotected AmetysObjectResolver
The ametys object resolverstatic final String
The parent content type idstatic final String
The orgUnit content typestatic final String
The orgUnit parent attributestatic final String
The avalon role.static final String
The root node name of the plugin -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_requestUserContentIds
(UserIdentity user, String lang) Request the list of user content idvoid
contextualize
(Context context) getOrgUnits
(Content user) Get the list of orgunits contentgetUserContent
(UserIdentity user, String givenLanguage) Get user content from user identitygetUserContents
(UserIdentity user, String givenLanguage) Get user contents from user identityGets the root of user directory contentsgetUserDirectoryRootContent
(boolean create) Gets the root of user directory contentsvoid
void
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 Details
-
ROLE
The avalon role. -
USER_DIRECTORY_ROOT_NODE
The root node name of the plugin- See Also:
-
ORGUNITS_ATTRIBUTE
The orgUnit parent attribute- See Also:
-
ORGUNIT_CONTENT_TYPE
The orgUnit content type- See Also:
-
ABSTRACT_USER_CONTENT_TYPE
The parent content type id- See Also:
-
_resolver
The ametys object resolver -
_cTypeEP
The content type extension point -
_cacheManager
The cache manager -
_languagesManager
The languages manager -
_context
The context
-
-
Constructor Details
-
UserDirectoryHelper
public UserDirectoryHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getUserDirectoryRootContent
Gets the root of user directory contents- Returns:
- the root of user directory contents
-
getUserDirectoryRootContent
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
Get the list of orgunits content- Parameters:
user
- the user content- Returns:
- the list of orgunits
-
getUserContents
Get user contents from user identity- Parameters:
user
- the user identitygivenLanguage
- the given language- Returns:
- the user contents
-
getUserContent
Get user content from user identity- Parameters:
user
- the user identitygivenLanguage
- the given language- Returns:
- the user content (null if it not exist)
-
_requestUserContentIds
Request the list of user content id- Parameters:
user
- the user identitylang
- the lang- Returns:
- the list of user content id (empty if it not exist)
-
invalidateUserContentCache
Invalidate the user content cache for one language. If lang isnull
, invalidate all- Parameters:
lang
- the lang. Can benull
-