@PublicApi public interface SearchRequestManager extends SharedEntityAccessor<SearchRequest>
SearchRequest
s. SearchRequests encapsulate all information used for searches in the issue navigator.SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor
Modifier and Type | Method and Description |
---|---|
SearchRequest |
create(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
|
void |
delete(Long id)
Removes the SearchRequest GenericValue from the database based on its id
|
List<SearchRequest> |
findByNameIgnoreCase(String name) |
EnclosedIterable<SearchRequest> |
getAll()
Deprecated.
Use
visitAll(Visitor) instead. Since v5.2. |
Collection<SearchRequest> |
getAllOwnedSearchRequests(ApplicationUser user)
Retrieves a collection of SearchRequest objects that a user created.
|
SearchRequest |
getOwnedSearchRequestByName(ApplicationUser author,
String name)
Find a search request given the author and the request name.
|
SearchRequest |
getSearchRequestById(ApplicationUser user,
Long id)
Return the search request as stored in the database if the user has permission to see it.
|
SearchRequest |
getSearchRequestById(Long id)
Return the search request as stored in the database without any permission checks.
|
ApplicationUser |
getSearchRequestOwner(Long id) |
String |
getSearchRequestOwnerUserName(Long id)
Deprecated.
Use
getSearchRequestOwner(Long id) instead. Since v6.0.
Return the owner of the passed SearchRequest. This is mainly used for permission checks. |
EnclosedIterable<SearchRequest> |
getSearchRequests(ApplicationUser searcher,
SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get
sharable entities from a search result filtered
to only those that are shared with the searcher. |
boolean |
hasShareRights(ApplicationUser user,
SearchRequest searchRequest,
ShareRight shareRight)
Checks if provided user has share rights for given search request.
|
SharedEntitySearchResult<SearchRequest> |
search(SharedEntitySearchParameters searchParameters,
ApplicationUser user,
int pagePosition,
int pageWidth)
Search for the SearchRequests that match the passed searchParameters.
|
SearchRequest |
update(ApplicationUser editor,
SearchRequest request)
Updates an existing search request in the database.
|
SearchRequest |
update(SearchRequest request)
Deprecated.
use
update(ApplicationUser, SearchRequest) instead |
void |
visitAll(Visitor<SearchRequestEntity> visitor)
Iterates over all SearchRequests using a Visitor pattern callback.
|
adjustFavouriteCount, get, get, getAllIndexableSharedEntities, getSharedEntity, getSharedEntity, getType, hasPermissionToUse
EnclosedIterable<SearchRequest> getSearchRequests(ApplicationUser searcher, SharedEntityAccessor.RetrievalDescriptor descriptor)
sharable entities
from a search result filtered
to only those that are shared with the searcher.
The entities returned may be modified by the user parameter (e.g. permissions or clause sanitisation).searcher
- the user performing the searchdescriptor
- retrieval descriptorEnclosedIterable
of SharedEntity
'sCollection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser user)
user
- The user who created the SearchRequestsSearchRequest
that user created.SearchRequest getOwnedSearchRequestByName(ApplicationUser author, String name)
author
- The author of the SearchRequestname
- The name of the SearchRequestSearchRequest getSearchRequestById(ApplicationUser user, Long id)
user
- The user to check shares withid
- The id of the filtergetSearchRequestById(Long)
SearchRequest getSearchRequestById(Long id)
id
- The id of the filterEnclosedIterable<SearchRequest> getAll()
visitAll(Visitor)
instead. Since v5.2.WARNING: This method will run horribly slow on systems with a lot of saved filters.
getAll
in interface SharedEntityAccessor<SearchRequest>
EnclosedIterable
of SearchRequestsvoid visitAll(Visitor<SearchRequestEntity> visitor)
List<SearchRequest> findByNameIgnoreCase(String name)
String getSearchRequestOwnerUserName(Long id)
getSearchRequestOwner(Long id)
instead. Since v6.0.
Return the owner of the passed SearchRequest. This is mainly used for permission checks.
id
- the identifier of the SearchRequest.ApplicationUser getSearchRequestOwner(Long id)
SearchRequest create(SearchRequest request)
request
- SearchResult that should be persisted@Deprecated SearchRequest update(SearchRequest request)
update(ApplicationUser, SearchRequest)
insteadrequest
- the request to persistSearchRequest
that was persisted to the database and by default sanitized for the owner of the request.
To change the default behaviour use update(ApplicationUser, SearchRequest)
instead@ExperimentalApi SearchRequest update(ApplicationUser editor, SearchRequest request)
editor
- application user which updates the search requestrequest
- the request to persistSearchRequest
that was persisted to the database and sanitized for the editorvoid delete(Long id)
id
- of the search request to be removed from storageSharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)
search
in interface SharedEntityAccessor<SearchRequest>
searchParameters
- the searchParameters to query.user
- the user performing the search.pagePosition
- the page to return.pageWidth
- the number of results per page.@ExperimentalApi boolean hasShareRights(@Nullable ApplicationUser user, @Nonnull SearchRequest searchRequest, @Nonnull ShareRight shareRight)
user
- user which wants for example view or edit the entitysearchRequest
- search request which permissions and ownership are going to be checkedshareRight
- share right which will be checked if user has itCopyright © 2002-2019 Atlassian. All Rights Reserved.