org.tigris.scarab.om
Class ScarabUserImpl

java.lang.Object
  extended byorg.apache.torque.om.BaseObject
      extended byorg.apache.fulcrum.security.impl.db.entity.BaseTurbineUser
          extended byorg.apache.fulcrum.security.impl.db.entity.TurbineUser
              extended byorg.tigris.scarab.om.BaseScarabUserImpl
                  extended byorg.tigris.scarab.om.ScarabUserImpl
All Implemented Interfaces:
org.apache.torque.om.Persistent, org.apache.fulcrum.intake.Retrievable, ScarabUser, org.apache.fulcrum.security.entity.SecurityEntity, java.io.Serializable, org.apache.fulcrum.security.session.SessionBindingListener, org.apache.fulcrum.security.entity.User

public class ScarabUserImpl
extends BaseScarabUserImpl
implements ScarabUser

This class is an abstraction that is currently based around Turbine's code. We can change this later. It is here so that it is easier to change later to work under different implementation needs.

Version:
$Id: ScarabUserImpl.java 10273 2006-08-30 22:37:32Z jorgeuriarte $
Author:
Jon S. Stevens
See Also:
Serialized Form

Field Summary
static java.lang.String PASSWORD_EXPIRE
           
 
Fields inherited from class org.tigris.scarab.om.BaseScarabUserImpl
collActivitySets, collActivitysRelatedByNewUserId, collActivitysRelatedByOldUserId, collAttachmentsRelatedByCreatedBy, collAttachmentsRelatedByModifiedBy, collAttributes, collAttributeValues, collIssueVotes, collMITLists, collNotificationFilters, collNotificationStatuss, collPendingGroupUserRoles, collQuerys, collReports, collRModuleUserAttributes, collRQueryUsers, collScarabModulesRelatedByOwnerId, collScarabModulesRelatedByQaContactId, collUserPreferences, collUserVotes
 
Fields inherited from class org.apache.fulcrum.security.impl.db.entity.BaseTurbineUser
collTurbineUserGroupRoles
 
Fields inherited from class org.apache.torque.om.BaseObject
NEW_ID
 
Fields inherited from interface org.tigris.scarab.om.ScarabUser
DELETED
 
Fields inherited from interface org.apache.fulcrum.security.entity.User
ACCESS_COUNTER, CONFIRM_DATA, CONFIRM_VALUE, EMAIL, FIRST_NAME, HAS_LOGGED_IN, LAST_LOGIN, LAST_NAME, PASSWORD, SESSION_ACCESS_COUNTER, SESSION_KEY, USERNAME
 
Constructor Summary
ScarabUserImpl()
          Call the superclass constructor to initialize this object.
 
Method Summary
 void addRMITsToCurrentMITList(java.util.List rmits)
           
static boolean checkConfirmationCode(java.lang.String username, java.lang.String confirm)
          Utility method that takes a username and a confirmation code and will return true if there is a match and false if no match.
