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, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getComposite, getComposite, getRepeater, getRepeater, removeValue, setValue, setValue
getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, isMultiple
copyTo, getDataNames
equals, getId, getName, getParent, getParentPath, getPath, hashCode
toSAX, toSAX
dataToSAX, dataToSAX, dataToSAX, dataToSAX
needsSave, rename, revertChanges, saveChanges
remove
public 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
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 String getViewName() throws AmetysRepositoryException
ZoneItem
getViewName
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.
TODO NEWATTRIBUTEAPI_SERVICE: remove the default implementation when all zone items implement the methodpublic void setMetadataSetName(String metadataSetName) throws AmetysRepositoryException
ModifiableZoneItem
setMetadataSetName
in interface ModifiableZoneItem
metadataSetName
- the metadata set name.AmetysRepositoryException
- if an error occurs.public void setViewName(String viewName) throws AmetysRepositoryException
ModifiableZoneItem
setViewName
in interface ModifiableZoneItem
viewName
- the view name.AmetysRepositoryException
- if an error occurs.public String getServiceId() throws AmetysRepositoryException
ZoneItem
getServiceId
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 ModifiableModelAwareDataHolder getServiceParameters() throws AmetysRepositoryException
ZoneItem
getServiceParameters
in interface ModifiableZoneItem
getServiceParameters
in interface ZoneItem
AmetysRepositoryException
- if an error occurs.public ModifiableModelLessDataHolder getDataHolder()
DataAwareAmetysObject
DataHolder
of this AmetysObject
.getDataHolder
in interface DataAwareAmetysObject
getDataHolder
in interface ModelLessDataAwareAmetysObject
getDataHolder
in interface ModifiableModelLessDataAwareAmetysObject
DataHolder
of this AmetysObject
public ModifiableCompositeMetadata getMetadataHolder()
SimpleAmetysObject
CompositeMetadata
of this AmetysObject
.getMetadataHolder
in interface MetadataAwareAmetysObject
getMetadataHolder
in interface ModifiableMetadataAwareAmetysObject
getMetadataHolder
in class SimpleAmetysObject<DefaultZoneItemFactory>
CompositeMetadata
of this AmetysObject
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.