Skip to content

Commit

Permalink
get-version-rendition-content
Browse files Browse the repository at this point in the history
  • Loading branch information
saidone75 committed Jun 27, 2024
1 parent 3832641 commit 6e10926
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/cral/api/core/versions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
(:import (clojure.lang PersistentHashMap PersistentVector)
(cral.model.auth Ticket)
(cral.model.core GetVersionContentQueryParams
ListVersionHistoryQueryParams
GetVersionRenditionContentQueryParams ListVersionHistoryQueryParams
ListVersionRenditionsQueryParams
RevertVersionBody
RevertVersionQueryParams)))
Expand Down Expand Up @@ -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))
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))))
6 changes: 5 additions & 1 deletion src/cral/model/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,8 @@
[^String id])

(defrecord ListVersionRenditionsQueryParams
[^String where])
[^String where])

(defrecord GetVersionRenditionContentQueryParams
[^Boolean attachment
^Boolean placeholder])

0 comments on commit 6e10926

Please sign in to comment.