org.tigris.scarab.tools
Class ScarabRequestTool

java.lang.Object
  extended byorg.tigris.scarab.tools.ScarabRequestTool
All Implemented Interfaces:
org.apache.turbine.services.pull.ApplicationTool, org.apache.fulcrum.pool.Recyclable

public class ScarabRequestTool
extends java.lang.Object
implements org.apache.turbine.services.pull.ApplicationTool, org.apache.fulcrum.pool.Recyclable

This class is used by the Scarab API


Nested Class Summary
 class ScarabRequestTool.IssueListIterator
           
 
Field Summary
(package private)  java.util.Map attributeTypes
           
(package private)  int initialIssueListColumnsSize
          keep track if the columns were reduced to avoid db limits
(package private)  java.util.List issueListColumns
          cache list so that we always return the same object for all invocations within a single request
 
Constructor Summary
ScarabRequestTool()
          Constructor does initialization stuff
 
Method Summary
 java.lang.String convertPath(java.lang.String path)
          Convert paths with slashes to commas.
static MITListItem convertToMITListItem(RModuleIssueType rmit)
          Create a MITListItem from an RModuleIssueType instance.
 void dispose()
          Disposes the object after use.
 java.lang.String formatDate(java.lang.String value)
          Format a date from internal timestamp value to the user's locale format.
 int getAdjustedPageNum()
          Checks for a query parameter "oldResultsPerPage" and compares it to the current "resultsPerPage" parameter.
 java.lang.Object getAlert()
          Retrieves any Alert!
 java.lang.Object getAlertMessage()
          Get any alert message usually set in the action.
 java.util.List getAllIssueTemplates(IssueType issueType)
          Returns all issue templates that are global, Plus those that are personal and created by logged-in user.
 java.util.List getAllQueries()
          Returns all queries that are global, Plus those that are personal and created by logged-in user.
 java.util.List getAllValidIssueListAttributes()
           
 Attachment getAttachment()
          A Attachment object for use within the Scarab API.
 Attribute getAttribute()
           
 Attribute getAttribute(java.lang.Integer pk)
          A Attribute object for use within the Scarab API.
 AttributeGroup getAttributeGroup()
          A AttributeGroup object for use within the Scarab API.
 AttributeGroup getAttributeGroup(java.lang.String key)
          Get a AttributeGroup object.
 AttributeOption getAttributeOption()
          A Attribute object for use within the Scarab API.
 AttributeOption getAttributeOption(java.lang.Integer pk)
          A Attribute object for use within the Scarab API.
 AttributeOption getAttributeOption(java.lang.String key)
           
 java.util.List getAttributeSearchResults()
          Return results of attribute search.
 java.lang.String getAttributeType(int key)
          Retrieves an attribute type from request scope.
 java.util.Calendar getCalendar()
          This is used to get the format for a date in the Locale sent by the browser.
 org.apache.fulcrum.intake.Intake getConditionalIntake(java.lang.String parameter)
           
 java.lang.Object getConfirmMessage()
          Get any confirmation message usually set in the action.
 IssueType getCurrentIssueType()
          Gets the IssueType associated with the information passed around in the query string.
 Module getCurrentModule()
          Gets the Module associated with the information passed around in the query string.
 IteratorWithSize getCurrentSearchResults()
          Performs search on current query (which is stored in user session).
 int getCurrentSearchResultsSize()
          Gets the number of results for the current query.
 java.lang.String getCurrentTemplate()
          Returns name of current template
 ScarabUser getCurrentUser()
          retrieves the user from the current request.
 java.text.DateFormat getDateFormat()
          This is used to get the format for a date in the Locale sent by the browser.
 Depend getDepend()
          A Depend object for use within the Scarab API.
 java.lang.String getEditLink(java.lang.String link, Query query)
          Generates link to the Query Detail page.
 java.lang.String getExecuteLink(java.lang.String link, Query query)
          Generates link to Issue List page, re-running stored query.
 java.util.List getFrequencies()
          Get all frequencies.
 java.util.List getGlobalQueries()
          Returns all queries that are global.
 java.util.List getGlobalQueries(Module module)
          Returns all queries global for the module
 java.util.List getGlobalTemplates(IssueType issueType)
          Returns templates that are personal and created by logged-in user.
 java.util.List getGlobalUserSearch()
          When a user searches for other users (in the ManageUserSearch.vm template for example), the result of this search is stored into the temporary data for that user.
 java.lang.String getGlobalUserSearchParam(java.lang.String name)
          Return the parameter used for the user-search (like in the ManageUserSearch.vm template for example) returned by the getGlobalUserSearch() method.
 java.lang.Object getInfoMessage()
          Get any informational message usually set in the action.
 Issue getIssue()
          Get an Issue object from unique id given either as an intake field or a request parameter keyed with "id".
 Issue getIssue(java.lang.String id)
          Takes unique id and returns issue.
 Issue getIssueByPk(java.lang.String key)
          The id may only be the issue's primary key.
 Issue getIssueIncludingDeleted(java.lang.String id)
          Returns an issue given its ID, even if it's been deleted or moved.
 java.util.List getIssueListAttributes(boolean validOnly, boolean commonOnly)
           
 ScarabRequestTool.IssueListIterator getIssueListIterator(IteratorWithSize iterator, int listOffset, int size)
           
 int getIssuePosInList()
          Returns the issue's position (1-based) in current issue list.
 java.util.List getIssues()
          Get a list of Issue objects.
 java.util.List getIssues(java.util.List issueIds)
          Get a list of Issue objects from a list of issue IDs.
 Issue getIssueTemplate()
          An Enter issue template.
 Issue getIssueTemplate(java.lang.String templateId)
          An Enter issue template.
 IssueTemplateInfo getIssueTemplateInfo()
          A IssueTemplateInfo object for use within the Scarab API.
 IssueType getIssueType()
          Get an issue type object.
 IssueType getIssueType(java.lang.String key)
          Get a specific issue type by key value.
 java.lang.Object getLastEnteredIssueTypeOrTemplate()
           
 MITList getMITList(java.util.List issues)
           
 Module getModule()
          Get an Module object.
 Module getModule(java.lang.String key)
          Get a specific module by key value.
 int getNbrPages()
          Return the number of paginated pages.
 AttributeValue getNewAttributeValue(Attribute attribute, Issue issue)
          Gets a new instance of AttributeValue
 IssueSearch getNewSearch()
          Get a new IssueSearch object.
 java.lang.String getNextEntryTemplate(IssueType issueType)
          Looks at the current RModuleIssueType and if it is null, returns the users home page.
 java.lang.String getNextIssue()
          Returns next issue id in list.
 int getNextPage()
          Return the next page in the paginated list.
 ScarabPaginatedList getPaginatedGlobalUsersList(int pageNum, int resultsPerPage, java.lang.String searchField, java.lang.String searchCriteria, java.lang.String sortColumn, java.lang.String sortPolarity)
           
 IteratorWithSize getPaginatedIterator(IteratorWithSize fullList, int pgNbr, int nbrItmsPerPage)
          Return a subset of the passed-in list.
 java.util.List getPaginatedList(java.util.List fullList, int pgNbr, int nbrItmsPerPage)
          Return a subset of the passed-in list.
 ParentChildAttributeOption getParentChildAttributeOption()
          Gets an instance of a ParentChildAttributeOption from this tool.
 IssueSearch getPopulatedSearch()
          Get an IssueSearch object based on current query string.
 IssueSearch getPopulatedSearch(java.lang.String query)
          Get an IssueSearch object based on a query string.
 java.lang.String getPrevIssue()
          Returns previous issue id in list.
 int getPrevPage()
          Return the previous page in the paginated list.
 java.util.List getPrivateQueries()
          Returns queries that are personal and created by logged-in user.
 java.util.List getPrivateTemplates(IssueType issueType)
          Returns templates that are personal and created by logged-in user.
 Query getQuery()
          A Query object for use within the Scarab API.
 ReportBridge getReport()
          a report helper class
 Issue getReportingIssue()
          The issue that is currently being entered.
 RModuleAttribute getRModuleAttribute()
          Get an RModuleAttribute object.
 RModuleIssueType getRModuleIssueType(java.lang.Integer moduleId, java.lang.Integer issueTypeId)
           
 java.util.List getRModuleUserAttributes()
          First attempts to get the RModuleUserAttributes from the user.
 ROptionOption getROptionOption()
          Gets an instance of a ROptionOption from this tool.
 java.util.List getScopes()
          Get all scopes.
 java.lang.Object getSessionAttribute(java.lang.String key)
          retrieve an attribute value from the current HttpSession.
 java.util.List getSortedAttributeOptions()
           
 java.util.List getSortedAttributeOptionsForRMIT(RModuleIssueType rmit)
          Returned all attribute options allowed for every attribute assigned to this RModuleIssueType.
 Transition getTransition(java.lang.Integer pk)
           
 java.util.List getTransitionMatrix(IssueType issueType, Attribute attribute)
          Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination as a displayable matrix organized in rows and columns.
 java.util.List getTransitions(IssueType issueType, Attribute attribute)
          Returns the list of transitions allowed for the current user in the current module/issueType/attribute combination
 ScarabUser getUser()
          A User object for use within the Scarab API.
 ScarabUser getUser(java.lang.Object id)
          Return a specific User by ID from within the system.
 java.util.List getUserAllQueries()
          Returns all queries that are global.
 java.util.List getUserAttributes(java.util.List issues, boolean activeOnly)
          Gets a list of Attributes or the user type that are in common between the issues in the given list.
 ScarabUser getUserByUserName(java.lang.String username)
          Return a specific User by username.
 ScarabPaginatedList getUserFilteredSearchResults(MITList mitList, int pageNum, int resultsPerPage, java.lang.String sortColumn, java.lang.String sortPolarity, boolean includeCommitters)
          Full featured, paginated, sorted version for returning results of a user search.
 java.util.List getUserQueries()
          Returns queries that are personal and created by logged-in user.
 ScarabPaginatedList getUserSearchResults(MITList mitList, int pageNum, int resultsPerPage, java.lang.String sortColumn, java.lang.String sortPolarity, boolean includeCommitters)
          Full featured, paginated, sorted method for returning the results of user search.
 java.util.List getValidIssueListAttributes()
           
 boolean hasItemsToApprove()
           
 boolean hasPermission(java.lang.String permission)
          Determine if the user currently interacting with the scarab application has a permission within the user's currently selected module.
 boolean hasPermission(java.lang.String permission, Module module)
          Determine if the user currently interacting with the scarab application has a permission within a module.
 boolean hasSessionAttribute(java.lang.String key)
          Check whether the current session has an attribute of given key.
 void init(java.lang.Object data)
          This method expects to get a RunData object
 boolean isAnonymousLoginAllowed()
          Returns if the system is configurated to allow anonymous login.
 boolean isDisposed()
          Checks whether the object is disposed.
 org.apache.fulcrum.intake.Intake parseQuery(java.lang.String query)
          Parses query into intake values.
 void recycle()
          Recycles the object by removing its disposed flag.
 void refresh()
          nulls out the issue and user objects
 java.lang.String reportTimer(java.lang.String mesg)
          Useful when performance tuning.
 void resetAssociatedUsers()
           
 void resetSelectedUsers()
           
 void setAlert(java.lang.Object message)
          Sets the Alert!
 void setAlertMessage(Localizable localizable)
          Set alert message using Localizable localizable.
 void setAlertMessage(java.lang.Object v)
          Deprecated.  
 void setAttachment(Attachment attachment)
          A Attachment object for use within the Scarab API
 void setAttribute(Attribute attribute)
          A Attribute object for use within the Scarab API.
 void setAttributeOption(AttributeOption option)
          A Attribute object for use within the Scarab API.
 void setAttributeType(int key, java.lang.String type)
          Stores in the request scope a type.
 void setConfirmMessage(Localizable localizable)
          Set confirm message using Localizable localizable.
 void setConfirmMessage(java.lang.Object v)
          Deprecated.  
 void setCurrentIssueType(IssueType type)
           
 void setCurrentModule(Module me)
          Sets the current Module
 void setDepend(Depend depend)
          A Depend object for use within the Scarab API.
 void setGlobalUserSearch(java.util.List users)
          Store the search result of other users for later use.
 void setGlobalUserSearchParam(java.lang.String name, java.lang.String value)
          Set the parameters used to retrieved the users in the List given to the setGlobalUserSearch(List) method.
 void setInfoMessage(Localizable localizable)
          Set alert message using Localizable localizable.
 void setInfoMessage(java.lang.Object v)
          Deprecated.  
 void setIssue(Issue issue)
          A Issue object for use within the Scarab API.
 void setIssueTemplateInfo(IssueTemplateInfo templateInfo)
          A IssueTemplateInfo object for use within the Scarab API.
 void setIssueType(IssueType issuetype)
          A IssueType object for use within the Scarab API.
 void setModule(Module module)
          A Module object for use within the Scarab API.
 void setParentChildAttributeOption(ParentChildAttributeOption roo)
          Sets an instance of a ParentChildAttributeOption
 void setQuery(Query query)
          A Query object for use within the Scarab API.
 void setReport(ReportBridge report)
           
 void setReportingIssue(Issue issue)
           
 void setROptionOption(ROptionOption roo)
          Sets an instance of a ROptionOption
 boolean setSessionAttribute(java.lang.String key, java.lang.Object value)
          Place an attribute value into the current HttpSession.
 void setUser(ScarabUser user)
          A User object for use within the Scarab API, generally not the user who is logged in.
 java.util.List sortAttributes(java.util.List attList)
          Sort attributes on name or description.
 java.util.List sortUsers(java.util.List userList)
          Sort users on name or email.
 void startTimer()
          Should be called near the beginning of a template or wherever timing should start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialIssueListColumnsSize

