com.atlassian.jira.mail
Class TemplateIssue

java.lang.Object
  extended bycom.atlassian.jira.mail.TemplateIssue
All Implemented Interfaces:
Issue, IssueContext, OfBizValueWrapper

public class TemplateIssue
extends Object
implements Issue

Decorator for the Issue Object.

This class will ensure backwards compatibility for templates accessing the issue object. This class also includes helper methods for retrieving rendered fields (e.g. description, environment) and nicely formatted date fields (e.g. Original Time Estimate, Time Spent, etc.).

This object is passed to the template through the TemplateContext for the velocity email templates


Constructor Summary
TemplateIssue(Issue issue, FieldLayoutManager fieldLayoutManager, RendererManager rendererManager, CustomFieldManager customFieldManager, JiraDurationUtils jiraDurationUtils)
           
 
Method Summary
 Collection getAffectedVersions()
           
 User getAssignee()
           
 String getAssigneeId()
           
 Object getAssigneeUser()
          Return the assignee - an object will be returned even if the user has been deleted from the system.
 Collection getAttachments()
           
 Collection getComponents()
           
 Timestamp getCreated()
           
 CustomField getCustomField(String id)
           
 Object getCustomFieldValue(CustomField customField)
           
 Object getCustomFieldValue(String id)
          Get value for a custom field.
 String getDescription()
          Retrieve the description of the issue.
 Timestamp getDueDate()
           
 String getEnvironment()
          Retrieve the environment of the issue.
 Long getEstimate()
           
 Object getExternalFieldValue(String fieldId)
           
 Collection getFixVersions()
           
 org.ofbiz.core.entity.GenericValue getGenericValue()
          Get the backing GenericValue object.
 String getHtmlDescription()
          Retrieves the html formatted description.
 String getHtmlEnvironment()
          Retrieves the html formatted environment.
 Long getId()
           
 IssueRenderContext getIssueRenderContext()
           
 org.ofbiz.core.entity.GenericValue getIssueType()
           
 IssueType getIssueTypeObject()
           
 String getKey()
           
 Long getLong(String name)
          Retrieve a numeric field.
 String getNiceTimeEstimate(I18nHelper i18n)
          Return a formatted time string of the time estimate.
 String getNiceTimeOriginalEstimate(I18nHelper i18n)
          Return a formatted time string of the original time estimate.
 String getNiceTimeSpent(I18nHelper i18n)
          Return a formatted time string of the time spent.
 Long getOriginalEstimate()
           
 org.ofbiz.core.entity.GenericValue getParent()
           
 Long getParentId()
           
 Issue getParentObject()
          If this issue is a subtask, return its parent.
 org.ofbiz.core.entity.GenericValue getPriority()
           
 Priority getPriorityObject()
           
 org.ofbiz.core.entity.GenericValue getProject()
           
 Project getProjectObject()
           
 User getReporter()
           
 String getReporterId()
           
 Object getReporterUser()
          Return the reporter - an object will be returned even if the user has been deleted from the system.
 org.ofbiz.core.entity.GenericValue getResolution()
           
 Resolution getResolutionObject()
           
 org.ofbiz.core.entity.GenericValue getSecurityLevel()
           
 Long getSecurityLevelId()
           
 org.ofbiz.core.entity.GenericValue getStatus()
           
 Status getStatusObject()
           
 String getString(String name)
          Retrieve a String field.
 Collection getSubTaskObjects()
          Gets all the issue's subtasks.
 Collection getSubTasks()
           
 String getSummary()
           
 Long getTimeSpent()
           
 Timestamp getTimestamp(String name)
          Retrieve a timestamp field.
 Timestamp getUpdated()
           
 Long getVotes()
           
 Long getWorkflowId()
           
 boolean isCreated()
           
 boolean isEditable()
           
 boolean isSubTask()
           
 void store()
          Persist this object's immediate fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateIssue

