1 13 package info.magnolia.cms.core; 14 15 import info.magnolia.cms.security.AccessDeniedException; 16 import info.magnolia.cms.security.AccessManager; 17 import info.magnolia.cms.security.Permission; 18 19 import javax.jcr.Node; 20 import javax.jcr.PathNotFoundException; 21 import javax.jcr.RepositoryException; 22 23 24 31 public class ContentNode extends Content { 32 33 36 private Node workingNode; 37 38 41 private String name; 42 43 46 private Content contentNode; 47 48 56 public ContentNode(Node workingNode, String name, AccessManager manager) 57 throws PathNotFoundException, 58 RepositoryException, 59 AccessDeniedException { 60 this.workingNode = workingNode; 61 this.name = name; 62 this.contentNode = new Content(this.workingNode, this.name, manager); 63 this.node = this.contentNode.node; 64 } 65 66 73 public ContentNode(Node node, AccessManager manager) throws RepositoryException, AccessDeniedException { 74 Access.isGranted(manager, Path.getAbsolutePath(node.getPath()), Permission.READ); 75 this.node = node; 76 this.setAccessManager(manager); 77 } 78 79 88 public ContentNode(Node workingNode, String name, boolean createNew, AccessManager manager) 89 throws PathNotFoundException, 90 RepositoryException, 91 AccessDeniedException { 92 this.workingNode = workingNode; 93 this.name = name; 94 this.contentNode = new Content(this.workingNode, this.name, ItemType.CONTENTNODE.getSystemName(), manager); 95 this.node = this.contentNode.node; 96 } 97 98 } 99 | Popular Tags |