int initialIssueListColumnsSize
keep track if the columns were reduced to avoid db limits


issueListColumns

java.util.List issueListColumns
cache list so that we always return the same object for all invocations within a single request


attributeTypes

java.util.Map attributeTypes
Constructor Detail

ScarabRequestTool

public ScarabRequestTool()
Constructor does initialization stuff

Method Detail

init

public void init(java.lang.Object data)
This method expects to get a RunData object

Specified by:
init in interface org.apache.turbine.services.pull.ApplicationTool

refresh

public void refresh()
nulls out the issue and user objects

Specified by:
refresh in interface org.apache.turbine.services.pull.ApplicationTool

setAlert

public void setAlert(java.lang.Object message)
Sets the Alert! message for this request.

Parameters:
message - The alert message to set.

getAlert

public java.lang.Object getAlert()
Retrieves any Alert! message which has been set.

Returns:
The alert message.

setAttachment

public void setAttachment(Attachment attachment)
A Attachment object for use within the Scarab API


setAttribute

public void setAttribute(Attribute attribute)
A Attribute object for use within the Scarab API.


setDepend

public void setDepend(Depend depend)
A Depend object for use within the Scarab API.


setQuery

public void setQuery(Query query)
A Query object for use within the Scarab API.


getROptionOption

public ROptionOption getROptionOption()
Gets an instance of a ROptionOption from this tool. if it is null it will return a new instance of an empty ROptionOption and set it within this tool.