public TemplateIssue(Issue issue,
                     FieldLayoutManager fieldLayoutManager,
                     RendererManager rendererManager,
                     CustomFieldManager customFieldManager,
                     JiraDurationUtils jiraDurationUtils)
Method Detail

getId

public Long getId()
Specified by:
getId in interface Issue

getProject

public org.ofbiz.core.entity.GenericValue getProject()
Specified by:
getProject in interface Issue

getProjectObject

public Project getProjectObject()
Specified by:
getProjectObject in interface Issue

getIssueType

public org.ofbiz.core.entity.GenericValue getIssueType()
Specified by:
getIssueType in interface Issue

getIssueTypeObject

public IssueType getIssueTypeObject()
Specified by:
getIssueTypeObject in interface Issue

getSummary

public String getSummary()
Specified by:
getSummary in interface Issue

getAssignee

public User getAssignee()
Specified by:
getAssignee in interface Issue

getAssigneeId

public String getAssigneeId()
Specified by:
getAssigneeId in interface Issue

getAssigneeUser

public Object getAssigneeUser()
Return the assignee - an object will be returned even if the user has been deleted from the system.

Returns:
Object a User or DummyUser object if the issue has an assignee

getComponents

public Collection getComponents()
Specified by:
getComponents in interface Issue
Returns:
A collection of component GenericValues.

getReporter

public User getReporter()
Specified by:
getReporter in interface Issue

getReporterId

public String getReporterId()
Specified by:
getReporterId in interface Issue

getReporterUser

public Object getReporterUser()
Return the reporter - an object will be returned even if the user has been deleted from the system.

Returns:
Object a User or DummyUser object if the issue has an reporter

getDescription

public String getDescription()
Retrieve the description of the issue.

Specified by:
getDescription in interface Issue
Returns:
String the issue description - rendered or text dependant on format

getHtmlDescription

public String getHtmlDescription()
Retrieves the html formatted description.

A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated.

Returns:
String the html formatted description.

getEnvironment

public String getEnvironment()
Retrieve the environment of the issue. Depending on the format specified - attempt to return the rendered description or the simple text

Specified by:
getEnvironment in interface Issue
Returns:
String the issue environment - rendered or text dependant on format specified

getHtmlEnvironment

public String getHtmlEnvironment()
Retrieves the html formatted environment.

A simple string (with linked bug keys displayed) is returned if a rendered version cannot be generated.

Returns:
String the html formatted environment.

getAffectedVersions

public Collection getAffectedVersions()
Specified by:
getAffectedVersions in interface Issue
Returns:
a collection of 'affects' Version objects.

getFixVersions

public Collection getFixVersions()
Specified by:
getFixVersions in interface Issue
Returns:
a collection of fix-for Version objects.

getDueDate

public Timestamp getDueDate()
Specified by:
getDueDate in interface Issue

getSecurityLevel

public org.ofbiz.core.entity.GenericValue getSecurityLevel()
Specified by:
getSecurityLevel in interface Issue

getSecurityLevelId

public Long getSecurityLevelId()
Specified by:
getSecurityLevelId in interface Issue

getPriority

public org.ofbiz.core.entity.GenericValue getPriority()
Specified by:
getPriority in interface Issue

getPriorityObject

public Priority getPriorityObject()
Specified by:
getPriorityObject in interface Issue

getResolution

public org.ofbiz.core.entity.GenericValue getResolution()
Specified by:
getResolution in interface Issue

getResolutionObject

public Resolution getResolutionObject()
Specified by:
getResolutionObject in interface Issue

getKey

public String getKey()
Specified by:
getKey in interface Issue

getVotes

public Long getVotes()
Specified by:
getVotes in interface Issue

getCreated

public Timestamp getCreated()
Specified by:
getCreated in interface Issue

getUpdated

public Timestamp getUpdated()
Specified by:
getUpdated in interface Issue

getWorkflowId

public Long getWorkflowId()
Specified by:
getWorkflowId in interface Issue

