org.tigris.scarab.om
Class AbstractScarabModule

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.tigris.scarab.om.AbstractScarabModule
All Implemented Interfaces:
java.lang.Comparable, Module, org.apache.torque.om.Persistent, java.io.Serializable
Direct Known Subclasses:
BaseScarabModule

public abstract class AbstractScarabModule
extends org.apache.torque.om.BaseObject
implements Module, java.lang.Comparable

The ScarabModule class is the focal point for dealing with Modules. It implements the concept of a Module which is a single module and is the base interface for all Modules. In code, one should never reference ScarabModule directly -- use its Module interface instead. This allows us to swap out Module implementations by modifying the Scarab.properties file.

This class is the base class for org.tigris.scarab.om.ScarabModule. BaseScarabModule extends this class and that definition is defined in the scarab-schema.xml which is used by Torque to generated BaseScarabModule.

Version:
$Id: AbstractScarabModule.java 10407 2006-12-28 15:38:01Z ronvoe122 $
Author:
Jon S. Stevens, John McNally
See Also:
Serialized Form

Field Summary
protected static java.lang.String GET_ALL_R_MODULE_OPTIONS
           
protected static java.lang.String GET_AVAILABLE_ISSUE_TYPES
           
protected static java.lang.String GET_DEDUPE_GROUPS_WITH_ATTRIBUTES
           
protected static java.lang.String GET_DEFAULT_RMODULE_USERATTRIBUTES
           
protected static java.lang.String GET_ISSUE_TYPES
           
protected static java.lang.String GET_LEAF_R_MODULE_OPTIONS
           
protected static java.lang.String GET_NAV_ISSUE_TYPES
           
protected static java.lang.String GET_R_MODULE_ATTRIBUTES
           
protected static java.lang.String GET_R_MODULE_ISSUE_TYPE
           
protected static java.lang.String GET_R_MODULE_ISSUE_TYPES
           
protected static java.lang.String GET_SAVED_REPORTS
           
protected static java.lang.String GET_TEMPLATE_TYPES
           
protected static java.lang.String GET_UNAPPROVED_QUERIES
           
protected static java.lang.String GET_UNAPPROVED_TEMPLATES
           
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
Fields inherited from interface org.tigris.scarab.om.Module
NAME_DELIMINATOR, NON_USER, ROOT_ID, USER
 
Constructor Summary
AbstractScarabModule()
           
 
Method Summary
 void addAttributeOption(IssueType issueType, AttributeOption option)
          Adds attribute options to a module.
 void addIssueType(IssueType issueType)
          Adds an issue type to a module Copies properties from the global issue type's settings
 RModuleAttribute addRModuleAttribute(IssueType issueType, Attribute attribute)
          Adds module-attribute mapping to module.
 RModuleOption addRModuleOption(IssueType issueType, AttributeOption option)
          Adds module-attribute-option mapping to module.
 boolean allowsIssues()
          Determines whether this module accepts issues.
 boolean allowsMultipleVoting()
          Determines whether this module allows users to vote many times for the same issue.
 boolean allowsNewIssues()
          Determines whether this module is accepting new issues.
 int compareTo(java.lang.Object obj)
          Used for ordering Groups.
 AttributeGroup createNewGroup(IssueType issueType)
          Creates new attribute group.
 java.util.List getActiveAttributesByName(IssueType issueType, java.lang.String attributeType)
          gets a list of all of the active Attributes. ordered by name
 java.util.List getAllAttributeOptions(java.lang.Integer attributeId)
          Return the list of attribute options for attribute with given attributeId.
 java.util.List getAllAttributes()
          gets a list of all of the Attributes in this module.
 java.util.List getAllOptionAttributes()
          Return the list of option attributes (ATTRIBUTE_ID=5).
 java.util.List getAncestors()
          Returns this ModuleEntities ancestors in ascending order.