setROptionOption

public void setROptionOption(ROptionOption roo)
Sets an instance of a ROptionOption


setIssueTemplateInfo

public void setIssueTemplateInfo(IssueTemplateInfo templateInfo)
A IssueTemplateInfo object for use within the Scarab API.


setIssueType

public void setIssueType(IssueType issuetype)
A IssueType object for use within the Scarab API.


getParentChildAttributeOption

public ParentChildAttributeOption getParentChildAttributeOption()
Gets an instance of a ParentChildAttributeOption from this tool. if it is null it will return a new instance of an empty ParentChildAttributeOption and set it within this tool.


setParentChildAttributeOption

public void setParentChildAttributeOption(ParentChildAttributeOption roo)
Sets an instance of a ParentChildAttributeOption


setAttributeOption

public void setAttributeOption(AttributeOption option)
A Attribute object for use within the Scarab API.


getAttributeOption

public AttributeOption getAttributeOption()
                                   throws java.lang.Exception
A Attribute object for use within the Scarab API.

Throws:
java.lang.Exception

setUser

public void setUser(ScarabUser user)
A User object for use within the Scarab API, generally not the user who is logged in.


getUser

public ScarabUser getUser()
A User object for use within the Scarab API. This is the result of whatever was set with setUser() (generally not the user who is logged in). It can return null if setUser() has not been previously called. If you would like to get the currently logged in User, retrieve that from the data.getUser() method.

