com.atlassian.jira.issue.search
Class SearchRequestManagerImpl

java.lang.Object
  extended by com.atlassian.jira.issue.search.SearchRequestManagerImpl
All Implemented Interfaces:
SearchRequestManager

public class SearchRequestManagerImpl
extends Object
implements SearchRequestManager


Constructor Summary
SearchRequestManagerImpl(OfBizDelegator delegator, PermissionManager permissionManager, ProjectManager projectManager, IssueSearcherManager issueSearcherManager, ColumnLayoutManager columnLayoutManager, SubscriptionManager SubscriptionManager)
           
 
Method Summary
 SearchRequest create(SearchRequest oldSearchRequest, User searchUser, FieldValuesHolder fieldValuesHolder, 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
 SearchRequest loadByMap(Map fields, User 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchRequestManagerImpl

public SearchRequestManagerImpl(OfBizDelegator delegator,
                                PermissionManager permissionManager,
                                ProjectManager projectManager,
                                IssueSearcherManager issueSearcherManager,
                                ColumnLayoutManager columnLayoutManager,
                                SubscriptionManager SubscriptionManager)
Method Detail

create

public SearchRequest create(SearchRequest oldSearchRequest,
                            User searchUser,
                            FieldValuesHolder fieldValuesHolder,
                            SearchContext searchContext)
Description copied from interface: SearchRequestManager
Takes a user and a FieldValuesHolder of parameters that are used to create a object representation of the search request.

Specified by:
create in interface SearchRequestManager
searchUser - The user that is searching
fieldValuesHolder - 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

public SearchRequest getSearchRequestWithSearchSorts(Map parameterMap,
                                                     User searchUser)
Description copied from interface: SearchRequestManager
Takes a user and a Map of request parameters that are used to create a object representation of the search request.

Specified by:
getSearchRequestWithSearchSorts in interface SearchRequestManager
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

public void createSearchSorts(SearchRequest searchRequest,
                              Map params)
Description copied from interface: SearchRequestManager
Adds SearchSort parameters to the searchRequest, to specify ordering and sorting of results.

Specified by:
createSearchSorts in interface SearchRequestManager

getRequests

public List getRequests()
                 throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: SearchRequestManager
Retrieves all the SearchRequest GenericValues

Specified by:
getRequests in interface SearchRequestManager
Returns:
Returns a list of searchRequest GenericValues
Throws:
org.ofbiz.core.entity.GenericEntityException

getRequests

public Collection getRequests(User author)
Description copied from interface: SearchRequestManager
Retrieves all the SearchRequest GenericValues from a particular user

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

getRequest

public SearchRequest getRequest(User author,
                                String name,
                                User searcher)
                         throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: SearchRequestManager
Find a search request given the author and the request name.

Specified by:
getRequest in interface SearchRequestManager
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

public SearchRequest getRequest(User searcher,
                                Long id)
Description copied from interface: SearchRequestManager
Find a search request given the searcher and the search request ID.

Specified by:
getRequest in interface SearchRequestManager
Returns:
The SearchRequest, or null if there is no matching request for this searcher.

getSearchRequest

public SearchRequest getSearchRequest(User searcher,
                                      Long id)
Description copied from interface: SearchRequestManager
Return the search request as stored in the database

Specified by:
getSearchRequest in interface SearchRequestManager
Returns:
The SearchRequest, or null if the request id does not exist

isRequestPrivate

public boolean isRequestPrivate(User searcher,
                                Long id)
Description copied from interface: SearchRequestManager
Determine whether the search request is a private filter to the searcher

Specified by:
isRequestPrivate in interface SearchRequestManager
Returns:
boolean of whether the request is private or not

loadByMap

public SearchRequest loadByMap(Map fields,
                               User searcher)
                        throws org.ofbiz.core.entity.GenericEntityException
Parameters:
fields -
Throws:
org.ofbiz.core.entity.GenericEntityException

getVisibleRequests

public List getVisibleRequests(User user)
                        throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: SearchRequestManager
Return a list of all search requests visible to a given user.

Specified by:
getVisibleRequests in interface SearchRequestManager
Parameters:
user - The user to find search requests for
Returns:
A list of visible search requests
Throws:
org.ofbiz.core.entity.GenericEntityException

save

public org.ofbiz.core.entity.GenericValue save(SearchRequest request)
                                        throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: SearchRequestManager
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

Specified by:
save in interface SearchRequestManager
Parameters:
request - SearchResult that should be persisted
Returns:
GenericValue object that was persisted to the database
Throws:
org.ofbiz.core.entity.GenericEntityException

update

public org.ofbiz.core.entity.GenericValue update(SearchRequest request)
                                          throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: SearchRequestManager
Updates an existing search request in the database.

Specified by:
update in interface SearchRequestManager
Returns:
A GenericValue object that was persisted to the database
Throws:
org.ofbiz.core.entity.GenericEntityException

remove

public void remove(Long id)
            throws SearchException
Description copied from interface: SearchRequestManager
Removes the SearchRequest GenericValue from the database based on its id

Specified by:
remove in interface SearchRequestManager
Parameters:
id - of the search request to be removed from storage
Throws:
SearchException

removeAllFilters

public void removeAllFilters(User author)
                      throws SearchException
Description copied from interface: SearchRequestManager
Remove all filters owned by a particular author.

Specified by:
removeAllFilters in interface SearchRequestManager
Throws:
SearchException

removeAllFilters

public void removeAllFilters(org.ofbiz.core.entity.GenericValue project)
                      throws SearchException
Description copied from interface: SearchRequestManager
Remove all filters related to a particular project. This is useful when deleting a project.

Specified by:
removeAllFilters in interface SearchRequestManager
Throws:
SearchException


Copyright © 2002-2007 Atlassian. All Rights Reserved.