Package org.ametys.plugins.userdirectory
Class OrganisationChartPageHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.userdirectory.OrganisationChartPageHandler
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class OrganisationChartPageHandler extends AbstractLogEnabled implements Component, Serviceable
Component providing methods to retrieve organization chart virtual pages, such as the organization chart root and orgUnit page.
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_resolver
The ametys object resolver.static String
CHILD_ORGUNIT_ATTRIBUTE_NAME
The orgUnit child attribute namestatic String
ORGUNIT_CONTENT_TYPE
The orgUnit content typestatic String
ORGUNIT_USER_ATTRIBUTE_NAME
The attribute name for orgUnit user in repeaterstatic String
ORGUNIT_USER_ROLE_ATTRIBUTE_NAME
The attribute name for orgUnit user role in repeaterstatic String
ORGUNIT_USERS_ATTRIBUTE_NAME
The attribute name for orgUnit users repeaterstatic String
PARENT_ORGUNIT_ATTRIBUTE_NAME
The orgUnit parent attribute namestatic String
ROLE
The avalon role.
-
Constructor Summary
Constructors Constructor Description OrganisationChartPageHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Content>
getChildContents(Content parentContent)
Get child orgUnit contents from parentContentContent
getChildFromPath(Content parentContent, String path)
Get the child content.AmetysObjectIterable<Content>
getContentsForRootPage(Page rootPage)
Get orgUnit contents from rootPageAmetysObjectIterable<Content>
getFirstLevelOfContents(String lang)
Get orgUnit contentsPage
getOrganisationChartRootPages(String siteName, String sitemapName)
Get the organization chart root page.Content
getParentContent(Content childContent)
Get parent orgUnit content from childContentList<Content>
getUserContents(Content content)
Get users contents from contentboolean
isOrganisationChartRootPage(JCRAmetysObject jcrPage)
True if the page is the organization chart root pagevoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
ORGUNIT_CONTENT_TYPE
public static final String ORGUNIT_CONTENT_TYPE
The orgUnit content type- See Also:
- Constant Field Values
-
PARENT_ORGUNIT_ATTRIBUTE_NAME
public static final String PARENT_ORGUNIT_ATTRIBUTE_NAME
The orgUnit parent attribute name- See Also:
- Constant Field Values
-
CHILD_ORGUNIT_ATTRIBUTE_NAME
public static final String CHILD_ORGUNIT_ATTRIBUTE_NAME
The orgUnit child attribute name- See Also:
- Constant Field Values
-
ORGUNIT_USERS_ATTRIBUTE_NAME
public static final String ORGUNIT_USERS_ATTRIBUTE_NAME
The attribute name for orgUnit users repeater- See Also:
- Constant Field Values
-
ORGUNIT_USER_ATTRIBUTE_NAME
public static final String ORGUNIT_USER_ATTRIBUTE_NAME
The attribute name for orgUnit user in repeater- See Also:
- Constant Field Values
-
ORGUNIT_USER_ROLE_ATTRIBUTE_NAME
public static final String ORGUNIT_USER_ROLE_ATTRIBUTE_NAME
The attribute name for orgUnit user role in repeater- See Also:
- Constant Field Values
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver.
-
-
Constructor Detail
-
OrganisationChartPageHandler
public OrganisationChartPageHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getContentsForRootPage
public AmetysObjectIterable<Content> getContentsForRootPage(Page rootPage)
Get orgUnit contents from rootPage- Parameters:
rootPage
- the root page- Returns:
- the list of orgUnit contents
-
getFirstLevelOfContents
public AmetysObjectIterable<Content> getFirstLevelOfContents(String lang)
Get orgUnit contents- Parameters:
lang
- the language- Returns:
- the list of orgUnit contents at the first level
-
isOrganisationChartRootPage
public boolean isOrganisationChartRootPage(JCRAmetysObject jcrPage)
True if the page is the organization chart root page- Parameters:
jcrPage
- the page- Returns:
- true if the page is the organization chart root page
-
getChildContents
public List<Content> getChildContents(Content parentContent)
Get child orgUnit contents from parentContent- Parameters:
parentContent
- the parent content- Returns:
- the list of child orgUnit contents
-
getParentContent
public Content getParentContent(Content childContent)
Get parent orgUnit content from childContent- Parameters:
childContent
- the child content- Returns:
- the parent orgUnit content
-
getUserContents
public List<Content> getUserContents(Content content)
Get users contents from content- Parameters:
content
- the content- Returns:
- the list of user contents
-
getChildFromPath
public Content getChildFromPath(Content parentContent, String path)
Get the child content. Return null if it not exist- Parameters:
parentContent
- the parent contentpath
- the path from the parent content- Returns:
- the child content.
-
getOrganisationChartRootPages
public Page getOrganisationChartRootPages(String siteName, String sitemapName) throws AmetysRepositoryException
Get the organization chart root page.- Parameters:
siteName
- the current site.sitemapName
- the sitemap name.- Returns:
- the organization chart root page
- Throws:
AmetysRepositoryException
- if an error occurred.
-
-