org.tigris.scarab.om
Class ScarabModule

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.tigris.scarab.om.AbstractScarabModule
          extended byorg.tigris.scarab.om.BaseScarabModule
              extended byorg.tigris.scarab.om.ScarabModule
All Implemented Interfaces:
java.lang.Comparable, org.apache.fulcrum.security.entity.Group, Module, org.apache.torque.om.Persistent, org.apache.fulcrum.intake.Retrievable, org.apache.fulcrum.security.entity.SecurityEntity, java.io.Serializable
Direct Known Subclasses:
ScarabModuleContainer

public class ScarabModule
extends BaseScarabModule
implements org.apache.torque.om.Persistent, Module, org.apache.fulcrum.security.entity.Group

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.

Version:
$Id: ScarabModule.java 10198 2006-07-03 23:33:30Z dabbous $
Author:
Jon S. Stevens, John McNally
See Also:
Serialized Form

Field Summary
protected static java.lang.Integer ROOT_ID
           
 
Fields inherited from class org.tigris.scarab.om.BaseScarabModule
collAttributeGroups, collGlobalParameters, collIssues, collMITListItems, collNotificationDefaultFilters, collNotificationFilters, collPendingGroupUserRoles, collQuerys, collReports, collRModuleAttributes, collRModuleIssueTypes, collRModuleOptions, collRModuleUserAttributes, collUserVotes
 
Fields inherited from class org.tigris.scarab.om.AbstractScarabModule
GET_ALL_R_MODULE_OPTIONS, GET_AVAILABLE_ISSUE_TYPES, GET_DEDUPE_GROUPS_WITH_ATTRIBUTES, GET_DEFAULT_RMODULE_USERATTRIBUTES, GET_ISSUE_TYPES, GET_LEAF_R_MODULE_OPTIONS, GET_NAV_ISSUE_TYPES, GET_R_MODULE_ATTRIBUTES, GET_R_MODULE_ISSUE_TYPE, GET_R_MODULE_ISSUE_TYPES, GET_SAVED_REPORTS, GET_TEMPLATE_TYPES, GET_UNAPPROVED_QUERIES, 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, USER
 
Fields inherited from interface org.apache.fulcrum.security.entity.Group
GLOBAL_GROUP_NAME
 
