za.org.coefficient.modules.issueTracker
Class IssueTracker

java.lang.Object
  extended by za.org.coefficient.modules.BaseModule
      extended by za.org.coefficient.modules.BaseProjectModule
          extended by za.org.coefficient.modules.issueTracker.IssueTracker
All Implemented Interfaces:
CoefficientEventPublisher, ModuleLocal

public class IssueTracker
extends BaseProjectModule


Field Summary
private static java.lang.String CURRENT_FILTER
           
private static java.lang.String ISSUE_DATA
           
private static java.lang.String ISSUE_DATAS
           
private static java.util.ArrayList ISSUE_LINKS
           
private static java.lang.String ISSUE_PAGER
           
private static java.util.ArrayList ISSUE_PRIORITIES
           
private static java.util.ArrayList ISSUE_RESOLUTIONS
           
private static java.util.ArrayList ISSUE_STATUSES
           
private static java.util.ArrayList ISSUE_TYPES
           
static java.lang.String LINK_DUPLICATED_BY
           
static java.lang.String LINK_DUPLICATES
           
static java.lang.String LINK_INCORPORATES
           
static java.lang.String LINK_PART_OF
           
static java.lang.String LINK_RELATED_TO
           
static java.lang.String LINK_RELATES_TO
           
private static java.lang.String MESSAGE_1
           
private static java.lang.String MESSAGE_2
           
static int PERCENT_COMPLETE_FINISHED
           
static int PERCENT_COMPLETE_START
           
static java.lang.String PRIORITY_BLOCKER
           
static java.lang.String PRIORITY_CRITICAL
           
static java.lang.String PRIORITY_MAJOR
           
static java.lang.String PRIORITY_MINOR
           
static java.lang.String PRIORITY_TRIVIAL
           
static java.lang.String RESOLUTION_CANNOT_REPRODUCE
           
static java.lang.String RESOLUTION_DUPLICATE
           
static java.lang.String RESOLUTION_FIXED
           
static java.lang.String RESOLUTION_INCOMPLETE
           
static java.lang.String RESOLUTION_REJECTED
           
static java.lang.String RESOLUTION_UNRESOLVED
           
static java.lang.String RESOLUTION_WONT_FIX
           
private static int SIZEKB
           
private static int SIZEMB
           
static java.lang.String STATUS_ASSIGNED
           
static java.lang.String STATUS_CLOSED
           
static java.lang.String STATUS_REOPENED
           
static java.lang.String STATUS_UNASSIGNED
           
private static java.lang.String SUBJECT
           
static java.lang.String TYPE_BUG
           
static java.lang.String TYPE_IMPROVEMENT
           
static java.lang.String TYPE_NEWFEATURE
           
static java.lang.String TYPE_PATCH
           
static java.lang.String TYPE_TASK
           
 
Constructor Summary
IssueTracker()
           
 
Method Summary
 CoefficientContext attatchFile(CoefficientContext ctx)
           
 java.lang.String canExecuteForRole(CoefficientContext ctx, java.lang.String methodName, Role usersHighestRole)
          This is a base implementation that will allow all methods to be invoked without regard to roles
 CoefficientContext changeStatus(CoefficientContext ctx)
           
 CoefficientContext comment(CoefficientContext ctx)
           
 CoefficientContext createIssue(CoefficientContext ctx)
           
 CoefficientContext deleteAllForProject(CoefficientContext ctx)
          TODO: implement this
 CoefficientContext deleteAttatchment(CoefficientContext ctx)
           
 CoefficientContext deleteFilter(CoefficientContext ctx)
           
 CoefficientContext deleteIssueWithSummary(CoefficientContext ctx)
           
 java.lang.String displayUsersData(CoefficientUser user)
          This is a base implementation that will return an empty string for a modules user related data.
private  void emailWatchers(IssueData issue, java.lang.String subject, java.lang.String message)
           
 CoefficientContext entry(CoefficientContext ctx)
           
 CoefficientContext filterIssues(CoefficientContext ctx)
           
 CoefficientContext findIssues(CoefficientContext ctx)
           
private  java.lang.Integer getAllCount(java.lang.Long projectId)
           
private  java.lang.Integer getAssignedToMeCount(java.lang.Long projectId, java.lang.Long userId)
           
