Changeset 174


Ignore:
Timestamp:
Feb 13, 2012, 4:15:01 PM (5 years ago)
Author:
kostas.karasavvas@…
Message:

Fixed bug when acquiring information from versions other than the newest

Location:
myexperiment-rest/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • myexperiment-rest/trunk/CHANGES

    r172 r174  
    11= Changes log for the MyExperiment via REST Gem
     2
     3== Version 0.3.3
     4* Fixed bug when acquiring information from versions other than the newest
     5
    26
    37== Version 0.3.2
    48* Updated to libxml-ruby 2.2.2
    5 
    69
    710== Version 0.3.1
  • myexperiment-rest/trunk/README

    r172 r174  
    22
    33Authors::     Konstantinos Karasavvas
    4 Gem Version:: 0.3.2
     4Gem Version:: 0.3.3
    55Contact::     mailto:kostas.karasavvas@nbic.nl
    66Licence::     MIT (See LICENCE or http://www.opensource.org/licenses/mit-license)
  • myexperiment-rest/trunk/Rakefile

    r172 r174  
    88spec = Gem::Specification.new do |s|
    99  s.name = 'myexperiment-rest'
    10   s.version = '0.3.2'
     10  s.version = '0.3.3'
    1111  s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGES']
    1212  s.summary = 'This is a simple library to access data on myExperiment via its REST API.'
  • myexperiment-rest/trunk/lib/myexperiment-rest.rb

    r160 r174  
    1717
    1818    when Urls::WORKFLOW_URL
     19      rest_params = { :params => {'id' => "#{params[:id]}",
     20                                  'elements' => 'title,description,content-uri,components,uploader'}
     21                    }
     22
     23      # if version is not empty use that one -- otherwise it returns the current version
     24      if params[:version]
     25        rest_params[:params]['version'] = "#{params[:version]}"
     26      end
     27
     28      # if session cookie is not empty it uses simple cookie auth (not secure -- used for demos)
     29      if params[:session_cookie]
     30        rest_params[:cookies] = params[:session_cookie]
     31      end
     32
     33
     34      # Get workflow resource information
    1935      begin
    20         # Get workflow resource information -- if version is empty it returns the current version
    21         if params[:session_cookie].empty?
    22           response = RestClient.get("#{Urls::MYEXPERIMENT_URL}/#{Urls::WORKFLOW_URL}",
    23                                            {:params => {'id' => "#{params[:id]}",
    24                                                         'version' => "#{params[:version]}",
    25                                                         'elements' => 'title,description,content-uri,components,uploader'} } )
    26           response     
    27         else    # TODO: reduce repetition.. if else only for the cookie key-value pair!!
    28           response = RestClient.get("#{Urls::MYEXPERIMENT_URL}/#{Urls::WORKFLOW_URL}",
    29                                            {:params => {'id' => "#{params[:id]}",
    30                                                         'version' => "#{params[:version]}",
    31                                                         'elements' => 'title,description,content-uri,components,uploader'},
    32                                             :cookies => params[:session_cookie] } )
    33           response
    34         end
     36        response = RestClient.get("#{Urls::MYEXPERIMENT_URL}/#{Urls::WORKFLOW_URL}", rest_params)
    3537      rescue Exception => e
    3638        raise "REST call to acquire workflow resource failed!\n" + e
Note: See TracChangeset for help on using the changeset viewer.