|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.tigris.scarab.tools.ScarabRequestTool
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 |
int initialIssueListColumnsSize
java.util.List issueListColumns
java.util.Map attributeTypes
| Constructor Detail |
public ScarabRequestTool()
| Method Detail |
public void init(java.lang.Object data)
init in interface org.apache.turbine.services.pull.ApplicationToolpublic void refresh()
refresh in interface org.apache.turbine.services.pull.ApplicationToolpublic void setAlert(java.lang.Object message)
Alert! message for this request.
message - The alert message to set.public java.lang.Object getAlert()
Alert! message which has been set.
public void setAttachment(Attachment attachment)
public void setAttribute(Attribute attribute)
public void setDepend(Depend depend)
public void setQuery(Query query)
public ROptionOption getROptionOption()
public void setROptionOption(ROptionOption roo)
public void setIssueTemplateInfo(IssueTemplateInfo templateInfo)
public void setIssueType(IssueType issuetype)
public ParentChildAttributeOption getParentChildAttributeOption()
public void setParentChildAttributeOption(ParentChildAttributeOption roo)
public void setAttributeOption(AttributeOption option)
public AttributeOption getAttributeOption()
throws java.lang.Exception
java.lang.Exceptionpublic void setUser(ScarabUser user)
User object for use within the Scarab API,
generally not the user who is logged in.
public ScarabUser getUser()
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.
public ScarabUser getCurrentUser()
public ScarabUser getUser(java.lang.Object id)
throws java.lang.Exception
java.lang.Exception
public ScarabUser getUserByUserName(java.lang.String username)
throws java.lang.Exception
java.lang.Exception
public Attribute getAttribute()
throws java.lang.Exception
Attribute object
(possibly "blank", but never null).
java.lang.Exception
public Attribute getAttribute(java.lang.Integer pk)
throws java.lang.Exception
java.lang.Exception
public AttributeOption getAttributeOption(java.lang.Integer pk)
throws java.lang.Exception
java.lang.Exception
public AttributeOption getAttributeOption(java.lang.String key)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.List getRModuleUserAttributes()
public java.util.List getValidIssueListAttributes()
public java.util.List getAllValidIssueListAttributes()
public java.util.List getIssueListAttributes(boolean validOnly,
boolean commonOnly)
public Query getQuery()
throws java.lang.Exception
java.lang.Exception
public IssueTemplateInfo getIssueTemplateInfo()
throws java.lang.Exception
java.lang.Exception
public Issue getIssueTemplate()
throws java.lang.Exception
java.lang.Exception
public Issue getIssueTemplate(java.lang.String templateId)
throws java.lang.Exception
java.lang.Exception
public Depend getDepend()
throws java.lang.Exception
java.lang.Exception
public Attachment getAttachment()
throws java.lang.Exception
java.lang.Exception
public AttributeGroup getAttributeGroup()
throws java.lang.Exception
java.lang.Exceptionpublic AttributeGroup getAttributeGroup(java.lang.String key)
public IssueType getIssueType(java.lang.String key)
key - a String value
IssueType value
public IssueType getIssueType()
throws java.lang.Exception
java.lang.Exception
public AttributeValue getNewAttributeValue(Attribute attribute,
Issue issue)
throws java.lang.Exception
java.lang.Exception
public RModuleAttribute getRModuleAttribute()
throws java.lang.Exception
Module value
java.lang.Exceptionpublic void setModule(Module module)
public Module getModule()
throws java.lang.Exception
Module value
java.lang.Exceptionpublic Module getModule(java.lang.String key)
key - a String value
Module valuepublic Module getCurrentModule()
public IssueType getCurrentIssueType()
throws java.lang.Exception
java.lang.Exceptionpublic void setCurrentIssueType(IssueType type)
public java.lang.String getNextEntryTemplate(IssueType issueType)
public java.lang.String getCurrentTemplate()
public Issue getReportingIssue()
throws java.lang.Exception
Issue value
java.lang.Exceptionpublic void setReportingIssue(Issue issue)
public void setCurrentModule(Module me)
public void setIssue(Issue issue)
public Issue getIssue()
throws java.lang.Exception
Issue value
java.lang.Exceptionpublic Issue getIssue(java.lang.String id)
id -
public Issue getIssueIncludingDeleted(java.lang.String id)
id -
public Issue getIssueByPk(java.lang.String key)
key - a String value
Issue value
public java.util.List getIssues()
throws java.lang.Exception
Issue value
java.lang.Exception
public java.util.List getIssues(java.util.List issueIds)
throws java.lang.Exception
issueIds - a List value
List value
java.lang.Exception - if an error occurs
public java.lang.Object getSessionAttribute(java.lang.String key)
throws ScarabException
key -
ScarabException
public boolean hasSessionAttribute(java.lang.String key)
throws ScarabException
ScarabException
public boolean setSessionAttribute(java.lang.String key,
java.lang.Object value)
throws ScarabException
key - value -
ScarabException
public java.util.List getScopes()
throws java.lang.Exception
java.lang.Exception
public java.util.List getFrequencies()
throws java.lang.Exception
java.lang.Exception
public java.lang.String getExecuteLink(java.lang.String link,
Query query)
public java.lang.String getEditLink(java.lang.String link,
Query query)
public org.apache.fulcrum.intake.Intake getConditionalIntake(java.lang.String parameter)
throws java.lang.Exception
java.lang.Exception
public IssueSearch getNewSearch()
throws java.lang.Exception,
MaxConcurrentSearchException
Issue value
java.lang.Exception
MaxConcurrentSearchException
public IssueSearch getPopulatedSearch(java.lang.String query)
throws java.lang.Exception
Issue value
java.lang.Exception
public IssueSearch getPopulatedSearch()
throws java.lang.Exception
Issue value
java.lang.Exception
public org.apache.fulcrum.intake.Intake parseQuery(java.lang.String query)
throws java.lang.Exception
java.lang.Exceptionpublic IteratorWithSize getCurrentSearchResults()
public int getCurrentSearchResultsSize()
public int getIssuePosInList()
throws java.lang.Exception,
ScarabException
java.lang.Exception
ScarabException
public java.lang.String getNextIssue()
throws java.lang.Exception,
ScarabException
java.lang.Exception
ScarabException
public java.lang.String getPrevIssue()
throws java.lang.Exception,
ScarabException
java.lang.Exception
ScarabException
public java.lang.String convertPath(java.lang.String path)
throws java.lang.Exception
java.lang.Exception
public java.util.List getAllIssueTemplates(IssueType issueType)
throws java.lang.Exception
java.lang.Exception
public java.util.List getPrivateTemplates(IssueType issueType)
throws java.lang.Exception
java.lang.Exception
public java.util.List getGlobalTemplates(IssueType issueType)
throws java.lang.Exception
java.lang.Exception
public java.util.List getAllQueries()
throws java.lang.Exception
java.lang.Exception
public java.util.List getPrivateQueries()
throws java.lang.Exception
java.lang.Exception
public java.util.List getUserQueries()
throws java.lang.Exception
java.lang.Exception
public java.util.List getGlobalQueries()
throws java.lang.Exception
java.lang.Exception
public java.util.List getGlobalQueries(Module module)
throws java.lang.Exception
java.lang.Exception
public java.util.List getUserAllQueries()
throws java.lang.Exception
java.lang.Exception
public ReportBridge getReport()
throws java.lang.Exception
java.lang.Exceptionpublic void setReport(ReportBridge report)
public ScarabPaginatedList getUserSearchResults(MITList mitList,
int pageNum,
int resultsPerPage,
java.lang.String sortColumn,
java.lang.String sortPolarity,
boolean includeCommitters)
throws java.lang.Exception
java.lang.Exception
public ScarabPaginatedList getUserFilteredSearchResults(MITList mitList,
int pageNum,
int resultsPerPage,
java.lang.String sortColumn,
java.lang.String sortPolarity,
boolean includeCommitters)
throws java.lang.Exception
java.lang.Exception
public java.util.List getAttributeSearchResults()
throws java.lang.Exception
java.lang.Exception
public java.util.List sortUsers(java.util.List userList)
throws java.lang.Exception
java.lang.Exception
public java.util.List sortAttributes(java.util.List attList)
throws java.lang.Exception
java.lang.Exception
public java.util.List getPaginatedList(java.util.List fullList,
int pgNbr,
int nbrItmsPerPage)
nbrItmsPerPage - negative value returns full list
public IteratorWithSize getPaginatedIterator(IteratorWithSize fullList,
int pgNbr,
int nbrItmsPerPage)
nbrItmsPerPage - negative value returns full listpublic int getAdjustedPageNum()
public int getNbrPages()
public int getNextPage()
public int getPrevPage()
public java.text.DateFormat getDateFormat()
public java.util.Calendar getCalendar()
public boolean hasPermission(java.lang.String permission)
permission - a String permission value, which should
be a constant in this interface.
public boolean hasPermission(java.lang.String permission,
Module module)
permission - a String permission value, which should
be a constant in this interface.module - a Module value
public void resetAssociatedUsers()
throws java.lang.Exception
java.lang.Exception
public void resetSelectedUsers()
throws java.lang.Exception
java.lang.Exceptionpublic java.util.List getGlobalUserSearch()
public ScarabPaginatedList getPaginatedGlobalUsersList