|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.search.SearchRequest
public class SearchRequest
A class representing a Search Request. Sometimes also referred to as a "Saved search", "Saved Filter", "Search Filter". This sits in the session so all non-serializable properties should be transient and accessed through accessors. TODO SearchRequest has traditionally been backed by a collection (so you could have mutliple SP with the same name). Is this intended? I don't really see where this is used & all helper methods (getValues) picks out the first named SP anyway. Not sure if we should remove and enforce a single SR only
Constructor Summary | |
---|---|
SearchRequest(boolean turnOffSecurity)
This constructor should only be used by internal JIRA queries, as the results will be unprotected (ie no permission checks are done). |
|
SearchRequest(electric.xml.Document doc)
Construct a SearchRequest from its XML representation. |
|
SearchRequest(electric.xml.Document doc,
User searcher)
|
|
SearchRequest(org.ofbiz.core.entity.GenericValue gv,
User searcher)
|
|
SearchRequest(SearchRequest oldSearchRequest,
User searcher)
|
|
SearchRequest(User searcher)
|
|
SearchRequest(User searcher,
String name,
String description)
|
Method Summary | |
---|---|
void |
addParameter(SearchParameter parameter)
|
void |
addParameters(Collection searchParams)
|
void |
addSearchSort(SearchSort searchSort)
|
SearchRequest |
cloneSearchRequest()
|
boolean |
equals(Object o)
|
User |
getAuthor()
|
String |
getDescription()
|
String |
getGroup()
|
Long |
getId()
|
List |
getLuceneParameters()
|
String |
getName()
|
SearchParameter |
getParam(String paramName)
Returns the first SearchParameter that matches the given name. |
List |
getParameters()
Returns all the parameters for the search request as a List of SearchParameter |
org.ofbiz.core.entity.GenericValue |
getProject()
Deprecated. since 3.5 (for removal in 3.8). To retrieve the projects that are being searched by a search request check for the existance of ProjectParameter :
SearchParameter projParam = searchRequest.getParam(DocumentConstants.PROJECT_ID)If the projParam is null then all projects are being searched. (TODO Check that this is indeed true). If the param is not null, to retrieve the project ids that are being searched, call: Collection searchedProjectIds = projParam.getValues();searchedProjectIds should be a Collection of Long s. |
String |
getQueryString()
Returns the encoded query string of the current search request |
String |
getQueryStringWithSorts()
Returns the encoded query string of the current search request with sort info |
List |
getReleventSearchers()
|
SearchContext |
getSearchContext()
|
org.ofbiz.core.entity.GenericValue |
getSearchFilterGV()
|
Long |
getSearchFilterId()
|
SearchRequest |
getSearchRequestWithSubstitutions(List substitutions)
This method will return an new instance of a SearchRequest that will have the same parameters as in this SearchRequest except that any parameters listed in the substitutions list will exist in the new SearchRequest in place of any of the same parameters that may have been in this SearchRequest. |
Collection |
getSearchSorts()
|
Collection |
getSearchSortsReverse()
|
String |
getUser()
|
List |
getValues(String paramName)
Returns the values of the first SearchParameter that matches the given name. |
electric.xml.Document |
getXml()
Returns the search request as an XML document |
int |
hashCode()
|
boolean |
isContainsParam(String paramName)
Whether the SR contains this param name |
boolean |
isLoaded()
|
boolean |
isModified()
|
boolean |
isOverRideSecurity()
|
void |
removeParameter(SearchParameter parameter)
This method will remove a parameter by name. |
void |
setAuthor(User author)
|
void |
setDescription(String description)
|
void |
setGroup(String group)
|
void |
setLoaded(boolean loaded)
|
void |
setModified(boolean modified)
|
void |
setName(String name)
|
void |
setSearchContext(SearchContext searchContext)
|
void |
setSearchSorts(Collection searchSorts)
|
void |
setUseColumns(boolean useColumns)
|
void |
setUser(String user)
|
String |
toString()
|
boolean |
useColumns()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SearchRequest(User searcher)
public SearchRequest(User searcher, String name, String description)
public SearchRequest(boolean turnOffSecurity)
turnOffSecurity
- security on/off flagpublic SearchRequest(electric.xml.Document doc)
doc
- DOM document to construct this search request frompublic SearchRequest(electric.xml.Document doc, User searcher)
public SearchRequest(SearchRequest oldSearchRequest, User searcher)
public SearchRequest(org.ofbiz.core.entity.GenericValue gv, User searcher) throws SearchException
SearchException
Method Detail |
---|
public SearchContext getSearchContext()
public void setSearchContext(SearchContext searchContext)
public List getReleventSearchers()
public void addParameter(SearchParameter parameter)
public void addParameters(Collection searchParams)
public void removeParameter(SearchParameter parameter)
parameter
- the type of parameter to remove.public List getParameters()
SearchParameter
SearchParameter
public List getLuceneParameters()
public List getValues(String paramName)
SearchParameter
that matches the given name.
paramName
- name of a the SearchParameter
SearchParameter
foundpublic SearchParameter getParam(String paramName)
SearchParameter
that matches the given name.
paramName
- name of a the SearchParameter
SearchParameter
found else the SearchParameter
itselfpublic boolean isContainsParam(String paramName)
paramName
- name of a the SearchParameter
public String getQueryString()
public String getQueryStringWithSorts()
public SearchRequest getSearchRequestWithSubstitutions(List substitutions)
substitutions
- a list containing SearchParameter objects that will be inserted into the new SearchRequest
object.
public SearchRequest cloneSearchRequest()
public electric.xml.Document getXml()
public void addSearchSort(SearchSort searchSort)
public Collection getSearchSorts()
public void setSearchSorts(Collection searchSorts)
public Collection getSearchSortsReverse()
public String toString()
toString
in class Object
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public org.ofbiz.core.entity.GenericValue getSearchFilterGV()
public org.ofbiz.core.entity.GenericValue getProject()
ProjectParameter
:
SearchParameter projParam = searchRequest.getParam(DocumentConstants.PROJECT_ID)If the projParam is null then all projects are being searched. (TODO Check that this is indeed true). If the param is not null, to retrieve the project ids that are being searched, call:
Collection searchedProjectIds = projParam.getValues();searchedProjectIds should be a
Collection
of Long
s.
GenericValue
representing the project that is being searched, or
null if multiple or all projects are
being searched. Do not use this method, it is evil.public String getName()
public void setName(String name)
public Long getId()
public String getDescription()
public void setDescription(String description)
public User getAuthor()
public void setAuthor(User author)
public Long getSearchFilterId()
public String getUser()
public void setUser(String user)
public String getGroup()
public void setGroup(String group)
public boolean isModified()
public void setModified(boolean modified)
public boolean isLoaded()
public void setLoaded(boolean loaded)
public boolean useColumns()
public void setUseColumns(boolean useColumns)
public boolean isOverRideSecurity()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |