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 java.lang.Object
implements SearchRequestManager


Field Summary
(package private)  CustomFieldManager customFieldManager
           
(package private) static SearchProvider provider
           
 
Constructor Summary
SearchRequestManagerImpl(OfBizDelegator delegator, PermissionManager permissionManager, ProjectManager projectManager, CustomFieldManager customFieldManager)
           
 
Method Summary
 SearchRequest create(SearchRequest oldSearchRequest, com.opensymphony.user.User searcher, java.util.Map params)
          Takes a user and a Map of parameters that are used to create a object representation of the search request.
 void createSearchSorts(SearchRequest searchRequest, java.util.Map params)
           
 java.util.Map getCustomFieldParams(java.util.Map params)
          Return a map of CustomFieldId (Long) -> CustomFieldParams
 SearchRequest getRequest(com.opensymphony.user.User searcher, java.lang.Long id)
          Find a search request given the searcher and the search request ID.
 SearchRequest getRequest(com.opensymphony.user.User author, java.lang.String name, com.opensymphony.user.User searcher)
          Find a search request given the author and the request name.
 java.util.List getRequests()
          Retrieves all the SearchRequest GenericValues
 java.util.Collection getRequests(com.opensymphony.user.User author)
          Retrieves all the SearchRequest GenericValues from a particular user
 java.util.List getVisibleRequests(com.opensymphony.user.User user)
          Return a list of all search requests visible to a given user.
 SearchRequest loadByMap(java.util.Map fields, com.opensymphony.user.User searcher)
           
 void remove(com.opensymphony.user.User author, java.lang.Long id)
          Removes the SearchRequest GenericValue from the database based on its id and User
 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

provider

static SearchProvider provider
Constructor Detail

SearchRequestManagerImpl

public SearchRequestManagerImpl(OfBizDelegator delegator,
                                PermissionManager permissionManager,
                                ProjectManager projectManager,
                                CustomFieldManager customFieldManager)
Method Detail

create

public SearchRequest create(SearchRequest oldSearchRequest,
                            com.opensymphony.user.User searcher,
                            java.util.Map params)
Takes a user and a Map of parameters that are used to create a object representation of the search request.

Specified by:
create in interface SearchRequestManager
Parameters:
searcher - The user that is searching
params - The Map of parameters to search for
Returns:

getCustomFieldParams

public java.util.Map getCustomFieldParams(java.util.Map params)
Return a map of CustomFieldId (Long) -> CustomFieldParams

Parameters:
params - A map of customField string params (eg. 'customfield_123:key1' -> 'value1')
Returns:

createSearchSorts

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

getRequests

public java.util.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 java.util.Collection getRequests(com.opensymphony.user.User author)
                                 throws org.ofbiz.core.entity.GenericEntityException
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
Throws:
org.ofbiz.core.entity.GenericEntityException
See Also:
getVisibleRequests(com.opensymphony.user.User)

getRequest

public SearchRequest getRequest(com.opensymphony.user.User author,
                                java.lang.String name,
                                com.opensymphony.user.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(com.opensymphony.user.User searcher,
                                java.lang.Long id)
                         throws org.ofbiz.core.entity.GenericEntityException
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:
org.ofbiz.core.entity.GenericEntityException - If any exceptions occur finding the request

loadByMap

public SearchRequest loadByMap(java.util.Map fields,
                               com.opensymphony.user.User searcher)
                        throws org.ofbiz.core.entity.GenericEntityException
Parameters:
fields -
Returns:
Throws:
org.ofbiz.core.entity.GenericEntityException

getVisibleRequests

public java.util.List getVisibleRequests(com.opensymphony.user.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(com.opensymphony.user.User author,
                   java.lang.Long id)
            throws SearchException
Removes the SearchRequest GenericValue from the database based on its id and User

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


Copyright © 2002-2005 Atlassian. All Rights Reserved.