static boolean confirmUser(java.lang.String username)
          This method will mark username as confirmed.
 void createNewUser()
          This method is responsible for creating a new user.
 org.apache.fulcrum.security.util.AccessControlList getACL()
          Return the AccessControlList for this user.
 java.util.List getAllRModuleIssueTypes(Module module)
          returns a list of RModuleIssueTypes for the given module.
 java.util.List getAssignIssuesList()
           
 java.util.Map getAssociatedUsersMap()
          Get the working list of associated users For the AssignIssue screen
 java.util.List getCopyToModules(Module currentModule)
          Get modules that user can copy an issue to.
 java.util.List getCopyToModules(Module currentModule, java.lang.String action)
           
 java.util.List getCopyToModules(Module currentModule, java.lang.String action, java.lang.String searchString)
           
 IssueType getCurrentIssueType()
          The current issue type
 MITList getCurrentMITList()
           
 Module getCurrentModule()
          The current module
 ReportBridge getCurrentReport(java.lang.String key)
          Gets an report stored in the temp hash under key.
 RModuleIssueType getCurrentRModuleIssueType()
          The current RModuleIssueType which represents the module and issue type selected by the user within a request.
 java.util.List getCurrentRoleNames()
          eturn the list of currently active roles.
 java.util.List getEditableModules()
          Gets all modules the user has permissions to edit.
 java.util.List getEditableModules(Module currEditModule)
          Gets all modules the user has permissions to edit.
 int getEnterIssueRedirect()
          Returns integer representing user preference for Which screen to return to after entering an issue. 1 = Enter New Issue. 2 = Assign Issue (default) 3 = View Issue. 4 = Issue Types index.
 java.lang.String getHomePage()
          The template/tab to show for the home page using the current module.
 java.lang.String getHomePage(Module module)
          The template/tab to show for the home page in the given module.
 java.util.Locale getLocale()
          Get the user's current locale.
 java.util.List getMITLists()
          If this collection has already been initialized, returns the collection.
 java.util.List getModules()
          Gets all modules which are currently associated with this user (relationship has not been deleted.)
 java.util.List getModules(boolean showDeletedModules)
          Gets all modules which are currently associated with this user.
 Module[] getModules(java.lang.String permission)
          Get a list of Module's that where a user has the specified permission.
 Module[] getModules(java.lang.String[] permissions)
          Get a list of Module's that where a user has at least one of the permissions given.
 Module[] getModules(java.lang.String[] permissions, boolean showDeletedModules)
          Get a list of Module's that where a user has at least one of the permissions given.
 java.lang.String getMostRecentQuery()
          The most recent query entered.
 java.lang.String getName()
          The user's full name.
 java.util.List getNonGlobalModules()
          Gets all modules the user is associated to, except the Global one.
 java.util.Locale getPreferredLocale()
          Get the user's preferred locale.
 java.lang.String getQueryTarget()
          The template to show if the user is going to start a new query.
 Issue getReportingIssue(java.lang.String key)
          Gets an issue stored in the temp hash under key.
 RModuleUserAttribute getRModuleUserAttribute(Module module, Attribute attribute, IssueType issueType)
          Returns an RModuleUserAttribute object.
 java.util.List getRModuleUserAttributes(Module module, IssueType issueType)
          Returns list of RModuleUserAttribute objects for this User and Module -- the attributes the user has selected To appear on the IssueList for this module.
 java.util.List getRoleNames(Module module)
           
 java.util.List getSearchableRMITs(java.lang.String searchField, java.lang.String searchString, java.lang.String sortColumn, java.lang.String sortPolarity, Module skipModule)
          Returns a List of RModuleIssueTypes for which the user has the permission to search for issues.
 java.util.Map getSelectedUsersMap()
          Get the working list of associated users For the AssignIssue screen
 java.lang.String getStats()
          Report on size of several maps
 java.lang.Object getThreadKey()
          key used to keep concurrent activities by the same user from overwriting each others state.
 java.util.List getUnusedRModuleIssueTypes(Module module)
          returns a list of RModuleIssueTypes for the given module, excluding any that that have a corresponding MITListItem in the CurrentMITList.
 boolean hasAnyRoleIn(Module module)
          Determine whether the user has any role in the given module.
 boolean hasAnySearchableRMITs()
          Checks if the user can search for issues of at least one issue type in one module.
 boolean hasMostRecentQuery()
          Check if the user has a previous query
 boolean hasPermission(java.lang.String perm, java.util.List modules)
          Returns true if this user has the given permission within all the given modules, false otherwise.
 boolean hasPermission(java.lang.String perm, Module module)
          Returns true if this user has the given permission within the given module, false otherwise.
 boolean hasRoleInModule(org.apache.fulcrum.security.entity.Role role, Module module)
           
 boolean isPasswordExpired()
          Checks if the users password has expired.
 boolean isShowOtherModulesInIssueTypeList()
          Get the ShowOtherModulesInIssueTypeList value.
 boolean isUserAnonymous()
          Returns true if the user is the one set in scarab.anonymous.username, and false otherwise.
 java.lang.Object lastEnteredIssueTypeOrTemplate()
           
 void removeItemsFromCurrentMITList(java.lang.String[] ids)
           
 void setAssociatedUsersMap(java.util.Map associatedUsers)
          Set the working list of associated users For the AssignIssue screen
 void setCurrentIssueType(IssueType v)
          The current issue type
 void setCurrentMITList(MITList list)
           
 void setCurrentModule(Module v)
          The current module
 java.lang.String setCurrentReport(ReportBridge report)
          Places an report into the session that can be retrieved using the key that is returned from the method.
 void setCurrentReport(java.lang.String key, ReportBridge report)
          Places an report into the session under the given key.
 void setEnterIssueRedirect(int templateCode)
          Sets integer representing user preference for Which screen to return to after entering an issue. 1 = Enter New Issue. 2 = Assign Issue (default) 3 = View Issue. 4 = Issue Types index.
 void setHomePage(java.lang.String homePage)
          The template/tab to show for the home page.
 void setLastEnteredIssueType(IssueType type)
           
 void setLastEnteredTemplate(Issue template)
           
 void setLocale(java.util.Locale newLocale)
          Set the user's locale to a new value.
 void setMostRecentQuery(java.lang.String queryString)
          The most recent query entered.
 void setPasswordExpire()
          Sets the password to expire with information from the scarab.properties scarab.login.password.expire value.
 void setPasswordExpire(java.util.Calendar expire)
          Sets the password to expire on the specified date.
 java.lang.String setReportingIssue(Issue issue)
          Places an issue into the session that can be retrieved using the key that is returned from the method.
 void setReportingIssue(java.lang.String key, Issue issue)
          Places an issue into the session under the given key.
 void setSelectedUsersMap(java.util.Map selectedUsers)
          Set the working list of associated users For the AssignIssue screen
 void setShowOtherModulesInIssueTypeList(boolean newShowOtherModulesInIssueTypeList)
          Set the ShowOtherModulesInIssueTypeList value.
 void setSingleIssueTypeQueryTarget(IssueType type, java.lang.String target)
          Setup the users preference when entering a query for the given issue type.
 void setThreadKey(java.lang.Integer key)
          key used to keep concurrent activities by the same user from overwriting each others state.
 void updateIssueListAttributes(java.util.List attributes)
          Updates the attributes shown in IssueList.vm Removes any saved preferences for the current mit list or current module and issue type.
 
