info.magnolia.cms.util
Class HierarchyManagerWrapper

java.lang.Object
  extended by info.magnolia.cms.util.HierarchyManagerWrapper
All Implemented Interfaces:
HierarchyManager

public abstract class HierarchyManagerWrapper
extends Object
implements HierarchyManager

A HierarchyManager wrapping an other hierarchy manager. Subclassed to manipulate the hierarchy.

Version:
$Revision: $ ($Author: $)

Constructor Summary
protected HierarchyManagerWrapper(HierarchyManager wrappedHM)
           
 
Method Summary
 void copyTo(String source, String destination)
           
 Content createContent(String path, String label, String contentType)
           
 void delete(String path)
           
 AccessManager getAccessManager()
           
 Content getContent(String path)
           
 Content getContent(String path, boolean create, ItemType type)
           
 Content getContentByUUID(String uuid)
           
 HierarchyManager getDelegate()
          Deprecated. since 4.3 use getWrappedHierarchyManager() instead
 String getName()
           
 NodeData getNodeData(String path)
           
 Content getPage(String path, String templateName)
          Deprecated. since 4.0 - use getContent().isNodeType() instead. (not used currently)
 QueryManager getQueryManager()
           
 Content getRoot()
           
 javax.jcr.Workspace getWorkspace()
           
 HierarchyManager getWrappedHierarchyManager()
           
 boolean hasPendingChanges()
           
 boolean isExist(String path)
           
 boolean isGranted(String path, long permissions)
          Checks for the allowed access rights.
 boolean isNodeData(String path)
           
 boolean isNodeType(String path, ItemType type)
          Deprecated. since 4.0 - use getContent().isNodeType() instead. (not used currently)
 boolean isNodeType(String path, String type)
          Deprecated. since 4.0 - use getContent().isNodeType() instead.
 boolean isPage(String path)
          Deprecated. since 4.0 - use getContent().isNodeType() instead.
 void moveTo(String source, String destination)
           
 void refresh(boolean keepChanges)
           
 void save()
           
 String toString()
           
protected  String transformPath(String path)
          Override this method to alter all paths passed into the various hierarchy manager methods.
protected  Content wrap(Content content)
          Override this method to have hierarchy manager wrap every piece of content it returns.
protected  NodeData wrap(NodeData nodeData)
          Override this method to have hierarchy manager wrap every piece of node data it returns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HierarchyManagerWrapper

protected HierarchyManagerWrapper(HierarchyManager wrappedHM)
Method Detail

getWrappedHierarchyManager

public HierarchyManager getWrappedHierarchyManager()

getDelegate

@Deprecated
public HierarchyManager getDelegate()
Deprecated. since 4.3 use getWrappedHierarchyManager() instead


toString

public String toString()
Overrides:
toString in class Object

wrap

protected Content wrap(Content content)
Override this method to have hierarchy manager wrap every piece of content it returns.

Parameters:
content - unwrapped content
Returns:
wrapped content (or content passed in if not overriden)

wrap

protected NodeData wrap(NodeData nodeData)
Override this method to have hierarchy manager wrap every piece of node data it returns.

Parameters:
nodeData - unwrapped node data
Returns:
wrapped node data (or node data passed in if not overriden)

transformPath

protected String transformPath(String path)
Override this method to alter all paths passed into the various hierarchy manager methods.

Parameters:
path - unaltered path
Returns:
wrapped path (or the one passed in if not overridden)

getAccessManager

public AccessManager getAccessManager()
Specified by:
getAccessManager in interface HierarchyManager

getQueryManager

public QueryManager getQueryManager()
Specified by:
getQueryManager in interface HierarchyManager

createContent

public Content createContent(String path,
                             String label,
                             String contentType)
                      throws javax.jcr.RepositoryException
Specified by:
createContent in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getContent

public Content getContent(String path)
                   throws javax.jcr.RepositoryException
Specified by:
getContent in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getContent

public Content getContent(String path,
                          boolean create,
                          ItemType type)
                   throws javax.jcr.RepositoryException
Specified by:
getContent in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getNodeData

public NodeData getNodeData(String path)
                     throws javax.jcr.RepositoryException
Specified by:
getNodeData in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getPage

@Deprecated
public Content getPage(String path,
                                  String templateName)
                throws javax.jcr.RepositoryException
Deprecated. since 4.0 - use getContent().isNodeType() instead. (not used currently)

Specified by:
getPage in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

delete

public void delete(String path)
            throws javax.jcr.RepositoryException
Specified by:
delete in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getRoot

public Content getRoot()
                throws javax.jcr.RepositoryException
Specified by:
getRoot in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

isPage

@Deprecated
public boolean isPage(String path)
               throws AccessDeniedException
Deprecated. since 4.0 - use getContent().isNodeType() instead.

Specified by:
isPage in interface HierarchyManager
Throws:
AccessDeniedException

isExist

public boolean isExist(String path)
Specified by:
isExist in interface HierarchyManager

isGranted

public boolean isGranted(String path,
                         long permissions)
Description copied from interface: HierarchyManager
Checks for the allowed access rights.

Specified by:
isGranted in interface HierarchyManager
Parameters:
path - path to content to be checked
permissions - permission mask
Returns:
true if the current user has access on the provided node path.

isNodeType

@Deprecated
public boolean isNodeType(String path,
                                     String type)
Deprecated. since 4.0 - use getContent().isNodeType() instead.

Specified by:
isNodeType in interface HierarchyManager

isNodeType

@Deprecated
public boolean isNodeType(String path,
                                     ItemType type)
Deprecated. since 4.0 - use getContent().isNodeType() instead. (not used currently)

Specified by:
isNodeType in interface HierarchyManager

isNodeData

public boolean isNodeData(String path)
                   throws AccessDeniedException
Specified by:
isNodeData in interface HierarchyManager
Throws:
AccessDeniedException

getContentByUUID

public Content getContentByUUID(String uuid)
                         throws javax.jcr.RepositoryException
Specified by:
getContentByUUID in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getWorkspace

public javax.jcr.Workspace getWorkspace()
Specified by:
getWorkspace in interface HierarchyManager

moveTo

public void moveTo(String source,
                   String destination)
            throws javax.jcr.RepositoryException
Specified by:
moveTo in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

copyTo

public void copyTo(String source,
                   String destination)
            throws javax.jcr.RepositoryException
Specified by:
copyTo in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.RepositoryException
Specified by:
save in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

hasPendingChanges

public boolean hasPendingChanges()
                          throws javax.jcr.RepositoryException
Specified by:
hasPendingChanges in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

refresh

public void refresh(boolean keepChanges)
             throws javax.jcr.RepositoryException
Specified by:
refresh in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getName

public String getName()
Specified by:
getName in interface HierarchyManager


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.