org.tigris.scarab.om
Class IssueType

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.tigris.scarab.om.BaseIssueType
          extended byorg.tigris.scarab.om.IssueType
All Implemented Interfaces:
org.apache.torque.om.Persistent, org.apache.fulcrum.intake.Retrievable, java.io.Serializable

public class IssueType
extends BaseIssueType
implements org.apache.torque.om.Persistent

This class represents an IssueType.

Version:
$Id: IssueType.java 10123 2006-05-30 09:46:01Z dabbous $
Author:
Elicia David, Jon S. Stevens
See Also:
Serialized Form

Field Summary
protected static java.lang.String GET_ACTIVE_ATTRIBUTES
           
protected static java.lang.String GET_ALL_R_ISSUETYPE_OPTIONS
           
protected static java.lang.String GET_ATTRIBUTE_GROUP
           
protected static java.lang.String GET_ATTRIBUTE_GROUPS
           
protected static java.lang.String GET_DEFAULT_TEXT_ATTRIBUTE
           
protected static java.lang.String GET_QUICK_SEARCH_ATTRIBUTES
           
protected static java.lang.String GET_R_ISSUETYPE_ATTRIBUTES
           
protected static java.lang.String GET_R_ISSUETYPE_OPTIONS
           
protected static java.lang.String GET_REQUIRED_ATTRIBUTES
           
(package private) static java.lang.String NON_USER
           
(package private) static java.lang.String USER
           
 
Fields inherited from class org.tigris.scarab.om.BaseIssueType
collAttributeGroups, collIssues, collMITListItems, collQuerys, collReports, collRIssueTypeAttributes, collRIssueTypeOptions, collRModuleAttributes, collRModuleIssueTypes, collRModuleOptions, collRModuleUserAttributes
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
Constructor Summary
IssueType()
           
 
Method Summary
 RIssueTypeAttribute addRIssueTypeAttribute(Attribute attribute)
          Adds issuetype-attribute mapping to issue type.
 RIssueTypeOption addRIssueTypeOption(AttributeOption option)
          Adds issuetype-attribute-option mapping to module.
 boolean canCreateAttributeInScope(ScarabUser user, Module module, Attribute attribute)
          Checks whether the current user is allowed to set the given attribute in the given module and in this issueType.
 boolean canCreateIssueInScope(ScarabUser user, Module module)
          Checks whether the current user can create issues of this issueType in the given module.
 IssueType copyIssueType()
          Copy the IssueType and its corresponding template type
 void createDefaultGroups()
          Create default groups upon issue type creation.
 AttributeGroup createNewGroup()
           
 AttributeGroup createNewGroup(Module module)
          Creates new attribute group.
 void deleteModuleMappings(ScarabUser user)
          Delete mappings with all modules
 java.util.List getActiveAttributes(Module module)
          Array of active Attributes for an issue type.
 java.util.List getAttributeGroups(boolean activeOnly)
           
 java.util.List getAttributeGroups(Module module)
           
 java.util.List getAttributeGroups(Module module, boolean activeOnly)
          List of attribute groups associated with this module).
 java.util.List getAttributes(java.lang.String attributeType)
          Gets associated activeattributes.
 java.util.List getAvailableAttributeOptions(Attribute attribute)
          Gets a list of all of the global attributes options that are not associated with this issue type
 java.util.List getAvailableAttributes(java.lang.String attributeType)
          Gets a list of all of the global Attributes that are not Associated with this issue type
 int getDedupeSequence()
          Gets the sequence where the dedupe screen fits between groups.
(package private)  int getDedupeSequence(Module module)
          Gets the sequence where the dedupe screen fits between groups.
 Attribute getDefaultTextAttribute(Module module)
          if an RMA is the chosen attribute for email subjects then return it.
 java.lang.String getDisplayName(Module module)
          If module name is identical to global name, return the global name.
