Package org.ametys.plugins.repository
Interface TraversableAmetysObject
- All Superinterfaces:
AmetysObject
- All Known Subinterfaces:
Calendar
,JCRTraversableAmetysObject
,MetadataAwareSitemapElement
,ModifiableCalendar
,ModifiablePage
,ModifiableResourceCollection
,ModifiableSitemapElement
,ModifiableThread
,ModifiableTraversableAmetysObject
,ModifiableWebContent
,Page
,ResourceCollection
,SharedContent
,SitemapElement
,Thread
,WebContent
- All Known Implementing Classes:
AbstractColorableJCRTag
,AbstractConfigurableVirtualPage
,AbstractOdfPage
,AbstractProgram
,AbstractProgramItemPage
,AbstractProgramPart
,AbstractSitemapElement
,AbstractSurveyElement
,AbstractTraversableProgramPart
,AmetysObjectCollection
,CartContainer
,CategoryJCR
,CMISResourcesCollection
,CMISRootResourcesCollection
,CMSJCRTag
,Container
,Course
,CourseList
,CoursePage
,CoursePart
,DefaultContent
,DefaultLink
,DefaultPage
,DefaultSharedContent
,DefaultTraversableAmetysObject
,DefaultWebContent
,DefaultWorkflowAwareContent
,DefaultZone
,FirstLevelPage
,Form
,FormDirectory
,FormPage
,FormQuestion
,JCRCalendar
,JCRCalendarEvent
,JCRCategory
,JCRResourcesCollection
,JCRTag
,JCRTasksList
,JCRThread
,KeywordJCR
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,OrgUnitPage
,Person
,Program
,ProgramPage
,Project
,ProjectTagJCR
,QueryContainer
,RedirectPage
,RootAmetysObject
,SecondLevelPage
,Site
,Sitemap
,SubProgram
,Survey
,SurveyPage
,SurveyQuestion
,ThemeJCR
,Thesaurus
,TransitionalPage
,UGCPage
,UGCTransitionalPage
,UserPage
,VersionComponentAmetysObject
,VersionsAmetysObject
AmetysObject
which is traversable and allow to create children.-
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
ARetrieves a given child from its relative path.default <A extends AmetysObject>
AgetChildAt
(long index) Gets the childAmetysObject
at the given positiondefault long
Returns the position of thisAmetysObject
within the ordered set of its sibling objects.<A extends AmetysObject>
AmetysObjectIterable<A>Retrieves children of the current object.boolean
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 Details
-
getChildren
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
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
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.
-