diff --git a/src/cral/api/core/versions.clj b/src/cral/api/core/versions.clj index aa5d45b..fafac04 100644 --- a/src/cral/api/core/versions.clj +++ b/src/cral/api/core/versions.clj @@ -23,7 +23,7 @@ (:import (clojure.lang PersistentHashMap PersistentVector) (cral.model.auth Ticket) (cral.model.core GetVersionContentQueryParams - ListVersionHistoryQueryParams + GetVersionRenditionContentQueryParams ListVersionHistoryQueryParams ListVersionRenditionsQueryParams RevertVersionBody RevertVersionQueryParams))) @@ -158,4 +158,18 @@ (format "%s/nodes/%s/versions/%s/renditions/%s" (config/get-url 'core) node-id version-id rendition-id) ticket {:query-params nil} - opts)) \ No newline at end of file + opts)) + +(defn get-version-rendition-content + "Gets the rendition content for `rendition-id` of version of file `node-id` and `version-id`.\\ + More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API#/versions/getVersionRenditionContent)." + ([^Ticket ticket ^String node-id ^String version-id ^String rendition-id] + (get-version-rendition-content ticket node-id version-id rendition-id nil)) + ([^Ticket ticket ^String node-id ^String version-id ^String rendition-id ^GetVersionRenditionContentQueryParams query-params & [^PersistentHashMap opts]] + (utils/call-rest + client/get + (format "%s/nodes/%s/versions/%s/renditions/%s/content" (config/get-url 'core) node-id version-id rendition-id) + ticket + {:as :byte-array + :query-params query-params} + (merge {:return-headers true} opts)))) \ No newline at end of file diff --git a/src/cral/model/core.clj b/src/cral/model/core.clj index 309bcb5..9b50885 100644 --- a/src/cral/model/core.clj +++ b/src/cral/model/core.clj @@ -699,4 +699,8 @@ [^String id]) (defrecord ListVersionRenditionsQueryParams - [^String where]) \ No newline at end of file + [^String where]) + +(defrecord GetVersionRenditionContentQueryParams + [^Boolean attachment + ^Boolean placeholder]) \ No newline at end of file