static IssueType getInstance(java.lang.String issueTypeName)
          Get the IssueType using a issue type name
 IssueType getIssueTypeForTemplateType()
          Gets the parent IssueType for this template IssueType.
 int getLastAttribute(java.lang.String attributeType)
          FIXME: can this be done more efficently?
 int getLastAttributeOption(Attribute attribute)
          FIXME: can this be done more efficently?
 java.util.List getMatchingAttributeValuesList(Module oldModule, Module newModule, IssueType newIssueType)
          Gets a list of non-user AttributeValues which match a given Module.
 java.util.List getOrphanAttributeValuesList(Module oldModule, Module newModule, IssueType newIssueType)
          Gets a list of Attributes which do not match a given Module.
 java.util.List getQuickSearchAttributes(Module module)
          Array of Attributes used for quick search.
 java.util.List getRequiredAttributes(Module module)
          Array of Attributes which are active and required by this module.
 RIssueTypeAttribute getRIssueTypeAttribute(Attribute attribute)
           
 java.util.List getRIssueTypeAttributes()
          Gets associated attributes.
 java.util.List getRIssueTypeAttributes(boolean activeOnly)
          Gets associated attributes.
 java.util.List getRIssueTypeAttributes(boolean activeOnly, java.lang.String attributeType)
          Gets associated attributes.
 RIssueTypeOption getRIssueTypeOption(AttributeOption option)
           
 java.util.List getRIssueTypeOptions(Attribute attribute)
          Gets associated attribute options.
 java.util.List getRIssueTypeOptions(Attribute attribute, boolean activeOnly)
          Gets associated attribute options.
 java.lang.Integer getTemplateId()
          Gets the id of the template that corresponds to the issue type.
 IssueType getTemplateIssueType()
          Gets the IssueType template for this IssueType.
 java.util.List getUserAttributes()
          gets a list of all of the User Attributes in an issue type.
 java.util.List getUserAttributes(boolean activeOnly)
          gets a list of all of the User Attributes in an issue type.
 boolean hasIssues()
          Returns true if the issue type has issues associated with it.
 boolean hasIssues(Module module)
          Returns true if the issue type/module has issues associated with it.
 boolean isSystemDefined()
          Checks if this Issue Type is system defined.
 java.lang.String toString()
           
 
Methods inherited from class org.tigris.scarab.om.BaseIssueType
addAttributeGroup, addIssue, addMITListItem, addQuery, addReport, addRIssueTypeAttribute, addRIssueTypeOption, addRModuleAttribute, addRModuleIssueType, addRModuleOption, addRModuleUserAttribute, copy, copyInto, getAttributeGroups, getAttributeGroups, getAttributeGroups, getAttributeGroups, getAttributeGroupsJoinIssueType, getAttributeGroupsJoinScarabModule, getByName, getByPeerName, getByPosition, getDedupe, getDeleted, getDescription, getFieldNames, getIsdefault, getIssues, getIssues, getIssues, getIssues, getIssuesJoinActivitySetRelatedByCreatedTransId, getIssuesJoinActivitySetRelatedByLastTransId, getIssuesJoinIssueType, getIssuesJoinScarabModule, getIssueTypeId, getIssueTypeRelatedByParentId, getIssueTypeRelatedByParentId, getLocked, getMITListItems, getMITListItems, getMITListItems, getMITListItems, getMITListItemsJoinIssueType, getMITListItemsJoinMITList, getMITListItemsJoinScarabModule, getName, getParentId, getPeer, getPrimaryKey, getQueryKey, getQuerys, getQuerys, getQuerys, getQuerys, getQuerysJoinFrequency, getQuerysJoinIssueType, getQuerysJoinMITList, getQuerysJoinScarabModule, getQuerysJoinScarabUserImpl, getQuerysJoinScope, getReports, getReports, getReports, getReports, getReportsJoinIssueType, getReportsJoinScarabModule, getReportsJoinScarabUserImpl, getReportsJoinScope, getRIssueTypeAttributes, getRIssueTypeAttributes, getRIssueTypeAttributes, getRIssueTypeAttributesJoinAttribute, getRIssueTypeAttributesJoinIssueType, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptionsJoinAttributeOption, getRIssueTypeOptionsJoinIssueType, getRModuleAttributes, getRModuleAttributes, getRModuleAttributes, getRModuleAttributes, getRModuleAttributesJoinAttribute, getRModuleAttributesJoinIssueType, getRModuleAttributesJoinScarabModule, getRModuleIssueTypes, getRModuleIssueTypes, getRModuleIssueTypes, getRModuleIssueTypes, getRModuleIssueTypesJoinIssueType, getRModuleIssueTypesJoinScarabModule, getRModuleOptions, getRModuleOptions, getRModuleOptions, getRModuleOptions, getRModuleOptionsJoinAttributeOption, getRModuleOptionsJoinIssueType, getRModuleOptionsJoinScarabModule, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributesJoinAttribute, getRModuleUserAttributesJoinIssueType, getRModuleUserAttributesJoinMITList, getRModuleUserAttributesJoinScarabModule, getRModuleUserAttributesJoinScarabUserImpl, initAttributeGroups, initIssues, initMITListItems, initQuerys, initReports, initRIssueTypeAttributes, initRIssueTypeOptions, initRModuleAttributes, initRModuleIssueTypes, initRModuleOptions, initRModuleUserAttributes, isCacheOnSave, save, save, save, setDedupe, setDeleted, setDescription, setIsdefault, setIssueTypeId, setIssueTypeRelatedByParentId, setIssueTypeRelatedByParentIdKey, setLocked, setName, setParentId, setPrimaryKey, setPrimaryKey, setQueryKey
 
