Method: AlfrescoAPI::QueriesApi#find_nodes_with_http_info

Defined in:
lib/alfresco_api/api/queries_api.rb

#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