Methods inherited from class org.tigris.scarab.om.BaseScarabUserImpl
addActivityRelatedByNewUserId, addActivityRelatedByOldUserId, addActivitySet, addAttachmentRelatedByCreatedBy, addAttachmentRelatedByModifiedBy, addAttribute, addAttributeValue, addIssueVote, addMITList, addNotificationFilter, addNotificationStatus, addPendingGroupUserRole, addQuery, addReport, addRModuleUserAttribute, addRQueryUser, addScarabModuleRelatedByOwnerId, addScarabModuleRelatedByQaContactId, addUserPreference, addUserVote, getActivitySets, getActivitySets, getActivitySets, getActivitySets, getActivitySetsJoinActivitySetType, getActivitySetsJoinAttachment, getActivitySetsJoinScarabUserImpl, getActivitysRelatedByNewUserId, getActivitysRelatedByNewUserId, getActivitysRelatedByNewUserId, getActivitysRelatedByNewUserId, getActivitysRelatedByNewUserIdJoinActivitySet, getActivitysRelatedByNewUserIdJoinAttachment, getActivitysRelatedByNewUserIdJoinAttribute, getActivitysRelatedByNewUserIdJoinAttributeOptionRelatedByNewOptionId, getActivitysRelatedByNewUserIdJoinAttributeOptionRelatedByOldOptionId, getActivitysRelatedByNewUserIdJoinDepend, getActivitysRelatedByNewUserIdJoinIssue, getActivitysRelatedByNewUserIdJoinScarabUserImplRelatedByOldUserId, getActivitysRelatedByOldUserId, getActivitysRelatedByOldUserId, getActivitysRelatedByOldUserId, getActivitysRelatedByOldUserId, getActivitysRelatedByOldUserIdJoinActivitySet, getActivitysRelatedByOldUserIdJoinAttachment, getActivitysRelatedByOldUserIdJoinAttribute, getActivitysRelatedByOldUserIdJoinAttributeOptionRelatedByNewOptionId, getActivitysRelatedByOldUserIdJoinAttributeOptionRelatedByOldOptionId, getActivitysRelatedByOldUserIdJoinDepend, getActivitysRelatedByOldUserIdJoinIssue, getActivitysRelatedByOldUserIdJoinScarabUserImplRelatedByNewUserId, getAttachmentsRelatedByCreatedBy, getAttachmentsRelatedByCreatedBy, getAttachmentsRelatedByCreatedBy, getAttachmentsRelatedByCreatedBy, getAttachmentsRelatedByCreatedByJoinAttachmentType, getAttachmentsRelatedByCreatedByJoinIssue, getAttachmentsRelatedByCreatedByJoinScarabUserImplRelatedByModifiedBy, getAttachmentsRelatedByModifiedBy, getAttachmentsRelatedByModifiedBy, getAttachmentsRelatedByModifiedBy, getAttachmentsRelatedByModifiedBy, getAttachmentsRelatedByModifiedByJoinAttachmentType, getAttachmentsRelatedByModifiedByJoinIssue, getAttachmentsRelatedByModifiedByJoinScarabUserImplRelatedByCreatedBy, getAttributes, getAttributes, getAttributes, getAttributes, getAttributesJoinAttributeOption, getAttributesJoinAttributeType, getAttributesJoinScarabUserImpl, getAttributeValues, getAttributeValues, getAttributeValues, getAttributeValues, getAttributeValuesJoinAttribute, getAttributeValuesJoinAttributeOption, getAttributeValuesJoinIssue, getAttributeValuesJoinScarabUserImpl, getIssueVotes, getIssueVotes, getIssueVotes, getIssueVotes, getIssueVotesJoinIssue, getIssueVotesJoinScarabUserImpl, getMITLists, getMITLists, getMITLists, getMITListsJoinScarabUserImpl, getNotificationFilters, getNotificationFilters, getNotificationFilters, getNotificationFilters, getNotificationFiltersJoinScarabModule, getNotificationFiltersJoinScarabUserImpl, getNotificationStatuss, getNotificationStatuss, getNotificationStatuss, getNotificationStatuss, getNotificationStatussJoinActivity, getNotificationStatussJoinScarabUserImpl, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRoles, getPendingGroupUserRolesJoinScarabModule, getPendingGroupUserRolesJoinScarabUserImpl, getQueryKey, getQuerys, getQuerys, getQuerys, getQuerys, getQuerysJoinFrequency, getQuerysJoinIssueType, getQuerysJoinMITList, getQuerysJoinScarabModule, getQuerysJoinScarabUserImpl, getQuerysJoinScope, getReports, getReports, getReports, getReports, getReportsJoinIssueType, getReportsJoinScarabModule, getReportsJoinScarabUserImpl, getReportsJoinScope, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributes, getRModuleUserAttributesJoinAttribute, getRModuleUserAttributesJoinIssueType, getRModuleUserAttributesJoinMITList, getRModuleUserAttributesJoinScarabModule, getRModuleUserAttributesJoinScarabUserImpl, getRQueryUsers, getRQueryUsers, getRQueryUsers, getRQueryUsers, getRQueryUsersJoinFrequency, getRQueryUsersJoinQuery, getRQueryUsersJoinScarabUserImpl, getScarabModulesRelatedByOwnerId, getScarabModulesRelatedByOwnerId, getScarabModulesRelatedByOwnerId, getScarabModulesRelatedByOwnerId, getScarabModulesRelatedByOwnerIdJoinScarabUserImplRelatedByQaContactId, getScarabModulesRelatedByQaContactId, getScarabModulesRelatedByQaContactId, getScarabModulesRelatedByQaContactId, getScarabModulesRelatedByQaContactId, getScarabModulesRelatedByQaContactIdJoinScarabUserImplRelatedByOwnerId, getUserPreferences, getUserPreferences, getUserPreferences, getUserPreferences, getUserPreferencesJoinScarabUserImpl, getUserVotes, getUserVotes, getUserVotes, getUserVotes, getUserVotesJoinScarabModule, getUserVotesJoinScarabUserImpl, initActivitySets, initActivitysRelatedByNewUserId, initActivitysRelatedByOldUserId, initAttachmentsRelatedByCreatedBy, initAttachmentsRelatedByModifiedBy, initAttributes, initAttributeValues, initIssueVotes, initMITLists, initNotificationFilters, initNotificationStatuss, initPendingGroupUserRoles, initQuerys, initReports, initRModuleUserAttributes, initRQueryUsers, initScarabModulesRelatedByOwnerId, initScarabModulesRelatedByQaContactId, initUserPreferences, initUserVotes, setQueryKey, toString
 
