com.atlassian.jira.action.issue
Class AbstractIssueUpdateAction

java.lang.Object
  extended byActionSupport
      extended bycom.atlassian.jira.action.JiraActionSupport
          extended bycom.atlassian.jira.action.JiraNonWebActionSupport
              extended bycom.atlassian.jira.action.issue.AbstractIssueAction
                  extended bycom.atlassian.jira.action.issue.AbstractIssueUpdateAction
Direct Known Subclasses:
ActionCreate, ActionDelete, AttachmentCreate, AttachmentDelete, IssueUpdate, LinkCreate, LinkDelete

public abstract class AbstractIssueUpdateAction
extends AbstractIssueAction

This action should be subclassed by any action which changes issues and might want to generate a changelog.

It automatically stores a copy of the original issue, so that changelogs can be created easily using createChangeLog()

See Also:
Serialized Form

Field Summary
protected  TextAnalyzer textAnalyzer
           
 
Fields inherited from class com.atlassian.jira.action.JiraActionSupport
log
 
Constructor Summary
protected AbstractIssueUpdateAction()
           
  AbstractIssueUpdateAction(IssueUpdater issueUpdater)
           
  AbstractIssueUpdateAction(IssueUpdater issueUpdater, TextAnalyzer textAnalyzer)
           
 
Method Summary
protected  GenericValue createComment()
          This method will create a comment if possible (ie iff issue != null && comment != null).
protected  GenericValue createComment(GenericValue commentedIssue)
           
protected  void doUpdate(int eventType, GenericValue commentGV)
          This method 'completes' the update of an issue entity.
protected  void doUpdate(int eventType, GenericValue commentGV, java.util.List changeItems)
          This method 'completes' the update of an issue entity, given part of the changelog being prewritten as a StringBuffer.
protected  void doUpdate(int eventType, GenericValue commentGV, java.util.Map params)
          This method 'completes' the update of an issue entity.
protected  void doUpdateIfNeeded(int eventType)
          This method 'completes' the update of an entity if the entity has been modified during the action.
protected  void doUpdateWithChangelog(int eventType, java.util.List changeItems)
          This method 'completes' the update of an issue entity.
 java.lang.String getComment()
           
 java.lang.String getCommentLevel()
           
 void setComment(java.lang.String comment)
           
 void setCommentLevel(java.lang.String commentLevel)
           
 void setIssue(GenericValue issue)
          Here we override the AbstractGVIssueAction.setIssue() method and store a clone of the original issue.
 
Methods inherited from class com.atlassian.jira.action.issue.AbstractIssueAction
doValidation, getIssue
 
Methods inherited from class com.atlassian.jira.action.JiraNonWebActionSupport
doDefault, execute, getRemoteUser, isDispatchEvent, setDispatchEvent, setRemoteUser
 
Methods inherited from class com.atlassian.jira.action.JiraActionSupport
addErrorMessages, addErrors, getActionName, getApplicationProperties, getDelegator, getLocaleUtils, getResult, getText, isIndexing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textAnalyzer

protected final TextAnalyzer textAnalyzer
Constructor Detail

AbstractIssueUpdateAction

public AbstractIssueUpdateAction(IssueUpdater issueUpdater,
                                 TextAnalyzer textAnalyzer)

AbstractIssueUpdateAction

protected AbstractIssueUpdateAction()

AbstractIssueUpdateAction

public AbstractIssueUpdateAction(IssueUpdater issueUpdater)
Method Detail

doUpdate

protected void doUpdate(int eventType,
                        GenericValue commentGV)
                 throws java.lang.Exception
This method 'completes' the update of an issue entity.

It sets the update timestamp, stores the issue, updated the cache if needed, creates the changelog and dispatches the event (if desired).

This method will ALWAYS generate an update - see also doUpdateIfNeeded.

Throws:
java.lang.Exception

doUpdate

protected void doUpdate(int eventType,
                        GenericValue commentGV,
                        java.util.Map params)
                 throws java.lang.Exception
This method 'completes' the update of an issue entity.

It sets the update timestamp, stores the issue, updated the cache if needed, creates the changelog and dispatches the event (if desired).

This method will ALWAYS generate an update - see also doUpdateIfNeeded.

Throws:
java.lang.Exception

doUpdateWithChangelog

protected void doUpdateWithChangelog(int eventType,
                                     java.util.List changeItems)
                              throws java.lang.Exception
This method 'completes' the update of an issue entity.

It sets the update timestamp, stores the issue, updated the cache if needed, creates the changelog and dispatches the event (if desired).

This method will ALWAYS generate an update - see also doUpdateIfNeeded.

Throws:
java.lang.Exception

doUpdate

protected void doUpdate(int eventType,
                        GenericValue commentGV,
                        java.util.List changeItems)
                 throws java.lang.Exception
This method 'completes' the update of an issue entity, given part of the changelog being prewritten as a StringBuffer.

It sets the update timestamp, stores the issue, updated the cache if needed, creates the changelog and dispatches the event (if desired).

This method will ALWAYS generate an update - see also doUpdateIfNeeded.

Throws:
java.lang.Exception

doUpdateIfNeeded

protected void doUpdateIfNeeded(int eventType)
                         throws java.lang.Exception
This method 'completes' the update of an entity if the entity has been modified during the action.

Throws:
java.lang.Exception

setIssue

public void setIssue(GenericValue issue)
Here we override the AbstractGVIssueAction.setIssue() method and store a clone of the original issue.

This means we can automatically generate changelogs - nice!

Overrides:
setIssue in class AbstractIssueAction

createComment

protected GenericValue createComment()
                              throws java.lang.Exception
This method will create a comment if possible (ie iff issue != null && comment != null). It does not generate any events.

Returns:
The comment created or null if no comment was created
Throws:
java.lang.Exception

createComment

protected GenericValue createComment(GenericValue commentedIssue)
                              throws java.lang.Exception
Throws:
java.lang.Exception

getComment

public java.lang.String getComment()

setComment

public void setComment(java.lang.String comment)

getCommentLevel

public java.lang.String getCommentLevel()

setCommentLevel

public void setCommentLevel(java.lang.String commentLevel)