public class DefaultZoneItem extends SimpleAmetysObject<DefaultZoneItemFactory> implements ModifiableZoneItem, CopiableAmetysObject
ModifiableZoneItem.ZoneItem.ZoneType| Modifier and Type | Field and Description |
|---|---|
private static Logger |
__LOGGER |
static String |
METADATA_CONTENT
Constant for content metadata.
|
static String |
METADATA_METADATASET_NAME
Deprecated.
Use
METADATA_VIEW_NAME instead |
static String |
METADATA_SERVICE
Constant for service metadata.
|
static String |
METADATA_TYPE
Constant for title metadata.
|
static String |
METADATA_VIEW_NAME
Constant for view name metadata.
|
static String |
SERVICE_PARAM_NODETYPE
Constant service parameters node type.
|
SERVICE_PARAMETERS_DATA_NAME| 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.
|
ModifiableModelLessDataHolder |
getDataHolder()
Returns the
DataHolder of this AmetysObject. |
ModifiableCompositeMetadata |
getMetadataHolder()
Returns the root
CompositeMetadata of this AmetysObject. |
String |
getMetadataSetName()
Get the name of the metadata set to render the Content with.
|
String |
getServiceId()
Retrieves the service id.
|
ModifiableModelAwareDataHolder |
getServiceParameters()
Get the service parameters
|
ZoneItem.ZoneType |
getType()
Retrieves the type.
|
String |
getViewName()
Get the name of the view to render the Content with.
|
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.
|
void |
setViewName(String viewName)
Set the Content view name.
|
_getFactory, _invalidateName, _invalidateParentPath, getId, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetComposite, getComposite, getRepeater, getRepeater, removeValue, setValue, setValuegetType, getValue, getValue, getValueOfType, getValueOfType, hasValue, isMultiplecopyTo, getDataNamesequals, getId, getName, getParent, getParentPath, getPath, hashCodetoSAX, toSAXdataToSAX, dataToSAX, dataToSAX, dataToSAXneedsSave, rename, revertChanges, saveChangesremovepublic static final String METADATA_TYPE
public static final String METADATA_SERVICE
public static final String METADATA_CONTENT
public static final String SERVICE_PARAM_NODETYPE
@Deprecated public static final String METADATA_METADATASET_NAME
METADATA_VIEW_NAME insteadpublic static final String METADATA_VIEW_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 String getViewName() throws AmetysRepositoryException
ZoneItemgetViewName in interface ZoneItemAmetysRepositoryException - if an error occurs.
TODO NEWATTRIBUTEAPI_SERVICE: remove the default implementation when all zone items implement the methodpublic void setMetadataSetName(String metadataSetName) throws AmetysRepositoryException
ModifiableZoneItemsetMetadataSetName in interface ModifiableZoneItemmetadataSetName - the metadata set name.AmetysRepositoryException - if an error occurs.public void setViewName(String viewName) throws AmetysRepositoryException
ModifiableZoneItemsetViewName in interface ModifiableZoneItemviewName - the view name.AmetysRepositoryException - if an error occurs.public String getServiceId() throws AmetysRepositoryException
ZoneItemgetServiceId 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 ModifiableModelAwareDataHolder getServiceParameters() throws AmetysRepositoryException
ZoneItemgetServiceParameters in interface ModifiableZoneItemgetServiceParameters in interface ZoneItemAmetysRepositoryException - if an error occurs.public ModifiableModelLessDataHolder getDataHolder()
DataAwareAmetysObjectDataHolder of this AmetysObject.getDataHolder in interface DataAwareAmetysObjectgetDataHolder in interface ModelLessDataAwareAmetysObjectgetDataHolder in interface ModifiableModelLessDataAwareAmetysObjectDataHolder of this AmetysObjectpublic ModifiableCompositeMetadata getMetadataHolder()
SimpleAmetysObjectCompositeMetadata of this AmetysObject.getMetadataHolder in interface MetadataAwareAmetysObjectgetMetadataHolder in interface ModifiableMetadataAwareAmetysObjectgetMetadataHolder in class SimpleAmetysObject<DefaultZoneItemFactory>CompositeMetadata of this AmetysObjectpublic 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.