Constructor Summary
ScarabModule()
           
 
Method Summary
 boolean allowsIssues()
          Determines whether this module accepts issues.
 int compareTo(java.lang.Object obj)
          Used for ordering Groups.
 java.lang.String getArchiveEmail()
          All emails related to this module will have a copy sent to this address.
 java.lang.String[] getAutoApprovedRoles()
          returns an array of Roles that can be approved without need for moderation.
 java.lang.String getCommentRenderingEngine()
          Returns the comment rendering engine currently in use.
 java.lang.String getHttpDomain()
          Get the value of domain.
 int getIssueCount(ScarabUser user)
          The number of active issues within the module.
 int getIssueCount(ScarabUser user, AttributeOption attributeOption)
          The number of active issues within the module.
 Module getParent()
          Cast the getScarabModuleRelatedByParentId() to a Module
 java.lang.String getPort()
          Get the value of port.
 org.apache.fulcrum.security.entity.Role getRequiredRole()
          Returns the required role for *any* access to this module including for requesting roles.
 java.util.List getRModuleAttributes(org.apache.torque.util.Criteria crit)
          Returns RModuleAttributes associated with this Module.
 java.util.List getRModuleIssueTypes()
          This method returns a complete list of RModuleIssueTypes which are not deleted, have a IssueType.PARENT_ID of 0 and sorted ascending by PREFERRED_ORDER.
 java.util.List getRModuleOptions(org.apache.torque.util.Criteria crit)
          Returns associated RModuleOptions.
 java.util.List getRoles()
          Gets all module roles.
 java.lang.String getScarabInstanceId()
          Get the value of the Scarab instance id.
 java.lang.String getScheme()
          Get the value of scheme.
 java.lang.String getScriptName()
          Get the value of scriptName.
 ScarabUser[] getUsers(java.util.List permissions)
          Get a list of ScarabUser's that have any of the given permissions in the given module.
 ScarabUser[] getUsers(java.lang.String permission)
          Get a list of ScarabUser's that have the given permission in the given module.
 ScarabPaginatedList getUsers(java.lang.String name, java.lang.String username, MITList mitList, int pageNum, int resultsPerPage, java.lang.String sortColumn, java.lang.String sortPolarity, boolean includeCommitters)
          Gets users for a given criteria, starting at a particular offset, for a given length, and have at least one permission that is applicable to user attributes active in the given issue type.
 java.util.List getUsers(java.lang.String firstName, java.lang.String lastName, java.lang.String username, java.lang.String email, IssueType issueType)
          Gets users which match all of the given criteria and have at least one permission that is applicable to user attributes active in the given issue type.
 void grant(org.apache.fulcrum.security.entity.User user, org.apache.fulcrum.security.entity.Role role)
          Grants a Role in this Group to an User.
 void grant(org.apache.fulcrum.security.entity.User user, org.apache.fulcrum.security.util.RoleSet roleSet)
          Grants Roles in this Group to an User.
 boolean isIssueReasonRequired()
          Provides the flag, wether issue store needs valid reason.
 boolean isIssueReasonRequiredInherited()
          Determines if the value of isIssueReasonRequired is due to the configuration of this module or inherited from ancestors or default configuration.
 boolean registerNeedsRequiredRole()
          Checks if an attempt to register a role for this module needs a specific role. returns false, if no role is needed. otherwise return true.
 void remove()
          Removes a group from the system.
 void rename(java.lang.String name)
          Renames the group.
 void revoke(org.apache.fulcrum.security.entity.User user, org.apache.fulcrum.security.entity.Role role)
          Revokes a Role in this Group from an User.
 void revoke(org.apache.fulcrum.security.entity.User user, org.apache.fulcrum.security.util.RoleSet roleSet)
          Revokes Roles in this group from an User.
 void save()
          Saves the module into the database
 void save(java.sql.Connection dbCon)
          Saves the module into the database.
 void setHttpDomain(java.lang.String v)
          Set the value of domain.
 void setParent(Module v)
          Wrapper method to perform the proper cast to the BaseModule method of the same name.
 void setParentId(java.lang.Integer id)
          Override method to make sure the module name gets recalculated.
 void setPort(java.lang.String v)
          Set the value of port.
 void setScarabInstanceId(java.lang.String v)
          Set the value of Scarab domain name.
 void setScheme(java.lang.String v)
          Set the value of scheme.
 void setScriptName(java.lang.String v)
          Set the value of scriptName.
 java.lang.String toString()
           
 
