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 ContentResource

Manages localized content entries in the project's CMS. Get it from Ovok.content().

Methods

public JsonNode search(String type, String language) throws IOException, InterruptedException

Lists entries of one type in one language (GET /cms/{type}/{language}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode search(
        String type,
        String language,
        Map<String, ?> parameters) throws IOException, InterruptedException

Searches entries of one type in one language (GET /cms/{type}/{language}?...).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • parameters: query parameters

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode search(
        String type,
        String language,
        Map<String, ?> parameters,
        RequestOptions options) throws IOException, InterruptedException

Searches entries of one type in one language (GET /cms/{type}/{language}?...).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • parameters: query parameters
  • options: per-request options, such as the timeout

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

retrieve

public JsonNode retrieve(
        String type,
        String language,
        String key) throws IOException, InterruptedException

Reads one entry (GET /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key

Returns: the entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode retrieve(
        String type,
        String language,
        String key,
        RequestOptions options) throws IOException, InterruptedException

Reads one entry (GET /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key
  • options: per-request options, such as the timeout

Returns: the entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

create

public JsonNode create(
        String type,
        String language,
        Object body) throws IOException, InterruptedException

Creates an entry (POST /cms/{type}/{language}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • body: the entry, serialized as JSON

Returns: the created entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode create(
        String type,
        String language,
        Object body,
        RequestOptions options) throws IOException, InterruptedException

Creates an entry (POST /cms/{type}/{language}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • body: the entry, serialized as JSON
  • options: per-request options, such as the timeout

Returns: the created entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

update

public JsonNode update(
        String type,
        String language,
        String key,
        Object body) throws IOException, InterruptedException

Replaces an entry (PUT /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key
  • body: the entry, serialized as JSON

Returns: the updated entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: 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, InterruptedException

Replaces an entry (PUT /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key
  • body: the entry, serialized as JSON
  • options: per-request options, such as the timeout

Returns: the updated entry

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

delete

public void delete(
        String type,
        String language,
        String key) throws IOException, InterruptedException

Deletes an entry (DELETE /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public void delete(
        String type,
        String language,
        String key,
        RequestOptions options) throws IOException, InterruptedException

Deletes an entry (DELETE /cms/{type}/{language}/{key}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key
  • options: per-request options, such as the timeout

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

map

public JsonNode map(
        String type,
        String language,
        Map<String, ?> parameters) throws IOException, InterruptedException

Reads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}?...).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • parameters: query parameters

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode map(String type, String language) throws IOException, InterruptedException

Reads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode map(
        String type,
        String language,
        Map<String, ?> parameters,
        RequestOptions options) throws IOException, InterruptedException

Reads the entries of one type as a key-to-entry map (GET /cms/{type}/map/{language}?...).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • parameters: query parameters
  • options: per-request options, such as the timeout

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

copyFromParent

public JsonNode copyFromParent(
        String type,
        String language,
        String key) throws IOException, InterruptedException

Copies one entry from the parent project (POST /cms/{type}/{language}/{key}/copy-from-parent-project).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode copyFromParent(
        String type,
        String language,
        String key,
        RequestOptions options) throws IOException, InterruptedException

Copies one entry from the parent project (POST /cms/{type}/{language}/{key}/copy-from-parent-project).

Parameters:

  • type: the content type, such as articles
  • language: the language code, such as en
  • key: the entry key
  • options: per-request options, such as the timeout

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

copyAllFromParent

public JsonNode copyAllFromParent(
        String type,
        String language) throws IOException, InterruptedException

Copies 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 as articles
  • language: the language code, such as en

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
public JsonNode copyAllFromParent(
        String type,
        String language,
        RequestOptions options) throws IOException, InterruptedException

Copies 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 as articles
  • language: the language code, such as en
  • options: per-request options, such as the timeout

Returns: the response body

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Last updated on

On this page