Returns:
A user used during this request.

getCurrentUser

public ScarabUser getCurrentUser()
retrieves the user from the current request. If the current request has no explicit user in it's data section, retrieve the current user from the current session.

Returns:

getUser

public ScarabUser getUser(java.lang.Object id)
                   throws java.lang.Exception
Return a specific User by ID from within the system. You can pass in either a Integer or something that will resolve to a String object as id.toString() is called on everything that isn't a Integer.

Throws:
java.lang.Exception

getUserByUserName

public ScarabUser getUserByUserName(java.lang.String username)
                             throws java.lang.Exception
Return a specific User by username.

Throws:
java.lang.Exception

getAttribute

public Attribute getAttribute()
                       throws java.lang.Exception
Returns:
An Attribute object (possibly "blank", but never null).
Throws:
java.lang.Exception

getAttribute

public Attribute getAttribute(java.lang.Integer pk)
                       throws java.lang.Exception
A Attribute object for use within the Scarab API.

Throws:
java.lang.Exception

getAttributeOption

public AttributeOption getAttributeOption(java.lang.Integer pk)
                                   throws java.lang.Exception
A Attribute object for use within the Scarab API.

Throws:
java.lang.Exception

getAttributeOption

public AttributeOption getAttributeOption(java.lang.String key)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

