Package org.alfresco.repo.template
Class BaseContentNode
- java.lang.Object
-
- org.alfresco.repo.template.BaseContentNode
-
- All Implemented Interfaces:
java.io.Serializable,TemplateContent,TemplateNodeRef,TemplateProperties
- Direct Known Subclasses:
BasePermissionsNode,VersionHistoryNode
public abstract class BaseContentNode extends java.lang.Object implements TemplateContent
Base class for Template API objects that supply content functionality.- Author:
- Kevin Roast
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBaseContentNode.TemplateContentDataInner class wrapping and providing access to a ContentData property
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<org.alfresco.service.namespace.QName>aspectsprotected java.util.List<TemplateProperties>childrenThe children of this nodeprotected static java.lang.StringCONTENT_DOWNLOAD_PROP_URLprotected static java.lang.StringCONTENT_DOWNLOAD_URLprotected static java.lang.StringCONTENT_GET_PROP_URLprotected static java.lang.StringCONTENT_GET_URLprotected static java.lang.StringCONTENT_SERVICE_GET_PROP_URLprotected static java.lang.StringCONTENT_SERVICE_GET_URLprotected static java.lang.StringFOLDER_BROWSE_URLprotected TemplateImageResolverimageResolverprotected static java.lang.StringNAMESPACE_BEGINprotected ServiceRegistryservices
-
Constructor Summary
Constructors Constructor Description BaseContentNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<org.alfresco.service.namespace.QName>getAspects()java.util.List<TemplateProperties>getChildren()java.lang.StringgetContent()java.lang.StringgetDisplayMimetype()java.lang.StringgetDisplayPath()java.lang.StringgetDownloadUrl()java.lang.StringgetEncoding()booleangetHasChildren()java.lang.StringgetIcon16()java.lang.StringgetIcon32()java.lang.StringgetIcon64()booleangetIsContainer()booleangetIsDocument()booleangetIsLinkToContainer()booleangetIsLinkToDocument()java.lang.StringgetMimetype()java.lang.StringgetQnamePath()java.lang.StringgetServiceUrl()java.lang.StringgetSiteShortName()Returns the short name of the site this node is located within.longgetSize()java.lang.StringgetUrl()java.lang.StringgetWebdavUrl()booleanhasAspect(java.lang.String aspect)booleanisTemplateContent(java.lang.Object o)Helper to return true if the supplied property value is a TemplateContentData objectbooleanisTemplateNodeRef(java.lang.Object o)Helper to return true if the supplied property value is a TemplateNodeRef objectjava.lang.StringtoString()Override Object.toString() to provide useful debug output-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.template.TemplateNodeRef
getId, getName, getNodeRef, getType
-
Methods inherited from interface org.alfresco.repo.template.TemplateProperties
getParent, getProperties
-
-
-
-
Field Detail
-
CONTENT_GET_URL
protected static final java.lang.String CONTENT_GET_URL
- See Also:
- Constant Field Values
-
CONTENT_GET_PROP_URL
protected static final java.lang.String CONTENT_GET_PROP_URL
- See Also:
- Constant Field Values
-
CONTENT_DOWNLOAD_URL
protected static final java.lang.String CONTENT_DOWNLOAD_URL
- See Also:
- Constant Field Values
-
CONTENT_DOWNLOAD_PROP_URL
protected static final java.lang.String CONTENT_DOWNLOAD_PROP_URL
- See Also:
- Constant Field Values
-
CONTENT_SERVICE_GET_URL
protected static final java.lang.String CONTENT_SERVICE_GET_URL
- See Also:
- Constant Field Values
-
CONTENT_SERVICE_GET_PROP_URL
protected static final java.lang.String CONTENT_SERVICE_GET_PROP_URL
- See Also:
- Constant Field Values
-
FOLDER_BROWSE_URL
protected static final java.lang.String FOLDER_BROWSE_URL
- See Also:
- Constant Field Values
-
NAMESPACE_BEGIN
protected static final java.lang.String NAMESPACE_BEGIN
- See Also:
- Constant Field Values
-
children
protected java.util.List<TemplateProperties> children
The children of this node
-
services
protected ServiceRegistry services
-
imageResolver
protected TemplateImageResolver imageResolver
-
aspects
protected java.util.Set<org.alfresco.service.namespace.QName> aspects
-
-
Method Detail
-
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 java.lang.String toString()
Override Object.toString() to provide useful debug output- Overrides:
toStringin classjava.lang.Object
-
getQnamePath
public java.lang.String getQnamePath()
- Returns:
- QName path to this node. This can be used for Lucene PATH: style queries
-
getIcon16
public java.lang.String getIcon16()
- Returns:
- the small icon image for this node
-
getIcon32
public java.lang.String getIcon32()
- Returns:
- the medium icon image for this node
-
getIcon64
public java.lang.String getIcon64()
- Returns:
- the large icon image for this node
-
getDisplayPath
public java.lang.String getDisplayPath()
- Returns:
- Display path to this node - the path built of 'cm:name' attribute values.
-
getChildren
public java.util.List<TemplateProperties> getChildren()
- Specified by:
getChildrenin interfaceTemplateProperties- 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 java.util.Set<org.alfresco.service.namespace.QName> getAspects()
- Specified by:
getAspectsin interfaceTemplateProperties- Returns:
- The list of aspects applied to this node
-
hasAspect
public boolean hasAspect(java.lang.String aspect)
- Specified by:
hasAspectin interfaceTemplateProperties- Parameters:
aspect- The aspect name to test for- Returns:
- true if the node has the aspect false otherwise
-
getContent
public java.lang.String getContent()
- Specified by:
getContentin interfaceTemplateContent- Returns:
- the content String for this node from the default content property (@see ContentModel.PROP_CONTENT)
-
getUrl
public java.lang.String getUrl()
- Specified by:
getUrlin interfaceTemplateContent- 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 java.lang.String getDownloadUrl()
- Specified by:
getDownloadUrlin interfaceTemplateContent- 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 java.lang.String getServiceUrl()
-
getWebdavUrl
public java.lang.String getWebdavUrl()
- Returns:
- The WebDav cm:name based path to the content for the default content property (@see ContentModel.PROP_CONTENT)
-
getMimetype
public java.lang.String getMimetype()
- Specified by:
getMimetypein interfaceTemplateContent- Returns:
- The mimetype encoding for content attached to the node from the default content property (@see ContentModel.PROP_CONTENT)
-
getDisplayMimetype
public java.lang.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 java.lang.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:
getSizein interfaceTemplateContent- 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(java.lang.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(java.lang.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 java.lang.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.
-
-