getCustomFieldValue

public Object getCustomFieldValue(CustomField customField)
Specified by:
getCustomFieldValue in interface Issue
Returns:
A custom field's value. Will be a List, User, Timestamp etc, depending on custom field type.

getCustomField

public CustomField getCustomField(String id)

getCustomFieldValue

public Object getCustomFieldValue(String id)
Get value for a custom field.

Parameters:
id - Custom field key (eg. 'customfield_10010').
Returns:
custom field, or null if specified custom field doesn't exist or doesn't have a value in this issue.

getStatus

public org.ofbiz.core.entity.GenericValue getStatus()
Specified by:
getStatus in interface Issue

getStatusObject

public Status getStatusObject()
Specified by:
getStatusObject in interface Issue

getOriginalEstimate

public Long getOriginalEstimate()
Specified by:
getOriginalEstimate in interface Issue

getEstimate

public Long getEstimate()
Specified by:
getEstimate in interface Issue

getTimeSpent

public Long getTimeSpent()
Specified by:
getTimeSpent in interface Issue

getExternalFieldValue

public Object getExternalFieldValue(String fieldId)
Specified by:
getExternalFieldValue in interface Issue

isSubTask

public boolean isSubTask()
Specified by:
isSubTask in interface Issue

getParentId

public Long getParentId()
Specified by:
getParentId in interface Issue

isCreated

public boolean isCreated()
Specified by:
isCreated in interface Issue

getParentObject

public Issue getParentObject()
Description copied from interface: Issue
If this issue is a subtask, return its parent. The parent Issue, or null if the issue is not a subtask.

Specified by:
getParentObject in interface Issue

getParent

public org.ofbiz.core.entity.GenericValue getParent()
Specified by:
getParent in interface Issue

getSubTasks

public Collection getSubTasks()
Specified by:
getSubTasks in interface Issue

getSubTaskObjects

public Collection getSubTaskObjects()
Description copied from interface: Issue
Gets all the issue's subtasks.

Specified by:
getSubTaskObjects in interface Issue
Returns:
A collection of MutableIssues

isEditable

public boolean isEditable()
Specified by:
isEditable in interface Issue

getIssueRenderContext

public IssueRenderContext getIssueRenderContext()
Specified by:
getIssueRenderContext in interface Issue

getAttachments

public Collection getAttachments()
Specified by:
getAttachments in interface Issue
Returns:
A collection of Attachment objects

getString

public String getString(String name)
Description copied from interface: OfBizValueWrapper
Retrieve a String field.

Specified by:
getString in interface OfBizValueWrapper

getTimestamp

public Timestamp getTimestamp(String name)
Description copied from interface: OfBizValueWrapper
Retrieve a timestamp field.

Specified by:
getTimestamp in interface OfBizValueWrapper

getLong

public Long getLong(String name)
Description copied from interface: OfBizValueWrapper
Retrieve a numeric field.

Specified by:
getLong in interface OfBizValueWrapper

getGenericValue

public org.ofbiz.core.entity.GenericValue getGenericValue()
Description copied from interface: OfBizValueWrapper
Get the backing GenericValue object.

Specified by:
getGenericValue in interface OfBizValueWrapper

store

public void store()
Description copied from interface: OfBizValueWrapper
Persist this object's immediate fields.

Specified by:
store in interface OfBizValueWrapper

getNiceTimeOriginalEstimate

public String getNiceTimeOriginalEstimate(I18nHelper i18n)
Return a formatted time string of the original time estimate.

Returns:
String formatted string of original time estimate

getNiceTimeEstimate

public String getNiceTimeEstimate(I18nHelper i18n)
Return a formatted time string of the time estimate.

Returns:
String formatted string of time estimate

getNiceTimeSpent

public String getNiceTimeSpent(I18nHelper i18n)
Return a formatted time string of the time spent.

Returns:
String formatted string of time spent


Copyright © 2002-2007 Atlassian. All Rights Reserved.