getRModuleUserAttributes

public java.util.List getRModuleUserAttributes()
First attempts to get the RModuleUserAttributes from the user. If it is empty, then it will try to get the defaults from the module. If anything fails, it will return an empty list.


getValidIssueListAttributes

public java.util.List getValidIssueListAttributes()

getAllValidIssueListAttributes

public java.util.List getAllValidIssueListAttributes()

getIssueListAttributes

public java.util.List getIssueListAttributes(boolean validOnly,
                                             boolean commonOnly)

getQuery

public Query getQuery()
               throws java.lang.Exception
A Query object for use within the Scarab API.

Throws:
java.lang.Exception

getIssueTemplateInfo

public IssueTemplateInfo getIssueTemplateInfo()
                                       throws java.lang.Exception
A IssueTemplateInfo object for use within the Scarab API.

Throws:
java.lang.Exception

getIssueTemplate

public Issue getIssueTemplate()
                       throws java.lang.Exception
An Enter issue template.

Throws:
java.lang.Exception

getIssueTemplate

public Issue getIssueTemplate(java.lang.String templateId)
                       throws java.lang.Exception
An Enter issue template.

Throws:
java.lang.Exception

getDepend

public Depend getDepend()
                 throws java.lang.Exception
A Depend object for use within the Scarab API.

Throws:
java.lang.Exception

getAttachment

public Attachment getAttachment()
                         throws java.lang.Exception
A Attachment object for use within the Scarab API.

Throws:
java.lang.Exception

getAttributeGroup

public AttributeGroup getAttributeGroup()
                                 throws java.lang.Exception
A AttributeGroup object for use within the Scarab API.

Throws:
java.lang.Exception

getAttributeGroup

public AttributeGroup getAttributeGroup(java.lang.String key)
Get a AttributeGroup object.


getIssueType

public IssueType getIssueType(java.lang.String key)
Get a specific issue type by key value. Returns null if the Issue Type could not be found

Parameters:
key - a String value
Returns:
a IssueType value

getIssueType

public IssueType getIssueType()
                       throws java.lang.Exception
Get an issue type object.

Throws:
java.lang.Exception

getNewAttributeValue

public AttributeValue getNewAttributeValue(Attribute attribute,
                                           Issue issue)
                                    throws java.lang.Exception
