Class DefaultZone
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<DefaultZoneFactory>
org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<DefaultZoneFactory>
org.ametys.web.repository.page.jcr.DefaultZone
- All Implemented Interfaces:
ACLAmetysObject,AmetysObject,CopiableAmetysObject,DataHolder,ModifiableDataHolder,JCRAmetysObject,JCRTraversableAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,ModifiableTraversableAmetysObject,RemovableAmetysObject,TraversableAmetysObject,ModifiableZone,Zone
public class DefaultZone
extends DefaultTraversableAmetysObject<DefaultZoneFactory>
implements ModifiableZone, CopiableAmetysObject
JCR implementation of an
Zone.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant for zone item node namestatic final StringConstant for zone items node typestatic final StringConstant for zone items node nameFields inherited from interface org.ametys.web.repository.page.Zone
ZONEITEM_DATA_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDefaultZone(javax.jcr.Node node, String parentPath, DefaultZoneFactory factory) Creates aDefaultZone. -
Method Summary
Modifier and TypeMethodDescriptionAdd a new zone itemcopyTo(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObjectto the given object.copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) Copy the currentAmetysObjectto the given object if it is not in the restriction list.dataToJSON(String dataPath, DataContext context) Convert the data at the given path into a JSON objectdataToJSON(DataContext context) Convert the data contained in thisDataHoldervoiddataToSAX(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 thisDataHolderReturns the rootCompositeMetadataof thisAmetysObject.Get the parent page of the zoneRetrieve the list of used zone itemsGet the view parametersMethods 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, getComposite, getComposite, getDataHolder, getId, getName, getNode, getParent, getParentDataHolder, getParentPath, getPath, getRepositoryData, getRootDataHolder, needsSave, remove, removeValue, rename, revertChanges, saveChanges, setValue, setValue, synchronizeValuesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, getDataNames, getModelItemTypeExtensionPoint, getType, getValue, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, hasDifferences, hashCode, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultiple, 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.holder.DataHolder
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getDataNames, getModelItemTypeExtensionPoint, getType, getValue, getValueOfType, getValueOfTypeOrDefault, getValueOrDefault, hasDifferences, hasValue, hasValue, hasValueOrEmpty, isMultiple, isMultipleMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValuesMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
removeMethods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Field Details
-
ZONEITEMS_NODE_NAME
Constant for zone items node name- See Also:
-
ZONEITEM_NODE_NAME
Constant for zone item node name- See Also:
-
ZONEITEM_NODETYPE_NAME
Constant for zone items node type- See Also:
-
-
Constructor Details
-
DefaultZone
Creates aDefaultZone.- Parameters:
node- the node backing thisAmetysObject.parentPath- the parent path in the Ametys hierarchy.factory- theDefaultZoneFactorywhich creates the AmetysObject.
-
-
Method Details
-
getZoneItems
Description copied from interface:ModifiableZoneRetrieve the list of used zone items- Specified by:
getZoneItemsin interfaceModifiableZone- Specified by:
getZoneItemsin interfaceZone- Returns:
- The list of zone items. Cannot be null.
- Throws:
AmetysRepositoryException- if an error occured
-
addZoneItem
Description copied from interface:ModifiableZoneAdd a new zone item- Specified by:
addZoneItemin interfaceModifiableZone- Returns:
- The zone item created
- Throws:
AmetysRepositoryException- If an error occured
-
getSitemapElement
Description copied from interface:ZoneGet the parent page of the zone- Specified by:
getSitemapElementin interfaceZone- Returns:
- The parent page. Cannot be null.
-
copyTo
public ModifiableZone copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object. Be careful, this method save changes.- Specified by:
copyToin 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:CopiableAmetysObjectCopy the currentAmetysObjectto the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyToin 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 ofCopiableAmetysObjectauthorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
getMetadataHolder
Description copied from class:SimpleAmetysObjectReturns the rootCompositeMetadataof thisAmetysObject.- Specified by:
getMetadataHolderin interfaceMetadataAwareAmetysObject- Specified by:
getMetadataHolderin interfaceModifiableMetadataAwareAmetysObject- Overrides:
getMetadataHolderin classSimpleAmetysObject<DefaultZoneFactory>- Returns:
- the root
CompositeMetadataof thisAmetysObject
-
getZoneParametersHolder
Description copied from interface:ModifiableZoneGet the view parameters- Specified by:
getZoneParametersHolderin interfaceModifiableZone- Specified by:
getZoneParametersHolderin interfaceZone- Returns:
- the view parameters
- Throws:
AmetysRepositoryException- if an error occurs.
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException Description copied from interface:DataHolderGenerates SAX events for data contained in thisDataHolder- Specified by:
dataToSAXin interfaceDataHolder- Overrides:
dataToSAXin classAbstractAmetysObject- 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 valueBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToSAX
public void dataToSAX(ContentHandler contentHandler, String dataPath, DataContext context) throws SAXException, UnknownTypeException, NotUniqueTypeException, BadItemTypeException 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 interfaceDataHolder- Overrides:
dataToSAXin classAbstractAmetysObject- 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 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 valueBadItemTypeException- if the saxed value's type does not matches the stored data
-
dataToJSON
public Map<String,Object> dataToJSON(DataContext context) throws UnknownTypeException, NotUniqueTypeException, BadItemTypeException Description copied from interface:DataHolderConvert the data contained in thisDataHolder- Specified by:
dataToJSONin interfaceDataHolder- Overrides:
dataToJSONin classAbstractAmetysObject- Parameters:
context- The context of the data to convert- Returns:
- The data of the current
DataHolderas JSON - Throws:
UnknownTypeException- if there is no compatible type with the value to convertNotUniqueTypeException- if there are many compatible types (there is no way to determine which type is the good one) with the value to convertBadItemTypeException- if the value's type does not matches the stored data
-
dataToJSON
public Object dataToJSON(String dataPath, DataContext context) throws UnknownTypeException, NotUniqueTypeException, BadItemTypeException Description copied from interface:DataHolderConvert the data at the given path into a JSON object- Specified by:
dataToJSONin interfaceDataHolder- Overrides:
dataToJSONin classAbstractAmetysObject- Parameters:
dataPath- the path of the data to convertcontext- The context of the data to convert- Returns:
- The value as JSON
- Throws:
UnknownTypeException- if there is no compatible type with the value to convertNotUniqueTypeException- if there are many compatible types (there is no way to determine which type is the good one) with the value to convertBadItemTypeException- if the value's type does not matches the stored data
-