abstract  java.lang.String getArchiveEmail()
          All emails related to this module will have a copy sent to this address.
 java.util.List getAttributeOptions(Attribute attribute, IssueType issueType)
          Gets the modules list of attribute options.
 java.util.List getAttributes(org.apache.torque.util.Criteria criteria)
          gets a list of all of the Attributes in a Module based on the Criteria.
 java.util.List getAttributes(IssueType issueType)
          Gets a list of attributes for this module with a specific issue type.
 java.util.List getAvailableAttributeOptions(Attribute attribute, IssueType issueType)
          gets a list of all of the Attribute options that are not associated with this module and attribute.
 java.util.List getAvailableAttributes(IssueType issueType, java.lang.String attributeType)
          gets a list of all of the global Attributes that are not associated with this module and issue type
 java.util.List getAvailableIssueTypes()
          gets a list of all of the issue types that are not associated with this module
 java.util.List getDedupeAttributeGroups(IssueType issueType)
          List of active dedupe attribute groups associated with this module.
 java.util.List getDedupeAttributeGroups(IssueType issueType, boolean activeOnly)
          List of attribute groups associated with this module.
 java.util.List getDedupeGroupsWithAttributes(IssueType issueType)
          This method is used within Wizard1.vm to get a list of attribute groups which are marked as dedupe and have a list of attributes in them.
 int getDedupeSequence(IssueType issueType)
          Gets the sequence where the dedupe screen fits between groups.
 java.util.List getDefaultRModuleUserAttributes(IssueType issueType)
          Returns default issue list attributes for this module.
 ScarabUser[] getEligibleIssueReporters()
           
 ScarabUser[] getEligibleUsers(Attribute attribute)
          The users who are possible candidates as values for the given attribute.
 Issue getIssueById(java.lang.String id)
          Deprecated. use IssueManager.getIssueById(String id, String defaultCode)
 org.apache.regexp.REProgram getIssueRegex()
          returns a compiled regex that can used to create a new RE for matching some given text.
 java.lang.String getIssueRegexString()
           
 java.util.List getIssueTypes()
          gets a list of the Issue Types for this module. only shows active issue types
 java.util.List getIssueTypes(boolean activeOnly)
          gets a list of the Issue Types for this module. only shows active issue types
 int getLastAttribute(IssueType issueType, java.lang.String attributeType)
          FIXME: can this be done more efficently?
 int getLastAttributeOption(Attribute attribute, IssueType issueType)
          FIXME: can this be done more efficently?
 java.util.List getLeafRModuleOptions(Attribute attribute, IssueType issuetype)
           
 java.util.List getLeafRModuleOptions(Attribute attribute, IssueType issueType, boolean activeOnly)
           
 java.util.Locale getLocale()
          Simple implementation returns the single configured default locale from TR.props.
abstract  java.lang.Integer getModuleId()
           
 java.lang.String getName()
          This method is an implementation of the Group.getName() method and returns a module along with its ancestors
 java.util.List getNavIssueTypes()
          gets a list of the Issue Types for this module.
 Issue getNewIssue(IssueType issueType)
          Creates a new Issue.
 java.util.List getOptionTree(Attribute attribute, IssueType issueType)
          Gets a list of active RModuleOptions which have had their level within the options for this module set.
 java.util.List getOptionTree(Attribute attribute, IssueType issueType, boolean activeOnly)
          Gets a list of RModuleOptions which have had their level within the options for this module set.
abstract  Module getParent()
          Get this module's immediate parent module
abstract  java.lang.String getRealName()
          This method is only used by the Turbine Group interface.
 RModuleAttribute getRModuleAttribute(Attribute attribute, IssueType issueType)
           
 java.util.List getRModuleAttributes(org.apache.torque.util.Criteria crit)
          Returns RModuleAttributes associated with this module through the foreign key in the schema.
 java.util.List getRModuleAttributes(IssueType issueType)
          Overridden method.
 java.util.List getRModuleAttributes(IssueType issueType, boolean activeOnly)
          Overridden method.
 java.util.List getRModuleAttributes(IssueType issueType, boolean activeOnly, java.lang.String attributeType)
           
 RModuleIssueType getRModuleIssueType(IssueType issueType)
           
abstract  java.util.List getRModuleIssueTypes()
          This method is implemented in ScarabModule
 java.util.List getRModuleIssueTypes(java.lang.String sortColumn, java.lang.String sortPolarity)
           
 RModuleOption getRModuleOption(AttributeOption option, IssueType issueType)
           
 java.util.List getRModuleOptions(Attribute attribute, IssueType issueType)
           
 java.util.List getRModuleOptions(Attribute attribute, IssueType issueType, boolean activeOnly)
           