private  net.sf.hibernate.type.Type[] getHibernateTypesForObjects(java.lang.Object[] objects)
           
 java.lang.String getMainMethod()
          This method is used to determine which method should be invoked when the module is requested without an operation.
 java.lang.String getModuleDescription()
          This method is used to find the description of the module
 java.lang.String getModuleDisplayName()
          This method is used to find the display name of the module
private  java.util.List getMyFilters(java.lang.Long projectId, java.lang.Long userId)
           
private  java.util.HashMap getMyFiltersCount(java.util.List myFilters)
           
private  java.lang.Integer getNewCount(java.lang.Long projectId)
           
private  java.lang.Integer getOpenCount(java.lang.Long projectId)
           
private  java.util.HashMap getPrioritiesCount(java.lang.Long projectId)
           
private  java.lang.Integer getReportedByMeCount(java.lang.Long projectId, java.lang.Long userId)
           
private  java.lang.String getSizeString(int fileSize)
          To get a string describing the size of a file
private  java.util.HashMap getStatusesCount(java.lang.Long projectId)
           
 java.lang.String getSummaryForProject(CoefficientContext ctx)
           
private  java.util.HashMap getTypesCount(java.lang.Long projectId)
           
 boolean isIssueCompleted(CoefficientContext ctx)
          Workflow evalutation method.
 CoefficientContext linkIssue(CoefficientContext ctx)
           
 CoefficientContext linkIssuePrompt(CoefficientContext ctx)
           
 CoefficientContext resolveIssue(CoefficientContext ctx)
           
 CoefficientContext resolveIssuePrompt(CoefficientContext ctx)
           
 CoefficientContext saveComment(CoefficientContext ctx)
           
private  java.lang.String saveFile(CoefficientContext ctx, ProjectFolderItem item)
           
 CoefficientContext saveFilter(CoefficientContext ctx)
           
 CoefficientContext saveFilterPrompt(CoefficientContext ctx)
           
 CoefficientContext saveIssue(CoefficientContext ctx)
           
 CoefficientContext saveUpload(CoefficientContext ctx)
           
 CoefficientContext setWatch(CoefficientContext ctx)
           
 CoefficientContext showSummaryForProject(CoefficientContext ctx)
          This method is required as this is a project module.
private  java.lang.String trimToOneDecimalPlace(java.lang.String floatString)
           
 CoefficientContext unvoteForIssue(CoefficientContext ctx)
           
 CoefficientContext viewIssue(CoefficientContext ctx)
           
 CoefficientContext viewIssueComments(CoefficientContext ctx)
           
 CoefficientContext viewIssueFilters(CoefficientContext ctx)
           
 CoefficientContext voteForIssue(CoefficientContext ctx)
           
 
Methods inherited from class za.org.coefficient.modules.BaseModule
createRSSItem, getCoefficientContext, getModuleName, isProjectRequired, publishEvent, setCoefficientContext, showHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERCENT_COMPLETE_START

public static final int PERCENT_COMPLETE_START
See Also:
Constant Field Values

PERCENT_COMPLETE_FINISHED

public static final int PERCENT_COMPLETE_FINISHED
See Also:
Constant Field Values

LINK_DUPLICATES

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

LINK_DUPLICATED_BY

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

LINK_INCORPORATES

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

LINK_PART_OF

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

LINK_RELATES_TO

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

LINK_RELATED_TO

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

STATUS_ASSIGNED

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

STATUS_CLOSED

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

STATUS_REOPENED

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

STATUS_UNASSIGNED

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

PRIORITY_BLOCKER

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

PRIORITY_CRITICAL

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

PRIORITY_MAJOR

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

PRIORITY_MINOR

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

PRIORITY_TRIVIAL

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

TYPE_BUG

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

TYPE_NEWFEATURE

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

TYPE_TASK

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

TYPE_IMPROVEMENT

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

TYPE_PATCH

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

RESOLUTION_FIXED

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

RESOLUTION_WONT_FIX

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

RESOLUTION_DUPLICATE

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

RESOLUTION_INCOMPLETE

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

RESOLUTION_CANNOT_REPRODUCE

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

RESOLUTION_REJECTED

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

RESOLUTION_UNRESOLVED

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

ISSUE_TYPES

private static java.util.ArrayList ISSUE_TYPES

