Class UserDirectoryPageResolver
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.userdirectory.page.UserDirectoryPageResolver
-
- All Implemented Interfaces:
Initializable,Component,Contextualizable,LogEnabled,Serviceable
public class UserDirectoryPageResolver extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable
Resolves an user directory page path from the associated user content.
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver_ametysResolverThe ametys object resolver.protected static String_CACHE_KEY_EMPTY_SITEThe key cache for empty siteprotected AbstractCacheManager_cacheManagerThe cache managerprotected Context_contextThe contextprotected LanguagesManager_languagesManagerThe languages managerprotected UserDirectoryPageHandler_pageHandlerThe user directory page handlerstatic StringROLEThe avalon role.
-
Constructor Summary
Constructors Constructor Description UserDirectoryPageResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String_getUserPageId(Content userContent, String siteName, String language, String contentTypeId)Return the user page idvoidcontextualize(Context context)UserPagegetUserPage(Content userContent, String siteName, String sitemapName)Return the user pageUserPagegetUserPage(Content userContent, String siteName, String sitemapName, String contentTypeId)Return the user pageUserPagegetUserPage(Page userDirectoryRootPage, Content userContent)Return the user pageStringgetUserPageId(Page userDirectoryRootPage, Content userContent)Return the user page identifiervoidinitialize()voidinvalidateUserPageCache(String lang)Invalidate the user page cache for one language.voidservice(ServiceManager serviceManager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_CACHE_KEY_EMPTY_SITE
protected static final String _CACHE_KEY_EMPTY_SITE
The key cache for empty site- See Also:
- Constant Field Values
-
_ametysResolver
protected AmetysObjectResolver _ametysResolver
The ametys object resolver.
-
_pageHandler
protected UserDirectoryPageHandler _pageHandler
The user directory page handler
-
_cacheManager
protected AbstractCacheManager _cacheManager
The cache manager
-
_languagesManager
protected LanguagesManager _languagesManager
The languages manager
-
-
Constructor Detail
-
UserDirectoryPageResolver
public UserDirectoryPageResolver()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) 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
-
getUserPage
public UserPage getUserPage(Content userContent, String siteName, String sitemapName)
Return the user page- Parameters:
userContent- the user page contentsiteName- The current site name.sitemapName- The current sitemap name.- Returns:
- the user page or
nullif the user page does not exist
-
getUserPage
public UserPage getUserPage(Content userContent, String siteName, String sitemapName, String contentTypeId)
Return the user page- Parameters:
userContent- the user page contentsiteName- The current site name.sitemapName- The current sitemap name.contentTypeId- the content type id- Returns:
- the user page or
nullif the user page does not exist
-
_getUserPageId
protected String _getUserPageId(Content userContent, String siteName, String language, String contentTypeId)
Return the user page id- Parameters:
userContent- the user contentsiteName- the site namelanguage- the given languagecontentTypeId- the content type id- Returns:
- the user page id or
nullif the user page does not exist
-
getUserPage
public UserPage getUserPage(Page userDirectoryRootPage, Content userContent)
Return the user page- Parameters:
userDirectoryRootPage- the user directory root pageuserContent- the user content- Returns:
- the user page or
nullif the user page does not exist
-
getUserPageId
public String getUserPageId(Page userDirectoryRootPage, Content userContent)
Return the user page identifier- Parameters:
userDirectoryRootPage- the user directory root pageuserContent- the user content- Returns:
- the user page or
nullif the user page does not exist
-
invalidateUserPageCache
public void invalidateUserPageCache(String lang)
Invalidate the user page cache for one language. If lang isnull, invalidate all- Parameters:
lang- the lang. Can benull
-
-