Class BaseContentNode

java.lang.Object
org.alfresco.repo.template.BaseContentNode
All Implemented Interfaces:
Serializable, TemplateContent, TemplateNodeRef, TemplateProperties
Direct Known Subclasses:
BasePermissionsNode, VersionHistoryNode

public abstract class BaseContentNode extends Object implements TemplateContent
Base class for Template API objects that supply content functionality.
Author:
Kevin Roast
See Also:
  • Field Details

  • Constructor Details

    • BaseContentNode

      public BaseContentNode()
  • Method Details

    • getIsContainer

      public boolean getIsContainer()
      Returns:
      true if this Node is a container (i.e. a folder)
    • getIsDocument

      public boolean getIsDocument()
      Returns:
      true if this Node is a Document (i.e. with content)
    • getIsLinkToContainer

      public boolean getIsLinkToContainer()
      Returns:
      true if this Node is a Link to a Container (i.e. a folderlink)
    • getIsLinkToDocument

      public boolean getIsLinkToDocument()
      Returns:
      true if this Node is a Link to a Document (i.e. a filelink)
    • toString

      public String toString()
      Override Object.toString() to provide useful debug output
      Overrides:
      toString in class Object
    • getQnamePath

      public String getQnamePath()
      Returns:
      QName path to this node. This can be used for Lucene PATH: style queries
    • getIcon16

      public String getIcon16()
      Returns:
      the small icon image for this node
    • getIcon32

      public String getIcon32()
      Returns:
      the medium icon image for this node
    • getIcon64

      public String getIcon64()
      Returns:
      the large icon image for this node
    • getDisplayPath

      public String getDisplayPath()
      Returns:
      Display path to this node - the path built of 'cm:name' attribute values.
    • getChildren

      public List<TemplateProperties> getChildren()
      Specified by:
      getChildren in interface TemplateProperties
      Returns:
      The children of this Node as objects that support the TemplateProperties contract.
    • getHasChildren

      public boolean getHasChildren()
      Returns:
      true if the node has the children false otherwise
    • getAspects

      public Set<QName> getAspects()
      Specified by:
      getAspects in interface TemplateProperties
      Returns:
      The list of aspects applied to this node
    • hasAspect

      public boolean hasAspect(String aspect)
      Specified by:
      hasAspect in interface TemplateProperties
      Parameters:
      aspect - The aspect name to test for
      Returns:
      true if the node has the aspect false otherwise
    • getContent

      public String getContent()
      Specified by:
      getContent in interface TemplateContent
      Returns:
      the content String for this node from the default content property (@see ContentModel.PROP_CONTENT)
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface TemplateContent
      Returns:
      For a content document, this method returns the URL to the content stream for the default content property (@see ContentModel.PROP_CONTENT)

      For a container node, this method return the URL to browse to the folder in the web-client

    • getDownloadUrl

      public String getDownloadUrl()
      Specified by:
      getDownloadUrl in interface TemplateContent
      Returns:
      For a content document, this method returns the download URL to the content for the default content property (@see ContentModel.PROP_CONTENT)

      For a container node, this method returns an empty string

    • getServiceUrl

      public String getServiceUrl()
    • getWebdavUrl

      public String getWebdavUrl()
      Returns:
      The WebDav cm:name based path to the content for the default content property (@see ContentModel.PROP_CONTENT)
    • getMimetype

      public String getMimetype()
      Specified by:
      getMimetype in interface TemplateContent
      Returns:
      The mimetype encoding for content attached to the node from the default content property (@see ContentModel.PROP_CONTENT)
    • getDisplayMimetype

      public String getDisplayMimetype()
      Returns:
      The display label of the mimetype encoding for content attached to the node from the default content property (@see ContentModel.PROP_CONTENT)
    • getEncoding

      public String getEncoding()
      Returns:
      The character encoding for content attached to the node from the default content property (@see ContentModel.PROP_CONTENT)
    • getSize

      public long getSize()
      Specified by:
      getSize in interface TemplateContent
      Returns:
      The size in bytes of the content attached to the node from the default content property (@see ContentModel.PROP_CONTENT)
    • isTemplateContent

      public boolean isTemplateContent(Object o)
      Helper to return true if the supplied property value is a TemplateContentData object
      Parameters:
      o - Object to test
      Returns:
      true if instanceof TemplateContentData, false otherwise
    • isTemplateNodeRef

      public boolean isTemplateNodeRef(Object o)
      Helper to return true if the supplied property value is a TemplateNodeRef object
      Parameters:
      o - Object to test
      Returns:
      true if instanceof isTemplateNodeRef, false otherwise
    • getSiteShortName

      public String getSiteShortName()
      Returns the short name of the site this node is located within. If the node is not located within a site null is returned.
      Returns:
      The short name of the site this node is located within, null if the node is not located within a site.