public class DefaultZoneItem extends SimpleAmetysObject<DefaultZoneItemFactory> implements ModifiableZoneItem, CopiableAmetysObject
ZoneItem.ZoneItem.ZoneType| Modifier and Type | Field and Description | 
|---|---|
| static String | METADATA_CONTENTConstant for content metadata. | 
| static String | METADATA_METADATASET_NAMEConstant for "metadata set name" metadata. | 
| static String | METADATA_SERVICEConstant for service metadata. | 
| static String | METADATA_SERVICE_PARAMConstant for service metadata. | 
| static String | METADATA_TYPEConstant for title metadata. | 
| Constructor and Description | 
|---|
| DefaultZoneItem(Node node,
               String parentPath,
               DefaultZoneItemFactory factory)Creates a  DefaultZoneItem. | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | canMoveTo(AmetysObject newParent)Test if a move can be a success or if it is impossible (e.g. | 
| ModifiableZoneItem | copyTo(ModifiableTraversableAmetysObject parent,
      String name)Copy the current  AmetysObjectto the given object. | 
| ModifiableZoneItem | copyTo(ModifiableTraversableAmetysObject parent,
      String name,
      List<String> restrictTo)Copy the current  AmetysObjectto the given object if it is not in the restriction list. | 
| <C extends Content> | getContent()Retrieves the content reference. | 
| String | getMetadataSetName()Get the name of the metadata set to render the Content with. | 
| String | getServiceId()Retrieves the service id. | 
| ModifiableCompositeMetadata | getServiceParameters()Get the service parameters | 
| ZoneItem.ZoneType | getType()Retrieves the type. | 
| Zone | getZone()Get the parent zone. | 
| void | moveTo(AmetysObject newParent,
      boolean renameIfExist)Move the current object as a new child of the given object. | 
| void | orderBefore(AmetysObject siblingObject)Order a node before another sibling node (or as the last node) | 
| <C extends Content> | setContent(C content)Set the content reference. | 
| void | setMetadataSetName(String metadataSetName)Set the Content metadata set name. | 
| void | setServiceId(String serviceId)Set the service id. | 
| void | setType(ZoneItem.ZoneType type)Set the type. | 
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMetadataHolderneedsSave, rename, revertChanges, saveChangesequals, getId, getName, getParent, getParentPath, getPath, hashCoderemovepublic static final String METADATA_TYPE
public static final String METADATA_SERVICE
public static final String METADATA_SERVICE_PARAM
public static final String METADATA_CONTENT
public static final String METADATA_METADATASET_NAME
public DefaultZoneItem(Node node, String parentPath, DefaultZoneItemFactory factory)
DefaultZoneItem.node - the node backing this AmetysObject.parentPath - the parent path in the Ametys hierarchy.factory - the DefaultZoneItemFactory which creates the AmetysObject.public ZoneItem.ZoneType getType() throws AmetysRepositoryException
ZoneItemgetType in interface ZoneItemAmetysRepositoryException - if an error occurs.ZoneItem.ZoneTypepublic void setType(ZoneItem.ZoneType type) throws AmetysRepositoryException
ModifiableZoneItemsetType in interface ModifiableZoneItemtype - the type.AmetysRepositoryException - if an error occurs.ZoneItem.ZoneTypepublic <C extends Content> C getContent() throws AmetysRepositoryException
ZoneItemgetContent in interface ZoneItemC - the actual type of Content.AmetysRepositoryException - if an error occurs.public <C extends Content> void setContent(C content) throws AmetysRepositoryException
ModifiableZoneItemsetContent in interface ModifiableZoneItemC - the actual type of Content.content - the content.AmetysRepositoryException - if an error occurs.public String getMetadataSetName() throws AmetysRepositoryException
ZoneItemgetMetadataSetName in interface ZoneItemAmetysRepositoryException - if an error occurs.public void setMetadataSetName(String metadataSetName) throws AmetysRepositoryException
ModifiableZoneItemsetMetadataSetName in interface ModifiableZoneItemmetadataSetName - the metadata set name.AmetysRepositoryException - if an error occurs.public String getServiceId() throws AmetysRepositoryException
ZoneItemgetServiceId in interface ZoneItemAmetysRepositoryException - if an error occurs.public ModifiableCompositeMetadata getServiceParameters() throws AmetysRepositoryException
ZoneItemgetServiceParameters in interface ModifiableZoneItemgetServiceParameters in interface ZoneItemAmetysRepositoryException - if an error occurs.public void setServiceId(String serviceId) throws AmetysRepositoryException
ModifiableZoneItemsetServiceId in interface ModifiableZoneItemserviceId - the service id.AmetysRepositoryException - if an error occurs.public ModifiableZoneItem copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object if it is not in the restriction list. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 of CopiableAmetysObject authorized to be copiedAmetysRepositoryException - if an error occurs.public ModifiableZoneItem copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 objectAmetysRepositoryException - if an error occurs.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObjectcanMoveTo in interface MovableAmetysObjectnewParent - See moveTo.AmetysRepositoryException - if an error occurs.public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
MovableAmetysObjectmoveTo in interface MovableAmetysObjectnewParent - The new parent for the current object. Can not be null. Can not be a child of the current node. Must be a TraversableAmetyObject.renameIfExist - true to rename moved page if a page with same name already existAmetysRepositoryException - if an error occurs.RepositoryIntegrityViolationException - if a page with the same name already exists.public void orderBefore(AmetysObject siblingObject) throws AmetysRepositoryException
MovableAmetysObjectorderBefore in interface MovableAmetysObjectsiblingObject - The node that will be the next sibling node of the current node. Must have the same parent as the current node. Can be null to set the current node as the last node.AmetysRepositoryException - if an error occurs.