Package org.ametys.plugins.ugc.page
Class UGCPage
java.lang.Object
org.ametys.plugins.ugc.page.UGCPage
- All Implemented Interfaces:
AmetysObject,DataAwareAmetysObject,ModelLessDataAwareAmetysObject,DataHolder,ModelLessDataHolder,TagAwareAmetysObject,TraversableAmetysObject,MetadataAwareSitemapElement,Page,SitemapElement,SiteAwareAmetysObject
Page representing an UGC 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 interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE -
Constructor Summary
ConstructorsConstructorDescriptionUGCPage(Page root, Content syncContent, String path, AmetysObjectResolver resolver, UGCPageHandler ugcPageHandler, SkinsManager skinsManager, ModelItemTypeExtensionPoint pageDataTypeExtensionPoint, ModelItemTypeExtensionPoint zoneDataTypeExtensionPoint, ServiceExtensionPoint serviceExtensionPoint, ModelItemTypeExtensionPoint zoneItemDataTypeExtensionPoint) Constructor. -
Method Summary
Modifier and TypeMethodDescription<A extends AmetysObject>
ARetrieves a given child from its relative path.getChildPageAt(int index) Gets the childPageat the given positionAmetysObjectIterable<? extends AmetysObject>Retrieves children of the current object.AmetysObjectIterable<? extends Page>Retrieves child pages.AmetysObjectIterable<? extends Page>getChildrenPages(boolean includeInvisiblePage) Retrieves child pages.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.getPath()Retrieves the path of the current object.Computes the path relative to the current sitemap.Retrieves allAmetysObjectids referencing this page.Retrieves the attachments root nodegetSite()Returns this object's site.Retrieves the sitemap containing the current sitemap.Returns this page's sitemap nameReturns this object's site name.getTags()Retrieves current tags.Retrieves the template name.Get the view parametersgetTitle()Retrieves the title.getType()Retrieves the type.Returns the associated UGCContent.getURL()Retrieves the linked URL.Retrieves the linked URL type.Retrieves a given zone.AmetysObjectIterable<? extends Zone>getZones()Retrieves the zones.booleanTests if this Object has at least one child with the given name.booleanDetermine if a zone existsbooleanDetermine if the page is visible into navigation elementsMethods 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, 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, 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
-
UGCPage
public UGCPage(Page root, Content syncContent, String path, AmetysObjectResolver resolver, UGCPageHandler ugcPageHandler, SkinsManager skinsManager, ModelItemTypeExtensionPoint pageDataTypeExtensionPoint, ModelItemTypeExtensionPoint zoneDataTypeExtensionPoint, ServiceExtensionPoint serviceExtensionPoint, ModelItemTypeExtensionPoint zoneItemDataTypeExtensionPoint) Constructor.- Parameters:
root- the root page.syncContent- the synchronized contentpath- the pathresolver- theAmetysObjectResolver.ugcPageHandler- the ugc page handlerskinsManager- the skins managerpageDataTypeExtensionPoint- 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 Details
-
getUgcContent
Returns the associated UGCContent.- Returns:
- the associated UGC
Content.
-
getDepth
Description copied from interface:PageGet the page depth- Specified by:
getDepthin interfacePage- Returns:
- the page depth
- Throws:
AmetysRepositoryException- if an error occurs.
-
getReferers
Description copied from interface:PageRetrieves allAmetysObjectids referencing this page.- Specified by:
getReferersin interfacePage- Returns:
- the
AmetysObjectids referencing this page. - Throws:
AmetysRepositoryException- if an error occurs.
-
getRootAttachments
Description copied from interface:PageRetrieves the attachments root node- Specified by:
getRootAttachmentsin interfacePage- Returns:
- The the attachments root node
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTemplate
Description copied from interface:SitemapElementRetrieves the template name.- Specified by:
getTemplatein interfaceSitemapElement- Returns:
- the template name or
nullif none has been set or if the type is not container. - Throws:
AmetysRepositoryException- if an error occurs.
-
getTitle
Description copied from interface:SitemapElementRetrieves the title.- Specified by:
getTitlein interfaceSitemapElement- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getLongTitle
Description copied from interface:PageRetrieves the long title.- Specified by:
getLongTitlein interfacePage- Returns:
- the title.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getType
Description copied from interface:PageRetrieves the type.- Specified by:
getTypein interfacePage- Returns:
- the type.
- Throws:
AmetysRepositoryException- if an error occurs.- See Also:
-
getURL
Description copied from interface:PageRetrieves the linked URL.- Specified by:
getURLin interfacePage- Returns:
- the linked URL.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getURLType
Description copied from interface:PageRetrieves the linked URL type.- Specified by:
getURLTypein interfacePage- Returns:
- the linked URL type.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getZone
Description copied from interface:SitemapElementRetrieves a given zone.- Specified by:
getZonein interfaceSitemapElement- Parameters:
name- the name of the zone.- Returns:
- the given zone.
- Throws:
UnknownZoneException- if there is no zone for the given name.AmetysRepositoryException- if an error occurs.
-
getZones
Description copied from interface:SitemapElementRetrieves the zones.- Specified by:
getZonesin interfaceSitemapElement- Returns:
- the zones.
- Throws:
AmetysRepositoryException- if an error occurs.
-
hasZone
Description copied from interface:SitemapElementDetermine if a zone exists- Specified by:
hasZonein interfaceSitemapElement- Parameters:
name- The name of the zone- Returns:
- true if the zone exists
- Throws:
AmetysRepositoryException- If an error occured
-
getChildrenPages
Description copied from interface:SitemapElementRetrieves child pages.- Specified by:
getChildrenPagesin interfaceSitemapElement- Returns:
- the child pages.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getPathInSitemap
Description copied from interface:SitemapElementComputes the path relative to the current sitemap.- Specified by:
getPathInSitemapin interfaceSitemapElement- Returns:
- the path relative to the current sitemap.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSite
Description copied from interface:SiteAwareAmetysObjectReturns this object's site.- Specified by:
getSitein interfaceSiteAwareAmetysObject- Returns:
- this object's site
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSiteName
Description copied from interface:SiteAwareAmetysObjectReturns this object's site name.- Specified by:
getSiteNamein interfaceSiteAwareAmetysObject- Returns:
- this object's site name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSitemap
Description copied from interface:SitemapElementRetrieves the sitemap containing the current sitemap.- Specified by:
getSitemapin interfaceSitemapElement- Returns:
- the sitemap containing the current sitemap.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getSitemapName
Description copied from interface:SitemapElementReturns this page's sitemap name- Specified by:
getSitemapNamein interfaceSitemapElement- 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'/'.- Specified by:
getChildin interfaceTraversableAmetysObject- 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
Description copied from interface:TraversableAmetysObjectRetrieves children of the current object.- Specified by:
getChildrenin interfaceTraversableAmetysObject- Returns:
- the children or an empty
AmetysObjectIterable. - Throws:
AmetysRepositoryException- if an error occurs.
-
hasChild
Description copied from interface:TraversableAmetysObjectTests if this Object has at least one child with the given name.- Specified by:
hasChildin interfaceTraversableAmetysObject- 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>- Specified by:
getIdin interfaceAmetysObject- 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.- Specified by:
getNamein interfaceAmetysObject- Returns:
- the name.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getParent
Description copied from interface:AmetysObjectReturns the parent object in the Ametys hierarchy.- Specified by:
getParentin interfaceAmetysObject- 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.- Specified by:
getParentPathin interfaceAmetysObject- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getPath
Description copied from interface:AmetysObjectRetrieves the path of the current object.- Specified by:
getPathin interfaceAmetysObject- Returns:
- the path.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelLessDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
getTags
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Specified by:
getTagsin interfaceTagAwareAmetysObject- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePage) throws AmetysRepositoryException Description copied from interface:SitemapElementRetrieves child pages.- Specified by:
getChildrenPagesin interfaceSitemapElement- Parameters:
includeInvisiblePage- true to include invisible pages- Returns:
- the child pages.
- Throws:
AmetysRepositoryException- if an error occurs.
-
isVisible
Description copied from interface:PageDetermine if the page is visible into navigation elements- Specified by:
isVisiblein interfacePage- Returns:
- true if the page is visible.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getChildPageAt
public Page getChildPageAt(int index) throws UnknownAmetysObjectException, AmetysRepositoryException Description copied from interface:SitemapElementGets the childPageat the given position- Specified by:
getChildPageAtin interfaceSitemapElement- 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
-
getTemplateParametersHolder
Description copied from interface:SitemapElementGet the view parameters- Specified by:
getTemplateParametersHolderin interfaceSitemapElement- Returns:
- the view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-