Copyright© 2008-2026 Sitevision AB, all rights reserved.
@Requireable(value="StructureUtil") public interface StructureUtil
Note! Use TrashcanUtil to
"move a Node to the Trashcan" or "restore a Node from the Trashcan".
An instance of the Sitevision class implementing this interface can be obtained via
Utils.getStructureUtil(). See Utils
for how to obtain an instance of the Utils interface.
| Modifier and Type | Method and Description |
|---|---|
void |
moveNode(Node aNode,
Node aParent)
Moves a node from the current parent to another in the node structure.
|
void moveNode(Node aNode, Node aParent) throws ConstraintViolationException, RepositoryException
Moves a node from the current parent to another in the node structure.
Trashcan note! A Node that resides in the Trashcan can not be moved.
Also, a Node can not be moved to the Trashcan (or to any Node that resides in the Trashcan).
Use TrashcanUtil to move a Node to the Trashcan or restore a Node from the Trashcan.
Currently supported node types are:
sv:articlesv:archivesv:collaborationGroupPage (since Sitevision 2023.02.1)sv:filesv:foldersv:imagesv:linksv:pagesv:template
The valid structures are listed below. Any other, invalid combination will result in a ConstraintViolationException.
Parent restrictions
| Node | Allowed parents |
|---|---|
sv:article |
sv:archive |
sv:archive |
sv:sitePage, sv:page, sv:folder, sv:article |
sv:collaborationGroupPage |
sv:collaborationGroupFolder |
sv:file |
sv:folder, *fileRepos |
sv:folder |
sv:sitePage, sv:page, sv:folder, sv:article, sv:templateRepository, *fileRepos |
sv:image |
sv:folder, *fileRepos |
sv:link |
sv:sitePage, sv:page, sv:folder, sv:article |
sv:page |
sv:sitePage, sv:page, sv:folder, sv:article |
sv:template |
sv:folder, sv:templateRepository |
Root restrictions
| Node | Allowed root nodes |
|---|---|
sv:article |
sv:sitePage |
sv:archive |
sv:sitePage |
sv:collaborationGroupPage |
sv:sitePage |
sv:file |
sv:folder, *fileRepos |
sv:folder |
sv:sitePage, sv:templateRepository, *fileRepos |
sv:image |
*fileRepos |
sv:link |
sv:sitePage |
sv:page |
sv:sitePage |
sv:template |
sv:templateRepository |
(*fileRepos corresponds to sv:fileRepository, sv:imageRepository, sv:localFileRepository, sv:localImageRepository)
If the node or the parent is null a NullPointerException is thrown.
Requires PermissionUtil.Permission.MOVE_NODE and
PermissionUtil.Permission.WRITE on aNode
If the user is not authorized to alter aNode a ConstraintViolationException is thrown.
Requires PermissionUtil.Permission.WRITE on aParent and current container of aNode
If the user is not authorized to write on aParent or the current container of aNode a ConstraintViolationException is thrown.
If the parent is descendant of the node a ConstraintViolationException is thrown.
Note! The move operation will be silently ignored if the node is already a child of the parent.
aNode - the node that is to be moved. May not be nullaParent - the new parent node. May not be nullConstraintViolationException - if current user is not authorized to move aNode to aParent
or if an invalid structure would be result of the operationRepositoryException - if something else goes wrongSitevision - Content Management Made Easy
Sitevision is an advanced Java enterprise portal product that implements Java Content Repository (JSR 283).
Copyright© 2008-2026 Sitevision AB, all rights reserved.