Methods inherited from class org.apache.fulcrum.security.impl.db.entity.TurbineUser
getAccessCounter, getAccessCounterForSession, getLastAccessDate, getPerm, getPerm, getPermStorage, getTemp, getTemp, getTempStorage, hasLoggedIn, incrementAccessCounter, incrementAccessCounterForSession, isConfirmed, removeTemp, safeAddToHashtable, setAccessCounter, setAccessCounterForSession, setHasLoggedIn, setLastAccessDate, setName, setPerm, setPermStorage, setTemp, setTempStorage, updateLastLogin, valueBound, valueUnbound
 
Methods inherited from class org.apache.fulcrum.security.impl.db.entity.BaseTurbineUser
addTurbineUserGroupRole, copy, copyInto, getByName, getByPeerName, getByPosition, getConfirmed, getCreateDate, getEmail, getFieldNames, getFirstName, getLastLogin, getLastName, getModified, getObjectdata, getPassword, getPeer, getPrimaryKey, getTurbineUserGroupRoles, getTurbineUserGroupRoles, getTurbineUserGroupRoles, getTurbineUserGroupRoles, getTurbineUserGroupRolesJoinTurbineGroup, getTurbineUserGroupRolesJoinTurbineRole, getTurbineUserGroupRolesJoinTurbineUser, getUserId, getUserName, initTurbineUserGroupRoles, save, save, save, setConfirmed, setCreateDate, setEmail, setFirstName, setLastLogin, setLastName, setModified, setObjectdata, setPassword, setPrimaryKey, setPrimaryKey, setUserId, setUserName
 
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.tigris.scarab.om.ScarabUser
getPrimaryKey, getQueryKey, getUserId, setPrimaryKey, setQueryKey, setUserId
 
Methods inherited from interface org.apache.fulcrum.security.entity.User
getAccessCounter, getAccessCounterForSession, getConfirmed, getCreateDate, getEmail, getFirstName, getLastAccessDate, getLastLogin, getLastName, getPassword, getPerm, getPerm, getPermStorage, getTemp, getTemp, getTempStorage, getUserName, hasLoggedIn, incrementAccessCounter, incrementAccessCounterForSession, isConfirmed, removeTemp, setAccessCounter, setAccessCounterForSession, setConfirmed, setCreateDate, setEmail, setFirstName, setHasLoggedIn, setLastAccessDate, setLastLogin, setLastName, setPassword, setPerm, setPermStorage, setTemp, setTempStorage, setUserName, updateLastLogin
 
Methods inherited from interface org.apache.fulcrum.security.session.SessionBindingListener
valueBound, valueUnbound
 
Methods inherited from interface org.apache.fulcrum.security.entity.SecurityEntity
setName
 
Methods inherited from interface org.apache.torque.om.Persistent
isModified, isNew, save, save, save, setModified, setNew, setPrimaryKey
 

Field Detail

PASSWORD_EXPIRE

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

ScarabUserImpl

public ScarabUserImpl()
Call the superclass constructor to initialize this object.

Method Detail

getName

public java.lang.String getName()
Description copied from interface: ScarabUser
The user's full name.

Specified by:
getName in interface ScarabUser

checkConfirmationCode

public static boolean checkConfirmationCode(java.lang.String username,
                                            java.lang.String confirm)
Utility method that takes a username and a confirmation code and will return true if there is a match and false if no match.

If there is an Exception, it will also return false.


confirmUser

public static boolean confirmUser(java.lang.String username)
This method will mark username as confirmed. returns true on success and false on any error


hasPermission

public boolean hasPermission(java.lang.String perm,
                             Module module)
Description copied from interface: ScarabUser
Returns true if this user has the given permission within the given module, false otherwise.

Specified by:
hasPermission in interface ScarabUser
Parameters:
perm - a String permission value, which should be a constant in this interface.
module - a Module value
Returns:
true if the permission exists for the user within the given module, false otherwise
See Also:
Determine if a user has a permission, either within the specified module or within the 'Global' module.

hasPermission

public boolean hasPermission(java.lang.String perm,
                             java.util.List modules)
Description copied from interface: ScarabUser
Returns true if this user has the given permission within all the given modules, false otherwise. If the list is null or empty

Specified by:
hasPermission in interface ScarabUser
See Also:
ScarabUser.hasPermission(String, List)

getModules

public java.util.List getModules()
                          throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets all modules which are currently associated with this user (relationship has not been deleted.)

