Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find-sites #274

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/cral/api/core/queries.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
[cral.model.core]
[cral.utils.utils :as utils])
(:import (clojure.lang PersistentHashMap)
(cral.model.auth Ticket)))
(cral.model.auth Ticket)
(cral.model.core FindNodesQueryParams
FindSitesQueryParams)))

(defn find-nodes
"Gets a list of nodes that match the given search criteria.
Expand All @@ -37,10 +39,30 @@
- modifiedAt
- createdAt\n\n
More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API#/queries/findNodes)."
[^Ticket ticket ^PersistentHashMap query-params & [^PersistentHashMap opts]]
[^Ticket ticket ^FindNodesQueryParams query-params & [^PersistentHashMap opts]]
(utils/call-rest
client/get
(format "%s/queries/nodes" (config/get-url 'core))
ticket
{:query-params query-params}
opts))

(defn find-sites
"Gets a list of sites that match the given search criteria.
The search term is used to look for sites that match against site id, title or description.
The search term:
- must contain a minimum of 2 alphanumeric characters
- can optionally use '*' for wildcard matching within the term\n\n
The default sort order for the returned list is for sites to be sorted by ascending id.
You can override the default by using the **order-by** parameter. You can specify one or more of the following fields in the **order-by** parameter:
- id
- title
- description\n\n
More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API#/queries/findSites)."
[^Ticket ticket ^FindSitesQueryParams query-params & [^PersistentHashMap opts]]
(utils/call-rest
client/get
(format "%s/queries/sites" (config/get-url 'core))
ticket
{:query-params query-params}
opts))
7 changes: 7 additions & 0 deletions src/cral/model/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@
^PersistentVector order-by
^PersistentVector fields])

(defrecord FindSitesQueryParams
[^String term
^Integer skip-count
^Integer max-items
^PersistentVector order-by
^PersistentVector fields])

;; ratings
(defrecord ListRatingsQueryParams
[^Integer skip-count
Expand Down