public class RequestBuilder
extends java.lang.Object
requests
:
Modifier and Type | Method and Description |
---|---|
RequestBuilder |
apiVersion(int version)
Specifies Sitecore Item Web API version.
|
ScRequest<? extends ScResponse> |
build()
Creates
ScRequest with specified parameters. |
RequestBuilder |
byItemId(java.lang.String itemId)
Specifies the ID of the content item.
|
RequestBuilder |
byItemPath(java.lang.String path)
Specifies item path.
|
RequestBuilder |
bySitecoreQuery(java.lang.String query)
Specifies Sitecore Query or Sitecore Fast Query
|
RequestBuilder |
database(java.lang.String database)
Specifies the database that contains the content items.
|
RequestBuilder |
fromSite(java.lang.String site)
Specifies site name for Sitecore site resolving mechanism.
|
RequestBuilder |
itemVersion(int version)
Specifies the version number of the content item.
|
RequestBuilder |
setFields(java.util.Set<java.lang.String> fields)
Specifies set of the fields to return in response.
|
RequestBuilder |
setFields(java.lang.String... fields)
Specifies set of fields to return in response.
|
RequestBuilder |
setLanguage(java.lang.String language)
Specifies the context language for the request.
|
RequestBuilder |
setPage(int pageNumber,
int pageSize)
If the response contains numerous result items, you can use paging to obtain parts
of the whole result set as pages.
|
RequestBuilder |
updateFieldValue(java.lang.String key,
java.lang.String value)
Update field value.
|
RequestBuilder |
withPayloadType(PayloadType payloadType)
Specifies amount of fields to load.
|
RequestBuilder |
withScope(RequestScope scope,
RequestScope... otherScopes)
Specifies the set of the items that you are working with.
|
public RequestBuilder apiVersion(int version)
version
- web api version.public RequestBuilder fromSite(java.lang.String site)
site
- site name.public RequestBuilder byItemPath(java.lang.String path)
path
- item path.public RequestBuilder byItemId(java.lang.String itemId)
itemId
- item ID.public RequestBuilder itemVersion(int version)
By default the latest version is used.
version
- item version.public RequestBuilder database(java.lang.String database)
database
- database name.public RequestBuilder setLanguage(java.lang.String language)
Example : da-DK
.
Default language : default
.
language
- language.public RequestBuilder setFields(java.util.Set<java.lang.String> fields)
fields
- Set
of fields names or IDs.public RequestBuilder setFields(java.lang.String... fields)
fields
- fields names or IDs.public RequestBuilder withPayloadType(PayloadType payloadType)
One of PayloadType
.
payloadType
- PayloadType
of fields payload in response.PayloadType
public RequestBuilder withScope(RequestScope scope, RequestScope... otherScopes)
scope
- scope of items.otherScopes
- extra scopes of items.java.lang.IllegalArgumentException
- if otherScopes
> 2.public RequestBuilder bySitecoreQuery(java.lang.String query)
query
- Sitecore query.java.lang.IllegalStateException
- if query
is already set.public RequestBuilder setPage(int pageNumber, int pageSize)
pageNumber
- number is the index of a given page in a set that starts with 0.pageSize
- page size is the number of the result items that are presented in the page.
Should be greater than 0java.lang.IllegalArgumentException
- if pageNumber
< 0 or pageSize
< 1.public RequestBuilder updateFieldValue(java.lang.String key, java.lang.String value)
CreateItemRequest
and EditItemsRequest
only.key
- field ID or name to updatevalue
- updated field valuepublic ScRequest<? extends ScResponse> build()
ScRequest
with specified parameters.java.lang.IllegalArgumentException
- if request method isn't recognized.