abstract  java.util.List getRModuleOptions(org.apache.torque.util.Criteria crit)
          Overridden method.
 java.util.List getSavedReports(ScarabUser user)
          List of saved reports associated with this module and created by this user.
 java.lang.String[] getSystemEmail()
          The default address that is used to fill out either the From or ReplyTo header on emails related to this module.
 java.util.List getTemplateTypes()
           
 java.util.List getUnapprovedQueries()
          Returns list of queries needing approval.
 java.util.List getUnapprovedTemplates()
          Returns list of enter issue templates needing approval.
 int getUnusedVoteCount(ScarabUser user)
          How many votes does the user have left to cast.
 java.util.List getUserAttributes(IssueType issueType)
          gets a list of all of the User Attributes in a Module.
 java.util.List getUserAttributes(IssueType issueType, boolean activeOnly)
          gets a list of all of the User Attributes in a Module.
 java.util.List getUserPermissions(IssueType issueType)
          gets a list of permissions associated with the User Attributes that are active for this Module.
abstract  ScarabUser[] getUsers(java.util.List permissions)
          Get a list of ScarabUser's that have any of the given permissions in the given module.
abstract  ScarabUser[] getUsers(java.lang.String permission)
          Get a list of ScarabUser's that have the given permission in the given module.
protected  java.lang.String getValidationMessage(java.lang.String typeName, java.lang.String detail)
           
 boolean hasAttributes(IssueType issueType)
          Returns true if module has attributes associated with issue type.
 boolean includesIssueType(IssueType issueType)
           
protected  void inheritFromParent(Module parentModule)
          sets up attributes and issue types for this module based on.
 boolean isEndlessLoop(Module parent)
          check for endless loops where Module A > Module B > Module A
 boolean isGlobalModule()
          Returns true if this module is the the top level parent module.
 boolean isInitializing()
          Returns true if no issue types are associated with this module, or if the module is currently getting its initial values set.
protected  void resetAncestors()
          Should be called when the parentage is modified.
protected  void setInitialAttributesAndIssueTypes()
          for a new module: inherit issue types from parent module and from the issue types marked as default parent configuration takes precedence over default
 void setName(java.lang.String name)
          This method is an implementation of the Group.setName() method
abstract  void setParent(Module v)
          Set this module's immediate parent module
 void setRmaBasedOnIssueType(RIssueTypeAttribute ria)
           
 void setRmoBasedOnIssueType(RIssueTypeOption rio)
           
 void shiftAttributeOption(Attribute attribute, IssueType issueType, int offset)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.torque.om.BaseObject
equals, equals, getByName, getByPeerName, getByPosition, getLog, getPrimaryKey, hashCode, isModified, isNew, resetModified, save, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey, setPrimaryKey
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.tigris.scarab.om.Module
getCode, getCommentRenderingEngine, getDeleted, getDescription, getHttpDomain, getOwnerId, getParentId, getPort, getPrimaryKey, getQaContactId, getQueryKey, getRequiredRole, getRoles, getScarabInstanceId, getScheme, getScriptName, getUrl, getUsers, getUsers, isIssueReasonRequired, isIssueReasonRequiredInherited, setCode, setDeleted, setDescription, setHttpDomain, setModuleId, setOwnerId, setParentId, setPort, setPrimaryKey, setQaContactId, setRealName, setScarabInstanceId, setScheme, setScriptName, setUrl
 
Methods inherited from interface org.apache.torque.om.Persistent
isModified, isNew, save, save, save, setModified, setNew, setPrimaryKey
 

Field Detail

GET_R_MODULE_ATTRIBUTES

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

GET_DEDUPE_GROUPS_WITH_ATTRIBUTES

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

GET_SAVED_REPORTS

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

GET_DEFAULT_RMODULE_USERATTRIBUTES

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

GET_ISSUE_TYPES

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

GET_NAV_ISSUE_TYPES

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

GET_ALL_R_MODULE_OPTIONS

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

GET_LEAF_R_MODULE_OPTIONS

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

GET_R_MODULE_ISSUE_TYPES

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

GET_R_MODULE_ISSUE_TYPE

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

GET_TEMPLATE_TYPES

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

GET_UNAPPROVED_QUERIES

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

GET_UNAPPROVED_TEMPLATES

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

GET_AVAILABLE_ISSUE_TYPES

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

AbstractScarabModule

public AbstractScarabModule()
Method Detail

resetAncestors

protected void resetAncestors()
Should be called when the parentage is modified.