Specified by:
getModules in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getModules()

getModules

public java.util.List getModules(boolean showDeletedModules)
                          throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets all modules which are currently associated with this user.

Specified by:
getModules in interface ScarabUser
Parameters:
showDeletedModules - show modules which have been marked as deleted
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getModules(boolean)

getModules

public Module[] getModules(java.lang.String permission)
                    throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Get a list of Module's that where a user has the specified permission. Does not show deleted modules. (showDeleted = false)

Specified by:
getModules in interface ScarabUser
Parameters:
permission - a String value
Returns:
a Module[] value
Throws:
org.apache.torque.TorqueException

getModules

public Module[] getModules(java.lang.String[] permissions)
Description copied from interface: ScarabUser
Get a list of Module's that where a user has at least one of the permissions given. Does not show deleted modules. (showDeleted = false)

Specified by:
getModules in interface ScarabUser
Parameters:
permissions - a String[] value
Returns:
a Module[] value
See Also:
ScarabUser.getModules(String[])

getCopyToModules

public java.util.List getCopyToModules(Module currentModule)
                                throws org.apache.torque.TorqueException
Get modules that user can copy an issue to.

Specified by:
getCopyToModules in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getCopyToModules

public java.util.List getCopyToModules(Module currentModule,
                                       java.lang.String action)
                                throws org.apache.torque.TorqueException
Specified by:
getCopyToModules in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getCopyToModules

public java.util.List getCopyToModules(Module currentModule,
                                       java.lang.String action,
                                       java.lang.String searchString)
                                throws org.apache.torque.TorqueException
Specified by:
getCopyToModules in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getModules

public Module[] getModules(java.lang.String[] permissions,
                           boolean showDeletedModules)
Description copied from interface: ScarabUser
Get a list of Module's that where a user has at least one of the permissions given. Does not show deleted modules.

Specified by:
getModules in interface ScarabUser
Parameters:
permissions - a String[] value
showDeletedModules - a boolean value
Returns:
a Module[] value
See Also:
ScarabUser.getModules(String[], boolean)

hasAnyRoleIn

public boolean hasAnyRoleIn(Module module)
                     throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Determine whether the user has any role in the given module. This only checks roles directly in this module, not in the "Global" module.

Specified by:
hasAnyRoleIn in interface ScarabUser
Parameters:
module - a Module value
Returns:
a boolean value
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.hasAnyRoleIn(Module)

getCurrentRoleNames

public java.util.List getCurrentRoleNames()
eturn the list of currently active roles. If no roles are active, reuturn an empty list.

Returns:

createNewUser

public void createNewUser()
                   throws org.apache.torque.TorqueException,
                          org.apache.fulcrum.security.util.DataBackendException,
                          org.apache.fulcrum.security.util.EntityExistsException
Description copied from interface: ScarabUser
This method is responsible for creating a new user. It will throw an exception if there is any sort of error (such as a duplicate login id) and place the error message into e.getMessage(). This also creates a uniqueid and places it into this object in the perm table under the Visitor.CONFIRM_VALUE key. It will use the current instance of this object as the basis to create the new User.

Specified by:
createNewUser in interface ScarabUser
Throws:
org.apache.torque.TorqueException
org.apache.fulcrum.security.util.DataBackendException
org.apache.fulcrum.security.util.EntityExistsException
See Also:
ScarabUser.createNewUser()

getEditableModules

public java.util.List getEditableModules()
                                  throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets all modules the user has permissions to edit. The default is to not show global modules if you have the permission to edit it.

Specified by:
getEditableModules in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getEditableModules()

getEditableModules

public java.util.List getEditableModules(Module currEditModule)
                                  throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets all modules the user has permissions to edit.

Specified by:
getEditableModules in interface ScarabUser
Parameters:
currEditModule - the module we are currently editing
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getEditableModules(Module)

getNonGlobalModules

public java.util.List getNonGlobalModules()
                                   throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets all modules the user is associated to, except the Global one.

Specified by:
getNonGlobalModules in interface ScarabUser
Returns:
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getNonGlobalModules()

getRModuleUserAttributes

public java.util.List getRModuleUserAttributes(Module module,
                                               IssueType issueType)
                                        throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Returns list of RModuleUserAttribute objects for this User and Module -- the attributes the user has selected To appear on the IssueList for this module.

Specified by:
getRModuleUserAttributes in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getRModuleUserAttributes(Module, IssueType)

getRModuleUserAttribute

public RModuleUserAttribute getRModuleUserAttribute(Module module,
                                                    Attribute attribute,
                                                    IssueType issueType)
                                             throws org.apache.torque.TorqueException,
                                                    ScarabException
Description copied from interface: ScarabUser
Returns an RModuleUserAttribute object.

Specified by:
getRModuleUserAttribute in interface ScarabUser
Throws:
org.apache.torque.TorqueException
ScarabException
See Also:
ScarabUser.getRModuleUserAttribute(Module, Attribute, IssueType)

getReportingIssue

public Issue getReportingIssue(java.lang.String key)
                        throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets an issue stored in the temp hash under key.

Specified by:
getReportingIssue in interface ScarabUser
Parameters:
key - a String used as the key to retrieve the issue
Returns:
an Issue value
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getReportingIssue(String)

setReportingIssue