Methods inherited from class org.tigris.scarab.om.BaseScarabModule
addAttributeGroup, addGlobalParameter, addIssue, addMITListItem, addNotificationDefaultFilter, addNotificationFilter, addPendingGroupUserRole, addQuery, addReport, addRModuleAttribute, addRModuleIssueType, addRModuleOption, addRModuleUserAttribute, addUserVote, copy, copyInto, getAttributeGroups, getAttributeGroups, getAttributeGroups, getAttributeGroups, getAttributeGroupsJoinIssueType, getAttributeGroupsJoinScarabModule, getByName, getByPeerName, getByPosition, getClassKey, getCode, getDeleted, getDescription, getDomain, getFieldNames, getGlobalParameters, getGlobalParameters, getGlobalParameters, getGlobalParameters, getGlobalParametersJoinScarabModule, getIssues, getIssues, getIssues, getIssues, getIssuesJoinActivitySetRelatedByCreatedTransId, getIssuesJoinActivitySetRelatedByLastTransId, getIssuesJoinIssueType, getIssuesJoinScarabModule, getLocked, getMITListItems, getMITListItems, getMITListItems, getMITListItems, getMITListItemsJoinIssueType, getMITListItemsJoinMITList, getMITListItemsJoinScarabModule, getModuleId, getModuleRelatedByParentId, getModuleRelatedByParentId, getNotificationDefaultFilters, getNotificationDefaultFilters, getNotificationDefaultFilters, getNotificationDefaultFilters, getNotificationDefaultFiltersJoinScarabModule, getNotificationDefaultFiltersJoinScarabRoleImpl, getNotificationFilters, getNotificationFilters, getNotificationFilters, getNotificationFilters, getNotificationFiltersJoinScarabModule, getNotificationFiltersJoinScarabUserImpl, getOwnerId, getParentId, getPeer, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRolesJoinScarabModule, getPendingGroupUserRolesJoinScarabUserImpl, getPrimaryKey, getQaContactId, getQueryKey, getQuerys, getQuerys, getQuerys, getQuerys, getQuerysJoinFrequency, getQuerysJoinIssueType, getQuerysJoinMITList, getQuerysJoinScarabModule, getQuerysJoinScarabUserImpl, getQuerysJoinScope, getRealName, getReports, getReports, getReports, getReports, getReportsJoinIssueType, getReportsJoinScarabModule, getReportsJoinScarabUserImpl, getReportsJoinScope, getRModuleAttributes, getRModuleAttributes, getRModuleAttributes, getRModuleAttributesJoinAttribute, getRModuleAttributesJoinIssueType, getRModuleAttributesJoinScarabModule, getRModuleIssueTypes, getRModuleIssueTypes, getRModuleIssueTypes, getRModuleIssueTypesJoinIssueType, getRModuleIssueTypesJoinScarabModule, getRModuleOptions, getRModuleOptions, getRModuleOptions, getRModuleOptionsJoinAttributeOption, getRModuleOptionsJoinIssueType, getRModuleOptionsJoinScarabModule, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributesJoinAttribute, getRModuleUserAttributesJoinIssueType, getRModuleUserAttributesJoinMITList, getRModuleUserAttributesJoinScarabModule, getRModuleUserAttributesJoinScarabUserImpl, getScarabUserRelatedByOwnerId, getScarabUserRelatedByOwnerId, getScarabUserRelatedByQaContactId, getScarabUserRelatedByQaContactId, getUrl, getUserVotes, getUserVotes, getUserVotes, getUserVotes, getUserVotesJoinScarabModule, getUserVotesJoinScarabUserImpl, initAttributeGroups, initGlobalParameters, initIssues, initMITListItems, initNotificationDefaultFilters, initNotificationFilters, initPendingGroupUserRoles, initQuerys, initReports, initRModuleAttributes, initRModuleIssueTypes, initRModuleOptions, initRModuleUserAttributes, initUserVotes, isCacheOnSave, save, setArchiveEmail, setClassKey, setCode, setDeleted, setDescription, setDomain, setLocked, setModuleId, setModuleRelatedByParentId, setModuleRelatedByParentIdKey, setOwnerId, setPrimaryKey, setPrimaryKey, setQaContactId, setQueryKey, setRealName, setScarabUserRelatedByOwnerId, setScarabUserRelatedByOwnerIdKey, setScarabUserRelatedByQaContactId, setScarabUserRelatedByQaContactIdKey, setUrl
 
