org.alfresco.repo.template
Class VersionHistoryNode

java.lang.Object
  extended by org.alfresco.repo.template.BaseContentNode
      extended by org.alfresco.repo.template.VersionHistoryNode
All Implemented Interfaces:
java.io.Serializable, TemplateContent, TemplateNodeRef, TemplateProperties, org.alfresco.service.namespace.NamespacePrefixResolverProvider

public class VersionHistoryNode
extends BaseContentNode
implements org.alfresco.service.namespace.NamespacePrefixResolverProvider

Template Node wrapper representing a record in the version history of a node. Provides access to basic properties and version information for the frozen state record.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.repo.template.BaseContentNode
BaseContentNode.TemplateContentData
 
Field Summary
 
Fields inherited from class org.alfresco.repo.template.BaseContentNode
children, CONTENT_DOWNLOAD_PROP_URL, CONTENT_DOWNLOAD_URL, CONTENT_GET_PROP_URL, CONTENT_GET_URL, CONTENT_SERVICE_GET_PROP_URL, CONTENT_SERVICE_GET_URL, FOLDER_BROWSE_URL, imageResolver, NAMESPACE_BEGIN, services
 
Constructor Summary
VersionHistoryNode(Version version, TemplateNode parent, ServiceRegistry services)
          Constructor
 
Method Summary
 java.util.Set getAspects()
           
 java.util.List getChildren()
           
 java.util.Date getCreatedDate()
          Helper method to get the created date from the version property data.
 java.lang.String getCreator()
          Helper method to get the creator of the version.
 java.lang.String getDescription()
          Helper method to get the version description.
 java.lang.String getId()
           
 boolean getIsMajorVersion()
          Helper method to get the version type.
 java.lang.String getName()
          Helper method to get the item name.
 org.alfresco.service.namespace.NamespacePrefixResolver getNamespacePrefixResolver()
           
 org.alfresco.service.cmr.repository.NodeRef getNodeRef()
           
 TemplateProperties getParent()
           
 java.util.Map getProperties()
          Get the map containing the version property values.
 org.alfresco.service.namespace.QName getType()
           
 java.lang.String getUrl()
           
 java.lang.String getVersionLabel()
          Helper method to get the version label from the version property data.
 boolean hasAspect(java.lang.String aspect)
           
 
Methods inherited from class org.alfresco.repo.template.BaseContentNode
getContent, getDisplayMimetype, getDisplayPath, getDownloadUrl, getEncoding, getHasChildren, getIcon16, getIcon32, getIcon64, getIsContainer, getIsDocument, getIsLinkToContainer, getIsLinkToDocument, getMimetype, getQnamePath, getServiceUrl, getSiteShortName, getSize, getWebdavUrl, isTemplateContent, isTemplateNodeRef, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionHistoryNode

public VersionHistoryNode(Version version,
                          TemplateNode parent,
                          ServiceRegistry services)
Constructor

Parameters:
version - Descriptor of the node version information
Method Detail

getId

public java.lang.String getId()
Specified by:
getId in interface TemplateNodeRef
Returns:
The GUID for the frozen state NodeRef

getNodeRef

public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
Specified by:
getNodeRef in interface TemplateNodeRef
Returns:
Returns the frozen state NodeRef this record represents

getType

public org.alfresco.service.namespace.QName getType()
Specified by:
getType in interface TemplateNodeRef
Returns:
Returns the type.

getName

public java.lang.String getName()
Helper method to get the item name.

Specified by:
getName in interface TemplateNodeRef
Returns:
the item name

getCreatedDate

public java.util.Date getCreatedDate()
Helper method to get the created date from the version property data.

Returns:
the date the version was created

getCreator

public java.lang.String getCreator()
Helper method to get the creator of the version.

Returns:
the creator of the version

getVersionLabel

public java.lang.String getVersionLabel()
Helper method to get the version label from the version property data.

Returns:
the version label

getIsMajorVersion

public boolean getIsMajorVersion()
Helper method to get the version type.

Returns:
true if this is a major version, false otherwise.

getDescription

public java.lang.String getDescription()
Helper method to get the version description.

Returns:
the version description

getProperties

public java.util.Map getProperties()
Get the map containing the version property values.

Specified by:
getProperties in interface TemplateProperties
Returns:
the map containing the version properties

getAspects

public java.util.Set getAspects()
Specified by:
getAspects in interface TemplateProperties
Overrides:
getAspects in class BaseContentNode
Returns:
The list of aspects applied to this node

hasAspect

public boolean hasAspect(java.lang.String aspect)
Specified by:
hasAspect in interface TemplateProperties
Overrides:
hasAspect in class BaseContentNode
Parameters:
aspect - The aspect name to test for
Returns:
true if the node has the aspect false otherwise

getChildren

public java.util.List getChildren()
Specified by:
getChildren in interface TemplateProperties
Overrides:
getChildren in class BaseContentNode
Returns:
The children of this Node as objects that support the TemplateProperties contract.
See Also:
TemplateProperties.getChildren()

getParent

public TemplateProperties getParent()
Specified by:
getParent in interface TemplateProperties
Returns:
the primary parent of this node
See Also:
TemplateProperties.getParent()

getNamespacePrefixResolver

public org.alfresco.service.namespace.NamespacePrefixResolver getNamespacePrefixResolver()
Specified by:
getNamespacePrefixResolver in interface org.alfresco.service.namespace.NamespacePrefixResolverProvider

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface TemplateContent
Overrides:
getUrl in class BaseContentNode
Returns:
Returns the URL to the content stream for the frozen state of the node from the default content property (@see ContentModel.PROP_CONTENT)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.