public java.lang.String setReportingIssue(Issue issue)
                                   throws ScarabException
Description copied from interface: ScarabUser
Places an issue into the session that can be retrieved using the key that is returned from the method.

Specified by:
setReportingIssue in interface ScarabUser
Parameters:
issue - an Issue to store in the session under a new key
Returns:
a String value that can be used to retrieve the issue
Throws:
ScarabException - if issue is null.
See Also:
ScarabUser.setReportingIssue(Issue)

setReportingIssue

public void setReportingIssue(java.lang.String key,
                              Issue issue)
Description copied from interface: ScarabUser
Places an issue into the session under the given key. If another issue was already using that key, it will be overwritten. Giving a null issue removes any issue stored using key. This method is primarily used to remove the issue from storage. Inserting a new issue would be most likely done with setReportingIssue(Issue issue).

Specified by:
setReportingIssue in interface ScarabUser
Parameters:
key - a String value under which to store the issue
issue - an Issue value to store, null removes any issue already stored under key.
See Also:
ScarabUser.setReportingIssue(String, Issue)

getCurrentReport

public ReportBridge getCurrentReport(java.lang.String key)
                              throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Gets an report stored in the temp hash under key.

Specified by:
getCurrentReport in interface ScarabUser
Parameters:
key - a String used as the key to retrieve the report
Returns:
an Report value
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getCurrentReport(String)

setCurrentReport

public java.lang.String setCurrentReport(ReportBridge report)
                                  throws ScarabException
Description copied from interface: ScarabUser
Places an report into the session that can be retrieved using the key that is returned from the method.

Specified by:
setCurrentReport in interface ScarabUser
Parameters:
report - an ReportBridge to store in the session under a new key
Returns:
a String value that can be used to retrieve the report
Throws:
ScarabException - if report is null.
See Also:
ScarabUser.setCurrentReport(ReportBridge)

setCurrentReport

public void setCurrentReport(java.lang.String key,
                             ReportBridge report)
Description copied from interface: ScarabUser
Places an report into the session under the given key. If another report was already using that key, it will be overwritten. Giving a null report removes any report stored using key. This method is primarily used to remove the report from storage. Inserting a new report would be most likely done with setCurrentReport(ReportBridge report).

Specified by:
setCurrentReport in interface ScarabUser
Parameters:
key - a String value under which to store the report
report - an ReportBridge value to store, null removes any report already stored under key.
See Also:
ScarabUser.setCurrentReport(String, ReportBridge)

setPasswordExpire

public void setPasswordExpire()
                       throws org.apache.torque.TorqueException
Sets the password to expire with information from the scarab.properties scarab.login.password.expire value.

Specified by:
setPasswordExpire in interface ScarabUser
Throws:
java.lang.Exception - if problem setting the password.
org.apache.torque.TorqueException

setPasswordExpire

public void setPasswordExpire(java.util.Calendar expire)
                       throws org.apache.torque.TorqueException
Sets the password to expire on the specified date.

Specified by:
setPasswordExpire in interface ScarabUser
Parameters:
expire - a Calendar value specifying the expire date. If this value is null, the password will be set to expire 10 years from the current year. Since Logging in resets this value, it should be ok to have someone's password expire after 10 years.
Throws:
java.lang.Exception - if problem updating the password.
org.apache.torque.TorqueException

isPasswordExpired

public boolean isPasswordExpired()
                          throws org.apache.torque.TorqueException,
                                 ScarabException
Checks if the users password has expired.

Specified by:
isPasswordExpired in interface ScarabUser
Throws:
java.lang.Exception - if problem querying for the password.
org.apache.torque.TorqueException
ScarabException

isUserAnonymous

public boolean isUserAnonymous()
Returns true if the user is the one set in scarab.anonymous.username, and false otherwise.

Specified by:
isUserAnonymous in interface ScarabUser
Returns:

getEnterIssueRedirect

public int getEnterIssueRedirect()
                          throws org.apache.torque.TorqueException
Returns integer representing user preference for Which screen to return to after entering an issue. 1 = Enter New Issue. 2 = Assign Issue (default) 3 = View Issue. 4 = Issue Types index.

Specified by:
getEnterIssueRedirect in interface ScarabUser
Throws:
org.apache.torque.TorqueException

setEnterIssueRedirect

public void setEnterIssueRedirect(int templateCode)
                           throws org.apache.torque.TorqueException
Sets integer representing user preference for Which screen to return to after entering an issue. 1 = Enter New Issue. 2 = Assign Issue (default) 3 = View Issue. 4 = Issue Types index.

Specified by:
setEnterIssueRedirect in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getHomePage

public java.lang.String getHomePage()
                             throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
The template/tab to show for the home page using the current module.

Specified by:
getHomePage in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getHomePage()

getHomePage

public java.lang.String getHomePage(Module module)
                             throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
The template/tab to show for the home page in the given module.

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

setHomePage

public void setHomePage(java.lang.String homePage)
                 throws org.apache.torque.TorqueException,
                        ScarabException
Description copied from interface: ScarabUser
The template/tab to show for the home page.

Specified by:
setHomePage in interface ScarabUser
Throws:
org.apache.torque.TorqueException
ScarabException
See Also:
ScarabUser.setHomePage(String)

getQueryTarget