ISSUE_PRIORITIES

private static java.util.ArrayList ISSUE_PRIORITIES

ISSUE_STATUSES

private static java.util.ArrayList ISSUE_STATUSES

ISSUE_RESOLUTIONS

private static java.util.ArrayList ISSUE_RESOLUTIONS

ISSUE_LINKS

private static java.util.ArrayList ISSUE_LINKS

CURRENT_FILTER

private static final java.lang.String CURRENT_FILTER
See Also:
Constant Field Values

ISSUE_PAGER

private static final java.lang.String ISSUE_PAGER
See Also:
Constant Field Values

SIZEKB

private static final int SIZEKB
See Also:
Constant Field Values

SIZEMB

private static final int SIZEMB
See Also:
Constant Field Values

MESSAGE_1

private static final java.lang.String MESSAGE_1
See Also:
Constant Field Values

MESSAGE_2

private static final java.lang.String MESSAGE_2
See Also:
Constant Field Values

SUBJECT

private static final java.lang.String SUBJECT

ISSUE_DATA

private static final java.lang.String ISSUE_DATA
See Also:
Constant Field Values

ISSUE_DATAS

private static final java.lang.String ISSUE_DATAS
See Also:
Constant Field Values
Constructor Detail

IssueTracker

public IssueTracker()
Method Detail

getMainMethod

public java.lang.String getMainMethod()
Description copied from interface: ModuleLocal
This method is used to determine which method should be invoked when the module is requested without an operation.

Specified by:
getMainMethod in interface ModuleLocal
Specified by:
getMainMethod in class BaseModule
Returns:
name of the method that should be invoked

getModuleDescription

public java.lang.String getModuleDescription()
Description copied from interface: ModuleLocal
This method is used to find the description of the module

Specified by:
getModuleDescription in interface ModuleLocal
Specified by:
getModuleDescription in class BaseModule
Returns:
the description of the module

getModuleDisplayName

public java.lang.String getModuleDisplayName()
Description copied from interface: ModuleLocal
This method is used to find the display name of the module

Specified by:
getModuleDisplayName in interface ModuleLocal
Specified by:
getModuleDisplayName in class BaseModule
Returns:
the display name of the module

canExecuteForRole

public java.lang.String canExecuteForRole(CoefficientContext ctx,
                                          java.lang.String methodName,
                                          Role usersHighestRole)
Description copied from class: BaseModule
This is a base implementation that will allow all methods to be invoked without regard to roles

Specified by:
canExecuteForRole in interface ModuleLocal
Overrides:
canExecuteForRole in class BaseModule
Returns:
null if we can execute the method an error message if not

displayUsersData

public java.lang.String displayUsersData(CoefficientUser user)
Description copied from class: BaseModule
This is a base implementation that will return an empty string for a modules user related data. This should be implmented to show what data the module contains that relates to the currently logged in user.

Overrides:
displayUsersData in class BaseModule
Returns:
String containing the html to display for the modules summary.

deleteAllForProject

public CoefficientContext deleteAllForProject(CoefficientContext ctx)
TODO: implement this

Specified by:
deleteAllForProject in class BaseProjectModule

entry

public CoefficientContext entry(CoefficientContext ctx)

getSummaryForProject

public java.lang.String getSummaryForProject(CoefficientContext ctx)
                                      throws net.sf.hibernate.HibernateException
Overrides:
getSummaryForProject in class BaseProjectModule
Throws:
net.sf.hibernate.HibernateException

showSummaryForProject

public CoefficientContext showSummaryForProject(CoefficientContext ctx)
                                         throws net.sf.hibernate.HibernateException
This method is required as this is a project module.

Overrides:
showSummaryForProject in class BaseProjectModule
Throws:
net.sf.hibernate.HibernateException

viewIssueFilters

public CoefficientContext viewIssueFilters(CoefficientContext ctx)
                                    throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

createIssue

public CoefficientContext createIssue(CoefficientContext ctx)
                               throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

saveIssue

public CoefficientContext saveIssue(CoefficientContext ctx)
                             throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

viewIssue

public CoefficientContext viewIssue(CoefficientContext ctx)
                             throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

viewIssueComments

public CoefficientContext viewIssueComments(CoefficientContext ctx)

setWatch