getUsers

public abstract ScarabUser[] getUsers(java.lang.String permission)
                               throws org.apache.torque.TorqueException
Description copied from interface: Module
Get a list of ScarabUser's that have the given permission in the given module.

Specified by:
getUsers in interface Module
Parameters:
permission - a String value
Returns:
ScarabUser[]
Throws:
org.apache.torque.TorqueException
See Also:
Module.getUsers(String)

getUsers

public abstract ScarabUser[] getUsers(java.util.List permissions)
                               throws org.apache.torque.TorqueException
Description copied from interface: Module
Get a list of ScarabUser's that have any of the given permissions in the given module.

Specified by:
getUsers in interface Module
Parameters:
permissions - a List value
Returns:
ScarabUser[]
Throws:
org.apache.torque.TorqueException
See Also:
Module.getUsers(String)

getRealName

public abstract java.lang.String getRealName()
Description copied from interface: Module
This method is only used by the Turbine Group interface. The implementation of getName() returns a unique name for this Module that is human readable because our implementation of Flux needs it as well as the fact that each Group needs to have a unique name. If you want to get the actual name of the Module, you need to call the getRealName method.

Specified by:
getRealName in interface Module
Returns:
The unadorned real name of this module; never null.
See Also:
getName()

getModuleId

public abstract java.lang.Integer getModuleId()
Specified by:
getModuleId in interface Module

getName

public java.lang.String getName()
This method is an implementation of the Group.getName() method and returns a module along with its ancestors

Specified by:
getName in interface Module

setName

public void setName(java.lang.String name)
This method is an implementation of the Group.setName() method

Specified by:
setName in interface Module

getNewIssue

public Issue getNewIssue(IssueType issueType)
                  throws org.apache.torque.TorqueException
Creates a new Issue.

Specified by:
getNewIssue in interface Module
Throws:
org.apache.torque.TorqueException

getAncestors

public java.util.List getAncestors()
                            throws org.apache.torque.TorqueException
Returns this ModuleEntities ancestors in ascending order. It does not return the 0 parent though.

Specified by:
getAncestors in interface Module
Throws:
org.apache.torque.TorqueException

isEndlessLoop

public boolean isEndlessLoop(Module parent)
                      throws org.apache.torque.TorqueException
check for endless loops where Module A > Module B > Module A

Specified by:
isEndlessLoop in interface Module
Throws:
org.apache.torque.TorqueException

createNewGroup

public AttributeGroup createNewGroup(IssueType issueType)
                              throws org.apache.torque.TorqueException
Creates new attribute group.

Specified by:
createNewGroup in interface Module
Throws:
org.apache.torque.TorqueException

getDedupeGroupsWithAttributes

public java.util.List getDedupeGroupsWithAttributes(IssueType issueType)
                                             throws org.apache.torque.TorqueException
This method is used within Wizard1.vm to get a list of attribute groups which are marked as dedupe and have a list of attributes in them.

Specified by:
getDedupeGroupsWithAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getDedupeAttributeGroups

public java.util.List getDedupeAttributeGroups(IssueType issueType)
                                        throws org.apache.torque.TorqueException
List of active dedupe attribute groups associated with this module.

Specified by:
getDedupeAttributeGroups in interface Module
Throws:
org.apache.torque.TorqueException

getDedupeAttributeGroups

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

Specified by:
getDedupeAttributeGroups in interface Module
Throws:
org.apache.torque.TorqueException

getDedupeSequence

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

Specified by:
getDedupeSequence in interface Module
Throws:
org.apache.torque.TorqueException

getEligibleIssueReporters

public ScarabUser[] getEligibleIssueReporters()
                                       throws org.apache.torque.TorqueException
Specified by:
getEligibleIssueReporters in interface Module
Throws:
org.apache.torque.TorqueException

getEligibleUsers

public ScarabUser[] getEligibleUsers(Attribute attribute)
                              throws org.apache.torque.TorqueException,
                                     ScarabException
The users who are possible candidates as values for the given attribute. An eligible user is determined by checking for users that have the permission associated with the attribute.

Specified by:
getEligibleUsers in interface Module
Parameters:
attribute - an Attribute value
Returns:
a ScarabUser[] value
Throws:
ScarabException - if the attribute has no associated permission
java.lang.Exception - if an error occurs
org.apache.torque.TorqueException

