Class CoursePage
- All Implemented Interfaces:
AmetysObject,DataAwareAmetysObject,ModelLessDataAwareAmetysObject,DataHolder,ModelLessDataHolder,TagAwareAmetysObject,TraversableAmetysObject,MetadataAwareSitemapElement,Page,SitemapElement,SiteAwareAmetysObject
Page representing a course.
-
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.plugins.odfweb.repository.AbstractOdfPage
INDEXABLE_CHILDRENFields inherited from class org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage
_configuration, _factory, _root, _schemeFields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE -
Constructor Summary
ConstructorsConstructorDescriptionCoursePage(Page root, VirtualPageConfiguration configuration, CoursePageFactory factory, Course course, Program parentProgram, String path, Page parentPage) Constructor. -
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
ARetrieves a given child from its relative path.AmetysObjectIterable<? extends Page> Retrieves child pages.Get the page's contentReturns the associatedCourse.Returns theDataHolderof thisAmetysObject.intgetDepth()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>Retrieves 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.protected ProgramItemGet the program item wrapped in this pagegetTitle()Retrieves the title.booleanTests if this Object has at least one child with the given name.Methods inherited from class org.ametys.plugins.odfweb.repository.AbstractProgramItemPage
getChildPageAt, getChildren, getChildrenPages, getOdfPath, setCurrentEducationalPathsMethods inherited from class org.ametys.plugins.odfweb.repository.AbstractOdfPage
isIndexableMethods inherited from class org.ametys.web.repository.page.virtual.AbstractConfigurableVirtualPage
getPath, getReferers, getRootAttachments, getScheme, getSite, getSitemap, getSitemapName, getSiteName, getTags, getTemplate, getTemplateParametersHolder, getType, getURL, getURLType, getZone, getZoneConfiguration, getZones, hasZone, isVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames, getRepositoryDataMethods 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, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAXMethods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Constructor Details
-
CoursePage
public CoursePage(Page root, VirtualPageConfiguration configuration, CoursePageFactory factory, Course course, Program parentProgram, String path, Page parentPage) Constructor.- Parameters:
root- the odf root page.configuration- The Course virtual page's configurationfactory- The factorycourse- the course.parentProgram- the parent programpath- path from the parentProgramPageparentPage- the parentPageor null if not yet computed.
-
-
Method Details
-
getCourse
Returns the associatedCourse.- Returns:
- the associated
Course.
-
getProgramItem
Description copied from class:AbstractProgramItemPageGet the program item wrapped in this page- Specified by:
getProgramItemin classAbstractProgramItemPage<CoursePageFactory>- Returns:
- the program item
-
getDepth
Description copied from interface:PageGet the page depth- Returns:
- the page depth
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTitle
Description copied from interface:SitemapElementRetrieves the title.- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getLongTitle
Description copied from interface:PageRetrieves the long title.- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getChildrenPages
Description copied from interface:SitemapElementRetrieves child pages.- Returns:
- the child pages.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getPathInSitemap
Description copied from interface:SitemapElementComputes the path relative to the current sitemap.- 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:TraversableAmetysObjectRetrieves 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.
-
hasChild
Description copied from interface:TraversableAmetysObjectTests if this Object has at least one child with the given name.- Parameters:
name- the name to test. Cannot benullnor empty nor begin with a'/'and it cannot contain'/'.- Returns:
trueif the named child exists,falseotherwise.- Throws:
AmetysRepositoryException- if an error occurs.
-
getId
Description copied from interface:AmetysObjectRetrieves 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>- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException- if an error occurs.
-
getName
Description copied from interface:AmetysObjectRetrieves the name of the current object.- Returns:
- the name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getParent
Description copied from interface:AmetysObjectReturns the parent object in the Ametys hierarchy.- Returns:
- the parent object or
nullif current object is the root. - Throws:
AmetysRepositoryException- if an error occurs.
-
getParentPath
Description copied from interface:AmetysObjectReturns the path of the parent object in the Ametys hierarchy.- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Returns:
- the
DataHolderof thisAmetysObject
-
getContent
Description copied from class:AbstractConfigurableVirtualPageGet the page's content- Overrides:
getContentin classAbstractConfigurableVirtualPage<CoursePageFactory>- Returns:
- The content
-