Class AbstractSitemapElement<F extends AbstractSitemapElementFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<F>
org.ametys.web.repository.page.jcr.AbstractSitemapElement<F>
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
,MetadataAwareSitemapElement
,ModifiableSitemapElement
,SitemapElement
,SiteAwareAmetysObject
- Direct Known Subclasses:
DefaultPage
,Sitemap
public abstract class AbstractSitemapElement<F extends AbstractSitemapElementFactory>
extends DefaultTraversableAmetysObject<F>
implements MetadataAwareSitemapElement, ModifiableSitemapElement, ModifiableModelLessDataAwareAmetysObject
SitemapElement
implementation stored into a JCR node.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for the zone node type.static final String
Constant for the zones node name.static final String
Constant for the zones node type.Fields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE
-
Constructor Summary
ConstructorDescriptionAbstractSitemapElement
(javax.jcr.Node node, String parentPath, F factory) Creates anAbstractSitemapElement
. -
Method Summary
Modifier and TypeMethodDescriptioncreateZone
(String name) Creates a given zone.void
dataToSAX
(ContentHandler contentHandler, String dataPath, DataContext context) Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given pathvoid
dataToSAX
(ContentHandler contentHandler, DataContext context) Generates SAX events for data contained in thisDataHolder
getChildPageAt
(int index) Gets the childPage
at the given positionAmetysObjectIterable<? extends Page>
Retrieves child pages.AmetysObjectIterable<? extends Page>
getChildrenPages
(boolean includeInvisiblePage) Retrieves child pages.Returns theDataHolder
of thisAmetysObject
.Returns the rootCompositeMetadata
of thisAmetysObject
.Get the view parametersRetrieves a given zone.getZones()
Retrieves the zones.boolean
Determine if a zone existsMethods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, getDataNames, getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToJSON, getComposite, getModelItemTypeExtensionPoint, getParentDataHolder, getRootDataHolder, getType, getValue, getValue, getValueOfType, getValueOfType, hasDifferences, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultiple
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX, hasValue, hasValueOrEmpty
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValues
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
Methods inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
getSite, getSiteName
Methods inherited from interface org.ametys.web.repository.page.SitemapElement
getPathInSitemap, getSitemap, getSitemapName, getTemplate, getTitle
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
Field Details
-
ZONES_NODE_NAME
Constant for the zones node name.- See Also:
-
ZONES_NODE_TYPE
Constant for the zones node type.- See Also:
-
ZONE_NODE_TYPE
Constant for the zone node type.- See Also:
-
-
Constructor Details
-
AbstractSitemapElement
Creates anAbstractSitemapElement
.- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultPageFactory
which creates the AmetysObject.
-
-
Method Details
-
getChildrenPages
Description copied from interface:SitemapElement
Retrieves child pages.- Specified by:
getChildrenPages
in interfaceSitemapElement
- Returns:
- the child pages.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChildrenPages
public AmetysObjectIterable<? extends Page> getChildrenPages(boolean includeInvisiblePage) throws AmetysRepositoryException Description copied from interface:SitemapElement
Retrieves child pages.- Specified by:
getChildrenPages
in interfaceSitemapElement
- Parameters:
includeInvisiblePage
- 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:SitemapElement
Gets the childPage
at the given position- Specified by:
getChildPageAt
in interfaceSitemapElement
- Parameters:
index
- the position of thePage
within the ordered set of its sibling objects.- Returns:
- the
Page
if found - Throws:
UnknownAmetysObjectException
- if no child page was found at this positionAmetysRepositoryException
- if an error occurs
-
getZones
Description copied from interface:SitemapElement
Retrieves the zones.- Specified by:
getZones
in interfaceModifiableSitemapElement
- Specified by:
getZones
in interfaceSitemapElement
- Returns:
- the zones.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasZone
Description copied from interface:SitemapElement
Determine if a zone exists- Specified by:
hasZone
in interfaceSitemapElement
- Parameters:
name
- The name of the zone- Returns:
- true if the zone exists
- Throws:
AmetysRepositoryException
- If an error occured
-
getZone
Description copied from interface:SitemapElement
Retrieves a given zone.- Specified by:
getZone
in interfaceModifiableSitemapElement
- Specified by:
getZone
in 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.
-
createZone
Description copied from interface:ModifiableSitemapElement
Creates a given zone.- Specified by:
createZone
in interfaceModifiableSitemapElement
- Parameters:
name
- the name of the zone.- Returns:
- the given zone.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getMetadataHolder
Description copied from class:SimpleAmetysObject
Returns the rootCompositeMetadata
of thisAmetysObject
.- Specified by:
getMetadataHolder
in interfaceMetadataAwareAmetysObject
- Specified by:
getMetadataHolder
in interfaceModifiableMetadataAwareAmetysObject
- Overrides:
getMetadataHolder
in classSimpleAmetysObject<F extends AbstractSitemapElementFactory>
- Returns:
- the root
CompositeMetadata
of thisAmetysObject
-
getTemplateParametersHolder
public ModifiableModelAwareDataHolder getTemplateParametersHolder() throws AmetysRepositoryExceptionDescription copied from interface:SitemapElement
Get the view parameters- Specified by:
getTemplateParametersHolder
in interfaceModifiableSitemapElement
- Specified by:
getTemplateParametersHolder
in interfaceSitemapElement
- Returns:
- the view parameters. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException Description copied from interface:ModelLessDataHolder
Generates SAX events for data contained in thisDataHolder
- Specified by:
dataToSAX
in interfaceModelLessDataAwareAmetysObject
- Specified by:
dataToSAX
in interfaceModelLessDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventscontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generationUnknownTypeException
- if there is no compatible type with the saxed valueNotUniqueTypeException
- if there are many compatible types (there is no way to determine which type is the good one) with the saxed value
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException Description copied from interface:DataHolder
Generates SAX events for the data at the given data path in the currentDataHolder
Do not generate any event if there is no values at the given path- Specified by:
dataToSAX
in interfaceDataAwareAmetysObject
- Specified by:
dataToSAX
in interfaceDataHolder
- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsdataPath
- the path of the data to SAXcontext
- The context of the data to SAX- Throws:
SAXException
- if an error occurs during the SAX events generation
-