Methods inherited from class org.tigris.scarab.om.AbstractScarabModule
addAttributeOption, addIssueType, addRModuleAttribute, addRModuleOption, allowsMultipleVoting, allowsNewIssues, createNewGroup, getActiveAttributesByName, getAllAttributeOptions, getAllAttributes, getAllOptionAttributes, getAncestors, getAttributeOptions, getAttributes, getAttributes, getAvailableAttributeOptions, getAvailableAttributes, getAvailableIssueTypes, getDedupeAttributeGroups, getDedupeAttributeGroups, getDedupeGroupsWithAttributes, getDedupeSequence, getDefaultRModuleUserAttributes, getEligibleIssueReporters, getEligibleUsers, getIssueById, getIssueRegex, getIssueRegexString, getIssueTypes, getIssueTypes, getLastAttribute, getLastAttributeOption, getLeafRModuleOptions, getLeafRModuleOptions, getLocale, getName, getNavIssueTypes, getNewIssue, getOptionTree, getOptionTree, getRModuleAttribute, getRModuleAttributes, getRModuleAttributes, getRModuleAttributes, getRModuleIssueType, getRModuleIssueTypes, getRModuleOption, getRModuleOptions, getRModuleOptions, getSavedReports, getSystemEmail, getTemplateTypes, getUnapprovedQueries, getUnapprovedTemplates, getUnusedVoteCount, getUserAttributes, getUserAttributes, getUserPermissions, getValidationMessage, hasAttributes, includesIssueType, inheritFromParent, isEndlessLoop, isGlobalModule, isInitializing, resetAncestors, setInitialAttributesAndIssueTypes, setName, setRmaBasedOnIssueType, setRmoBasedOnIssueType, shiftAttributeOption
 
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, setModified, setNew, setPrimaryKey, setPrimaryKey
 
Methods inherited from interface org.tigris.scarab.om.Module
addAttributeOption, addIssueType, addRModuleAttribute, addRModuleOption, allowsMultipleVoting, allowsNewIssues, createNewGroup, getAllAttributes, getAncestors, getAttributes, getAttributes, getCode, getDedupeAttributeGroups, getDedupeAttributeGroups, getDedupeGroupsWithAttributes, getDedupeSequence, getDefaultRModuleUserAttributes, getDeleted, getDescription, getEligibleIssueReporters, getEligibleUsers, getIssueById, getIssueRegex, getIssueTypes, getIssueTypes, getLastAttribute, getLastAttributeOption, getLeafRModuleOptions, getLeafRModuleOptions, getLocale, getModuleId, getName, getNavIssueTypes, getNewIssue, getOptionTree, getOptionTree, getOwnerId, getParentId, getPrimaryKey, getQaContactId, getQueryKey, getRealName, getRModuleAttribute, getRModuleAttributes, getRModuleAttributes, getRModuleAttributes, getRModuleIssueType, getRModuleOption, getRModuleOptions, getRModuleOptions, getSavedReports, getSystemEmail, getTemplateTypes, getUnapprovedQueries, getUnapprovedTemplates, getUnusedVoteCount, getUrl, getUserAttributes, getUserAttributes, getUserPermissions, isEndlessLoop, isGlobalModule, isInitializing, setCode, setDeleted, setDescription, setModuleId, setName, setOwnerId, setPrimaryKey, setQaContactId, setRealName, setUrl
 
Methods inherited from interface org.apache.fulcrum.security.entity.Group
getName, setName
 

Field Detail

ROOT_ID

protected static final java.lang.Integer ROOT_ID
Constructor Detail

ScarabModule

public ScarabModule()
Method Detail

getHttpDomain

public java.lang.String getHttpDomain()
Get the value of domain.

Specified by:
getHttpDomain in interface Module
Returns:
value of domain.

setHttpDomain

public void setHttpDomain(java.lang.String v)
Set the value of domain.

Specified by:
setHttpDomain in interface Module
Parameters:
v - Value to assign to domain.

getScarabInstanceId

public java.lang.String getScarabInstanceId()
Get the value of the Scarab instance id.

Specified by:
getScarabInstanceId in interface Module
Returns:
value of domain.

setScarabInstanceId

public void setScarabInstanceId(java.lang.String v)
Set the value of Scarab domain name. The value can be an arbirtrary String. Note: This instance attriute is NOT related to ip/email-domains!

Specified by:
setScarabInstanceId in interface Module
Parameters:
v - Value to assign to domain.

