com.atlassian.jira.issue.search
Interface SearchRequestManager

All Known Implementing Classes:
SearchRequestManagerImpl

public interface SearchRequestManager

This manager is reponsible for SearchRequests. SearchRequests encapsulate all information used for searches in the issue navigator.


Method Summary
 SearchRequest create(SearchRequest oldSearchRequest, User searchUser, FieldValuesHolder params, SearchContext searchContext)
          Takes a user and a FieldValuesHolder of parameters that are used to create a object representation of the search request.
 void createSearchSorts(SearchRequest searchRequest, Map params)
          Adds SearchSort parameters to the searchRequest, to specify ordering and sorting of results.
 SearchRequest getRequest(User searcher, Long id)
          Find a search request given the searcher and the search request ID.
 SearchRequest getRequest(User author, String name, User searcher)
          Find a search request given the author and the request name.
 List getRequests()
          Retrieves all the SearchRequest GenericValues
 Collection getRequests(User author)
          Retrieves all the SearchRequest GenericValues from a particular user
 SearchRequest getSearchRequest(User searcher, Long id)
          Return the search request as stored in the database
 SearchRequest getSearchRequestWithSearchSorts(Map parameterMap, User searchUser)
          Takes a user and a Map of request parameters that are used to create a object representation of the search request.
 List getVisibleRequests(User user)
          Return a list of all search requests visible to a given user.
 boolean isRequestPrivate(User searcher, Long id)
          Determine whether the search request is a private filter to the searcher
 void remove(Long id)
          Removes the SearchRequest GenericValue from the database based on its id
 void removeAllFilters(org.ofbiz.core.entity.GenericValue project)
          Remove all filters related to a particular project.
 void removeAllFilters(User author)
          Remove all filters owned by a particular author.
 org.ofbiz.core.entity.GenericValue save(SearchRequest request)
          Takes a searchrequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the details
 org.ofbiz.core.entity.GenericValue update(SearchRequest request)
          Updates an existing search request in the database.
 

Method Detail

create

SearchRequest create(SearchRequest oldSearchRequest,
                     User searchUser,
                     FieldValuesHolder params,
                     SearchContext searchContext)
Takes a user and a FieldValuesHolder of parameters that are used to create a object representation of the search request.

Parameters:
searchUser - The user that is searching
params - parameters to search for. Must not be null
searchContext - the search context. Used to determined available searchers. If it's null, a Global search context will be used

getSearchRequestWithSearchSorts

SearchRequest getSearchRequestWithSearchSorts(Map parameterMap,
                                              User searchUser)
Takes a user and a Map of request parameters that are used to create a object representation of the search request.

Parameters:
parameterMap - Generally this will be obtained by calling ServletRequest.getParameterMap()
searchUser - The user that is searching
Returns:
A search request representing the parameters that were passed

createSearchSorts

void createSearchSorts(SearchRequest searchRequest,
                       Map params)
Adds SearchSort parameters to the searchRequest, to specify ordering and sorting of results.

Parameters:
searchRequest -
params -

getRequests

List getRequests()
                 throws org.ofbiz.core.entity.GenericEntityException
Retrieves all the SearchRequest GenericValues

Returns:
Returns a list of searchRequest GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getRequests

Collection getRequests(User author)
Retrieves all the SearchRequest GenericValues from a particular user

Parameters:
author - to retrieve all the SearchRequests for
Returns:
Returns a list of searchRequest GenericValues. Empty list if none exists
See Also:
getVisibleRequests(com.opensymphony.user.User)

getRequest

SearchRequest getRequest(User author,
                         String name,
                         User searcher)
                         throws org.ofbiz.core.entity.GenericEntityException
Find a search request given the author and the request name.

Returns:
The SearchRequest, or null if there is no matching request
Throws:
org.ofbiz.core.entity.GenericEntityException - If any exceptions occur finding the request

getRequest

SearchRequest getRequest(User searcher,
                         Long id)
Find a search request given the searcher and the search request ID.

Returns:
The SearchRequest, or null if there is no matching request for this searcher.
Throws:
DataAccessException - If any exceptions occur finding the request

getSearchRequest

SearchRequest getSearchRequest(User searcher,
                               Long id)
Return the search request as stored in the database

Returns:
The SearchRequest, or null if the request id does not exist

isRequestPrivate

boolean isRequestPrivate(User searcher,
                         Long id)
Determine whether the search request is a private filter to the searcher

Returns:
boolean of whether the request is private or not

getVisibleRequests

List getVisibleRequests(User user)
                        throws org.ofbiz.core.entity.GenericEntityException
Return a list of all search requests visible to a given user.

Parameters:
user - The user to find search requests for
Returns:
A list of visible search requests
Throws:
org.ofbiz.core.entity.GenericEntityException

save

org.ofbiz.core.entity.GenericValue save(SearchRequest request)
                                        throws org.ofbiz.core.entity.GenericEntityException
Takes a searchrequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the details

Parameters:
request - SearchResult that should be persisted
Returns:
GenericValue object that was persisted to the database
Throws:
org.ofbiz.core.entity.GenericEntityException

update

org.ofbiz.core.entity.GenericValue update(SearchRequest request)
                                          throws org.ofbiz.core.entity.GenericEntityException
Updates an existing search request in the database.

Parameters:
request -
Returns:
A GenericValue object that was persisted to the database
Throws:
org.ofbiz.core.entity.GenericEntityException

remove

void remove(Long id)
            throws SearchException
Removes the SearchRequest GenericValue from the database based on its id

Parameters:
id - of the search request to be removed from storage
Throws:
SearchException

removeAllFilters

void removeAllFilters(User author)
                      throws SearchException
Remove all filters owned by a particular author.

Parameters:
author -
Throws:
SearchException

removeAllFilters

void removeAllFilters(org.ofbiz.core.entity.GenericValue project)
                      throws SearchException
Remove all filters related to a particular project. This is useful when deleting a project.

Parameters:
project -
Throws:
SearchException


Copyright © 2002-2007 Atlassian. All Rights Reserved.