Methods inherited from class org.apache.torque.om.BaseObject
equals, equals, getLog, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.torque.om.Persistent
getPrimaryKey, isModified, isNew, save, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey
 

Field Detail

GET_ATTRIBUTE_GROUPS

protected static final java.lang.String GET_ATTRIBUTE_GROUPS
See Also:
Constant Field Values

GET_ATTRIBUTE_GROUP

protected static final java.lang.String GET_ATTRIBUTE_GROUP
See Also:
Constant Field Values

GET_R_ISSUETYPE_ATTRIBUTES

protected static final java.lang.String GET_R_ISSUETYPE_ATTRIBUTES
See Also:
Constant Field Values

GET_R_ISSUETYPE_OPTIONS

protected static final java.lang.String GET_R_ISSUETYPE_OPTIONS
See Also:
Constant Field Values

GET_ALL_R_ISSUETYPE_OPTIONS

protected static final java.lang.String GET_ALL_R_ISSUETYPE_OPTIONS
See Also:
Constant Field Values

GET_DEFAULT_TEXT_ATTRIBUTE

protected static final java.lang.String GET_DEFAULT_TEXT_ATTRIBUTE
See Also:
Constant Field Values

GET_QUICK_SEARCH_ATTRIBUTES

protected static final java.lang.String GET_QUICK_SEARCH_ATTRIBUTES
See Also:
Constant Field Values

GET_REQUIRED_ATTRIBUTES

protected static final java.lang.String GET_REQUIRED_ATTRIBUTES
See Also:
Constant Field Values

GET_ACTIVE_ATTRIBUTES

protected static final java.lang.String GET_ACTIVE_ATTRIBUTES
See Also:
Constant Field Values

USER

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

NON_USER

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

IssueType

public IssueType()
Method Detail

getTemplateIssueType

public IssueType getTemplateIssueType()
                               throws org.apache.torque.TorqueException,
                                      ScarabException
Gets the IssueType template for this IssueType. The template is a special type of IssueType.

Throws:
org.apache.torque.TorqueException
ScarabException

getIssueTypeForTemplateType

public IssueType getIssueTypeForTemplateType()
                                      throws org.apache.torque.TorqueException
Gets the parent IssueType for this template IssueType. The template is a special type of IssueType.

Throws:
org.apache.torque.TorqueException

getTemplateId

public java.lang.Integer getTemplateId()
                                throws org.apache.torque.TorqueException,
                                       ScarabException
Gets the id of the template that corresponds to the issue type.

Throws:
org.apache.torque.TorqueException
ScarabException

hasIssues

public boolean hasIssues()
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException
Returns true if the issue type has issues associated with it.

Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getDisplayName

public java.lang.String getDisplayName(Module module)
                                throws org.apache.torque.TorqueException
If module name is identical to global name, return the global name. Otherwise return the module name followed by a space and the global name in parentheses.

Returns:
a String representation of the display name.
Throws:
org.apache.torque.TorqueException

hasIssues

public boolean hasIssues(Module module)
                  throws org.apache.torque.TorqueException,
                         com.workingdogs.village.DataSetException
Returns true if the issue type/module has issues associated with it.

Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getInstance

public static IssueType getInstance(java.lang.String issueTypeName)
                             throws org.apache.torque.TorqueException,
                                    ScarabException
Get the IssueType using a issue type name

Throws:
org.apache.torque.TorqueException
ScarabException

copyIssueType

public IssueType copyIssueType()
                        throws org.apache.torque.TorqueException,
                               ScarabException
Copy the IssueType and its corresponding template type

Throws:
org.apache.torque.TorqueException
ScarabException

