com.versionone.om
Class BaseAsset

java.lang.Object
  extended by com.versionone.om.Entity
      extended by com.versionone.om.BaseAsset
Direct Known Subclasses:
BuildProject, BuildRun, ChangeSet, Iteration, Member, Message, Project, ProjectAsset, RegressionSuite, Retrospective, Schedule, Team, TestSuite

public abstract class BaseAsset
extends Entity

Represents the base type of members, projects, teams, etc in the VersionOne system.


Field Summary
protected static int STATE_ACTIVE
           
protected static int STATE_CLOSED
           
 
Fields inherited from class com.versionone.om.Entity
ASSET_STATE_VALUE, ASSET_VALUE, CHANGE_DATE_UTC, CONTENT_TYPE_VALUE, CONTENT_VALUE, CREATE_DATE_UTC, DELETE_OPERATION, DESCRIPTION_VALUE, FILENAME_VALUE, NAME_VALUE
 
Method Summary
 boolean canClose()
           
 boolean canDelete()
           
 boolean canReactivate()
           
 void close()
          Closes or Inactivates the item
 Attachment createAttachment(java.lang.String name, java.lang.String fileName, java.io.InputStream stream)
          Create an attachment that belongs to this asset.
 Attachment createAttachment(java.lang.String name, java.lang.String fileName, java.io.InputStream stream, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Create an attachment that belongs to this asset.
 Conversation createConversation(Member author, java.lang.String content)
          Creates conversation which mentioned this asset.
 Conversation createConversation(Member author, java.lang.String content, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Creates conversation which mentioned this asset.
 Link createLink(java.lang.String name, java.lang.String url, boolean onMenu)
          Create a link that belongs to this asset.
 Link createLink(java.lang.String name, java.lang.String url, boolean onMenu, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Create a link that belongs to this asset.
 Note createNote(java.lang.String name, java.lang.String content, boolean personal)
          Create a note that belongs to this asset.
 Note createNote(java.lang.String name, java.lang.String content, boolean personal, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Create a note that belongs to this asset.
 void delete()
          Deletes the Item
 java.util.Collection<Attachment> getAttachments(AttachmentFilter filter)
           
 ICustomDropdownDictionary getCustomDropdown()
           
 ICustomAttributeDictionary getCustomField()
           
 java.lang.String getDescription()
           
 java.util.Collection<Link> getLinks(LinkFilter filter)
           
 java.lang.String getName()
           
 java.util.Collection<Note> getNotes(NoteFilter filter)
           
 java.util.Collection<Conversation> getReferencedInExpressions()
           
 java.lang.String getURL()
           
 boolean isActive()
           
 boolean isClosed()
           
 void reactivate()
          Reactivates the item.
 void setDescription(java.lang.String value)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class com.versionone.om.Entity
equals, get, getChangeComment, getChangeDate, getChangedBy, getCreateComment, getCreateDate, getCreatedBy, getID, getInstance, hashCode, save, save, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE_CLOSED

protected static final int STATE_CLOSED
See Also:
Constant Field Values

STATE_ACTIVE

protected static final int STATE_ACTIVE
See Also:
Constant Field Values
Method Detail

getURL

public java.lang.String getURL()
Returns:
URL to VersionOne Detail Page for this BaseAsset.

getName

public java.lang.String getName()
Returns:
Name of the base asset.

setName

public void setName(java.lang.String name)
Parameters:
name - Name of the base asset.

getDescription

public java.lang.String getDescription()
Returns:
description of the base asset.

setDescription

public void setDescription(java.lang.String value)
Parameters:
value - description of the base asset.

getReferencedInExpressions

public java.util.Collection<Conversation> getReferencedInExpressions()
Returns:
Expressions that referenced to current item.

getAttachments

public java.util.Collection<Attachment> getAttachments(AttachmentFilter filter)
Parameters:
filter - filter for getting a collection of attachments (If null, then all items returned).
Returns:
A collection attachments that belong to this base asset filtered by the passed in filter.

getNotes

public java.util.Collection<Note> getNotes(NoteFilter filter)
Parameters:
filter - filter for getting a collection of notes (If null, then all items returned).
Returns:
A collection notes that belong to this base asset filtered by the passed in filter.

getLinks

public java.util.Collection<Link> getLinks(LinkFilter filter)
Parameters:
filter - Limit the link returned. If null, then all items returned.
Returns:
A collection links that belong to this base asset filtered by the passed in filter.

isActive

public boolean isActive()
Returns:
Indicates if the entity is open or active.

isClosed

public boolean isClosed()
Returns:
Indicates if the entity is closed or inactive.

canDelete

public boolean canDelete()
Returns:
True if the item can be deleted

delete

public void delete()
            throws java.lang.UnsupportedOperationException
Deletes the Item

Throws:
java.lang.UnsupportedOperationException - if the item is an invalid state for the Operation.

getCustomField

public ICustomAttributeDictionary getCustomField()
Returns:
Simple Custom Fields.

getCustomDropdown

public ICustomDropdownDictionary getCustomDropdown()
Returns:
Custom List-Type Fields.

createLink

public Link createLink(java.lang.String name,
                       java.lang.String url,
                       boolean onMenu)
Create a link that belongs to this asset.

Parameters:
name - The name of the link.
url - The url of the link.
onMenu - True if the link is visible on this asset's detail page menu.
Returns:
created Link.

createLink

public Link createLink(java.lang.String name,
                       java.lang.String url,
                       boolean onMenu,
                       java.util.Map<java.lang.String,java.lang.Object> attributes)
Create a link that belongs to this asset.

Parameters:
name - The name of the link.
url - The url of the link.
onMenu - True if the link is visible on this asset's detail page menu.
attributes - additional attributes for the Link.
Returns:
created Link.

createNote

public Note createNote(java.lang.String name,
                       java.lang.String content,
                       boolean personal)
Create a note that belongs to this asset.

Parameters:
name - The name of the note.
content - The content of the note.
personal - True if the note is only visible to the currently logged in user.
Returns:
created Note.

createNote

public Note createNote(java.lang.String name,
                       java.lang.String content,
                       boolean personal,
                       java.util.Map<java.lang.String,java.lang.Object> attributes)
Create a note that belongs to this asset.

Parameters:
name - The name of the note.
content - The content of the note.
personal - True if the note is only visible to the currently logged in user.
attributes - additional attributes for the Note.
Returns:
created Note.

createAttachment

public Attachment createAttachment(java.lang.String name,
                                   java.lang.String fileName,
                                   java.io.InputStream stream)
                            throws AttachmentLengthExceededException,
                                   ApplicationUnavailableException
Create an attachment that belongs to this asset.

Parameters:
name - The name of the attachment.
fileName - The name of the original attachment file.
stream - The read-enabled stream that contains the attachment. content to upload.
Returns:
Attachment object with corresponding parameters.
Throws:
AttachmentLengthExceededException - if attachment is too long.
ApplicationUnavailableException - if any problem appears during connection to the server.

createAttachment

public Attachment createAttachment(java.lang.String name,
                                   java.lang.String fileName,
                                   java.io.InputStream stream,
                                   java.util.Map<java.lang.String,java.lang.Object> attributes)
                            throws AttachmentLengthExceededException,
                                   ApplicationUnavailableException
Create an attachment that belongs to this asset.

Parameters:
name - The name of the attachment.
fileName - The name of the original attachment file.
stream - The read-enabled stream that contains the attachment. content to upload.
attributes - additional attributes for the Attachment.
Returns:
Attachment object with corresponding parameters.
Throws:
AttachmentLengthExceededException - if attachment is too long.
ApplicationUnavailableException - if any problem appears during connection to the server.

createConversation

public Conversation createConversation(Member author,
                                       java.lang.String content)
Creates conversation which mentioned this asset.

Parameters:
author - Author of conversation.
content - Content of conversation.
Returns:
Created conversation

createConversation

public Conversation createConversation(Member author,
                                       java.lang.String content,
                                       java.util.Map<java.lang.String,java.lang.Object> attributes)
Creates conversation which mentioned this asset.

Parameters:
author - Author of conversation.
content - Content of conversation.
attributes - additional attributes for the Conversation.
Returns:
Created conversation

canClose

public boolean canClose()
Returns:
True if the item can be closed.

close

public void close()
           throws java.lang.UnsupportedOperationException
Closes or Inactivates the item

Throws:
java.lang.UnsupportedOperationException - if the item is an invalid state for the Operation, e.g. it is already closed or inactive.

canReactivate

public boolean canReactivate()
Returns:
True if item can be Reactivated.

reactivate

public void reactivate()
                throws java.lang.UnsupportedOperationException
Reactivates the item.

Throws:
java.lang.UnsupportedOperationException - if the item is an invalid state for the Operation, e.g. it is already open or active.