public java.lang.String getQueryTarget()
Description copied from interface: ScarabUser
The template to show if the user is going to start a new query. if the user has not selected a set of issue types it will return IssueTypeList.vm. If a list is already selected, then it will go to AdvancedQuery.vm unless the list is only one issue type and the user has last selected Custom query for that issue type.

Specified by:
getQueryTarget in interface ScarabUser
See Also:
ScarabUser.getQueryTarget()

setSingleIssueTypeQueryTarget

public void setSingleIssueTypeQueryTarget(IssueType type,
                                          java.lang.String target)
Description copied from interface: ScarabUser
Setup the users preference when entering a query for the given issue type. Valid values of target are AdvancedQuery.vm and Search.vm (Custom query).

Specified by:
setSingleIssueTypeQueryTarget in interface ScarabUser
See Also:
ScarabUser.setSingleIssueTypeQueryTarget(IssueType, String)

getMITLists

public java.util.List getMITLists()
                           throws org.apache.torque.TorqueException
Description copied from class: BaseScarabUserImpl
If this collection has already been initialized, returns the collection. Otherwise returns the results of getMITLists(new Criteria())

Specified by:
getMITLists in interface ScarabUser
Overrides:
getMITLists in class BaseScarabUserImpl
Returns:
the collection of associated objects
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getMITLists()

hasAnySearchableRMITs

public boolean hasAnySearchableRMITs()
                              throws org.apache.torque.TorqueException,
                                     com.workingdogs.village.DataSetException
Description copied from interface: ScarabUser
Checks if the user can search for issues of at least one issue type in one module.

Specified by:
hasAnySearchableRMITs in interface ScarabUser
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
See Also:
ScarabUser.hasAnySearchableRMITs().

getSearchableRMITs

public java.util.List getSearchableRMITs(java.lang.String searchField,
                                         java.lang.String searchString,
                                         java.lang.String sortColumn,
                                         java.lang.String sortPolarity,
                                         Module skipModule)
                                  throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Returns a List of RModuleIssueTypes for which the user has the permission to search for issues.

Specified by:
getSearchableRMITs in interface ScarabUser
Parameters:
skipModule - do not include issue types for this module. Useful for separating the current module.
Returns:
a List value
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getSearchableRMITs(String, String, String, String, Module)

getUnusedRModuleIssueTypes

public java.util.List getUnusedRModuleIssueTypes(Module module)
                                          throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
returns a list of RModuleIssueTypes for the given module, excluding any that that have a corresponding MITListItem in the CurrentMITList.

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

getAllRModuleIssueTypes

public java.util.List getAllRModuleIssueTypes(Module module)
                                       throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
returns a list of RModuleIssueTypes for the given module.

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

addRMITsToCurrentMITList

public void addRMITsToCurrentMITList(java.util.List rmits)
                              throws org.apache.torque.TorqueException
Specified by:
addRMITsToCurrentMITList in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.addRMITsToCurrentMITList(List)

getCurrentMITList

public MITList getCurrentMITList()
Specified by:
getCurrentMITList in interface ScarabUser
See Also:
ScarabUser.getCurrentMITList()

setCurrentMITList

public void setCurrentMITList(MITList list)
Specified by:
setCurrentMITList in interface ScarabUser
See Also:
ScarabUser.setCurrentMITList(MITList)

removeItemsFromCurrentMITList

public void removeItemsFromCurrentMITList(java.lang.String[] ids)
Specified by:
removeItemsFromCurrentMITList in interface ScarabUser
See Also:
ScarabUser.removeItemsFromCurrentMITList(String[])

lastEnteredIssueTypeOrTemplate

public java.lang.Object lastEnteredIssueTypeOrTemplate()
Specified by:
lastEnteredIssueTypeOrTemplate in interface ScarabUser
See Also:
ScarabUser.lastEnteredIssueTypeOrTemplate()

setLastEnteredIssueType

public void setLastEnteredIssueType(IssueType type)
Specified by:
setLastEnteredIssueType in interface ScarabUser
See Also:
ScarabUser.setLastEnteredIssueType(IssueType)

setLastEnteredTemplate

public void setLastEnteredTemplate(Issue template)
Specified by:
setLastEnteredTemplate in interface ScarabUser
See Also:
ScarabUser.setLastEnteredTemplate(Issue)

getMostRecentQuery

public java.lang.String getMostRecentQuery()
Description copied from interface: ScarabUser
The most recent query entered. This method has the effect of loading the MITList used for the query (if one exists) as the CurrentMITList so it should only be called if the query is to be used. Use @see #hasMostRecentQuery() to determine existence.

Specified by:
getMostRecentQuery in interface ScarabUser
See Also:
ScarabUser.getMostRecentQuery()

setMostRecentQuery

public void setMostRecentQuery(java.lang.String queryString)
Description copied from interface: ScarabUser
The most recent query entered.

Specified by:
setMostRecentQuery in interface ScarabUser
See Also:
ScarabUser.setMostRecentQuery(String)

hasMostRecentQuery

public boolean hasMostRecentQuery()
Description copied from interface: ScarabUser
Check if the user has a previous query

Specified by:
hasMostRecentQuery in interface ScarabUser
See Also:
ScarabUser.hasMostRecentQuery()

getAssociatedUsersMap

public java.util.Map getAssociatedUsersMap()
                                    throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Get the working list of associated users For the AssignIssue screen

Specified by:
getAssociatedUsersMap in interface ScarabUser
Throws:
org.apache.torque.TorqueException

