Changeset 176

Show
Ignore:
Timestamp:
06-03-12 15:14:46 (2 years ago)
Author:
kostas.karasavvas@…
Message:

Updated to new myexperiment-rest API and written something in README

Location:
t2-web/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • t2-web/trunk/bin/t2_webapp.rb

    r153 r176  
    44require 'sinatra' 
    55require 'haml' 
    6 #require 'rest-open-uri'   this seems redundant after adding require 'open-uri' to myexperiment-rest!!! 
     6require 'open-uri' 
    77require 'rest-client' 
    88require 't2-server' 
     
    4747     
    4848    # Construct the complete or partial URL as MyExperimentRest lib expects it 
    49     # TODO: Maybe update myExperimentRest lib to accept only wid and wkf_version 
     49    # TODO: Maybe update myExperimentREST lib to accept only wid and wkf_version 
    5050    # Minor for now 
    5151    def get_url_from_wid(wid, wkf_version) 
     
    5959 
    6060    # Generates the contents of the header frame 
    61     def generate_header_frame(my_exp_wkf) 
     61    def generate_header_frame(my_exp_wkf, my_exp_usr) 
    6262      <<END 
    6363<html> 
    6464  <head><link href='/css/form.css' rel='stylesheet'/></head> 
    6565  <body> 
    66     #{generate_header_table(my_exp_wkf)} 
     66    #{generate_header_table(my_exp_wkf, my_exp_usr)} 
    6767  </body> 
    6868</html> 
     
    7272     
    7373    # Generates the contents of the header frame 
    74     def generate_header_table(my_exp_wkf) 
     74    def generate_header_table(my_exp_wkf, my_exp_usr) 
    7575      <<END 
    7676    <div id='header'> 
     
    8686              </tr> 
    8787              <tr> 
    88                 <td class='right'>workflow by #{@my_exp_wkf.user.name}</td> 
     88                <td class='right'>workflow by #{@my_exp_usr.name}</td> 
    8989 
    9090              </tr> 
     
    156156    # TODO: consider adding the following to a session 
    157157    @wid = params[:wid] 
    158     @wkf_version = params[:wkf_version] || "default" 
     158    @wkf_version = params[:wkf_version] || nil 
    159159    @t2_server = params[:server] || "http://test.mybiobank.org/taverna-server" 
    160160 
    161161    # Get myExperiment workflow object 
    162     @my_exp_wkf = MyExperimentREST::Workflows.new.read(get_url_from_wid(@wid, @wkf_version)) 
     162    # TODO: catch exception -- make custom exceptions? 
     163    @my_exp_wkf = MyExperimentREST::Workflow.from_id_and_version(@wid, @wkf_version) 
     164 
     165    # Get myExperiment user object 
     166    # TODO: catch exception -- make custom exceptions? 
     167    @my_exp_usr = MyExperimentREST::User.from_uri(@my_exp_wkf.uploader_uri) 
    163168 
    164169    haml :form 
     
    178183    @t2_server = params[:server] 
    179184 
    180     # Get myExperiment workflow object (TODO: session!) 
    181     @my_exp_wkf = MyExperimentREST::Workflows.new.read(get_url_from_wid(@wid, @wkf_version)) 
     185    @my_exp_wkf = MyExperimentREST::Workflow.from_id_and_version(@wid, @wkf_version) 
     186 
     187    # Get myExperiment user object (TODO: session!, exceptions) 
     188    @my_exp_usr = MyExperimentREST::User.from_uri(@my_exp_wkf.uploader_uri) 
     189 
    182190 
    183191    # use the uri reference to download the workflow locally 
    184     wkf_file = URI.parse(@my_exp_wkf.xml_uri) 
    185     wkf = wkf_file.read 
     192    #wkf_file = URI.parse(@my_exp_wkf.content_uri) 
     193    wkf = open(@my_exp_wkf.content_uri).read 
    186194 
    187195    # create run 
     
    245253    # Get myExperiment workflow object 
    246254    # TODO: with sessions that would be remembered 
    247     @my_exp_wkf = MyExperimentREST::Workflows.new.read(get_url_from_wid(@wid, @wkf_version)) 
     255    @my_exp_wkf = MyExperimentREST::Workflow.from_id_and_version(@wid, @wkf_version) 
    248256 
    249257    @run_uuid = params[:uuid] 
  • t2-web/trunk/CHANGES

    r153 r176  
    11= Changes log for the Taverna via the Web Gem 
     2 
     3== Version 0.0.5 
     4* Updated to new myexperiment-rest API 
    25 
    36== Version 0.0.4 
  • t2-web/trunk/Rakefile

    r153 r176  
    1313spec = Gem::Specification.new do |s| 
    1414  s.name = 't2-web' 
    15   s.version = '0.0.4' 
     15  s.version = '0.0.5' 
    1616  s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGES'] 
    1717  s.summary = 'WS (with libs) that generates a Web UI form for a Taverna2 workflow and then enacts it to a T2 server.' 
     
    2727  s.add_dependency 'rest-client', '~> 1.6.3' 
    2828  s.add_dependency 't2-server', '~> 0.6.1' 
    29   s.add_dependency 'myexperiment-rest', '~> 0.2.8' 
     29  s.add_dependency 'myexperiment-rest', '~> 0.3.0' 
    3030end 
    3131 
  • t2-web/trunk/README

    r140 r176  
    1 == t2-web  
     1= t2-web interface generator 
    22 
    3 You should document your project here. 
     3 
     4Authors::     Konstantinos Karasavvas 
     5Gem Version:: 0.0.5 
     6Contact::     mailto:kostas.karasavvas@nbic.nl 
     7Licence::     MIT (See LICENCE or http://www.opensource.org/licenses/mit-license) 
     8Copyright::   (c) 2010 Netherlands Bioinformatics Centre, The Netherlands 
     9 
     10 
     11== Synopsis 
     12 
     13This web application accepts a myExperiment workflow identifier and constructs 
     14a web form to allow end-users to configure and execute that workflow via a web 
     15browser with no other dependencies.. The web form interface is as good as the 
     16description provided in the workflow itself in myExperiment. 
     17 
     18 
     19== Installation 
     20 
     21  [sudo] gem install t2-web 
     22 
     23 
     24== Usage 
     25 
     26t2_webapp 
     27 
     28Runs the web application at port 9494 and waits for incoming requests. 
     29 
     30 
     31 
     32== References 
     33 
     34Taverna to Web Form Generator:: https://trac.nbic.nl/elabfactory/wiki/t2web 
     35Taverna2::       http://www.taverna.org.uk 
     36myExperiment::   http://www.myexperiment.org 
     37 
     38 
     39== Semantic Versioning 
     40 
     41This module uses semantic versioning concepts from http://semver.org/.