com.atlassian.jira.issue.search
Class SearchRequestManagerImpl

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

public class SearchRequestManagerImpl
extends Object
implements SearchRequestManager


Field Summary
(package private)  CustomFieldManager customFieldManager
           
 
Constructor Summary
SearchRequestManagerImpl(OfBizDelegator delegator, PermissionManager permissionManager, ProjectManager projectManager, CustomFieldManager customFieldManager, 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)
           
 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
 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)
           
 void removeAllFilters(User 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

customFieldManager

final CustomFieldManager customFieldManager
Constructor Detail

SearchRequestManagerImpl

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

create

public 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.

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

createSearchSorts

public void createSearchSorts(SearchRequest searchRequest,
                              Map params)
Specified by:
createSearchSorts in interface SearchRequestManager

getRequests

public List getRequests()
                 throws org.ofbiz.core.entity.GenericEntityException
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)
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:
getVisibleRequests(com.opensymphony.user.User)

getRequest

public 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.

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)
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.
Throws:
DataAccessException - If any exceptions occur finding the request

getSearchRequest

public SearchRequest getSearchRequest(User searcher,
                                      Long id)
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)
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
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
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
Specified by:
update in interface SearchRequestManager
Throws:
org.ofbiz.core.entity.GenericEntityException

remove

public void remove(Long id)
            throws SearchException
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
Specified by:
removeAllFilters in interface SearchRequestManager
Throws:
SearchException

removeAllFilters

public void removeAllFilters(org.ofbiz.core.entity.GenericValue project)
                      throws SearchException
Specified by:
removeAllFilters in interface SearchRequestManager
Throws:
SearchException


Copyright © 2002-2006 Atlassian. All Rights Reserved.