Class VirtualYearPage
- java.lang.Object
-
- org.ametys.plugins.blog.repository.AbstractBlogPage
-
- org.ametys.plugins.blog.repository.VirtualYearPage
-
- All Implemented Interfaces:
AmetysObject,DataAwareAmetysObject,ModelLessDataAwareAmetysObject,DataHolder,ModelLessDataHolder,TagAwareAmetysObject,TraversableAmetysObject,MetadataAwarePagesContainer,Page,PagesContainer,SiteAwareAmetysObject
public class VirtualYearPage extends AbstractBlogPage
Virtual page representing a year 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.plugins.blog.repository.AbstractBlogPage
BLOG_MONTH_TEMPLATE, BLOG_POST_TEMPLATE, BLOG_TAG_TEMPLATE, BLOG_YEAR_TEMPLATE
-
-
Constructor Summary
Constructors Constructor Description VirtualYearPage(AmetysObjectResolver resolver, BlogCacheManager cacheManager, SkinsManager skinsManager, I18nUtils i18nCache, String i18nCatalogue, int year, String title, PagesContainer root, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> pageDataTypeExtensionPoint, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> zoneDataTypeExtensionPoint, ServiceExtensionPoint serviceExtensionPoint, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> zoneItemDataTypeExtensionPoint)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends AmetysObject>
AgetChild(String path)Retrieves a given child from its relative path.PagegetChildPageAt(int index)Gets the childPageat the given positionAmetysObjectIterable<? extends AmetysObject>getChildren()Retrieves children of the current object.AmetysObjectIterable<? extends Page>getChildrenPages()Retrieves child pages.AmetysObjectIterable<? extends Page>getChildrenPages(boolean includeInvisiblePages)Retrieves child pages.ModelLessDataHoldergetDataHolder()Returns theDataHolderof thisAmetysObject.protected ZonegetDefaultZone()Get the "default" zone.intgetDepth()Get the page depthStringgetId()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>StringgetLongTitle()Retrieves the long title.StringgetName()Retrieves the name of the current object.PagesContainergetParent()Returns the parent object in the Ametys hierarchy.StringgetParentPath()Returns the path of the parent object in the Ametys hierarchy.StringgetPath()Retrieves the path of the current object.StringgetPathInSitemap()Computes the path relative to the current sitemap.Set<String>getReferers()Retrieves allAmetysObjectids referencing this page.ResourceCollectiongetRootAttachments()Retrieves the attachments root nodeSitegetSite()Returns this object's site.SitemapgetSitemap()Retrieves the sitemap containing the current sitemap.StringgetSitemapName()Returns this page's sitemap nameStringgetSiteName()Returns this object's site name.Set<String>getTags()Retrieves current tags.StringgetTemplate()Retrieves the template name.ModelAwareDataHoldergetTemplateParametersHolder()Get the view parametersStringgetTitle()Retrieves the title.StringgetURL()Retrieves the linked URL.Page.LinkTypegetURLType()Retrieves the linked URL type.intgetYear()Get the page's year.booleanhasChild(String name)Tests if this Object has at least one child with the given name.booleanisVisible()Determine if the page is visible into navigation elements-
Methods inherited from class org.ametys.plugins.blog.repository.AbstractBlogPage
getReferencePage, getType, getZone, 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, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX, getDataNames, getRepositoryData
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToSAX, getComposite, getParentDataHolder, getRootDataHolder, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Constructor Detail
-
VirtualYearPage
public VirtualYearPage(AmetysObjectResolver resolver, BlogCacheManager cacheManager, SkinsManager skinsManager, I18nUtils i18nCache, String i18nCatalogue, int year, String title, PagesContainer root, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> pageDataTypeExtensionPoint, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> zoneDataTypeExtensionPoint, ServiceExtensionPoint serviceExtensionPoint, AbstractThreadSafeComponentExtensionPoint<RepositoryModelItemType> zoneItemDataTypeExtensionPoint)
Constructor.- Parameters:
resolver- theAmetysObjectResolver.cacheManager- theBlogCacheManager.skinsManager- theSkinsManageri18nCache- the i18n utilsi18nCatalogue- the i18n catalogue.year- the yeartitle- the page's title.root- the blog root page.pageDataTypeExtensionPoint- the extension point with available data types for pageszoneDataTypeExtensionPoint- the extension point with available data types for zonesserviceExtensionPoint- The service extension pointzoneItemDataTypeExtensionPoint- the extension point with available data types for zone items
-
-
Method Detail
-
getYear
public int getYear()
Get the page's year.- Returns:
- the year.
-
getDepth
public int getDepth() throws AmetysRepositoryException
Description copied from interface:PageGet the page depth- Returns:
- the page depth
- Throws:
AmetysRepositoryException- if an error occurs.
-
getReferers
public Set<String> getReferers() throws AmetysRepositoryException
Description copied from interface:PageRetrieves allAmetysObjectids referencing this page.- Returns:
- the
AmetysObjectids referencing this page. - Throws:
AmetysRepositoryException- if an error occurs.
-
getRootAttachments
public ResourceCollection getRootAttachments() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the attachments root node- Returns:
- The the attachments root node
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTitle
public String getTitle() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the title.- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getLongTitle
public String getLongTitle() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the long title.- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getURL
public String getURL() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the linked URL.- Returns:
- the linked URL.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getURLType
public Page.LinkType getURLType() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the linked URL type.- Returns:
- the linked URL type.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDefaultZone
protected Zone getDefaultZone()
Description copied from class:AbstractBlogPageGet the "default" zone.- Specified by:
getDefaultZonein classAbstractBlogPage- Returns:
- the "default" zone.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages() throws AmetysRepositoryException
Description copied from interface:PagesContainerRetrieves child pages.- Returns:
- the child pages.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePages) throws AmetysRepositoryException
Description copied from interface:PagesContainerRetrieves child pages.- Parameters:
includeInvisiblePages- true to include invisible pages- Returns:
- the child pages.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getChildPageAt
public Page getChildPageAt(int index) throws UnknownAmetysObjectException, AmetysRepositoryException
Description copied from interface:PagesContainerGets the childPageat the given position- Parameters:
index- the position of thePagewithin the ordered set of its sibling objects.- Returns:
- the
Pageif found - Throws:
UnknownAmetysObjectException- if no child page was found at this positionAmetysRepositoryException- if an error occurs
-
getPathInSitemap
public String getPathInSitemap() throws AmetysRepositoryException
Description copied from interface:PagesContainerComputes the path relative to the current sitemap.- Returns:
- the path relative to the current sitemap.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSite
public Site getSite() throws AmetysRepositoryException
Description copied from interface:SiteAwareAmetysObjectReturns this object's site.- Returns:
- this object's site
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSiteName
public String getSiteName() throws AmetysRepositoryException
Description copied from interface:SiteAwareAmetysObjectReturns this object's site name.- Returns:
- this object's site name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSitemap
public Sitemap getSitemap() throws AmetysRepositoryException
Description copied from interface:PagesContainerRetrieves the sitemap containing the current sitemap.- Returns:
- the sitemap containing the current sitemap.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSitemapName
public String getSitemapName() throws AmetysRepositoryException
Description copied from interface:PagesContainerReturns this page's sitemap name- Returns:
- this page's sitemap name
- 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.
-
getChildren
public AmetysObjectIterable<? extends AmetysObject> getChildren() throws AmetysRepositoryException
Description copied from interface:TraversableAmetysObjectRetrieves children of the current object.- Returns:
- the children or an empty
AmetysObjectIterable. - Throws:
AmetysRepositoryException- if an error occurs.
-
hasChild
public boolean hasChild(String name) throws AmetysRepositoryException
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
public String getId() throws AmetysRepositoryException
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
public String getName() throws AmetysRepositoryException
Description copied from interface:AmetysObjectRetrieves the name of the current object.- Returns:
- the name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getParent
public PagesContainer getParent() throws AmetysRepositoryException
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
public String getParentPath() throws AmetysRepositoryException
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.
-
getPath
public String getPath() throws AmetysRepositoryException
Description copied from interface:AmetysObjectRetrieves the path of the current object.- Returns:
- the path.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDataHolder
public ModelLessDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Returns:
- the
DataHolderof thisAmetysObject
-
getTags
public Set<String> getTags() throws AmetysRepositoryException
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTemplate
public String getTemplate() throws AmetysRepositoryException
Description copied from interface:PageRetrieves the template name.- Specified by:
getTemplatein interfacePage- Overrides:
getTemplatein classAbstractBlogPage- Returns:
- the template name or
nullif none has been set. - Throws:
AmetysRepositoryException- if an error occurs.
-
isVisible
public boolean isVisible() throws AmetysRepositoryException
Description copied from interface:PageDetermine if the page is visible into navigation elements- Returns:
- true if the page is visible.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTemplateParametersHolder
public ModelAwareDataHolder getTemplateParametersHolder() throws AmetysRepositoryException
Description copied from interface:PageGet the view parameters- Returns:
- the view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
-