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
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for the zone node type.static final StringConstant for the zones node name.static final StringConstant for the zones node type.Fields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSitemapElement(javax.jcr.Node node, String parentPath, F factory) Creates anAbstractSitemapElement. -
Method Summary
Modifier and TypeMethodDescriptioncreateZone(String name) Creates a given zone.voiddataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) Generates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given pathvoiddataToSAX(ContentHandler contentHandler, DataContext context) Generates SAX events for data contained in thisDataHoldergetChildPageAt(int index) Gets the childPageat the given positionAmetysObjectIterable<? extends Page>Retrieves child pages.AmetysObjectIterable<? extends Page>getChildrenPages(boolean includeInvisiblePage) Retrieves child pages.Returns theDataHolderof thisAmetysObject.Returns the rootCompositeMetadataof thisAmetysObject.Get the view parametersRetrieves a given zone.getZones()Retrieves the zones.booleanDetermine 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, removeDeniedUsersMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, getDataNames, getRepositoryDataMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods 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, isMultipleMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToJSON, dataToSAX, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChildMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
removeMethods inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
getSite, getSiteNameMethods inherited from interface org.ametys.web.repository.page.SitemapElement
getPathInSitemap, getSitemap, getSitemapName, getTemplate, getTitleMethods 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- theDefaultPageFactorywhich creates the AmetysObject.
-
-
Method Details
-
getChildrenPages
Description copied from interface:SitemapElementRetrieves child pages.- Specified by:
getChildrenPagesin 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:SitemapElementRetrieves child pages.- Specified by:
getChildrenPagesin 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: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
-
getZones
Description copied from interface:SitemapElementRetrieves the zones.- Specified by:
getZonesin interfaceModifiableSitemapElement- 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
-
getZone
Description copied from interface:SitemapElementRetrieves a given zone.- Specified by:
getZonein interfaceModifiableSitemapElement- 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.
-
createZone
Description copied from interface:ModifiableSitemapElementCreates a given zone.- Specified by:
createZonein interfaceModifiableSitemapElement- Parameters:
name- the name of the zone.- Returns:
- the given zone.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDataHolder
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelLessDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelLessDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-
getMetadataHolder
Description copied from class:SimpleAmetysObjectReturns the rootCompositeMetadataof thisAmetysObject.- Specified by:
getMetadataHolderin interfaceMetadataAwareAmetysObject- Specified by:
getMetadataHolderin interfaceModifiableMetadataAwareAmetysObject- Overrides:
getMetadataHolderin classSimpleAmetysObject<F extends AbstractSitemapElementFactory>- Returns:
- the root
CompositeMetadataof thisAmetysObject
-
getTemplateParametersHolder
public ModifiableModelAwareDataHolder getTemplateParametersHolder() throws AmetysRepositoryExceptionDescription copied from interface:SitemapElementGet the view parameters- Specified by:
getTemplateParametersHolderin interfaceModifiableSitemapElement- Specified by:
getTemplateParametersHolderin 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:ModelLessDataHolderGenerates SAX events for data contained in thisDataHolder- Specified by:
dataToSAXin interfaceModelLessDataAwareAmetysObject- Specified by:
dataToSAXin interfaceModelLessDataHolder- Parameters:
contentHandler- theContentHandlerthat 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:DataHolderGenerates SAX events for the data at the given data path in the currentDataHolderDo not generate any event if there is no values at the given path- Specified by:
dataToSAXin interfaceDataAwareAmetysObject- Specified by:
dataToSAXin interfaceDataHolder- Parameters:
contentHandler- theContentHandlerthat 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
-