Gets a new instance of AttributeValue

Throws:
java.lang.Exception

getRModuleAttribute

public RModuleAttribute getRModuleAttribute()
                                     throws java.lang.Exception
Get an RModuleAttribute object.

Returns:
a Module value
Throws:
java.lang.Exception

setModule

public void setModule(Module module)
A Module object for use within the Scarab API.


getModule

public Module getModule()
                 throws java.lang.Exception
Get an Module object.

Returns:
a Module value
Throws:
java.lang.Exception

getModule

public Module getModule(java.lang.String key)
Get a specific module by key value. Returns null if the Module could not be found

Parameters:
key - a String value
Returns:
a Module value

getCurrentModule

public Module getCurrentModule()
Gets the Module associated with the information passed around in the query string. Returns null if the Module could not be found.


getCurrentIssueType

public IssueType getCurrentIssueType()
                              throws java.lang.Exception
Gets the IssueType associated with the information passed around in the query string.

Throws:
java.lang.Exception

setCurrentIssueType

public void setCurrentIssueType(IssueType type)

getNextEntryTemplate

public java.lang.String getNextEntryTemplate(IssueType issueType)
Looks at the current RModuleIssueType and if it is null, returns the users home page. If it is not null, and is dedupe, returns Wizard1...else Wizard3.


getCurrentTemplate

public java.lang.String getCurrentTemplate()
Returns name of current template


getReportingIssue

public Issue getReportingIssue()
                        throws java.lang.Exception
The issue that is currently being entered.

Returns:
an Issue value
Throws:
java.lang.Exception

setReportingIssue

public void setReportingIssue(Issue issue)

setCurrentModule

public void setCurrentModule(Module me)
Sets the current Module


setIssue

public void setIssue(Issue issue)
A Issue object for use within the Scarab API.


getIssue

public Issue getIssue()
               throws java.lang.Exception
Get an Issue object from unique id given either as an intake field or a request parameter keyed with "id".

Returns:
a Issue value
Throws:
java.lang.Exception

getIssue

public Issue getIssue(java.lang.String id)
Takes unique id and returns issue.

Parameters:
id -
Returns:

getIssueIncludingDeleted

public Issue getIssueIncludingDeleted(java.lang.String id)
Returns an issue given its ID, even if it's been deleted or moved.

Parameters:
id -
Returns:

getIssueByPk

public Issue getIssueByPk(java.lang.String key)
The id may only be the issue's primary key.

Parameters:
key - a String value
Returns:
a Issue value

getIssues

public java.util.List getIssues()
                         throws java.lang.Exception
Get a list of Issue objects.

Returns:
a Issue value
Throws:
java.lang.Exception

getIssues

public java.util.List getIssues(java.util.List issueIds)
                         throws java.lang.Exception
Get a list of Issue objects from a list of issue IDs. The list can contain Strings or Integers, but all IDs must be of the same type (String or Integer).

Parameters:
issueIds - a List value
Returns:
a List value
Throws:
java.lang.Exception - if an error occurs

getSessionAttribute

public java.lang.Object getSessionAttribute(java.lang.String key)
                                     throws ScarabException
retrieve an attribute value from the current HttpSession. Throws a ScarabException, if no HttpSession is available. Returns empty String ("") if the Attribute is not available;

Parameters:
key -
Returns:
Throws:
ScarabException

hasSessionAttribute

public boolean hasSessionAttribute(java.lang.String key)
                            throws ScarabException
Check whether the current session has an attribute of given key. If there is no active session available, throw a scarabException. returns true, if attribute exists, otherwise returns false.

Throws:
ScarabException

setSessionAttribute

public boolean setSessionAttribute(java.lang.String key,
                                   java.lang.Object value)
                            throws ScarabException
Place an attribute value into the current HttpSession. Throws a ScarabException, if no HttpSession is available.

Parameters:
key -
value -
Throws:
ScarabException

getScopes

public java.util.List getScopes()
                         throws java.lang.Exception
Get all scopes.

Throws:
java.lang.Exception

getFrequencies

public java.util.List getFrequencies()
                              throws java.lang.Exception
