Package org.ametys.plugins.forms
Class FormAndDirectoryCommonMethods
java.lang.Object
org.ametys.plugins.forms.FormAndDirectoryCommonMethods
Common methods for
Form
and FormDirectory
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canMoveTo
(String siteName, AmetysObject newParent, SimpleAmetysObject formOrFormDirectory, FormDirectoryDAO formDAO) Implementation ofMovableAmetysObject.canMoveTo(AmetysObject)
static void
moveTo
(AmetysObject newParent, boolean renameIfExist, SimpleAmetysObject formOrFormDirectory) Implementation ofMovableAmetysObject.moveTo(AmetysObject, boolean)
static void
orderBefore
(AmetysObject siblingNode, SimpleAmetysObject formOrFormDirectory) Implementation ofMovableAmetysObject.orderBefore(AmetysObject)
-
Method Details
-
canMoveTo
public static boolean canMoveTo(String siteName, AmetysObject newParent, SimpleAmetysObject formOrFormDirectory, FormDirectoryDAO formDAO) throws AmetysRepositoryException Implementation ofMovableAmetysObject.canMoveTo(AmetysObject)
- Parameters:
siteName
- Name of current sitenewParent
- See moveTo.formOrFormDirectory
- The object to moveformDAO
- The Form 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 formOrFormDirectory) 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 existformOrFormDirectory
- 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 formOrFormDirectory) 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.formOrFormDirectory
- The object to move- Throws:
AmetysRepositoryException
- if an error occurs.
-