Skip to content

Commit

Permalink
Merge pull request #274 from saidone75/dev
Browse files Browse the repository at this point in the history
find-sites
  • Loading branch information
saidone75 authored May 28, 2024
2 parents 7312a06 + a9329e7 commit e0b56af
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
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

0 comments on commit e0b56af

Please sign in to comment.