Get all frequencies.

Throws:
java.lang.Exception

getExecuteLink

public java.lang.String getExecuteLink(java.lang.String link,
                                       Query query)
Generates link to Issue List page, re-running stored query.


getEditLink

public java.lang.String getEditLink(java.lang.String link,
                                    Query query)
Generates link to the Query Detail page.


getConditionalIntake

public org.apache.fulcrum.intake.Intake getConditionalIntake(java.lang.String parameter)
                                                      throws java.lang.Exception
Throws:
java.lang.Exception

getNewSearch

public IssueSearch getNewSearch()
                         throws java.lang.Exception,
                                MaxConcurrentSearchException
Get a new IssueSearch object.

Returns:
a Issue value
Throws:
java.lang.Exception
MaxConcurrentSearchException

getPopulatedSearch

public IssueSearch getPopulatedSearch(java.lang.String query)
                               throws java.lang.Exception
Get an IssueSearch object based on a query string.

Returns:
a Issue value
Throws:
java.lang.Exception

getPopulatedSearch

public IssueSearch getPopulatedSearch()
                               throws java.lang.Exception
Get an IssueSearch object based on current query string.

Returns:
a Issue value
Throws:
java.lang.Exception

parseQuery

public org.apache.fulcrum.intake.Intake parseQuery(java.lang.String query)
                                            throws java.lang.Exception
Parses query into intake values.

Throws:
java.lang.Exception

getCurrentSearchResults

public IteratorWithSize getCurrentSearchResults()
Performs search on current query (which is stored in user session).


getCurrentSearchResultsSize

public int getCurrentSearchResultsSize()
Gets the number of results for the current query. Looks first at the URL, then re-queries if size information is missing.


getIssuePosInList

public int getIssuePosInList()
                      throws java.lang.Exception,
                             ScarabException
Returns the issue's position (1-based) in current issue list.

Throws:
java.lang.Exception
ScarabException

getNextIssue

public java.lang.String getNextIssue()
                              throws java.lang.Exception,
                                     ScarabException
Returns next issue id in list.

Throws:
java.lang.Exception
ScarabException

getPrevIssue

public java.lang.String getPrevIssue()
                              throws java.lang.Exception,
                                     ScarabException
Returns previous issue id in list.

Throws:
java.lang.Exception
ScarabException

convertPath

public java.lang.String convertPath(java.lang.String path)
                             throws java.lang.Exception
Convert paths with slashes to commas.

Throws:
java.lang.Exception

getAllIssueTemplates

public java.util.List getAllIssueTemplates(IssueType issueType)
                                    throws java.lang.Exception
Returns all issue templates that are global, Plus those that are personal and created by logged-in user.

Throws:
java.lang.Exception

getPrivateTemplates

public java.util.List getPrivateTemplates(IssueType issueType)
                                   throws java.lang.Exception
Returns templates that are personal and created by logged-in user.

Throws:
java.lang.Exception

getGlobalTemplates

public java.util.List getGlobalTemplates(IssueType issueType)
                                  throws java.lang.Exception
Returns templates that are personal and created by logged-in user.

Throws:
java.lang.Exception

getAllQueries

public java.util.List getAllQueries()
                             throws java.lang.Exception
Returns all queries that are global, Plus those that are personal and created by logged-in user.

Throws:
java.lang.Exception

getPrivateQueries

public java.util.List getPrivateQueries()
                                 throws java.lang.Exception
Returns queries that are personal and created by logged-in user.

Throws:
java.lang.Exception

getUserQueries

public java.util.List getUserQueries()
                              throws java.lang.Exception
Returns queries that are personal and created by logged-in user.

Throws:
java.lang.Exception

getGlobalQueries

public java.util.List getGlobalQueries()
                                throws java.lang.Exception
Returns all queries that are global.

Throws:
java.lang.Exception

getGlobalQueries

public java.util.List getGlobalQueries(Module module)
                                throws java.lang.Exception
Returns all queries global for the module

Throws:
java.lang.Exception

getUserAllQueries

public java.util.List getUserAllQueries()
                                 throws java.lang.Exception
