CodeBeamer 5.4.0.1-RC API

com.intland.codebeamer.persistence.dto
Class ArtifactDto

java.lang.Object
  extended by com.intland.codebeamer.persistence.dto.base.IdentifiableDto
      extended by com.intland.codebeamer.persistence.dto.base.NamedDto
          extended by com.intland.codebeamer.persistence.dto.base.DescribeableDto
              extended by com.intland.codebeamer.persistence.dto.ArtifactDto
All Implemented Interfaces:
BaseDto, IndexableDto, ProjectAwareDto, ReferableDto, VersionedReferableDto, WriteControlledDto, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
CalendarDto, CalendarEntryDto, ChatStatsDto, InboxDto, WikiPageDto

public class ArtifactDto
extends DescribeableDto
implements ProjectAwareDto, VersionedReferableDto, IndexableDto, WriteControlledDto

Wraps an artifact.

See Also:
Serialized Form

Nested Class Summary
static class ArtifactDto.PathComparator
          A special Comparator to compare artifacts by canonical path
 
Nested classes/interfaces inherited from class com.intland.codebeamer.persistence.dto.base.DescribeableDto
DescribeableDto.DescriptionComparator
 
Nested classes/interfaces inherited from class com.intland.codebeamer.persistence.dto.base.NamedDto
NamedDto.NameComparator
 
Nested classes/interfaces inherited from class com.intland.codebeamer.persistence.dto.base.IdentifiableDto
IdentifiableDto.IdComparator
 
Nested classes/interfaces inherited from interface com.intland.codebeamer.persistence.dto.base.ReferableDto
ReferableDto.DescriptionComparator
 
Field Summary
static java.lang.String INTERWIKI_LINK_TYPE_DIR
           
static java.lang.String INTERWIKI_LINK_TYPE_DOC
           
static java.lang.String INTERWIKI_LINK_TYPE_NOTE
           
static java.lang.String INTERWIKI_LINK_TYPE_NOTES
          Deprecated. Use INTERWIKI_LINK_TYPE_NOTE instead.
static java.lang.String INTERWIKI_LINK_TYPE_REPORT
           
 
Fields inherited from interface com.intland.codebeamer.persistence.dto.base.ReferableDto
HEAD_VERSION, SECTION_DELIMITER, VERSION_DELIMITER
 
Constructor Summary
ArtifactDto()
           
 
Method Summary
 java.lang.Object clone()
           
static int compareArtifacts(ArtifactDto t1, ArtifactDto t2)
          Compare two ArtifactDtos that may be null
static int compareScope(java.lang.String s1, java.lang.String s2)
          Compare two scope names, which is basically identical to NamedDto.compareStringIgnoreCase(String, String), except that null is treated as less than not null.
 int compareTo(java.lang.Object obj)
          Caution: NamedDto compareTo violates the rule that a.equals(b) is equivalent to a.compareTo(b) == 0, because only the names are compared
static int compareType(java.lang.Integer t1, java.lang.Integer t2)
          Compare two ArtifactType constants, so that directories are in front of other artifacts, but do not distinguish between the type of non-directories
 boolean equals(java.lang.Object obj)
           
 ArtifactAdditionalInfoDto getAdditionalInfo()
          Get information about the artifact body/content (if any)
 long getAge()
          Get the age of the artifact (ellapsed time since last modification/creation) in milliseconds
 boolean getCanDelete()
          Check if the current user may delete this artifact
