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 java.lang.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(java.lang.String source, java.lang.String destination)
           
 Content createContent(java.lang.String path, java.lang.String label, java.lang.String contentType)
           
 void delete(java.lang.String path)
           
 AccessManager getAccessManager()
           
 Content getContent(java.lang.String path)
           
 Content getContent(java.lang.String path, boolean create, ItemType type)
           
 Content getContentByUUID(java.lang.String uuid)
           
 HierarchyManager getDelegate()
          Deprecated. since 4.3 use getWrappedHierarchyManager() instead
 java.lang.String getName()
           
 NodeData getNodeData(java.lang.String path)
           
 Content getPage(java.lang.String path, java.lang.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(java.lang.String path)
           
 boolean isGranted(java.lang.String path, long permissions)
          Checks for the allowed access rights.
 boolean isNodeData(java.lang.String path)
           
 boolean isNodeType(java.lang.String path, ItemType type)
          Deprecated. since 4.0 - use getContent().isNodeType() instead. (not used currently)
 boolean isNodeType(java.lang.String path, java.lang.String type)
          Deprecated. since 4.0 - use getContent().isNodeType() instead.
 boolean isPage(java.lang.String path)
          Deprecated. since 4.0 - use getContent().isNodeType() instead.
 void moveTo(java.lang.String source, java.lang.String destination)
           
 void refresh(boolean keepChanges)
           
 void save()
           
 java.lang.String toString()
           
protected  java.lang.String transformPath(java.lang.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 java.lang.String toString()
Overrides:
toString in class java.lang.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 java.lang.String transformPath(java.lang.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(java.lang.String path,
                             java.lang.String label,
                             java.lang.String contentType)
                      throws javax.jcr.RepositoryException
Specified by:
createContent in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

getContent

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

getContent

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

getNodeData

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

getPage

@Deprecated
public Content getPage(java.lang.String path,
                                  java.lang.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(java.lang.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(java.lang.String path)
               throws AccessDeniedException
Deprecated. since 4.0 - use getContent().isNodeType() instead.

Specified by:
isPage in interface HierarchyManager
Throws:
AccessDeniedException

isExist

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

isGranted

public boolean isGranted(java.lang.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(java.lang.String path,
                                     java.lang.String type)
Deprecated. since 4.0 - use getContent().isNodeType() instead.

Specified by:
isNodeType in interface HierarchyManager

isNodeType

@Deprecated
public boolean isNodeType(java.lang.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(java.lang.String path)
                   throws AccessDeniedException
Specified by:
isNodeData in interface HierarchyManager
Throws:
AccessDeniedException

getContentByUUID

public Content getContentByUUID(java.lang.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(java.lang.String source,
                   java.lang.String destination)
            throws javax.jcr.RepositoryException
Specified by:
moveTo in interface HierarchyManager
Throws:
javax.jcr.RepositoryException

copyTo

public void copyTo(java.lang.String source,
                   java.lang.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 java.lang.String getName()
Specified by:
getName in interface HierarchyManager


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