Package com.oracle.content.sdk.request
Class SearchAssetsRequest
java.lang.Object
com.oracle.content.sdk.request.core.ContentRequest<T,C>
com.oracle.content.sdk.request.core.PaginatedListRequest<SearchAssetsRequest,AssetSearchResult>
com.oracle.content.sdk.request.SearchAssetsRequest
public class SearchAssetsRequest
extends PaginatedListRequest<SearchAssetsRequest,AssetSearchResult>
Request class used to search for a content item request based on specific search criteria.
Below is an example that searches for items up to 'searchLimit' number of items that match
the content type 'searchType' and sorts the results by the 'name' field.
// this shows how to build a search request
SearchAssetsRequest searchRequest = new SearchAssetsRequest(deliveryClient)
.limit(20) // maximum results to return
.sortByField("name") // field used to sort results
.type("mycontenttype"); // content type to search for
-
Field Summary
FieldsFields inherited from class com.oracle.content.sdk.request.core.PaginatedListRequest
expand, fields, includeTotalCount, limit, offset, sortByField, sortOrderDescending
Fields inherited from class com.oracle.content.sdk.request.core.ContentRequest
client, links, objectClass
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct request to search for content items. -
Method Summary
Modifier and TypeMethodDescriptionClear all filters.defaultQuery
(String defaultQuery) The "default" query string specified for the REST callfieldEquals
(String fieldName, String fieldValue) Filter results to specified field equal to the valuefieldMatchesList
(String fieldName, List<String> list) Add filter criteria for field and value list.Specify the search filter to apply when searching for items with a SCIM string.retrofit2.Call<com.google.gson.JsonElement>
getCall()
Get retrofit call to use for search requestFilter results to list of specific idsFilter results to specified languageFilter results to specified item nameFilter results to list of specific namestaxonomyCategoryNodeIds
(List<String> nodeIdList) Filter results to list of taxonomy category node ids.Forms a simple filter that searches by type that matches the "type" parameter.Filter results to list of content types.Methods inherited from class com.oracle.content.sdk.request.core.PaginatedListRequest
expand, expand, expandAll, fields, fields, fieldsAll, getOrderByParam, limit, offset, sortByField, sortOrderDescending, totalResults
Methods inherited from class com.oracle.content.sdk.request.core.ContentRequest
deserializeObject, fetch, fetchAsync, fetchResult, getCacheControl, getThis, gson, links, linksNone, noCache, observable, observableResult
-
Field Details
-
filter
-
-
Constructor Details
-
SearchAssetsRequest
Construct request to search for content items.- Parameters:
client
- Valid delivery client
-
-
Method Details
-
filter
Specify the search filter to apply when searching for items with a SCIM string. For example:type eq "Blog"
would only return items that match a type of "Blog". In general the most common methods for filtering should be provided by methods such astype(java.lang.String)
, etc. But if a query filter is not provided you can pass in your own as a string. It is recommended to use the helper builderSearchQueryBuilder
to construct the string.- Parameters:
filter
- Search criteria filter- Returns:
- this
-
type
Forms a simple filter that searches by type that matches the "type" parameter.- Parameters:
type
- TypeName to match- Returns:
- this
-
defaultQuery
The "default" query string specified for the REST call- Parameters:
defaultQuery
- default query string- Returns:
- this
-
typeList
Filter results to list of content types.- Parameters:
contentTypeList
- list of content type names to filter by- Returns:
- this
-
idList
Filter results to list of specific ids- Parameters:
idList
- list of ids to filter by- Returns:
- this
-
nameList
Filter results to list of specific names- Parameters:
nameList
- list of names to filter by- Returns:
- this
-
fieldMatchesList
Add filter criteria for field and value list. For example, orFieldList("name", {"a","b","c"}) would add a filter in the form of (a OR b OR c)- Parameters:
fieldName
- field name to matchlist
- list of values to use- Returns:
- this
-
clearFilter
Clear all filters.- Returns:
- this
-
name
Filter results to specified item name- Parameters:
name
- Name to search for- Returns:
- this
-
fieldEquals
Filter results to specified field equal to the value- Parameters:
fieldName
- Field name to testfieldValue
- Field value expected- Returns:
- this
-
language
Filter results to specified language- Parameters:
language
- Language (e.g. "fr", "en-US") filter- Returns:
- this
-
taxonomyCategoryNodeIds
Filter results to list of taxonomy category node ids.- Parameters:
nodeIdList
- list of taxonomy category node ids- Returns:
- this
-
getCall
public retrofit2.Call<com.google.gson.JsonElement> getCall()Get retrofit call to use for search request- Specified by:
getCall
in classContentRequest<SearchAssetsRequest,
AssetSearchResult> - Returns:
- return the retrofit call object to use for this request
-