static java.lang.Integer getCompareType(java.lang.Integer typeId)
           
 java.util.Date getCreatedAt()
          Get the date and time of artifact creation
 java.lang.Integer getGenericReferenceId()
           
 java.lang.String getIconUrl()
          Returns the URL of the (small) icon image that represents this DTO type.
 java.lang.String getInterwikiLink()
          Returns the interwiki link that points to the web page where this DTO is managed.
 java.lang.String getInterwikiLinkVersioned(java.lang.String version)
           
 java.util.Date getLastModifiedAt()
          Get the date and time of the last artifact modification
 UserDto getLastModifiedBy()
          Get the user that made the last artifact modification
 java.lang.Integer getNotification()
           
 UserDto getOwner()
          Get the user that created this artifact
 ArtifactDto getParent()
          Get the parent artifact
 java.lang.String getPath()
          Get the canonical path of this document.
 ProjectDto getProject()
          Get the project this artifact belongs to
 java.lang.String getScopeName()
          Get the concatenated names of all artifact ancestors, separated by slash /.
 java.lang.String getShortDescription()
          Get the canonical path of this document, or, if the document is within a hidden directory, only the document name
 java.lang.Integer getTypeId()
          Get the artifact type.
 java.lang.String getUrlLink()
          Returns the local URL that points to the web page where this DTO is managed.
 java.lang.String getUrlLinkVersioned(java.lang.String version)
           
 java.lang.String getVersion()
          Returns its version or null if not available.
 int hashCode()
           
 boolean isA(int type)
          Check whether this is an artifact of the specified type ArtifactType
 boolean isApprovalSupported()
          Returns whether this supports artifact approval workflows.
 boolean isDeleted()
          Check if this artifact has been deleted
 boolean isDirectory()
          Check if this artifact is a directory/folder
 boolean isExists()
          Check if artifact exists
 boolean isFile()
          Check if this artifact has a body/content getAdditionalInfo()
 boolean isIndexed()
          Check if this artifact has already been indexed for search
 boolean isReadable()
          Check if the current user can read the artifact (content)
 boolean isSubscribed()
           
 boolean isWikiNotes()
          Check if this artifact is a Wiki note (a file with extension ".wki")
 boolean isWikiPage()
          Check if this is a wiki document, including personal- and project pages and even wiki notes.
 boolean isWritable()
          Check if the current user can edit the artifact (content)
 void setAdditionalInfo(ArtifactAdditionalInfoDto additionalInfo)
          Set information about the artifact body/content (if any)
 void setCreatedAt(java.util.Date createdAt)
          Set the date and time of artifact creation
 void setDeleted(boolean deleted)
          This method is only public because of an implementation side effect.
 void setGenericReferenceId(java.lang.Integer genericReferenceId)
           
 void setIndexed(boolean indexed)
          Set whether this artifact has already been indexed for search This method is only public because of an implementation side effect.
 void setLastModifiedAt(java.util.Date lastModifiedAt)
          Set the date and time of the last artifact modification
 void setLastModifiedBy(UserDto lastModifiedByUser)
          Set the user that made the last artifact modification
 void setName(java.lang.String name)
          Sets its (descriptive) name.
 void setNotification(java.lang.Integer notification)
           
 void setOwner(UserDto owner)
          Set the user that created this artifact
 void setParent(ArtifactDto parent)
          Set the parent artifact
 void setProject(ProjectDto project)
          Set the project this artifact belongs to
 void setReadable(boolean readable)
          Set whether the current user can read the artifact (content)
 void setScopeName(java.lang.String scopeName)
          This method is only public because of an implementation side effect.
 void setTypeId(java.lang.Integer typeId)
          Set the artifact type.
 void setWritable(boolean writable)
          Set whether the current user can edit the artifact (content)
 java.lang.String toString()
           
 
Methods inherited from class com.intland.codebeamer.persistence.dto.base.DescribeableDto
compareByDescription, getDescription, getDescriptionFormat, setDescription, setDescriptionFormat
 
Methods inherited from class com.intland.codebeamer.persistence.dto.base.NamedDto
compareNames, compareString, compareStringIgnoreCase, createLookupMap, getName
 
Methods inherited from class com.intland.codebeamer.persistence.dto.base.IdentifiableDto
compare, compareInteger, equals, getId, hashCode, setId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

INTERWIKI_LINK_TYPE_DIR

public static final java.lang.String INTERWIKI_LINK_TYPE_DIR
See Also:
Constant Field Values

INTERWIKI_LINK_TYPE_DOC

public static final java.lang.String INTERWIKI_LINK_TYPE_DOC
See Also:
Constant Field Values

INTERWIKI_LINK_TYPE_NOTE

public static final java.lang.String INTERWIKI_LINK_TYPE_NOTE
See Also:
Constant Field Values

INTERWIKI_LINK_TYPE_REPORT

public static final java.lang.String INTERWIKI_LINK_TYPE_REPORT
See Also:
Constant Field Values

INTERWIKI_LINK_TYPE_NOTES

public static final java.lang.String INTERWIKI_LINK_TYPE_NOTES
Deprecated. Use INTERWIKI_LINK_TYPE_NOTE instead.
See Also:
Constant Field Values
Constructor Detail

ArtifactDto

public ArtifactDto()
Method Detail

getParent

public ArtifactDto getParent()
Get the parent artifact

Returns:
the parent artifact, or null if top-level artifact

setParent

public void setParent(ArtifactDto parent)
Set the parent artifact

Parameters:
parent - artifact, or null if top-level artifact

getTypeId

public java.lang.Integer getTypeId()
Get the artifact type.

Returns:
the artifact type

setTypeId

public void setTypeId(java.lang.Integer typeId)
Set the artifact type.

Parameters:
typeId - of the artifact

getProject