Returns all queries that are global.

Throws:
java.lang.Exception

getReport

public ReportBridge getReport()
                       throws java.lang.Exception
a report helper class

Throws:
java.lang.Exception

setReport

public void setReport(ReportBridge report)

getUserSearchResults

public ScarabPaginatedList getUserSearchResults(MITList mitList,
                                                int pageNum,
                                                int resultsPerPage,
                                                java.lang.String sortColumn,
                                                java.lang.String sortPolarity,
                                                boolean includeCommitters)
                                         throws java.lang.Exception
Full featured, paginated, sorted method for returning the results of user search. Returns all users (no search criteria).

Throws:
java.lang.Exception

getUserFilteredSearchResults

public ScarabPaginatedList getUserFilteredSearchResults(MITList mitList,
                                                        int pageNum,
                                                        int resultsPerPage,
                                                        java.lang.String sortColumn,
                                                        java.lang.String sortPolarity,
                                                        boolean includeCommitters)
                                                 throws java.lang.Exception
Full featured, paginated, sorted version for returning results of a user search.

Throws:
java.lang.Exception

getAttributeSearchResults

public java.util.List getAttributeSearchResults()
                                         throws java.lang.Exception
Return results of attribute search.

Throws:
java.lang.Exception

sortUsers

public java.util.List sortUsers(java.util.List userList)
                         throws java.lang.Exception
Sort users on name or email.

Throws:
java.lang.Exception

sortAttributes

public java.util.List sortAttributes(java.util.List attList)
                              throws java.lang.Exception
Sort attributes on name or description.

Throws:
java.lang.Exception

getPaginatedList

public java.util.List getPaginatedList(java.util.List fullList,
                                       int pgNbr,
                                       int nbrItmsPerPage)
Return a subset of the passed-in list.

Parameters:
nbrItmsPerPage - negative value returns full list

getPaginatedIterator

public IteratorWithSize getPaginatedIterator(IteratorWithSize fullList,
                                             int pgNbr,
                                             int nbrItmsPerPage)
Return a subset of the passed-in list.

Parameters:
nbrItmsPerPage - negative value returns full list

getAdjustedPageNum

public int getAdjustedPageNum()
Checks for a query parameter "oldResultsPerPage" and compares it to the current "resultsPerPage" parameter. If they are different, it returns 1 to avoid returning a value larger than the maximum number of pages; otherwise it returns the value of the query parameter "pageNum". Preferable optimization would be to adjust the page number to keep a set of the old displayed items on the new page.


getNbrPages

public int getNbrPages()
Return the number of paginated pages.


getNextPage

public int getNextPage()
Return the next page in the paginated list.


getPrevPage

public int getPrevPage()
Return the previous page in the paginated list.


getDateFormat

public java.text.DateFormat getDateFormat()
This is used to get the format for a date in the Locale sent by the browser.


getCalendar

public java.util.Calendar getCalendar()
This is used to get the format for a date in the Locale sent by the browser.


hasPermission

public boolean hasPermission(java.lang.String permission)
Determine if the user currently interacting with the scarab application has a permission within the user's currently selected module.

Parameters:
permission - a String permission value, which should be a constant in this interface.
Returns:
true if the permission exists for the user within the current module, false otherwise

hasPermission

public boolean hasPermission(java.lang.String permission,
                             Module module)
Determine if the user currently interacting with the scarab application has a permission within a module.

Parameters:
permission - 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

resetAssociatedUsers

public void resetAssociatedUsers()
                          throws java.lang.Exception
Throws:
java.lang.Exception

resetSelectedUsers

public void resetSelectedUsers()
                        throws java.lang.Exception
Throws:
java.lang.Exception

getGlobalUserSearch

public java.util.List getGlobalUserSearch()
When a user searches for other users (in the ManageUserSearch.vm template for example), the result of this search is stored into the temporary data for that user. This previous result can be retrieved by this method. FIXME: shouldn't this be stored into the cache instead of the temporary data of the user?

Returns:
The list of users of the last user-search.

getPaginatedGlobalUsersList

public ScarabPaginatedList getPaginatedGlobalUsersList