public CoefficientContext setWatch(CoefficientContext ctx)
                            throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

comment

public CoefficientContext comment(CoefficientContext ctx)
                           throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

saveComment

public CoefficientContext saveComment(CoefficientContext ctx)
                               throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

attatchFile

public CoefficientContext attatchFile(CoefficientContext ctx)
                               throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

saveUpload

public CoefficientContext saveUpload(CoefficientContext ctx)
                              throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

voteForIssue

public CoefficientContext voteForIssue(CoefficientContext ctx)
                                throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

unvoteForIssue

public CoefficientContext unvoteForIssue(CoefficientContext ctx)
                                  throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

findIssues

public CoefficientContext findIssues(CoefficientContext ctx)
                              throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

saveFilterPrompt

public CoefficientContext saveFilterPrompt(CoefficientContext ctx)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

saveFilter

public CoefficientContext saveFilter(CoefficientContext ctx)
                              throws java.lang.Exception
Throws:
java.lang.Exception

deleteFilter

public CoefficientContext deleteFilter(CoefficientContext ctx)
                                throws java.lang.Exception
Throws:
java.lang.Exception

changeStatus

public CoefficientContext changeStatus(CoefficientContext ctx)
                                throws java.lang.Exception
Throws:
java.lang.Exception

resolveIssuePrompt

public CoefficientContext resolveIssuePrompt(CoefficientContext ctx)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

resolveIssue

public CoefficientContext resolveIssue(CoefficientContext ctx)
                                throws java.lang.Exception
Throws:
java.lang.Exception

deleteAttatchment

public CoefficientContext deleteAttatchment(CoefficientContext ctx)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

linkIssuePrompt

public CoefficientContext linkIssuePrompt(CoefficientContext ctx)
                                   throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

linkIssue

public CoefficientContext linkIssue(CoefficientContext ctx)
                             throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

filterIssues

public CoefficientContext filterIssues(CoefficientContext ctx)
                                throws java.lang.Exception
Throws:
java.lang.Exception

isIssueCompleted

public boolean isIssueCompleted(CoefficientContext ctx)
                         throws net.sf.hibernate.HibernateException
Workflow evalutation method.

Throws:
net.sf.hibernate.HibernateException

deleteIssueWithSummary

public CoefficientContext deleteIssueWithSummary(CoefficientContext ctx)
                                          throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

emailWatchers

private void emailWatchers(IssueData issue,
                           java.lang.String subject,
                           java.lang.String message)

saveFile

private java.lang.String saveFile(CoefficientContext ctx,
                                  ProjectFolderItem item)
                           throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getSizeString

private java.lang.String getSizeString(int fileSize)
To get a string describing the size of a file


trimToOneDecimalPlace

private java.lang.String trimToOneDecimalPlace(java.lang.String floatString)

getHibernateTypesForObjects

private net.sf.hibernate.type.Type[] getHibernateTypesForObjects(java.lang.Object[] objects)

getStatusesCount

private java.util.HashMap getStatusesCount(java.lang.Long projectId)
                                    throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getPrioritiesCount

private java.util.HashMap getPrioritiesCount(java.lang.Long projectId)
                                      throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getTypesCount

private java.util.HashMap getTypesCount(java.lang.Long projectId)
                                 throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getReportedByMeCount

private java.lang.Integer getReportedByMeCount(java.lang.Long projectId,
                                               java.lang.Long userId)
                                        throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getAssignedToMeCount

private java.lang.Integer getAssignedToMeCount(java.lang.Long projectId,
                                               java.lang.Long userId)
                                        throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getAllCount

private java.lang.Integer getAllCount(java.lang.Long projectId)
                               throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getOpenCount

private java.lang.Integer getOpenCount(java.lang.Long projectId)
                                throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getNewCount

private java.lang.Integer getNewCount(java.lang.Long projectId)
                               throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getMyFilters

private java.util.List getMyFilters(java.lang.Long projectId,
                                    java.lang.Long userId)
                             throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException

getMyFiltersCount

private java.util.HashMap getMyFiltersCount(java.util.List myFilters)
                                     throws net.sf.hibernate.HibernateException
Throws:
net.sf.hibernate.HibernateException


Copyright CSIR. All Rights Reserved.