getPort

public java.lang.String getPort()
                         throws org.apache.torque.TorqueException
Get the value of port.

Specified by:
getPort in interface Module
Returns:
value of port.
Throws:
org.apache.torque.TorqueException

setPort

public void setPort(java.lang.String v)
             throws org.apache.torque.TorqueException
Set the value of port.

Specified by:
setPort in interface Module
Parameters:
v - Value to assign to port.
Throws:
org.apache.torque.TorqueException

getScheme

public java.lang.String getScheme()
                           throws org.apache.torque.TorqueException
Get the value of scheme.

Specified by:
getScheme in interface Module
Returns:
value of scheme.
Throws:
org.apache.torque.TorqueException

setScheme

public void setScheme(java.lang.String v)
               throws org.apache.torque.TorqueException
Set the value of scheme.

Specified by:
setScheme in interface Module
Parameters:
v - Value to assign to scheme.
Throws:
org.apache.torque.TorqueException

getScriptName

public java.lang.String getScriptName()
                               throws org.apache.torque.TorqueException
Get the value of scriptName.

Specified by:
getScriptName in interface Module
Returns:
value of scriptName.
Throws:
org.apache.torque.TorqueException

setScriptName

public void setScriptName(java.lang.String v)
                   throws org.apache.torque.TorqueException
Set the value of scriptName.

Specified by:
setScriptName in interface Module
Parameters:
v - Value to assign to scriptName.
Throws:
org.apache.torque.TorqueException

getUsers

public ScarabUser[] getUsers(java.lang.String permission)
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
Specified by:
getUsers in class AbstractScarabModule
See Also:
Module.getUsers(String)

getUsers

public ScarabUser[] getUsers(java.util.List permissions)
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
Specified by:
getUsers in class AbstractScarabModule
See Also:
Module.getUsers(List)

getUsers

public ScarabPaginatedList getUsers(java.lang.String name,
                                    java.lang.String username,
                                    MITList mitList,
                                    int pageNum,
                                    int resultsPerPage,
                                    java.lang.String sortColumn,
                                    java.lang.String sortPolarity,
                                    boolean includeCommitters)
                             throws org.apache.torque.TorqueException,
                                    com.workingdogs.village.DataSetException
Description copied from interface: Module
Gets users for a given criteria, starting at a particular offset, for a given length, and have at least one permission that is applicable to user attributes active in the given issue type. This method handles the case where limiting the result size is best accomplished by limiting the database transaction size, and not postfiltering the list. This is extremely helpful with large user datasets.

Specified by:
getUsers in interface Module
Parameters:
mitList - MITs to restrict the user's search. If null, it will not be restricted.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
See Also:
Module.getUsers(String, String, String, String, IssueType)

getUsers

public java.util.List getUsers(java.lang.String firstName,
                               java.lang.String lastName,
                               java.lang.String username,
                               java.lang.String email,
                               IssueType issueType)
                        throws org.apache.torque.TorqueException
Description copied from interface: Module
Gets users which match all of the given criteria and have at least one permission that is applicable to user attributes active in the given issue type. The String arguments may be null. Implementations are encouraged to include users where the given Strings are contained within respective fields. So firstName=fred would return a user named fredrick.

Specified by:
getUsers in interface Module
Throws:
org.apache.torque.TorqueException
See Also:
This implementation adds wildcard prefix and suffix and performs an SQL LIKE query for each of the String args that are not null. WARNING: This is potentially a very EXPENSIVE method.

setParent

public void setParent(Module v)
               throws org.apache.torque.TorqueException
Wrapper method to perform the proper cast to the BaseModule method of the same name. FIXME: find a better way

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

getParent

public Module getParent()
                 throws org.apache.torque.TorqueException
Cast the getScarabModuleRelatedByParentId() to a Module

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

setParentId

public void setParentId(java.lang.Integer id)
                 throws org.apache.torque.TorqueException
