CmsResource

Reads published CMS content for the configured tenant.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.24+fa54770
public final class CmsResource

Reads published CMS content for the configured tenant. Get it from Ovok.cms().

Methods

documents

public CmsResource.Documents documents()

Returns the generic document routes.

Returns: the document routes

releaseNotes

public CmsResource.ReleaseNotes releaseNotes()

Returns the release-note routes.

Returns: the release-note routes

legalPage

public JsonNode legalPage(
        String slug,
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Reads a legal page (GET /v1/public/cms/collections/legal-pages/items/{slug}).

Parameters:

  • slug: the page slug
  • params: locale, page, limit and sort
  • 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

translations

public JsonNode translations(
        String locale,
        RequestOptions options) throws IOException, InterruptedException

Reads every translation document for a locale and merges them into one key tree.

Parameters:

  • locale: the locale, such as de; unsupported locales fall back to en
  • options: per-request options, such as the timeout

Returns: the translations, keyed by document slug then key path

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

CmsResource.Documents

public static final class Documents

Reads documents from any CMS collection.

Documents.list

public Page<JsonNode> list(
        String collection,
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Lists documents in a collection (GET /v1/public/cms/collections/{collection}/items).

Parameters:

  • collection: the CMS collection slug
  • params: locale, page, limit and sort
  • options: per-request options, such as the timeout

Returns: the first page; iterating it loads the next pages

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

Documents.retrieve

public JsonNode retrieve(
        String collection,
        String slug,
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Reads one document (GET /v1/public/cms/collections/{collection}/items/{slug}).

Parameters:

  • collection: the CMS collection slug
  • slug: the document slug
  • params: locale, page, limit and sort
  • 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
  • OvokValidationException: if the slug is empty

CmsResource.ReleaseNotes

public static final class ReleaseNotes

Reads release notes, newest first.

ReleaseNotes.list

public Page<JsonNode> list(
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Lists release notes, newest first unless sort is given.

Parameters:

  • params: locale, page, limit and sort
  • options: per-request options, such as the timeout

Returns: the first page; iterating it loads the next pages

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