deleteModuleMappings

public void deleteModuleMappings(ScarabUser user)
                          throws org.apache.torque.TorqueException,
                                 ScarabException
Delete mappings with all modules

Throws:
org.apache.torque.TorqueException
ScarabException

createDefaultGroups

public void createDefaultGroups()
                         throws org.apache.torque.TorqueException
Create default groups upon issue type creation.

Throws:
org.apache.torque.TorqueException

getAttributeGroups

public java.util.List getAttributeGroups(Module module)
                                  throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getAttributeGroups

public java.util.List getAttributeGroups(boolean activeOnly)
                                  throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getAttributeGroups

public java.util.List getAttributeGroups(Module module,
                                         boolean activeOnly)
                                  throws org.apache.torque.TorqueException
List of attribute groups associated with this module).

Throws:
org.apache.torque.TorqueException

createNewGroup

public AttributeGroup createNewGroup()
                              throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

createNewGroup

public AttributeGroup createNewGroup(Module module)
                              throws org.apache.torque.TorqueException
Creates new attribute group.

Throws:
org.apache.torque.TorqueException

getDedupeSequence

public int getDedupeSequence()
                      throws org.apache.torque.TorqueException
Gets the sequence where the dedupe screen fits between groups.

Throws:
org.apache.torque.TorqueException
See Also:
getDedupeSequence(Module)

getDedupeSequence

int getDedupeSequence(Module module)
                throws org.apache.torque.TorqueException
Gets the sequence where the dedupe screen fits between groups.

Parameters:
module - A specific Module to retrieve AttributeGroup associations for, or null for groups associated with the global issue type.
Throws:
org.apache.torque.TorqueException

getRIssueTypeAttributes

public java.util.List getRIssueTypeAttributes()
Gets associated attributes.

Overrides:
getRIssueTypeAttributes in class BaseIssueType
Returns:
the collection of associated objects

getRIssueTypeAttributes

public java.util.List getRIssueTypeAttributes(boolean activeOnly)
                                       throws org.apache.torque.TorqueException
Gets associated attributes.

Throws:
org.apache.torque.TorqueException

getRIssueTypeAttributes

public java.util.List getRIssueTypeAttributes(boolean activeOnly,
                                              java.lang.String attributeType)
                                       throws org.apache.torque.TorqueException
Gets associated attributes.

Throws:
org.apache.torque.TorqueException

getAttributes

public java.util.List getAttributes(java.lang.String attributeType)
                             throws org.apache.torque.TorqueException
Gets associated activeattributes.

Throws:
org.apache.torque.TorqueException

addRIssueTypeAttribute

public RIssueTypeAttribute addRIssueTypeAttribute(Attribute attribute)
                                           throws org.apache.torque.TorqueException
Adds issuetype-attribute mapping to issue type.

Throws:
org.apache.torque.TorqueException

getRIssueTypeAttribute

public RIssueTypeAttribute getRIssueTypeAttribute(Attribute attribute)
                                           throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getUserAttributes

public java.util.List getUserAttributes()
                                 throws org.apache.torque.TorqueException
gets a list of all of the User Attributes in an issue type.

Throws:
org.apache.torque.TorqueException

getUserAttributes

public java.util.List getUserAttributes(boolean activeOnly)
                                 throws org.apache.torque.TorqueException
gets a list of all of the User Attributes in an issue type.

Throws:
org.apache.torque.TorqueException

getLastAttribute

public int getLastAttribute(java.lang.String attributeType)
                     throws org.apache.torque.TorqueException
FIXME: can this be done more efficently? gets highest sequence number for issueType-attribute map so that a new RIssueTypeAttribute can be added at the end.

Throws:
org.apache.torque.TorqueException

getLastAttributeOption

public int getLastAttributeOption(Attribute attribute)
                           throws org.apache.torque.TorqueException
FIXME: can this be done more efficently? gets highest sequence number for module-attribute map so that a new RIssueTypeOption can be added at the end.

Throws:
org.apache.torque.TorqueException

addRIssueTypeOption

public RIssueTypeOption addRIssueTypeOption(AttributeOption option)
                                     throws org.apache.torque.TorqueException
Adds issuetype-attribute-option mapping to module.

Throws:
org.apache.torque.TorqueException

getRIssueTypeOptions

public java.util.List getRIssueTypeOptions(Attribute attribute)
                                    throws org.apache.torque.TorqueException
