Package org.ametys.plugins.repository
Interface MovableAmetysObject
- All Superinterfaces:
AmetysObject
- All Known Subinterfaces:
ModifiableZoneItem
,MoveablePage
- All Known Implementing Classes:
DefaultAlias
,DefaultLink
,DefaultPage
,DefaultZoneItem
,Query
,QueryContainer
,Site
AmetysObject
that can be ordered or moved-
Method Summary
Modifier and TypeMethodDescriptionboolean
canMoveTo
(AmetysObject newParent) Test if a move can be a success or if it is impossible (e.g.void
moveTo
(AmetysObject newParent, boolean renameIfExist) Move the current object as a new child of the given object.void
orderBefore
(AmetysObject siblingNode) Order a node before another sibling node (or as the last node)Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Method Details
-
moveTo
void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException Move the current object as a new child of the given object. This node will be the last child. You should call canMoveTo to know if this is a supported operation.- Parameters:
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 exist- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if a page with the same name already exists.
-
canMoveTo
Test if a move can be a success or if it is impossible (e.g. due to the implementation of the target)- Parameters:
newParent
- See moveTo.- Returns:
- true if the move operation may succeed. If false is returned and you call moveTo anyway, you may encontered a RuntimeException (such as UnsupportedOperationException)
- Throws:
AmetysRepositoryException
- if an error occurs.
-
orderBefore
Order a node before another sibling node (or as the last node)- Parameters:
siblingNode
- 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.- Throws:
AmetysRepositoryException
- if an error occurs.
-