setParent

public abstract void setParent(Module v)
                        throws org.apache.torque.TorqueException
Set this module's immediate parent module

Specified by:
setParent in interface Module
Throws:
org.apache.torque.TorqueException

getParent

public abstract Module getParent()
                          throws org.apache.torque.TorqueException
Get this module's immediate parent module

Specified by:
getParent in interface Module
Throws:
org.apache.torque.TorqueException

getSavedReports

public java.util.List getSavedReports(ScarabUser user)
                               throws org.apache.torque.TorqueException,
                                      ScarabException
List of saved reports associated with this module and created by this user.

Specified by:
getSavedReports in interface Module
Parameters:
user - the user
Returns:
a List value
Throws:
org.apache.torque.TorqueException
ScarabException

getAttributes

public java.util.List getAttributes(IssueType issueType)
                             throws org.apache.torque.TorqueException
Gets a list of attributes for this module with a specific issue type.

Specified by:
getAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getAttributes

public java.util.List getAttributes(org.apache.torque.util.Criteria criteria)
                             throws org.apache.torque.TorqueException
gets a list of all of the Attributes in a Module based on the Criteria.

Specified by:
getAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getUserAttributes

public java.util.List getUserAttributes(IssueType issueType)
                                 throws org.apache.torque.TorqueException
gets a list of all of the User Attributes in a Module.

Specified by:
getUserAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getUserAttributes

public java.util.List getUserAttributes(IssueType issueType,
                                        boolean activeOnly)
                                 throws org.apache.torque.TorqueException
gets a list of all of the User Attributes in a Module.

Specified by:
getUserAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getUserPermissions

public java.util.List getUserPermissions(IssueType issueType)
                                  throws org.apache.torque.TorqueException
gets a list of permissions associated with the User Attributes that are active for this Module.

Specified by:
getUserPermissions in interface Module
Throws:
org.apache.torque.TorqueException

getLastAttribute

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

Specified by:
getLastAttribute in interface Module
Throws:
org.apache.torque.TorqueException

getLastAttributeOption

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

Specified by:
getLastAttributeOption in interface Module
Throws:
org.apache.torque.TorqueException

shiftAttributeOption

public void shiftAttributeOption(Attribute attribute,
                                 IssueType issueType,
                                 int offset)
                          throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getAvailableAttributes

public java.util.List getAvailableAttributes(IssueType issueType,
                                             java.lang.String attributeType)
                                      throws org.apache.torque.TorqueException
gets a list of all of the global Attributes that are not associated with this module and issue type

Throws:
org.apache.torque.TorqueException

getAvailableAttributeOptions

public java.util.List getAvailableAttributeOptions(Attribute attribute,
                                                   IssueType issueType)
                                            throws org.apache.torque.TorqueException
gets a list of all of the Attribute options that are not associated with this module and attribute.

Throws:
org.apache.torque.TorqueException

getDefaultRModuleUserAttributes

public java.util.List getDefaultRModuleUserAttributes(IssueType issueType)
                                               throws org.apache.torque.TorqueException
Returns default issue list attributes for this module.

Specified by:
getDefaultRModuleUserAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getIssueById

public Issue getIssueById(java.lang.String id)
                   throws org.apache.torque.TorqueException
Deprecated. use IssueManager.getIssueById(String id, String defaultCode)

This method is useful for getting an issue object by a String id. It has some logic in it for appending the Module Code as well as stripping spaces off the id value using the String.trim() method.

Specified by:
getIssueById in interface Module
Throws:
org.apache.torque.TorqueException

getIssueTypes

public java.util.List getIssueTypes()
                             throws org.apache.torque.TorqueException
gets a list of the Issue Types for this module. only shows active issue types

Specified by:
getIssueTypes in interface Module
Throws:
org.apache.torque.TorqueException

getIssueTypes

public java.util.List getIssueTypes(boolean activeOnly)
                             throws org.apache.torque.TorqueException
gets a list of the Issue Types for this module. only shows active issue types

Specified by:
getIssueTypes in interface Module
Throws:
org.apache.torque.TorqueException

getNavIssueTypes

public java.util.List getNavIssueTypes()
                                throws org.apache.torque.TorqueException
gets a list of the Issue Types for this module. that get listed in the left navigation. only shows active issue types.

