Class DefaultZone
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<DefaultZoneFactory>
-
- org.ametys.web.repository.page.jcr.DefaultZone
-
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
,ModifiableZone
,Zone
public class DefaultZone extends DefaultTraversableAmetysObject<DefaultZoneFactory> implements ModifiableZone, CopiableAmetysObject
JCR implementation of anZone
.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
__LOGGER
static String
ZONEITEM_NODE_NAME
Constant for zone item node namestatic String
ZONEITEM_NODETYPE_NAME
Constant for zone items node typestatic String
ZONEITEMS_NODE_NAME
Constant for zone items node name-
Fields inherited from interface org.ametys.web.repository.page.Zone
ZONEITEM_DATA_NAME
-
-
Constructor Summary
Constructors Constructor Description DefaultZone(Node node, String parentPath, DefaultZoneFactory factory)
Creates aDefaultZone
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableZoneItem
addZoneItem()
Add a new zone itemModifiableZone
copyTo(ModifiableTraversableAmetysObject parent, String name)
Copy the currentAmetysObject
to the given object.AmetysObject
copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo)
Copy the currentAmetysObject
to the given object if it is not in the restriction list.void
dataToSAX(ContentHandler contentHandler, String dataPath, Locale locale)
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, Locale locale)
Generates SAX events for data contained in thisDataHolder
ModifiableModelLessDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.ModifiableCompositeMetadata
getMetadataHolder()
Returns the rootCompositeMetadata
of thisAmetysObject
.Page
getPage()
Get the parent page of the zoneAmetysObjectIterable<ModifiableZoneItem>
getZoneItems()
Retrieve the list of used zone itemsModifiableModelAwareDataHolder
getZoneParametersHolder()
Get the view parameters-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, 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, getDataNames, getRepositoryData
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
getComposite, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX, hasValue
-
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, getRepositoryData, removeValue, setValue, setValue, synchronizeValues
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Field Detail
-
ZONEITEMS_NODE_NAME
public static final String ZONEITEMS_NODE_NAME
Constant for zone items node name- See Also:
- Constant Field Values
-
ZONEITEM_NODE_NAME
public static final String ZONEITEM_NODE_NAME
Constant for zone item node name- See Also:
- Constant Field Values
-
ZONEITEM_NODETYPE_NAME
public static final String ZONEITEM_NODETYPE_NAME
Constant for zone items node type- See Also:
- Constant Field Values
-
__LOGGER
private static final org.slf4j.Logger __LOGGER
-
-
Constructor Detail
-
DefaultZone
public DefaultZone(Node node, String parentPath, DefaultZoneFactory factory)
Creates aDefaultZone
.- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultZoneFactory
which creates the AmetysObject.
-
-
Method Detail
-
getZoneItems
public AmetysObjectIterable<ModifiableZoneItem> getZoneItems() throws AmetysRepositoryException
Description copied from interface:ModifiableZone
Retrieve the list of used zone items- Specified by:
getZoneItems
in interfaceModifiableZone
- Specified by:
getZoneItems
in interfaceZone
- Returns:
- The list of zone items. Cannot be null.
- Throws:
AmetysRepositoryException
- if an error occured
-
addZoneItem
public ModifiableZoneItem addZoneItem() throws AmetysRepositoryException
Description copied from interface:ModifiableZone
Add a new zone item- Specified by:
addZoneItem
in interfaceModifiableZone
- Returns:
- The zone item created
- Throws:
AmetysRepositoryException
- If an error occured
-
getPage
public Page getPage()
Description copied from interface:Zone
Get the parent page of the zone
-
copyTo
public ModifiableZone copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
copyTo
public AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Parameters:
parent
- The parent of the new object. Can not be null.name
- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo
- A restrict list ofCopiableAmetysObject
authorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDataHolder
public ModifiableModelLessDataHolder 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
public ModifiableCompositeMetadata 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<DefaultZoneFactory>
- Returns:
- the root
CompositeMetadata
of thisAmetysObject
-
getZoneParametersHolder
public ModifiableModelAwareDataHolder getZoneParametersHolder() throws AmetysRepositoryException
Description copied from interface:ModifiableZone
Get the view parameters- Specified by:
getZoneParametersHolder
in interfaceModifiableZone
- Specified by:
getZoneParametersHolder
in interfaceZone
- Returns:
- the view parameters
- Throws:
AmetysRepositoryException
- if an error occurs.
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, Locale locale) throws SAXException, IOException, 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 eventslocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O APIUnknownTypeException
- 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, Locale locale) throws SAXException, IOException
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 SAXlocale
- The locale to use for localized data, such asMultilingualString
. Can benull
to generate SAX events for all existingLocale
s.- Throws:
SAXException
- if an error occurs during the SAX events generationIOException
- if an error occurs while reading a value using the I/O API
-
-