app/search_engines/bento_search/eds_engine.rb
# Wraps calls to the EDS api with CreateSession and EndSession requests
# to EDS. Will pass sessionID in yield from block.
#
# Second optional arg is whether this is an authenticated user, else
# guest access will be used. 
#
#     with_session(true) do |session_token|
#       # can make more requests using session_token,
#       # EndSession will be called for you at end of block. 
#     end
Wraps calls to the EDS api with CreateSession and EndSession requests
to EDS. Will pass sessionID in yield from block.

Second optional arg is whether this is an authenticated user, else
guest access will be used.

with_session(true) do |session_token|
can make more requests using session_token,
EndSession will be called for you at end of block.
end
Wraps calls to the EDS api with CreateSession and EndSession requests to EDS . Will pass sessionID in yield from block . Second optional arg is whether this is an authenticated user else guest access will be used . with_session ( true ) do |session_token| can make more requests using session_token EndSession will be called for you at end of block . end
def with_session(auth = false, &block)
    auth_token = self.class.remembered_auth    
    if auth_token.nil?
      auth_token = self.class.remembered_auth = get_auth_token
    end
    create_url = "#{configuration.base_url}createsession?profile=#{configuration.profile}&guest=#{auth ? 'n' : 'y'}"    
    response_xml = get_with_auth(create_url)    
    session_token = nil
    unless response_xml && (session_token = at_xpath_text(response_xml, "//SessionToken"))  
      e = EdsCommException.new("Could not get SessionToken")      
    end
    begin    
      block.yield(session_token)
    ensure      
      if auth_token && session_token   
        end_url = "#{configuration.base_url}endsession?sessiontoken=#{CGI.escape session_token}"
        response_xml = get_with_auth(end_url)        
      end
    end
  end
def with_session ( auth = false , & block ) auth_token = self . class . remembered_auth if auth_token . nil? auth_token = self . class . remembered_auth = get_auth_token end create_url = "#{configuration.base_url}createsession?profile=#{configuration.profile}&guest=#{auth ? 'n' : 'y'}" response_xml = get_with_auth ( create_url ) session_token = nil unless response_xml && ( session_token = at_xpath_text ( response_xml , "//SessionToken" ) ) e = EdsCommException . new ( "Could not get SessionToken" ) end begin block . yield ( session_token ) ensure if auth_token && session_token end_url = "#{configuration.base_url}endsession?sessiontoken=#{CGI.escape session_token}" response_xml = get_with_auth ( end_url ) end end end
Wraps calls to the EDS api with CreateSession and EndSession requests
to EDS.
Wraps calls to the EDS api with CreateSession and EndSession requests to EDS .
auth
<not_specific>
block
<not_specific>