Specified by:
getNavIssueTypes in interface Module
Throws:
org.apache.torque.TorqueException

getAvailableIssueTypes

public java.util.List getAvailableIssueTypes()
                                      throws org.apache.torque.TorqueException
gets a list of all of the issue types that are not associated with this module

Throws:
org.apache.torque.TorqueException

getRModuleAttributes

public java.util.List getRModuleAttributes(org.apache.torque.util.Criteria crit)
                                    throws org.apache.torque.TorqueException
Returns RModuleAttributes associated with this module through the foreign key in the schema. This method will return an empty list, if the RModuleAttributes are inherited from its parent. Will not return an RModuleAttribute if the Attribute is deleted. NOTE: Do not try to add caching to this method as it seems to break things when an attribute is changed on an existing issue. (JSS)

Specified by:
getRModuleAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleOptions

public abstract java.util.List getRModuleOptions(org.apache.torque.util.Criteria crit)
                                          throws org.apache.torque.TorqueException
Overridden method.

Specified by:
getRModuleOptions in interface Module
Throws:
org.apache.torque.TorqueException

addRModuleAttribute

public RModuleAttribute addRModuleAttribute(IssueType issueType,
                                            Attribute attribute)
                                     throws org.apache.torque.TorqueException,
                                            ScarabException
Adds module-attribute mapping to module.

Specified by:
addRModuleAttribute in interface Module
Throws:
org.apache.torque.TorqueException
ScarabException

addRModuleOption

public RModuleOption addRModuleOption(IssueType issueType,
                                      AttributeOption option)
                               throws org.apache.torque.TorqueException
Adds module-attribute-option mapping to module.

Specified by:
addRModuleOption in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleAttribute

public RModuleAttribute getRModuleAttribute(Attribute attribute,
                                            IssueType issueType)
                                     throws org.apache.torque.TorqueException
Specified by:
getRModuleAttribute in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleAttributes

public java.util.List getRModuleAttributes(IssueType issueType)
                                    throws org.apache.torque.TorqueException
Overridden method. Calls the super method and if no results are returned the call is passed on to the parent module.

Specified by:
getRModuleAttributes in interface Module
Throws:
org.apache.torque.TorqueException

hasAttributes

public boolean hasAttributes(IssueType issueType)
                      throws org.apache.torque.TorqueException,
                             com.workingdogs.village.DataSetException
Returns true if module has attributes associated with issue type.

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

getRModuleAttributes

public java.util.List getRModuleAttributes(IssueType issueType,
                                           boolean activeOnly)
                                    throws org.apache.torque.TorqueException
Overridden method. Calls the super method and if no results are returned the call is passed on to the parent module.

Specified by:
getRModuleAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleAttributes

public java.util.List getRModuleAttributes(IssueType issueType,
                                           boolean activeOnly,
                                           java.lang.String attributeType)
                                    throws org.apache.torque.TorqueException
Specified by:
getRModuleAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getAllAttributes

public java.util.List getAllAttributes()
                                throws org.apache.torque.TorqueException
gets a list of all of the Attributes in this module.

Specified by:
getAllAttributes in interface Module
Throws:
org.apache.torque.TorqueException

getAllOptionAttributes

public java.util.List getAllOptionAttributes()
                                      throws org.apache.torque.TorqueException
Return the list of option attributes (ATTRIBUTE_ID=5).

Returns:
Throws:
org.apache.torque.TorqueException

getAllAttributeOptions

public java.util.List getAllAttributeOptions(java.lang.Integer attributeId)
                                      throws org.apache.torque.TorqueException,
                                             ScarabException
Return the list of attribute options for attribute with given attributeId.

Returns:
Throws:
org.apache.torque.TorqueException
ScarabException

getActiveAttributesByName

public java.util.List getActiveAttributesByName(IssueType issueType,
                                                java.lang.String attributeType)
                                         throws org.apache.torque.TorqueException
gets a list of all of the active Attributes. ordered by name

Throws:
org.apache.torque.TorqueException

getRModuleOptions

public java.util.List getRModuleOptions(Attribute attribute,
                                        IssueType issueType)
                                 throws org.apache.torque.TorqueException
Specified by:
getRModuleOptions in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleOptions

public java.util.List getRModuleOptions(Attribute attribute,
                                        IssueType issueType,
                                        boolean activeOnly)
                                 throws org.apache.torque.TorqueException
