Class UserPage
java.lang.Object
org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage<UserPageFactory>
org.ametys.plugins.userdirectory.page.UserPage
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,TagAwareAmetysObject
,TraversableAmetysObject
,MetadataAwareSitemapElement
,Page
,SitemapElement
,SiteAwareAmetysObject
public class UserPage
extends AbstractConfigurableVirtualPage<UserPageFactory>
implements ACLAmetysObject
Page representing a second-level page.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.web.repository.page.Page
Page.LinkType, Page.PageType
-
Field Summary
Fields inherited from class org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage
_configuration, _factory, _root, _scheme
Fields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE
-
Constructor Summary
ConstructorDescriptionUserPage
(Page root, VirtualPageConfiguration configuration, String scheme, UserPageFactory factory, Content syncContent, String path) Constructor. -
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
ARetrieves a given child from its relative path.getChildPageAt
(int index) Gets the childPage
at the given positionAmetysObjectIterable<? extends AmetysObject>
Retrieves children of the current object.AmetysObjectIterable<? extends Page>
Retrieves child pages.AmetysObjectIterable<? extends Page>
getChildrenPages
(boolean includeInvisiblePage) Retrieves child pages.Returns the associated synchronizableContent
.Returns theDataHolder
of thisAmetysObject
.int
getDepth()
Get the page depthgetId()
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
static String
Compute a page idRetrieves the long title.getName()
Retrieves the name of the current object.Returns the parent object in the Ametys hierarchy.Returns the path of the parent object in the Ametys hierarchy.Computes the path relative to the current sitemap.Gets the allowed profiles any connected user has on the given objectgetProfilesForGroups
(Set<GroupIdentity> groups) Gets the groups that have allowed profiles assigned on the given objectGets the users that have allowed profiles assigned on the given objectRetrieves allAmetysObject
ids referencing this page.getTitle()
Retrieves the title.boolean
Tests if this Object has at least one child with the given name.boolean
Returns true if the inheritance is disallow for this ametys objectboolean
Determine if the page is visible into navigation elementsMethods inherited from class org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage
getPath, getRootAttachments, getScheme, getSite, getSitemap, getSitemapName, getSiteName, getTags, getTemplate, getTemplateParametersHolder, getType, getURL, getURLType, getZone, getZoneConfiguration, getZones, hasZone
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames, getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToJSON, dataToSAX, getComposite, getModelItemTypeExtensionPoint, getParentDataHolder, getRootDataHolder, getType, getValue, getValue, getValueOfType, getValueOfType, hasDifferences, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultiple
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Constructor Details
-
UserPage
public UserPage(Page root, VirtualPageConfiguration configuration, String scheme, UserPageFactory factory, Content syncContent, String path) Constructor.- Parameters:
root
- the root page.syncContent
- the synchronized contentpath
- the pathconfiguration
- The abstract virtual page's configurationscheme
- The schemefactory
- The user page factory
-
-
Method Details
-
getId
Compute a page id- Parameters:
path
- The pathrootId
- The root page idcontentId
- The content id- Returns:
- The id
-
getContent
Returns the associated synchronizableContent
.- Overrides:
getContent
in classAbstractConfigurableVirtualPage<UserPageFactory>
- Returns:
- the associated synchronizable
Content
.
-
getDepth
Description copied from interface:Page
Get the page depth- Specified by:
getDepth
in interfacePage
- Returns:
- the page depth
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getReferers
Description copied from interface:Page
Retrieves allAmetysObject
ids referencing this page.- Specified by:
getReferers
in interfacePage
- Overrides:
getReferers
in classAbstractConfigurableVirtualPage<UserPageFactory>
- Returns:
- the
AmetysObject
ids referencing this page. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getTitle
Description copied from interface:SitemapElement
Retrieves the title.- Specified by:
getTitle
in interfaceSitemapElement
- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLongTitle
Description copied from interface:Page
Retrieves the long title.- Specified by:
getLongTitle
in interfacePage
- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildrenPages
Description copied from interface:SitemapElement
Retrieves child pages.- Specified by:
getChildrenPages
in interfaceSitemapElement
- Returns:
- the child pages.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPathInSitemap
Description copied from interface:SitemapElement
Computes the path relative to the current sitemap.- Specified by:
getPathInSitemap
in interfaceSitemapElement
- Returns:
- the path relative to the current sitemap.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChild
public <A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException Description copied from interface:TraversableAmetysObject
Retrieves a given child from its relative path. The path cannot benull
, empty nor begin with a'/'
.- Specified by:
getChild
in interfaceTraversableAmetysObject
- Type Parameters:
A
- the actual type ofAmetysObject
.- Parameters:
path
- the path of the child which can contains a position with.[n]
if same name sibling is allowed.- Returns:
- the child found.
- Throws:
AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.
-
getChildren
Description copied from interface:TraversableAmetysObject
Retrieves children of the current object.- Specified by:
getChildren
in interfaceTraversableAmetysObject
- Returns:
- the children or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChild
Description copied from interface:TraversableAmetysObject
Tests if this Object has at least one child with the given name.- Specified by:
hasChild
in interfaceTraversableAmetysObject
- Parameters:
name
- the name to test. Cannot benull
nor empty nor begin with a'/'
and it cannot contain'/'
.- Returns:
true
if the named child exists,false
otherwise.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getId
Description copied from interface:AmetysObject
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
- Specified by:
getId
in interfaceAmetysObject
- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getName
Description copied from interface:AmetysObject
Retrieves the name of the current object.- Specified by:
getName
in interfaceAmetysObject
- Returns:
- the name.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getParent
Description copied from interface:AmetysObject
Returns the parent object in the Ametys hierarchy.- Specified by:
getParent
in interfaceAmetysObject
- Returns:
- the parent object or
null
if current object is the root. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getParentPath
Description copied from interface:AmetysObject
Returns the path of the parent object in the Ametys hierarchy.- Specified by:
getParentPath
in interfaceAmetysObject
- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePage) throws AmetysRepositoryException Description copied from interface:SitemapElement
Retrieves child pages.- Specified by:
getChildrenPages
in interfaceSitemapElement
- Parameters:
includeInvisiblePage
- true to include invisible pages- Returns:
- the child pages.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
isVisible
Description copied from interface:Page
Determine if the page is visible into navigation elements- Specified by:
isVisible
in interfacePage
- Overrides:
isVisible
in classAbstractConfigurableVirtualPage<UserPageFactory>
- Returns:
- true if the page is visible.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildPageAt
public Page getChildPageAt(int index) throws UnknownAmetysObjectException, AmetysRepositoryException Description copied from interface:SitemapElement
Gets the childPage
at the given position- Specified by:
getChildPageAt
in interfaceSitemapElement
- Parameters:
index
- the position of thePage
within the ordered set of its sibling objects.- Returns:
- the
Page
if found - Throws:
UnknownAmetysObjectException
- if no child page was found at this positionAmetysRepositoryException
- if an error occurs
-
getProfilesForAnonymousAndAnyConnectedUser
public Map<ProfileAssignmentStorage.AnonymousOrAnyConnectedKeys,Set<String>> getProfilesForAnonymousAndAnyConnectedUser()Description copied from interface:ACLAmetysObject
Gets the allowed profiles any connected user has on the given object- Specified by:
getProfilesForAnonymousAndAnyConnectedUser
in interfaceACLAmetysObject
- Returns:
- a map containing allowed/denied profiles that anonymous and any connected user has on the given object
-
getProfilesForGroups
public Map<GroupIdentity,Map<ProfileAssignmentStorage.UserOrGroup, getProfilesForGroupsSet<String>>> (Set<GroupIdentity> groups) Description copied from interface:ACLAmetysObject
Gets the groups that have allowed profiles assigned on the given object- Specified by:
getProfilesForGroups
in interfaceACLAmetysObject
- Parameters:
groups
- The group to get profiles for. Can be null to get profiles for all groups that have rights- Returns:
- The map of allowed/denied groups with their assigned profiles
-
getProfilesForUsers
public Map<UserIdentity,Map<ProfileAssignmentStorage.UserOrGroup, getProfilesForUsersSet<String>>> (UserIdentity user) Description copied from interface:ACLAmetysObject
Gets the users that have allowed profiles assigned on the given object- Specified by:
getProfilesForUsers
in interfaceACLAmetysObject
- Parameters:
user
- The user to get profiles for. Can be null to get profiles for all users that have rights- Returns:
- The map of allowed users with their assigned allowed/denied profiles
-
isInheritanceDisallowed
Description copied from interface:ACLAmetysObject
Returns true if the inheritance is disallow for this ametys object- Specified by:
isInheritanceDisallowed
in interfaceACLAmetysObject
- Returns:
- true if the inheritance is disallow for this ametys object
-