public class ProgramPage extends AbstractOdfPage
Program
or a SubProgram
.Modifier and Type | Class and Description |
---|---|
(package private) static class |
ProgramPage.AbstractTreeIterator<T>
Breadth first search iterator for tree structure
Each node can provide an iterator that will be put in the end of the queue.
|
(package private) static class |
ProgramPage.ProgramPartTraverser
Program part traverser.
|
Page.LinkType, Page.PageType
Modifier and Type | Field and Description |
---|---|
private ProgramPageFactory |
_factory |
private Program |
_parent |
private Page |
_parentPage |
private String |
_path |
private AbstractProgram |
_program |
private Page |
_root |
Constructor and Description |
---|
ProgramPage(ProgramPageFactory factory,
Page root,
AbstractProgram program,
String path,
Program parent,
Page parentPage)
Constructor for program page holding a
Program or SubProgram |
ProgramPage(ProgramPageFactory factory,
Page root,
Program program,
Page parentPage)
Constructor for program page holding a
Program . |
Modifier and Type | Method and Description |
---|---|
(package private) String |
_computeLevelsPath()
Compute the path from the root odf page, representing the first and second level pages.
|
private boolean |
_filterByName(ProgramItem programItem,
String name) |
private Optional<ProgramItem> |
_findChild(TraversableProgramPart parent,
String name) |
private Optional<Page> |
_getChildPage(TraversableProgramPart parent,
String name) |
private CoursePage |
_toChildCoursePage(Course course) |
private Page |
_toChildPage(ProgramItem child) |
private ProgramPage |
_toChildProgramPage(SubProgram child) |
private Stream<ProgramItem> |
_traverseChildren(TraversableProgramPart parent) |
<A extends AmetysObject> |
getChild(String path)
Retrieves a given child from its relative path.
|
AmetysObjectIterable<? extends Page> |
getChildrenPages()
Retrieves child pages.
|
ModelLessDataHolder |
getDataHolder()
Returns the
DataHolder of this AmetysObject . |
int |
getDepth()
Get the page depth
|
String |
getId()
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> |
String |
getLongTitle()
Retrieves the long title.
|
String |
getName()
Retrieves the name of the current object.
|
Page |
getParent()
Returns the parent object in the Ametys hierarchy.
|
String |
getParentPath()
Returns the path of the parent object in the Ametys hierarchy.
|
(package private) Program |
getParentProgram() |
String |
getPathInSitemap()
Computes the path relative to the current sitemap.
|
AbstractProgram |
getProgram()
Returns the associated
Program or SubProgram . |
Site |
getSite()
Returns this object's site.
|
Sitemap |
getSitemap()
Retrieves the sitemap containing the current sitemap.
|
String |
getSitemapName()
Returns this page's sitemap name
|
String |
getSiteName()
Returns this object's site name.
|
String |
getTemplate()
Retrieves the template name.
|
String |
getTitle()
Retrieves the title.
|
Zone |
getZone(String name)
Retrieves a given zone.
|
AmetysObjectIterable<? extends Zone> |
getZones()
Retrieves the zones.
|
boolean |
hasChild(String name)
Tests if this Object has at least one child with the given name.
|
getChildPageAt, getChildren, getChildrenPages, getPath, getReferers, getRootAttachments, getTags, getType, getURL, getURLType, hasZone, isVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildAt, getChildPosition
getComposite, getRepeater, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, isMultiple
copyTo, getDataNames
equals, hashCode
toSAX, toSAX
dataToSAX, dataToSAX, dataToSAX, dataToSAX
private AbstractProgram _program
private Page _parentPage
private ProgramPageFactory _factory
public ProgramPage(ProgramPageFactory factory, Page root, Program program, Page parentPage)
Program
.factory
- The factoryroot
- the ODF root page.program
- the program.parentPage
- the parent Page
or null if not yet computed.public ProgramPage(ProgramPageFactory factory, Page root, AbstractProgram program, String path, Program parent, Page parentPage)
Program
or SubProgram
factory
- The factoryroot
- the ODF root page.program
- the program or subprogram.path
- The path from the virtual second level page. Can be null if abstract program is a Program
parent
- the parent program in case of a subprogram, null otherwiseparentPage
- the parent Page
or null if not yet computed.public AbstractProgram getProgram()
Program
or SubProgram
.Program
or SubProgram
.public int getDepth() throws AmetysRepositoryException
Page
AmetysRepositoryException
- if an error occurs.public String getTemplate() throws AmetysRepositoryException
Page
null
if none has
been set.AmetysRepositoryException
- if an error occurs.public String getTitle() throws AmetysRepositoryException
Page
AmetysRepositoryException
- if an error occurs.public String getLongTitle() throws AmetysRepositoryException
Page
AmetysRepositoryException
- if an error occurs.public Zone getZone(String name) throws UnknownZoneException, AmetysRepositoryException
Page
name
- the name of the zone.UnknownZoneException
- if there is no zone for the given name.AmetysRepositoryException
- if an error occurs.public AmetysObjectIterable<? extends Zone> getZones() throws AmetysRepositoryException
Page
AmetysRepositoryException
- if an error occurs.public AmetysObjectIterable<? extends Page> getChildrenPages() throws AmetysRepositoryException
PagesContainer
AmetysRepositoryException
- if an error occurs.public String getPathInSitemap() throws AmetysRepositoryException
PagesContainer
AmetysRepositoryException
- if an error occurs.Program getParentProgram()
String _computeLevelsPath()
public Site getSite() throws AmetysRepositoryException
SiteAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getSiteName() throws AmetysRepositoryException
SiteAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public Sitemap getSitemap() throws AmetysRepositoryException
PagesContainer
AmetysRepositoryException
- if an error occurs.public String getSitemapName() throws AmetysRepositoryException
PagesContainer
AmetysRepositoryException
- if an error occurs.public <A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
TraversableAmetysObject
null
, empty nor begin with a '/'
.A
- the actual type of AmetysObject
.path
- the path of the child which can contains a position with.
[n]
if same name sibling is allowed.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.private Optional<Page> _getChildPage(TraversableProgramPart parent, String name)
private Optional<ProgramItem> _findChild(TraversableProgramPart parent, String name)
private boolean _filterByName(ProgramItem programItem, String name)
private Page _toChildPage(ProgramItem child)
private ProgramPage _toChildProgramPage(SubProgram child)
private CoursePage _toChildCoursePage(Course course)
public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObject
name
- the name to test. Cannot be null
nor empty nor
begin with a '/'
and it cannot contain '/'
.true
if the named child exists,
false
otherwise.AmetysRepositoryException
- if an error occurs.public String getId() throws AmetysRepositoryException
AmetysObject
<protocol>://<protocol-specific-part>
AmetysRepositoryException
- if an error occurs.public String getName() throws AmetysRepositoryException
AmetysObject
AmetysRepositoryException
- if an error occurs.public Page getParent() throws AmetysRepositoryException
AmetysObject
null
if current object
is the root.AmetysRepositoryException
- if an error occurs.public String getParentPath() throws AmetysRepositoryException
AmetysObject
AmetysRepositoryException
- if an error occurs.public ModelLessDataHolder getDataHolder()
DataAwareAmetysObject
DataHolder
of this AmetysObject
.DataHolder
of this AmetysObject
private Stream<ProgramItem> _traverseChildren(TraversableProgramPart parent)