setAssociatedUsersMap

public void setAssociatedUsersMap(java.util.Map associatedUsers)
                           throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Set the working list of associated users For the AssignIssue screen

Specified by:
setAssociatedUsersMap in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getSelectedUsersMap

public java.util.Map getSelectedUsersMap()
                                  throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Get the working list of associated users For the AssignIssue screen

Specified by:
getSelectedUsersMap in interface ScarabUser
Throws:
org.apache.torque.TorqueException

setSelectedUsersMap

public void setSelectedUsersMap(java.util.Map selectedUsers)
                         throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
Set the working list of associated users For the AssignIssue screen

Specified by:
setSelectedUsersMap in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getThreadKey

public java.lang.Object getThreadKey()
Description copied from interface: ScarabUser
key used to keep concurrent activities by the same user from overwriting each others state.

Specified by:
getThreadKey in interface ScarabUser
See Also:
ScarabUser.getThreadKey()

setThreadKey

public void setThreadKey(java.lang.Integer key)
Description copied from interface: ScarabUser
key used to keep concurrent activities by the same user from overwriting each others state.

Specified by:
setThreadKey in interface ScarabUser
See Also:
ScarabUser.setThreadKey(Integer)

getCurrentModule

public Module getCurrentModule()
The current module

Specified by:
getCurrentModule in interface ScarabUser

setCurrentModule

public void setCurrentModule(Module v)
The current module

Specified by:
setCurrentModule in interface ScarabUser

getCurrentIssueType

public IssueType getCurrentIssueType()
                              throws org.apache.torque.TorqueException
The current issue type

Specified by:
getCurrentIssueType in interface ScarabUser
Throws:
org.apache.torque.TorqueException

setCurrentIssueType

public void setCurrentIssueType(IssueType v)
The current issue type

Specified by:
setCurrentIssueType in interface ScarabUser

getCurrentRModuleIssueType

public RModuleIssueType getCurrentRModuleIssueType()
                                            throws org.apache.torque.TorqueException
Description copied from interface: ScarabUser
The current RModuleIssueType which represents the module and issue type selected by the user within a request.

Specified by:
getCurrentRModuleIssueType in interface ScarabUser
Throws:
org.apache.torque.TorqueException
See Also:
ScarabUser.getCurrentRModuleIssueType()

updateIssueListAttributes

public void updateIssueListAttributes(java.util.List attributes)
                               throws org.apache.torque.TorqueException,
                                      org.apache.fulcrum.security.util.TurbineSecurityException
Description copied from interface: ScarabUser
Updates the attributes shown in IssueList.vm Removes any saved preferences for the current mit list or current module and issue type. And replaces them with the attributes given. The order of the attributes is preserved.

Specified by:
updateIssueListAttributes in interface ScarabUser
Throws:
org.apache.torque.TorqueException
org.apache.fulcrum.security.util.TurbineSecurityException
See Also:
ScarabUser.updateIssueListAttributes(List)

getRoleNames

public java.util.List getRoleNames(Module module)
                            throws org.apache.torque.TorqueException
Specified by:
getRoleNames in interface ScarabUser
Throws:
org.apache.torque.TorqueException

getStats

public java.lang.String getStats()
Report on size of several maps


setLocale

public void setLocale(java.util.Locale newLocale)
Set the user's locale to a new value.

Specified by:
setLocale in interface ScarabUser

getLocale

public java.util.Locale getLocale()
Get the user's current locale. If it is not set, retrieve the preferred Locale instead.

Specified by:
getLocale in interface ScarabUser

getPreferredLocale

public java.util.Locale getPreferredLocale()
Get the user's preferred locale.

Specified by:
getPreferredLocale in interface ScarabUser

isShowOtherModulesInIssueTypeList

public boolean isShowOtherModulesInIssueTypeList()
Description copied from interface: ScarabUser
Get the ShowOtherModulesInIssueTypeList value. toggle switch for show/hide the cross module section of the issue type selection widget.

Specified by:
isShowOtherModulesInIssueTypeList in interface ScarabUser
Returns:
the ShowOtherModulesInIssueTypeList value.
See Also:
ScarabUser.isShowOtherModulesInIssueTypeList()

setShowOtherModulesInIssueTypeList

public void setShowOtherModulesInIssueTypeList(boolean newShowOtherModulesInIssueTypeList)
Description copied from interface: ScarabUser
Set the ShowOtherModulesInIssueTypeList value. toggle switch for show/hide the cross module section of the issue type selection widget.

Specified by:
setShowOtherModulesInIssueTypeList in interface ScarabUser
Parameters:
newShowOtherModulesInIssueTypeList - The new ShowOtherModulesInIssueTypeList value.
See Also:
ScarabUser.setShowOtherModulesInIssueTypeList(boolean)

getAssignIssuesList

public java.util.List getAssignIssuesList()
Specified by:
getAssignIssuesList in interface ScarabUser

getACL

public org.apache.fulcrum.security.util.AccessControlList getACL()
Return the AccessControlList for this user. TODO: This should go wrapped in a fulcrum-independent interface, with Role and others.

Specified by:
getACL in interface ScarabUser

hasRoleInModule

public boolean hasRoleInModule(org.apache.fulcrum.security.entity.Role role,
                               Module module)
Specified by:
hasRoleInModule in interface ScarabUser


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