Specified by:
getRModuleOptions in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleOption

public RModuleOption getRModuleOption(AttributeOption option,
                                      IssueType issueType)
                               throws org.apache.torque.TorqueException
Specified by:
getRModuleOption in interface Module
Throws:
org.apache.torque.TorqueException

getAttributeOptions

public java.util.List getAttributeOptions(Attribute attribute,
                                          IssueType issueType)
                                   throws org.apache.torque.TorqueException
Gets the modules list of attribute options. Uses the RModuleOption table to do the join. returns null if there is any error.

Throws:
org.apache.torque.TorqueException

getLeafRModuleOptions

public java.util.List getLeafRModuleOptions(Attribute attribute,
                                            IssueType issuetype)
                                     throws org.apache.torque.TorqueException
Specified by:
getLeafRModuleOptions in interface Module
Throws:
org.apache.torque.TorqueException

getLeafRModuleOptions

public java.util.List getLeafRModuleOptions(Attribute attribute,
                                            IssueType issueType,
                                            boolean activeOnly)
                                     throws org.apache.torque.TorqueException
Specified by:
getLeafRModuleOptions in interface Module
Throws:
org.apache.torque.TorqueException

getOptionTree

public java.util.List getOptionTree(Attribute attribute,
                                    IssueType issueType)
                             throws org.apache.torque.TorqueException
Gets a list of active RModuleOptions which have had their level within the options for this module set.

Specified by:
getOptionTree in interface Module
Parameters:
attribute - an Attribute value
Returns:
a List value
Throws:
org.apache.torque.TorqueException - if an error occurs

getOptionTree

public java.util.List getOptionTree(Attribute attribute,
                                    IssueType issueType,
                                    boolean activeOnly)
                             throws org.apache.torque.TorqueException
Gets a list of RModuleOptions which have had their level within the options for this module set.

Specified by:
getOptionTree in interface Module
Parameters:
attribute - an Attribute value
activeOnly - a boolean value
Returns:
a List value
Throws:
org.apache.torque.TorqueException - if an error occurs

getRModuleIssueTypes

public abstract java.util.List getRModuleIssueTypes()
                                             throws org.apache.torque.TorqueException
This method is implemented in ScarabModule

Specified by:
getRModuleIssueTypes in interface Module
Throws:
org.apache.torque.TorqueException

getRModuleIssueTypes

public java.util.List getRModuleIssueTypes(java.lang.String sortColumn,
                                           java.lang.String sortPolarity)
                                    throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

addAttributeOption

public void addAttributeOption(IssueType issueType,
                               AttributeOption option)
                        throws org.apache.torque.TorqueException,
                               ScarabException
Adds attribute options to a module.

Specified by:
addAttributeOption in interface Module
Throws:
org.apache.torque.TorqueException
ScarabException

setRmaBasedOnIssueType

public void setRmaBasedOnIssueType(RIssueTypeAttribute ria)
                            throws org.apache.torque.TorqueException,
                                   ScarabException
Throws:
org.apache.torque.TorqueException
ScarabException

setRmoBasedOnIssueType

public void setRmoBasedOnIssueType(RIssueTypeOption rio)
                            throws org.apache.torque.TorqueException,
                                   ScarabException
Throws:
org.apache.torque.TorqueException
ScarabException

getValidationMessage

protected java.lang.String getValidationMessage(java.lang.String typeName,
                                                java.lang.String detail)

includesIssueType

public boolean includesIssueType(IssueType issueType)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

addIssueType

public void addIssueType(IssueType issueType)
                  throws org.apache.torque.TorqueException,
                         ValidationException,
                         com.workingdogs.village.DataSetException,
                         ScarabException
Adds an issue type to a module Copies properties from the global issue type's settings

Specified by:
addIssueType in interface Module
Throws:
org.apache.torque.TorqueException
ValidationException
com.workingdogs.village.DataSetException
ScarabException

getRModuleIssueType

public RModuleIssueType getRModuleIssueType(IssueType issueType)
                                     throws org.apache.torque.TorqueException
Specified by:
getRModuleIssueType in interface Module
Throws:
org.apache.torque.TorqueException

getTemplateTypes

public java.util.List getTemplateTypes()
                                throws org.apache.torque.TorqueException,
                                       ScarabException
