|
1 | 1 | # frozen_string_literal: true |
2 | 2 | module Mediaflux |
3 | 3 | class ProjectListRequest < Request |
4 | | - attr_reader :aql_query, :collection, :action, :deep_search, :iterator, :size |
| 4 | + attr_reader :aql_query, :action, :size |
5 | 5 |
|
6 | 6 | # Constructor |
7 | 7 | # @param session_token [String] the API token for the authenticated session |
8 | 8 | # @param aql_query [String] Optional AQL query string |
9 | | - # @param collection [Integer] Optional collection id |
10 | 9 | # @param action [String] Optional, by default it uses get-name but it could also be get-meta to get all |
11 | 10 | # the fields for the assets or `get-values` to get a limited list of fields. |
12 | | - # @param deep_search [Bool] Optional, false by default. When true queries the collection and it subcollections. |
13 | | - # @param iterator [Bool] Optional, true by default. When true returns an iterator. When false returns a list of results |
14 | | - def initialize(session_token:, aql_query: nil, action: "get-meta", deep_search: true) |
| 11 | + def initialize(session_token:, aql_query: nil, action: "get-meta") |
15 | 12 | super(session_token: session_token) |
16 | 13 | @aql_query = aql_query |
17 | | - @collection = collection |
18 | 14 | @action = action |
19 | | - @deep_search = deep_search |
20 | 15 | # For now we hard-code the size to infinity since only Administrators will fetch a large |
21 | 16 | # number of projects and they should get them all. At some point in the future we might |
22 | 17 | # want to implement pagination for this list but not now.. |
@@ -56,6 +51,11 @@ def build_http_request_body(name:) |
56 | 51 | xml.where aql_query if aql_query.present? |
57 | 52 | xml.action action if action.present? |
58 | 53 | xml.size size if size.present? |
| 54 | + # I tried sorting by path and that slowed down the query to unusable |
| 55 | + # We will need to be considerate of performance when sorting the results |
| 56 | + xml.sort do |
| 57 | + xml.key "name" |
| 58 | + end |
59 | 59 | end |
60 | 60 | end |
61 | 61 | end |
|
0 commit comments