class SearchRequest

Attributes

annotations[RW]

annotations attribute should be a Hash object

body[RW]

annotations attribute should be a Hash object

category[RW]

annotations attribute should be a Hash object

end[RW]

annotations attribute should be a Hash object

external_id[RW]

annotations attribute should be a Hash object

heading[RW]

annotations attribute should be a Hash object

location[RW]

annotations attribute should be a Hash object

page[RW]

annotations attribute should be a Hash object

retvals[RW]

annotations attribute should be a Hash object

rpp[RW]

annotations attribute should be a Hash object

source[RW]

annotations attribute should be a Hash object

start[RW]

annotations attribute should be a Hash object

text[RW]

annotations attribute should be a Hash object

trusted_annotations[RW]

annotations attribute should be a Hash object

Public Instance Methods

add_retval(retval) click to toggle source
# File lib/dto/search/search_request.rb, line 7
def add_retval(retval)
  @retvals << retval
end
query_params() click to toggle source
# File lib/dto/search/search_request.rb, line 11
  def query_params
    query = Hash.new
    url_params = ''
    if (rpp != nil)
      query[:rpp] = rpp.to_s;
      url_params += "rpp=#{CGI.escape(query[:rpp])}&"
    end
    if (page != nil)
      query[:page] = page.to_s;
      url_params += "page=#{CGI.escape(query[:page])}&"
    end
    if (source != nil)
      query[:source] = source.to_s;
      url_params += "source=#{CGI.escape(query[:source])}&"
    end
    if (category != nil)
      query[:category] = category.to_s;
      url_params += "category=#{CGI.escape(query[:category])}&"
    end
    if (location != nil)
      query[:location] = location.to_s;
      url_params += "location=#{CGI.escape(query[:location])}&"
    end
    if (heading != nil)
      query[:heading] = heading.to_s;
      url_params += "heading=#{CGI.escape(query[:heading])}&"
    end
    if (body != nil)
      query[:body] = body.to_s;
      url_params += "body=#{CGI.escape(query[:body])}&"
    end
    if (text != nil)
      query[:text] = text.to_s;
      url_params += "text=#{CGI.escape(query[:text])}&"
    end
    if (external_id != nil)
      query[:external_id] = external_id.to_s;
      url_params += "external_id=#{CGI.escape(query[:external_id])}&"
    end
    if (start != nil)
      query[:start] = start.to_s;
      url_params += "start=#{CGI.escape(query[:start])}&"
    end
    if (self.end != nil)
      query[:end] = self.end.to_s;
      url_params += "end=#{CGI.escape(query[:end])}&"
    end

    if (annotations != nil && annotations.size > 0)
#      query[:annotations] = ActiveSupport::JSON.encode(annotations)
      query[:annotations] = annotations
#      query.each do |key, value|
#        url_params += "#{key}=#{value}&"
#      end
      url_params += "annotations=#{CGI.escape(ActiveSupport::JSON.encode(query[:annotations]))}&" #'annotations=#{CGI.escape(ActiveSupport::JSON.encode(search.annotations))}'
    end
    if (trusted_annotations != nil && trusted_annotations.size > 0)
      #query[:trusted_annotations] = ActiveSupport::JSON.encode(trusted_annotations)
      query[:trusted_annotations] = trusted_annotations
      url_params += "trusted_annotations=#{CGI.escape(ActiveSupport::JSON.encode(query[:trusted_annotations]))}&"
    end
    if (retvals != nil)
      query[:retvals] = retvals.join(',')  #queryParams.put("retvals", Utils.join(retvals));
      url_params += "retvals=#{CGI.escape(query[:retvals])}&"
    end
    
    url_params
  end