public class DefaultZoneItem extends SimpleAmetysObject<DefaultZoneItemFactory> implements ModifiableZoneItem, CopiableAmetysObject
ZoneItem
.ZoneItem.ZoneType
Modifier and Type | Field and Description |
---|---|
static String |
METADATA_CONTENT
Constant for content metadata.
|
static String |
METADATA_METADATASET_NAME
Constant for "metadata set name" metadata.
|
static String |
METADATA_SERVICE
Constant for service metadata.
|
static String |
METADATA_SERVICE_PARAM
Constant for service metadata.
|
static String |
METADATA_TYPE
Constant 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
AmetysObject to the given object. |
ModifiableZoneItem |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
List<String> restrictTo)
Copy the current
AmetysObject to 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, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getMetadataHolder
needsSave, rename, revertChanges, saveChanges
equals, getId, getName, getParent, getParentPath, getPath, hashCode
remove
public 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
ZoneItem
getType
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.ZoneItem.ZoneType
public void setType(ZoneItem.ZoneType type) throws AmetysRepositoryException
ModifiableZoneItem
setType
in interface ModifiableZoneItem
type
- the type.AmetysRepositoryException
- if an error occurs.ZoneItem.ZoneType
public <C extends Content> C getContent() throws AmetysRepositoryException
ZoneItem
getContent
in interface ZoneItem
C
- the actual type of Content
.AmetysRepositoryException
- if an error occurs.public <C extends Content> void setContent(C content) throws AmetysRepositoryException
ModifiableZoneItem
setContent
in interface ModifiableZoneItem
C
- the actual type of Content
.content
- the content.AmetysRepositoryException
- if an error occurs.public String getMetadataSetName() throws AmetysRepositoryException
ZoneItem
getMetadataSetName
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.public void setMetadataSetName(String metadataSetName) throws AmetysRepositoryException
ModifiableZoneItem
setMetadataSetName
in interface ModifiableZoneItem
metadataSetName
- the metadata set name.AmetysRepositoryException
- if an error occurs.public String getServiceId() throws AmetysRepositoryException
ZoneItem
getServiceId
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.public ModifiableCompositeMetadata getServiceParameters() throws AmetysRepositoryException
ZoneItem
getServiceParameters
in interface ModifiableZoneItem
getServiceParameters
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.public void setServiceId(String serviceId) throws AmetysRepositoryException
ModifiableZoneItem
setServiceId
in interface ModifiableZoneItem
serviceId
- the service id.AmetysRepositoryException
- if an error occurs.public ModifiableZoneItem copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.copyTo
in interface CopiableAmetysObject
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 of CopiableAmetysObject
authorized to be copiedAmetysRepositoryException
- if an error occurs.public ModifiableZoneItem copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object. Be careful, this method save changes.copyTo
in interface CopiableAmetysObject
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 objectAmetysRepositoryException
- if an error occurs.public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
MovableAmetysObject
canMoveTo
in interface MovableAmetysObject
newParent
- See moveTo.AmetysRepositoryException
- if an error occurs.public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException
MovableAmetysObject
moveTo
in interface MovableAmetysObject
newParent
- 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
MovableAmetysObject
orderBefore
in interface MovableAmetysObject
siblingObject
- 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.