Gets associated attribute options.

Throws:
org.apache.torque.TorqueException

getRIssueTypeOptions

public java.util.List getRIssueTypeOptions(Attribute attribute,
                                           boolean activeOnly)
                                    throws org.apache.torque.TorqueException
Gets associated attribute options.

Throws:
org.apache.torque.TorqueException

getRIssueTypeOption

public RIssueTypeOption getRIssueTypeOption(AttributeOption option)
                                     throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getAvailableAttributes

public java.util.List getAvailableAttributes(java.lang.String attributeType)
                                      throws org.apache.torque.TorqueException
Gets a list of all of the global Attributes that are not Associated with this issue type

Throws:
org.apache.torque.TorqueException

getAvailableAttributeOptions

public java.util.List getAvailableAttributeOptions(Attribute attribute)
                                            throws org.apache.torque.TorqueException
Gets a list of all of the global attributes options that are not associated with this issue type

Throws:
org.apache.torque.TorqueException

toString

public java.lang.String toString()
Overrides:
toString in class BaseIssueType

getMatchingAttributeValuesList

public java.util.List getMatchingAttributeValuesList(Module oldModule,
                                                     Module newModule,
                                                     IssueType newIssueType)
                                              throws org.apache.torque.TorqueException
Gets a list of non-user AttributeValues which match a given Module. It is used in the MoveIssue2.vm template

Throws:
org.apache.torque.TorqueException

getOrphanAttributeValuesList

public java.util.List getOrphanAttributeValuesList(Module oldModule,
                                                   Module newModule,
                                                   IssueType newIssueType)
                                            throws org.apache.torque.TorqueException
Gets a list of Attributes which do not match a given Module. It is used in the MoveIssue2.vm template

Throws:
org.apache.torque.TorqueException

isSystemDefined

public boolean isSystemDefined()
                        throws org.apache.torque.TorqueException
Checks if this Issue Type is system defined. Such Issue types are specified in "IssueTypeConfig.properties" file in the format "=system"

Returns:
True if this Issue Type is System defined. False otherwise
Throws:
org.apache.torque.TorqueException

getDefaultTextAttribute

public Attribute getDefaultTextAttribute(Module module)
                                  throws org.apache.torque.TorqueException
if an RMA is the chosen attribute for email subjects then return it. if not explicitly chosen, choose the highest ordered text attribute.

Returns:
the Attribute to use as the email subject, or null if no suitable Attribute could be found.
Throws:
org.apache.torque.TorqueException

getQuickSearchAttributes

public java.util.List getQuickSearchAttributes(Module module)
                                        throws org.apache.torque.TorqueException
Array of Attributes used for quick search.

Returns:
an List of Attribute objects
Throws:
org.apache.torque.TorqueException

canCreateIssueInScope

public boolean canCreateIssueInScope(ScarabUser user,
                                     Module module)
                              throws org.apache.torque.TorqueException,
                                     ScarabException
Checks whether the current user can create issues of this issueType in the given module. Currently we only check whether the user is allowed to create all necessary input (i.e. the required attributes). If at least one attribute can not be set by the user due to transition constraints, this method returns false, otherwise true.

Parameters:
user -
module -
Returns:
Throws:
org.apache.torque.TorqueException
ScarabException

canCreateAttributeInScope

public boolean canCreateAttributeInScope(ScarabUser user,
                                         Module module,
                                         Attribute attribute)
                                  throws org.apache.torque.TorqueException,
                                         ScarabException
Checks whether the current user is allowed to set the given attribute in the given module and in this issueType. If due to transition rules the user is not allowed to set the attribute value, this method returns false, otherwise true.

Parameters:
user -
module -
attribute -
Returns:
Throws:
org.apache.torque.TorqueException
ScarabException

getRequiredAttributes

public java.util.List getRequiredAttributes(Module module)
                                     throws org.apache.torque.TorqueException
Array of Attributes which are active and required by this module. Whose attribute group's are also active.

Returns:
an List of Attribute objects
Throws:
org.apache.torque.TorqueException

getActiveAttributes

public java.util.List getActiveAttributes(Module module)
                                   throws org.apache.torque.TorqueException
Array of active Attributes for an issue type.

Returns:
an List of Attribute objects
Throws:
org.apache.torque.TorqueException


Copyright © 2000-2004 Tigris.org. All Rights Reserved.