Class: AlfrescoAPI::QueriesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/alfresco_api/api/queries_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ QueriesApi

Returns a new instance of QueriesApi.



19
20
21
# File 'lib/alfresco_api/api/queries_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/alfresco_api/api/queries_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#find_nodes(term, opts = {}) ⇒ NodePaging

Find nodes Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of nodes that match the given search criteria. The search term is used to look for nodes that match against name, title, description, full text content or tags. The search term: - must contain a minimum of 3 alphanumeric characters - allows "quoted term" - can optionally use ‘*’ for wildcard matching By default, file and folder types will be searched unless a specific type is provided as a query parameter. By default, the search will be across the repository unless a specific root node id is provided to start the search from. You can sort the result list using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * name * modifiedAt * createdAt

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :root_node_id (String)

    The id of the node to start the search from. Supports the aliases -my-, -root- and -shared-.

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :node_type (String)

    Restrict the returned results to only those of the given node type and its sub-types

  • :include (Array<String>)

    Returns additional information about the node. The following optional fields can be requested: * allowableOperations * aspectNames * isLink * isLocked * path * properties

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



35
36
37
38
# File 'lib/alfresco_api/api/queries_api.rb', line 35

def find_nodes(term, opts = {})
  data, _status_code, _headers = find_nodes_with_http_info(term, opts)
  return data
end

#find_nodes_with_http_info(term, opts = {}) ⇒ Array<(NodePaging, Fixnum, Hash)>

Find nodes Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of nodes that match the given search criteria. The search term is used to look for nodes that match against name, title, description, full text content or tags. The search term: - must contain a minimum of 3 alphanumeric characters - allows &quot;quoted term&quot; - can optionally use &#39;*&#39; for wildcard matching By default, file and folder types will be searched unless a specific type is provided as a query parameter. By default, the search will be across the repository unless a specific root node id is provided to start the search from. You can sort the result list using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * name * modifiedAt * createdAt

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :root_node_id (String)

    The id of the node to start the search from. Supports the aliases -my-, -root- and -shared-.

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :node_type (String)

    Restrict the returned results to only those of the given node type and its sub-types

  • :include (Array<String>)

    Returns additional information about the node. The following optional fields can be requested: * allowableOperations * aspectNames * isLink * isLocked * path * properties

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(NodePaging, Fixnum, Hash)>)

    NodePaging data, response status code and response headers



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/alfresco_api/api/queries_api.rb', line 52

def find_nodes_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: QueriesApi.find_nodes ..."
  end
  # verify the required parameter 'term' is set
  if @api_client.config.client_side_validation && term.nil?
    fail ArgumentError, "Missing the required parameter 'term' when calling QueriesApi.find_nodes"
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling QueriesApi.find_nodes, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling QueriesApi.find_nodes, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/queries/nodes"

  # query parameters
  query_params = {}
  query_params[:'term'] = term
  query_params[:'rootNodeId'] = opts[:'root_node_id'] if !opts[:'root_node_id'].nil?
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'nodeType'] = opts[:'node_type'] if !opts[:'node_type'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'NodePaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: QueriesApi#find_nodes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#find_people(term, opts = {}) ⇒ PersonPaging

Find people Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of people that match the given search criteria. The search term is used to look for matches against person id, firstname and lastname. The search term: - must contain a minimum of 2 alphanumeric characters - can optionally use ‘*’ for wildcard matching within the term You can sort the result list using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * firstName * lastName

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

Returns:



117
118
119
120
# File 'lib/alfresco_api/api/queries_api.rb', line 117

def find_people(term, opts = {})
  data, _status_code, _headers = find_people_with_http_info(term, opts)
  return data
end

#find_people_with_http_info(term, opts = {}) ⇒ Array<(PersonPaging, Fixnum, Hash)>

Find people Note: this endpoint is available in Alfresco 5.2 and newer versions. Gets a list of people that match the given search criteria. The search term is used to look for matches against person id, firstname and lastname. The search term: - must contain a minimum of 2 alphanumeric characters - can optionally use &#39;*&#39; for wildcard matching within the term You can sort the result list using the orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * firstName * lastName

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

Returns:

  • (Array<(PersonPaging, Fixnum, Hash)>)

    PersonPaging data, response status code and response headers



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/alfresco_api/api/queries_api.rb', line 131

def find_people_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: QueriesApi.find_people ..."
  end
  # verify the required parameter 'term' is set
  if @api_client.config.client_side_validation && term.nil?
    fail ArgumentError, "Missing the required parameter 'term' when calling QueriesApi.find_people"
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling QueriesApi.find_people, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling QueriesApi.find_people, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/queries/people"

  # query parameters
  query_params = {}
  query_params[:'term'] = term
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PersonPaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: QueriesApi#find_people\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#find_sites(term, opts = {}) ⇒ SitePaging

Find sites Note: this endpoint is available in Alfresco 5.2 and newer versions. 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 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 orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * title * description

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0. (default to 0)

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100. (default to 100)

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:



193
194
195
196
# File 'lib/alfresco_api/api/queries_api.rb', line 193

def find_sites(term, opts = {})
  data, _status_code, _headers = find_sites_with_http_info(term, opts)
  return data
end

#find_sites_with_http_info(term, opts = {}) ⇒ Array<(SitePaging, Fixnum, Hash)>

Find sites Note: this endpoint is available in Alfresco 5.2 and newer versions. 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 &#39;*&#39; for wildcard matching within the term 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 orderBy parameter. You can specify one or more of the following fields in the orderBy parameter: * id * title * description

Parameters:

  • term

    The term to search for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :skip_count (Integer)

    The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.

  • :max_items (Integer)

    The maximum number of items to return in the list. If not supplied then the default value is 100.

  • :order_by (Array<String>)

    A string to control the order of the entities returned in a list. You can use the orderBy parameter to sort the list by one or more fields. Each field has a default sort order, which is normally ascending order. Read the API method implementation notes above to check if any fields used in this method have a descending default search order. To sort the entities in a specific order, you can use the ASC and DESC keywords for any field.

  • :fields (Array<String>)

    A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the include parameter, then the fields specified in the include parameter are returned in addition to those specified in the fields parameter.

Returns:

  • (Array<(SitePaging, Fixnum, Hash)>)

    SitePaging data, response status code and response headers



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/alfresco_api/api/queries_api.rb', line 207

def find_sites_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: QueriesApi.find_sites ..."
  end
  # verify the required parameter 'term' is set
  if @api_client.config.client_side_validation && term.nil?
    fail ArgumentError, "Missing the required parameter 'term' when calling QueriesApi.find_sites"
  end
  if @api_client.config.client_side_validation && !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0
    fail ArgumentError, 'invalid value for "opts[:"skip_count"]" when calling QueriesApi.find_sites, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'max_items'].nil? && opts[:'max_items'] < 1
    fail ArgumentError, 'invalid value for "opts[:"max_items"]" when calling QueriesApi.find_sites, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/queries/sites"

  # query parameters
  query_params = {}
  query_params[:'term'] = term
  query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?
  query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?
  query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?
  query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['basicAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'SitePaging')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: QueriesApi#find_sites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end