ContentResource
Manages localized content entries in the project's CMS.
- Stable unknown
- Release candidate since 0.1.0-rc.4
- Development since 0.1.0-dev.24+fa54770
public final class ContentResourceManages localized content entries in the project's CMS. Get it from Ovok.content().
Methods
search
public JsonNode search(String type, String language) throws IOException, InterruptedExceptionLists entries of one type in one language (GET /cms/{type}/{language}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asen
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode search(
String type,
String language,
Map<String, ?> parameters) throws IOException, InterruptedExceptionSearches entries of one type in one language (GET /cms/{type}/{language}?...).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenparameters: query parameters
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode search(
String type,
String language,
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionSearches entries of one type in one language (GET /cms/{type}/{language}?...).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenparameters: query parametersoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
retrieve
public JsonNode retrieve(
String type,
String language,
String key) throws IOException, InterruptedExceptionReads one entry (GET /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry key
Returns: the entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(
String type,
String language,
String key,
RequestOptions options) throws IOException, InterruptedExceptionReads one entry (GET /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry keyoptions: per-request options, such as the timeout
Returns: the entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
create
public JsonNode create(
String type,
String language,
Object body) throws IOException, InterruptedExceptionCreates an entry (POST /cms/{type}/{language}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenbody: the entry, serialized as JSON
Returns: the created entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode create(
String type,
String language,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionCreates an entry (POST /cms/{type}/{language}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenbody: the entry, serialized as JSONoptions: per-request options, such as the timeout
Returns: the created entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
update
public JsonNode update(
String type,
String language,
String key,
Object body) throws IOException, InterruptedExceptionReplaces an entry (PUT /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry keybody: the entry, serialized as JSON
Returns: the updated entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode update(
String type,
String language,
String key,
Object body,
RequestOptions options) throws IOException, InterruptedExceptionReplaces an entry (PUT /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry keybody: the entry, serialized as JSONoptions: per-request options, such as the timeout
Returns: the updated entry
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
delete
public void delete(
String type,
String language,
String key) throws IOException, InterruptedExceptionDeletes an entry (DELETE /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry key
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public void delete(
String type,
String language,
String key,
RequestOptions options) throws IOException, InterruptedExceptionDeletes an entry (DELETE /cms/{type}/{language}/{key}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry keyoptions: per-request options, such as the timeout
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
map
public JsonNode map(
String type,
String language,
Map<String, ?> parameters) throws IOException, InterruptedExceptionReads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}?...).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenparameters: query parameters
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode map(String type, String language) throws IOException, InterruptedExceptionReads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asen
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode map(
String type,
String language,
Map<String, ?> parameters,
RequestOptions options) throws IOException, InterruptedExceptionReads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}?...).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenparameters: query parametersoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
copyFromParent
public JsonNode copyFromParent(
String type,
String language,
String key) throws IOException, InterruptedExceptionCopies one entry from the parent project (POST /cms/{type}/{language}/{key}/copy-from-parent-project).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry key
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode copyFromParent(
String type,
String language,
String key,
RequestOptions options) throws IOException, InterruptedExceptionCopies one entry from the parent project (POST /cms/{type}/{language}/{key}/copy-from-parent-project).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenkey: the entry keyoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
copyAllFromParent
public JsonNode copyAllFromParent(
String type,
String language) throws IOException, InterruptedExceptionCopies every entry of one type and language from the parent project (POST /cms/{type}/{language}/copy-from-parent-project).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asen
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
public JsonNode copyAllFromParent(
String type,
String language,
RequestOptions options) throws IOException, InterruptedExceptionCopies every entry of one type and language from the parent project (POST /cms/{type}/{language}/copy-from-parent-project).
Parameters:
type: the content type, such asarticleslanguage: the language code, such asenoptions: per-request options, such as the timeout
Returns: the response body
Throws:
IOException: if the request cannot be sent or the response cannot be readInterruptedException: if the thread is interrupted while waiting for the response
Last updated on