public ProjectDto getProject()
Get the project this artifact belongs to

Specified by:
getProject in interface ProjectAwareDto
Returns:
the project this artifact belongs to, or null if project independent artifact

setProject

public void setProject(ProjectDto project)
Set the project this artifact belongs to

Specified by:
setProject in interface ProjectAwareDto
Parameters:
project - this artifact belongs to, or null if project independent artifact

setName

public void setName(java.lang.String name)
Description copied from class: NamedDto
Sets its (descriptive) name.

Overrides:
setName in class NamedDto

setScopeName

public void setScopeName(java.lang.String scopeName)
This method is only public because of an implementation side effect. Client applications should never call this method.

Parameters:
scopeName -

getScopeName

public java.lang.String getScopeName()
Get the concatenated names of all artifact ancestors, separated by slash /.

Returns:
the concatenated names of all artifact ancestors, separated by slash /, or null if this is a top-level artifact

getPath

public java.lang.String getPath()
Get the canonical path of this document. Path separator is /

Returns:
the canonical path of this document

getShortDescription

public java.lang.String getShortDescription()
Get the canonical path of this document, or, if the document is within a hidden directory, only the document name

Specified by:
getShortDescription in interface ReferableDto
Returns:
either the document path or the document name

getCreatedAt

public java.util.Date getCreatedAt()
Get the date and time of artifact creation

Returns:
the date and time this artifact was created

setCreatedAt

public void setCreatedAt(java.util.Date createdAt)
Set the date and time of artifact creation

Parameters:
createdAt - is the date and time this artifact was created

getOwner

public UserDto getOwner()
Get the user that created this artifact

Returns:
the user that created this artifact

setOwner

public void setOwner(UserDto owner)
Set the user that created this artifact

Parameters:
owner - is the user that created this artifact

getLastModifiedAt

public java.util.Date getLastModifiedAt()
Get the date and time of the last artifact modification

Returns:
the date and time of the last artifact modification

setLastModifiedAt

public void setLastModifiedAt(java.util.Date lastModifiedAt)
Set the date and time of the last artifact modification

Parameters:
lastModifiedAt - is the date and time of the last artifact modification

getLastModifiedBy

public UserDto getLastModifiedBy()
Get the user that made the last artifact modification

Returns:
the user that made the last artifact modification

setLastModifiedBy

public void setLastModifiedBy(UserDto lastModifiedByUser)
Set the user that made the last artifact modification

Parameters:
lastModifiedByUser - is the user that made the last artifact modification

isIndexed

public boolean isIndexed()
Check if this artifact has already been indexed for search

Specified by:
isIndexed in interface IndexableDto
Returns:
true if this artifact has been indexed for search, otherwise false

setIndexed

public void setIndexed(boolean indexed)
Set whether this artifact has already been indexed for search This method is only public because of an implementation side effect. Client applications should never call this method.

Specified by:
setIndexed in interface IndexableDto
Parameters:
indexed - is true if the artifact has been indexed, otherwise false

isDeleted

public boolean isDeleted()
Check if this artifact has been deleted

Returns:
true if artifact has been deleted, otherwise false

setDeleted

public void setDeleted(boolean deleted)
This method is only public because of an implementation side effect. Client applications should never call this method.

Parameters:
deleted -

isExists

public boolean isExists()
Check if artifact exists

Returns:
true if artifact id is set and artifact is not deleted

isReadable

public boolean isReadable()
Check if the current user can read the artifact (content)

Returns:
true if the current user can read the artifact (content)

setReadable

public void setReadable(boolean readable)
Set whether the current user can read the artifact (content)

Parameters:
readable - is true if the current user can read the artifact (content), otherwise false

isWritable

public boolean isWritable()
Check if the current user can edit the artifact (content)

Specified by:
isWritable in interface WriteControlledDto
Returns:
true if the current user can edit the artifact (content)

setWritable

public void setWritable(boolean writable)
Set whether the current user can edit the artifact (content)

Specified by:
setWritable in interface WriteControlledDto
Parameters:
writable - is true if the current user can edit the artifact (content), otherwise false

getCanDelete

public boolean getCanDelete()
Check if the current user may delete this artifact

Returns:
true if current user may delete this artifact, otherwise false

getAdditionalInfo

public ArtifactAdditionalInfoDto getAdditionalInfo()
Get information about the artifact body/content (if any)

Returns:
information about the artifact body/content, or null if no body/content exists

setAdditionalInfo

public void setAdditionalInfo(ArtifactAdditionalInfoDto additionalInfo)
Set information about the artifact body/content (if any)

Parameters:
additionalInfo - about the artifact body/content, or null if no body/content exists