Specified by:
getTemplateTypes in interface Module
Throws:
org.apache.torque.TorqueException
ScarabException

allowsMultipleVoting

public boolean allowsMultipleVoting()
Determines whether this module allows users to vote many times for the same issue. This feature needs schema change to allow a configuration screen. Currently only one vote per issue is supported

Specified by:
allowsMultipleVoting in interface Module
Returns:
false

getUnusedVoteCount

public int getUnusedVoteCount(ScarabUser user)
How many votes does the user have left to cast. Currently always returns 1, so a user has unlimited voting rights. Should look to UserVote for the answer when implemented properly.

Specified by:
getUnusedVoteCount in interface Module

getUnapprovedQueries

public java.util.List getUnapprovedQueries()
                                    throws org.apache.torque.TorqueException
Returns list of queries needing approval.

Specified by:
getUnapprovedQueries in interface Module
Throws:
org.apache.torque.TorqueException

getUnapprovedTemplates

public java.util.List getUnapprovedTemplates()
                                      throws org.apache.torque.TorqueException
Returns list of enter issue templates needing approval.

Specified by:
getUnapprovedTemplates in interface Module
Throws:
org.apache.torque.TorqueException

setInitialAttributesAndIssueTypes

protected void setInitialAttributesAndIssueTypes()
                                          throws org.apache.torque.TorqueException,
                                                 com.workingdogs.village.DataSetException,
                                                 ScarabException
for a new module: inherit issue types from parent module and from the issue types marked as default parent configuration takes precedence over default

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

inheritFromParent

protected void inheritFromParent(Module parentModule)
                          throws org.apache.torque.TorqueException,
                                 ScarabException
sets up attributes and issue types for this module based on. the parent module

Throws:
org.apache.torque.TorqueException
ScarabException

allowsNewIssues

public boolean allowsNewIssues()
Determines whether this module is accepting new issues. This default implementation allows new issues if the module has not been deleted.

Specified by:
allowsNewIssues in interface Module

allowsIssues

public boolean allowsIssues()
Determines whether this module accepts issues. This default implementation does allow issues.

Specified by:
allowsIssues in interface Module

isInitializing

public boolean isInitializing()
                       throws org.apache.torque.TorqueException
Returns true if no issue types are associated with this module, or if the module is currently getting its initial values set.

Specified by:
isInitializing in interface Module
Throws:
org.apache.torque.TorqueException

isGlobalModule

public boolean isGlobalModule()
Description copied from interface: Module
Returns true if this module is the the top level parent module.

Specified by:
isGlobalModule in interface Module
Returns:
a boolean value
See Also:
Module.isGlobalModule()

getIssueRegexString

public java.lang.String getIssueRegexString()
                                     throws org.apache.torque.TorqueException
Throws:
org.apache.torque.TorqueException

getIssueRegex

public org.apache.regexp.REProgram getIssueRegex()
                                          throws org.apache.torque.TorqueException
Description copied from interface: Module
returns a compiled regex that can used to create a new RE for matching some given text.

Specified by:
getIssueRegex in interface Module
Throws:
org.apache.torque.TorqueException
See Also:
Module.getIssueRegex()

getArchiveEmail

public abstract java.lang.String getArchiveEmail()
All emails related to this module will have a copy sent to this address. A system-wide default email address can be specified in Scarab.properties with the key: scarab.email.archive.toAddress

Specified by:
getArchiveEmail in interface Module

getLocale

public java.util.Locale getLocale()
Simple implementation returns the single configured default locale from TR.props. Will be replaced by a way to set this per module.

Specified by:
getLocale in interface Module
Returns:
a Locale selected for the Fulcrum Localization context

getSystemEmail

public java.lang.String[] getSystemEmail()
The default address that is used to fill out either the From or ReplyTo header on emails related to this module. In many cases the From field is taken as the user who acted that resulted in the email, but replies should still go to the central location for the module, so in this address would be used in the ReplyTo field.

Specified by:
getSystemEmail in interface Module
Returns:
a String[] of length=2 where the first element is a name such as "Scarab System" and the second is an email address.

compareTo

public int compareTo(java.lang.Object obj)
Used for ordering Groups.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - The Object to compare to.
Returns:
-1 if the name of the other object is lexically greater than this group, 1 if it is lexically lesser, 0 if they are equal.

toString

public java.lang.String toString()
Specified by:
toString in interface Module


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