com.atlassian.jira.config
Class DefaultSubTaskManager

java.lang.Object
  extended by com.atlassian.jira.config.DefaultSubTaskManager
All Implemented Interfaces:
SubTaskManager

public class DefaultSubTaskManager
extends Object
implements SubTaskManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.config.SubTaskManager
SUB_TASK_ISSUE_TYPE_STYLE, SUB_TASK_LINK_TYPE_INWARD_NAME, SUB_TASK_LINK_TYPE_NAME, SUB_TASK_LINK_TYPE_OUTWARD_NAME, SUB_TASK_LINK_TYPE_STYLE
 
Constructor Summary
DefaultSubTaskManager(ConstantsManager constantsManager, IssueLinkTypeManager issueLinkTypeManager, IssueLinkManager issueLinkManager, PermissionManager permissionManager, ApplicationProperties applicationProperties, CollectionReorderer collectionReorderer, IssueTypeSchemeManager issueTypeSchemeManager, IssueManager issueManager)
           
 
Method Summary
 IssueUpdateBean changeParent(org.ofbiz.core.entity.GenericValue subTask, org.ofbiz.core.entity.GenericValue newParentIssue, com.atlassian.crowd.embedded.api.User currentUser)
          Change the parent of the given subtask to the given new parent on behalf of the given user.
 IssueUpdateBean changeParent(Issue subTask, Issue parentIssue, com.atlassian.crowd.embedded.api.User currentUser)
          Change the parent of the given subtask to the given new parent on behalf of the given user.
 void createSubTaskIssueLink(org.ofbiz.core.entity.GenericValue parentIssue, org.ofbiz.core.entity.GenericValue subTaskIssue, com.atlassian.crowd.embedded.api.User remoteUser)
          create SubTask IssueLink
 void createSubTaskIssueLink(Issue parentIssue, Issue subTaskIssue, com.atlassian.crowd.embedded.api.User remoteUser)
           
 org.ofbiz.core.entity.GenericValue createSubTaskIssueType(String name, Long sequence, String description, String iconurl)
          create SubTask IssueType
 void disableSubTasks()
           
 void enableSubTasks()
          Turn on sub-tasks by creating a sub-task issue link type and a default sub-task issue type
 Collection<Long> getAllSubTaskIssueIds()
          Retrieves ids of all sub-task issues in the system.
 org.ofbiz.core.entity.GenericValue getParentIssue(org.ofbiz.core.entity.GenericValue subtask)
          Get the parent issue from a subtask
 Long getParentIssueId(org.ofbiz.core.entity.GenericValue issue)
           
 SubTaskBean getSubTaskBean(org.ofbiz.core.entity.GenericValue issue, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns the SubTaskBean for the given parent issue in the context of the given user.
 SubTaskBean getSubTaskBean(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser)
          Returns the SubTaskBean for the given parent issue in the context of the given user.
 List<IssueLink> getSubTaskIssueLinks(Long issueId)
          Returns a list of issue links associated with the issue
 IssueType getSubTaskIssueType(String id)
          Returns the SubTask IssueType with the given ID.
 org.ofbiz.core.entity.GenericValue getSubTaskIssueTypeById(String id)
          Returns the SubTask IssueType with the given ID.
 Collection<IssueType> getSubTaskIssueTypeObjects()
          Retrieves all the sub-task issue types
 Collection<Issue> getSubTaskObjects(Issue parentIssue)
          Get an issue's subtasks.
 Collection<org.ofbiz.core.entity.GenericValue> getSubTasks(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. Use getSubTaskObjects(com.atlassian.jira.issue.Issue) instead.
 IssueType insertSubTaskIssueType(String name, Long sequence, String description, String iconurl)
           
 boolean isSubTask(org.ofbiz.core.entity.GenericValue issue)
           
 boolean isSubTaskIssueType(org.ofbiz.core.entity.GenericValue issueType)
           
 boolean isSubTasksEnabled()
           
 boolean issueTypeExistsById(String id)
           
 boolean issueTypeExistsByName(String name)
           
 void moveSubTask(org.ofbiz.core.entity.GenericValue parentIssue, Long currentSequence, Long sequence)
          move SubTask
 void moveSubTask(Issue parentIssue, Long currentSequence, Long sequence)
           
 void moveSubTaskIssueTypeDown(String id)
           
 void moveSubTaskIssueTypeUp(String id)
           
 void removeSubTaskIssueType(String name)
           
 void resetSequences(Issue issue)
           
 void updateSubTaskIssueType(String id, String name, Long sequence, String description, String iconurl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSubTaskManager

public DefaultSubTaskManager(ConstantsManager constantsManager,
                             IssueLinkTypeManager issueLinkTypeManager,
                             IssueLinkManager issueLinkManager,
                             PermissionManager permissionManager,
                             ApplicationProperties applicationProperties,
                             CollectionReorderer collectionReorderer,
                             IssueTypeSchemeManager issueTypeSchemeManager,
                             IssueManager issueManager)
Method Detail

enableSubTasks

public void enableSubTasks()
                    throws CreateException
Turn on sub-tasks by creating a sub-task issue link type and a default sub-task issue type

Specified by:
enableSubTasks in interface SubTaskManager
Throws:
CreateException

disableSubTasks

public void disableSubTasks()
Specified by:
disableSubTasks in interface SubTaskManager

getSubTaskIssueTypeObjects

public Collection<IssueType> getSubTaskIssueTypeObjects()
Description copied from interface: SubTaskManager
Retrieves all the sub-task issue types

Specified by:
getSubTaskIssueTypeObjects in interface SubTaskManager
Returns:
A Collection of all sub-task IssueTypes.

isSubTasksEnabled

public boolean isSubTasksEnabled()
Specified by:
isSubTasksEnabled in interface SubTaskManager

createSubTaskIssueType

public org.ofbiz.core.entity.GenericValue createSubTaskIssueType(String name,
                                                                 Long sequence,
                                                                 String description,
                                                                 String iconurl)
                                                          throws CreateException
Description copied from interface: SubTaskManager
create SubTask IssueType

Specified by:
createSubTaskIssueType in interface SubTaskManager
Returns:
Throws:
CreateException

insertSubTaskIssueType

public IssueType insertSubTaskIssueType(String name,
                                        Long sequence,
                                        String description,
                                        String iconurl)
                                 throws CreateException
Specified by:
insertSubTaskIssueType in interface SubTaskManager
Throws:
CreateException

updateSubTaskIssueType

public void updateSubTaskIssueType(String id,
                                   String name,
                                   Long sequence,
                                   String description,
                                   String iconurl)
                            throws DataAccessException
Specified by:
updateSubTaskIssueType in interface SubTaskManager
Throws:
DataAccessException

issueTypeExistsByName

public boolean issueTypeExistsByName(String name)
Specified by:
issueTypeExistsByName in interface SubTaskManager

moveSubTaskIssueTypeUp

public void moveSubTaskIssueTypeUp(String id)
                            throws DataAccessException
Specified by:
moveSubTaskIssueTypeUp in interface SubTaskManager
Throws:
DataAccessException

moveSubTaskIssueTypeDown

public void moveSubTaskIssueTypeDown(String id)
                              throws DataAccessException
Specified by:
moveSubTaskIssueTypeDown in interface SubTaskManager
Throws:
DataAccessException

getSubTaskIssueTypeById

public org.ofbiz.core.entity.GenericValue getSubTaskIssueTypeById(String id)
Description copied from interface: SubTaskManager
Returns the SubTask IssueType with the given ID.

Specified by:
getSubTaskIssueTypeById in interface SubTaskManager
Parameters:
id - the ID
Returns:
SubTask IssueType with the given ID.

getSubTaskIssueType

public IssueType getSubTaskIssueType(String id)
Description copied from interface: SubTaskManager
Returns the SubTask IssueType with the given ID.

Specified by:
getSubTaskIssueType in interface SubTaskManager
Parameters:
id - the ID
Returns:
SubTask IssueType with the given ID.

removeSubTaskIssueType

public void removeSubTaskIssueType(String name)
                            throws RemoveException
Specified by:
removeSubTaskIssueType in interface SubTaskManager
Throws:
RemoveException

issueTypeExistsById

public boolean issueTypeExistsById(String id)
Specified by:
issueTypeExistsById in interface SubTaskManager

isSubTask

public boolean isSubTask(org.ofbiz.core.entity.GenericValue issue)
Specified by:
isSubTask in interface SubTaskManager

isSubTaskIssueType

public boolean isSubTaskIssueType(org.ofbiz.core.entity.GenericValue issueType)
Specified by:
isSubTaskIssueType in interface SubTaskManager

getParentIssueId

public Long getParentIssueId(org.ofbiz.core.entity.GenericValue issue)
Specified by:
getParentIssueId in interface SubTaskManager

getParentIssue

public org.ofbiz.core.entity.GenericValue getParentIssue(org.ofbiz.core.entity.GenericValue subtask)
Description copied from interface: SubTaskManager
Get the parent issue from a subtask

Specified by:
getParentIssue in interface SubTaskManager
Parameters:
subtask - subtask
Returns:
the parent issue form a subtask

getSubTaskBean

public SubTaskBean getSubTaskBean(org.ofbiz.core.entity.GenericValue issue,
                                  com.atlassian.crowd.embedded.api.User remoteUser)
Description copied from interface: SubTaskManager
Returns the SubTaskBean for the given parent issue in the context of the given user.

Specified by:
getSubTaskBean in interface SubTaskManager
Parameters:
issue - the Issue
remoteUser - the user
Returns:
the SubTaskBean for the given parent issue in the context of the given user.

getSubTaskBean

public SubTaskBean getSubTaskBean(Issue issue,
                                  com.atlassian.crowd.embedded.api.User remoteUser)
Description copied from interface: SubTaskManager
Returns the SubTaskBean for the given parent issue in the context of the given user.

Specified by:
getSubTaskBean in interface SubTaskManager
Parameters:
issue - the Issue
remoteUser - the user
Returns:
the SubTaskBean for the given parent issue in the context of the given user.

moveSubTask

public void moveSubTask(org.ofbiz.core.entity.GenericValue parentIssue,
                        Long currentSequence,
                        Long sequence)
Description copied from interface: SubTaskManager
move SubTask

Specified by:
moveSubTask in interface SubTaskManager

moveSubTask

public void moveSubTask(Issue parentIssue,
                        Long currentSequence,
                        Long sequence)
Specified by:
moveSubTask in interface SubTaskManager

resetSequences

public void resetSequences(Issue issue)
Specified by:
resetSequences in interface SubTaskManager

getAllSubTaskIssueIds

public Collection<Long> getAllSubTaskIssueIds()
Retrieves ids of all sub-task issues in the system.

Specified by:
getAllSubTaskIssueIds in interface SubTaskManager

getSubTaskIssueLinks

public List<IssueLink> getSubTaskIssueLinks(Long issueId)
Description copied from interface: SubTaskManager
Returns a list of issue links associated with the issue

Specified by:
getSubTaskIssueLinks in interface SubTaskManager
Parameters:
issueId - issue id
Returns:
a list of issue links

getSubTasks

public Collection<org.ofbiz.core.entity.GenericValue> getSubTasks(org.ofbiz.core.entity.GenericValue issue)
Deprecated. Use getSubTaskObjects(com.atlassian.jira.issue.Issue) instead.

Specified by:
getSubTasks in interface SubTaskManager
Parameters:
issue - the issue
Returns:
subtasks as GenericValues

getSubTaskObjects

public Collection<Issue> getSubTaskObjects(Issue parentIssue)
Get an issue's subtasks.

Specified by:
getSubTaskObjects in interface SubTaskManager
Returns:
A collection of Issues.

createSubTaskIssueLink

public void createSubTaskIssueLink(org.ofbiz.core.entity.GenericValue parentIssue,
                                   org.ofbiz.core.entity.GenericValue subTaskIssue,
                                   com.atlassian.crowd.embedded.api.User remoteUser)
                            throws CreateException
Description copied from interface: SubTaskManager
create SubTask IssueLink

Specified by:
createSubTaskIssueLink in interface SubTaskManager
Throws:
CreateException

createSubTaskIssueLink

public void createSubTaskIssueLink(Issue parentIssue,
                                   Issue subTaskIssue,
                                   com.atlassian.crowd.embedded.api.User remoteUser)
                            throws CreateException
Specified by:
createSubTaskIssueLink in interface SubTaskManager
Throws:
CreateException

changeParent

public IssueUpdateBean changeParent(org.ofbiz.core.entity.GenericValue subTask,
                                    org.ofbiz.core.entity.GenericValue newParentIssue,
                                    com.atlassian.crowd.embedded.api.User currentUser)
                             throws RemoveException,
                                    CreateException
Description copied from interface: SubTaskManager
Change the parent of the given subtask to the given new parent on behalf of the given user.

Specified by:
changeParent in interface SubTaskManager
Parameters:
subTask - The SubTask
newParentIssue - The parent Issue
currentUser - The user
Returns:
an IssueUpdateBean representing the change action.
Throws:
RemoveException - if there's a problem unlinking original parent.
CreateException - if there's a problem linking new parent.

changeParent

public IssueUpdateBean changeParent(Issue subTask,
                                    Issue parentIssue,
                                    com.atlassian.crowd.embedded.api.User currentUser)
                             throws RemoveException,
                                    CreateException
Description copied from interface: SubTaskManager
Change the parent of the given subtask to the given new parent on behalf of the given user.

Specified by:
changeParent in interface SubTaskManager
Parameters:
subTask - The SubTask
parentIssue - The parent Issue
currentUser - The user
Returns:
an IssueUpdateBean representing the change action.
Throws:
RemoveException - if there's a problem unlinking original parent.
CreateException - if there's a problem linking new parent.


Copyright © 2002-2012 Atlassian. All Rights Reserved.