Package org.ametys.plugins.repository
Interface TraversableAmetysObject
-
- All Superinterfaces:
AmetysObject
- All Known Subinterfaces:
Calendar
,JCRTraversableAmetysObject
,MetadataAwarePagesContainer
,ModifiableCalendar
,ModifiablePage
,ModifiableResourceCollection
,ModifiableThread
,ModifiableTraversableAmetysObject
,ModifiableWebContent
,Page
,PagesContainer
,ResourceCollection
,SharedContent
,Thread
,WebContent
- All Known Implementing Classes:
AbstractBlogPage
,AbstractLevelPage
,AbstractOdfPage
,AbstractProgram
,AbstractProgramPart
,AbstractSurveyElement
,AbstractTraversableProgramPart
,AmetysObjectCollection
,CategoryJCR
,CMISResourcesCollection
,CMISRootResourcesCollection
,CMSJCRTag
,Container
,Course
,CourseList
,CoursePage
,CoursePart
,DefaultContent
,DefaultLink
,DefaultPage
,DefaultSharedContent
,DefaultTraversableAmetysObject
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,FirstLevelPage
,JCRCalendar
,JCRCalendarEvent
,JCRCategory
,JCRResourcesCollection
,JCRSubscribersList
,JCRTag
,JCRTasksList
,JCRThread
,JCRWorkflow
,JCRWorkflowProcess
,KeywordJCR
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,OrgUnitPage
,Person
,Program
,ProgramPage
,Project
,ProjectTagJCR
,QueryContainer
,RedirectPage
,RootAmetysObject
,SecondLevelPage
,Site
,Sitemap
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
,Thesaurus
,TransitionalPage
,UGCPage
,UGCTransitionalPage
,UserPage
,VersionComponentAmetysObject
,VersionsAmetysObject
,VirtualMonthPage
,VirtualPostPage
,VirtualPostsPage
,VirtualTagPage
,VirtualTagsPage
,VirtualYearPage
,VirtualYearsPage
public interface TraversableAmetysObject extends AmetysObject
AmetysObject
which is traversable and allow to create children.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <A extends AmetysObject>
AgetChild(String path)
Retrieves a given child from its relative path.default <A extends AmetysObject>
AgetChildAt(long index)
Gets the childAmetysObject
at the given positiondefault long
getChildPosition(AmetysObject ao)
Returns the position of thisAmetysObject
within the ordered set of its sibling objects.<A extends AmetysObject>
AmetysObjectIterable<A>getChildren()
Retrieves children of the current object.boolean
hasChild(String name)
Tests if this Object has at least one child with the given name.-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
-
-
-
Method Detail
-
getChildren
<A extends AmetysObject> AmetysObjectIterable<A> getChildren() throws AmetysRepositoryException
Retrieves children of the current object.- Type Parameters:
A
- the actual type ofAmetysObject
s.- Returns:
- the children or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChild
boolean hasChild(String name) throws AmetysRepositoryException
Tests if this Object has at least one child with the given name.- 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.
-
getChild
<A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
Retrieves a given child from its relative path. The path cannot benull
, empty nor begin with a'/'
.- 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.
-
getChildAt
default <A extends AmetysObject> A getChildAt(long index) throws AmetysRepositoryException, UnknownAmetysObjectException
Gets the childAmetysObject
at the given position- Type Parameters:
A
- The type of children objects- Parameters:
index
- the position of theAmetysObject
within the ordered set of its sibling objects.- Returns:
- the
AmetysObject
if found - Throws:
AmetysRepositoryException
- if an error occursUnknownAmetysObjectException
- if no object was found at this position
-
getChildPosition
default long getChildPosition(AmetysObject ao) throws AmetysRepositoryException
Returns the position of thisAmetysObject
within the ordered set of its sibling objects.- Parameters:
ao
- The Ametys object- Returns:
- the position of this
AmetysObject
within the ordered set of its sibling objects. - Throws:
AmetysRepositoryException
- if an error occurs.
-
-