getVersion

public java.lang.String getVersion()
Returns its version or null if not available.


isA

public boolean isA(int type)
Check whether this is an artifact of the specified type ArtifactType

Parameters:
type - to check (ArtifactType constant)
Returns:
true if this is an artifact of the specified type, otherwise false

isFile

public boolean isFile()
Check if this artifact has a body/content getAdditionalInfo()

Returns:
true if this artifact has a body/content

isDirectory

public boolean isDirectory()
Check if this artifact is a directory/folder

Returns:
true if this artifact is a directory/folder, otherwise false

isWikiNotes

public boolean isWikiNotes()
Check if this artifact is a Wiki note (a file with extension ".wki")

Returns:
true if this artifact is a Wiki note, otherwise false

isWikiPage

public boolean isWikiPage()
Check if this is a wiki document, including personal- and project pages and even wiki notes.

Returns:
true if this artifact is a Wiki page/note, otherwise false

isApprovalSupported

public boolean isApprovalSupported()
Returns whether this supports artifact approval workflows.


getNotification

public java.lang.Integer getNotification()

setNotification

public void setNotification(java.lang.Integer notification)

isSubscribed

public boolean isSubscribed()

getGenericReferenceId

public java.lang.Integer getGenericReferenceId()

setGenericReferenceId

public void setGenericReferenceId(java.lang.Integer genericReferenceId)

getAge

public long getAge()
Get the age of the artifact (ellapsed time since last modification/creation) in milliseconds

Returns:
the ellapsed time since the last artifact modification in milliseconds, or -1 if not available

getUrlLink

public java.lang.String getUrlLink()
Description copied from interface: ReferableDto
Returns the local URL that points to the web page where this DTO is managed.

Specified by:
getUrlLink in interface ReferableDto

getUrlLinkVersioned

public java.lang.String getUrlLinkVersioned(java.lang.String version)
Specified by:
getUrlLinkVersioned in interface VersionedReferableDto

getInterwikiLink

public java.lang.String getInterwikiLink()
Description copied from interface: ReferableDto
Returns the interwiki link that points to the web page where this DTO is managed.

Specified by:
getInterwikiLink in interface ReferableDto

getInterwikiLinkVersioned

public java.lang.String getInterwikiLinkVersioned(java.lang.String version)
Specified by:
getInterwikiLinkVersioned in interface VersionedReferableDto

getIconUrl

public java.lang.String getIconUrl()
Description copied from interface: ReferableDto
Returns the URL of the (small) icon image that represents this DTO type.

Specified by:
getIconUrl in interface ReferableDto

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class NamedDto
Returns:
true if the object passed in is a artifact with the same id, name and type.

hashCode

public int hashCode()
Overrides:
hashCode in class NamedDto

clone

public java.lang.Object clone()
Overrides:
clone in class IdentifiableDto

toString

public java.lang.String toString()
Overrides:
toString in class NamedDto

compareTo

public int compareTo(java.lang.Object obj)
Description copied from class: NamedDto
Caution: NamedDto compareTo violates the rule that a.equals(b) is equivalent to a.compareTo(b) == 0, because only the names are compared

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class NamedDto

compareArtifacts

public static int compareArtifacts(ArtifactDto t1,
                                   ArtifactDto t2)
Compare two ArtifactDtos that may be null

Parameters:
t1 - is the first ArtifactDto, or null
t2 - is the second ArtifactDto, or null
Returns:
a value < 0 if t1 is less than t2, a value > 0 if t1 greater than t2, and 0 if t1 equals t2

compareType

public static int compareType(java.lang.Integer t1,
                              java.lang.Integer t2)
Compare two ArtifactType constants, so that directories are in front of other artifacts, but do not distinguish between the type of non-directories

Parameters:
t1 - is the first ArtifactType, or null
t2 - is the second ArtifactType, or null
Returns:
a value < 0 if t1 is less than t2, a value > 0 if t1 greater than t2, and 0 if t1 equals t2

compareScope

public static int compareScope(java.lang.String s1,
                               java.lang.String s2)
Compare two scope names, which is basically identical to NamedDto.compareStringIgnoreCase(String, String), except that null is treated as less than not null.

Parameters:
s1 - is the first scope name to compare
s2 - is the second scope name to compare
Returns:
a value < 0 if s1 is less than s2, a value > 0 if s1 greater than s2, and 0 if s1 equals s2

getCompareType

public static java.lang.Integer getCompareType(java.lang.Integer typeId)

CodeBeamer 5.4.0.1-RC API

Copyright © 2006-2009 Intland Software. All rights reserved.