Class QueryAndContainerCommonMethods
java.lang.Object
org.ametys.plugins.queriesdirectory.QueryAndContainerCommonMethods
Common methods for
Query
and QueryContainer
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canMoveTo
(AmetysObject newParent, SimpleAmetysObject queryOrQueryContainer, QueryDAO queryDAO) Implementation ofMovableAmetysObject.canMoveTo(AmetysObject)
static void
moveTo
(AmetysObject newParent, boolean renameIfExist, SimpleAmetysObject queryOrQueryContainer) Implementation ofMovableAmetysObject.moveTo(AmetysObject, boolean)
static void
orderBefore
(AmetysObject siblingNode, SimpleAmetysObject queryOrQueryContainer) Implementation ofMovableAmetysObject.orderBefore(AmetysObject)
-
Method Details
-
canMoveTo
public static boolean canMoveTo(AmetysObject newParent, SimpleAmetysObject queryOrQueryContainer, QueryDAO queryDAO) throws AmetysRepositoryException Implementation ofMovableAmetysObject.canMoveTo(AmetysObject)
- Parameters:
newParent
- See moveTo.queryOrQueryContainer
- The object to movequeryDAO
- The Query DAO- 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.
-
moveTo
public static void moveTo(AmetysObject newParent, boolean renameIfExist, SimpleAmetysObject queryOrQueryContainer) throws AmetysRepositoryException, RepositoryIntegrityViolationException Implementation ofMovableAmetysObject.moveTo(AmetysObject, boolean)
- 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 existqueryOrQueryContainer
- The object to move- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if a page with the same name already exists.
-
orderBefore
public static void orderBefore(AmetysObject siblingNode, SimpleAmetysObject queryOrQueryContainer) throws AmetysRepositoryException Implementation ofMovableAmetysObject.orderBefore(AmetysObject)
- 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.queryOrQueryContainer
- The object to move- Throws:
AmetysRepositoryException
- if an error occurs.
-