Override method to make sure the module name gets recalculated.

Specified by:
setParentId in interface Module
Overrides:
setParentId in class BaseScarabModule
Parameters:
id - a Integer value
Throws:
org.apache.torque.TorqueException

getRModuleIssueTypes

public java.util.List getRModuleIssueTypes()
                                    throws org.apache.torque.TorqueException
This method returns a complete list of RModuleIssueTypes which are not deleted, have a IssueType.PARENT_ID of 0 and sorted ascending by PREFERRED_ORDER.

Specified by:
getRModuleIssueTypes in interface Module
Overrides:
getRModuleIssueTypes in class BaseScarabModule
Returns:
the collection of associated objects
Throws:
org.apache.torque.TorqueException

getIssueCount

public int getIssueCount(ScarabUser user,
                         AttributeOption attributeOption)
                  throws org.apache.torque.TorqueException,
                         ScarabException,
                         com.workingdogs.village.DataSetException
The number of active issues within the module.

Parameters:
user - a ScarabUser value used to determine if a count should be given.
Returns:
an int the number of issues entered for the module unless the user does not have permission to search for issues in the given module, then a value of 0 will be returned. if resource limited, this method will return -1.
Throws:
com.workingdogs.village.DataSetException
java.lang.Exception - if an error occurs
org.apache.torque.TorqueException
ScarabException

getIssueCount

public int getIssueCount(ScarabUser user)
                  throws org.apache.torque.TorqueException,
                         ScarabException,
                         com.workingdogs.village.DataSetException
The number of active issues within the module.

Parameters:
user - a ScarabUser value used to determine if a count should be given.
Returns:
an int the number of issues entered for the module unless the user does not have permission to search for issues in the given module, then a value of 0 will be returned. if resource limited, this method will return -1.
Throws:
com.workingdogs.village.DataSetException
java.lang.Exception - if an error occurs
org.apache.torque.TorqueException
ScarabException

getRModuleAttributes

public java.util.List getRModuleAttributes(org.apache.torque.util.Criteria crit)
                                    throws org.apache.torque.TorqueException
Returns RModuleAttributes associated with this Module. Tries to find RModuleAttributes associated directly through the db, but if none are found it should look up the parent module tree until it finds a non-empty list.

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

getRModuleOptions

public java.util.List getRModuleOptions(org.apache.torque.util.Criteria crit)
                                 throws org.apache.torque.TorqueException
Returns associated RModuleOptions. if a related AttributeOption is deleted the RModuleOption will not show up in this list.

Specified by:
getRModuleOptions in interface Module
Overrides:
getRModuleOptions in class BaseScarabModule
Parameters:
crit - a Criteria value
Returns:
a List value
Throws:
org.apache.torque.TorqueException

allowsIssues

public boolean allowsIssues()
Description copied from interface: Module
Determines whether this module accepts issues.

Specified by:
allowsIssues in interface Module
Overrides:
allowsIssues in class AbstractScarabModule

save

public void save()
Saves the module into the database

Specified by:
save in interface org.apache.torque.om.Persistent
Overrides:
save in class BaseScarabModule
Throws:
ScarabRuntimeException - when a TorqueException is thrown internally.

save

public void save(java.sql.Connection dbCon)
          throws org.apache.torque.TorqueException
Saves the module into the database. Note that this cannot be used within a activitySet if the module isNew() because dbCon.commit() is called within the method. An update can be done within a activitySet though.

Specified by:
save in interface org.apache.torque.om.Persistent
Overrides:
save in class BaseScarabModule
Parameters:
dbCon -
Throws:
org.apache.torque.TorqueException

remove

public void remove()
            throws org.apache.fulcrum.security.util.TurbineSecurityException
Removes a group from the system.

Specified by:
remove in interface org.apache.fulcrum.security.entity.Group
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if the Group could not be removed.

rename

