# CmsResource

Canonical page: https://docs.ovok.com/java-sdk/reference/cms-resource

```java
public final class CmsResource
```

Reads published CMS content for the configured tenant. Get it from [`Ovok.cms()`](/java-sdk/reference/ovok#cms).

## Methods [#methods]

### documents [#documents]

```java
public CmsResource.Documents documents()
```

Returns the generic document routes.

**Returns:** the document routes

### releaseNotes [#releasenotes]

```java
public CmsResource.ReleaseNotes releaseNotes()
```

Returns the release-note routes.

**Returns:** the release-note routes

### legalPage [#legalpage]

```java
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 [#translations]

```java
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 [#cmsresourcedocuments]

```java
public static final class Documents
```

Reads documents from any CMS collection.

### Documents.list [#documentslist]

```java
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 [#documentsretrieve]

```java
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`](/java-sdk/reference/ovok-validation-exception): if the slug is empty

## CmsResource.ReleaseNotes [#cmsresourcereleasenotes]

```java
public static final class ReleaseNotes
```

Reads release notes, newest first.

### ReleaseNotes.list [#releasenoteslist]

```java
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