public void rename(java.lang.String name)
            throws org.apache.fulcrum.security.util.TurbineSecurityException
Renames the group.

Specified by:
rename in interface org.apache.fulcrum.security.entity.Group
Parameters:
name - The new Group name.
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if the Group could not be renamed.

grant

public void grant(org.apache.fulcrum.security.entity.User user,
                  org.apache.fulcrum.security.entity.Role role)
           throws org.apache.fulcrum.security.util.TurbineSecurityException
Grants a Role in this Group to an User.

Specified by:
grant in interface org.apache.fulcrum.security.entity.Group
Parameters:
user - An User.
role - A Role.
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if there is a problem while assigning the Role.

grant

public void grant(org.apache.fulcrum.security.entity.User user,
                  org.apache.fulcrum.security.util.RoleSet roleSet)
           throws org.apache.fulcrum.security.util.TurbineSecurityException
Grants Roles in this Group to an User.

Specified by:
grant in interface org.apache.fulcrum.security.entity.Group
Parameters:
user - An User.
roleSet - A RoleSet.
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if there is a problem while assigning the Roles.

revoke

public void revoke(org.apache.fulcrum.security.entity.User user,
                   org.apache.fulcrum.security.entity.Role role)
            throws org.apache.fulcrum.security.util.TurbineSecurityException
Revokes a Role in this Group from an User.

Specified by:
revoke in interface org.apache.fulcrum.security.entity.Group
Parameters:
user - An User.
role - A Role.
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if there is a problem while unassigning the Role.

revoke

public void revoke(org.apache.fulcrum.security.entity.User user,
                   org.apache.fulcrum.security.util.RoleSet roleSet)
            throws org.apache.fulcrum.security.util.TurbineSecurityException
Revokes Roles in this group from an User.

Specified by:
revoke in interface org.apache.fulcrum.security.entity.Group
Parameters:
user - An User.
roleSet - a RoleSet.
Throws:
org.apache.fulcrum.security.util.TurbineSecurityException - if there is a problem while unassigning the Roles.

compareTo

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

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class AbstractScarabModule
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.

getArchiveEmail

public 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
Overrides:
getArchiveEmail in class BaseScarabModule
Returns:
String

getAutoApprovedRoles

public java.lang.String[] getAutoApprovedRoles()
returns an array of Roles that can be approved without need for moderation.


isIssueReasonRequired

public boolean isIssueReasonRequired()
Provides the flag, wether issue store needs valid reason. Note: This method returns true, when the global variable was not defined neither for this module nor for its ancestors. This may be the case when you migrate from an older version of scarab to a20++ where this parameter was not used. Thus per default Scarab makes the field required.

Specified by:
isIssueReasonRequired in interface Module
Returns:
true: yes, valid reason field needed; false: reason field may stay empty.

isIssueReasonRequiredInherited

public boolean isIssueReasonRequiredInherited()
Determines if the value of isIssueReasonRequired is due to the configuration of this module or inherited from ancestors or default configuration. The Global module does never inherite the value, that's by default 'True'.

Specified by:
isIssueReasonRequiredInherited in interface Module
Returns:
True if the configuration is inherited.

registerNeedsRequiredRole

public boolean registerNeedsRequiredRole()
Checks if an attempt to register a role for this module needs a specific role. returns false, if no role is needed. otherwise return true. To get the needed role, @see #getRequiredRole()

Returns:

getRequiredRole

public org.apache.fulcrum.security.entity.Role getRequiredRole()
Returns the required role for *any* access to this module including for requesting roles.

Specified by:
getRequiredRole in interface Module
Returns:

getCommentRenderingEngine

public java.lang.String getCommentRenderingEngine()
Returns the comment rendering engine currently in use.

Specified by:
getCommentRenderingEngine in interface Module
Returns:

getRoles

public java.util.List getRoles()
                        throws org.apache.torque.TorqueException
Gets all module roles.

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

toString

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


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