view · edit · sidebar · attach · print · history

20120515-migel-tab

<< | Index | >>


Summary

  • Removeh MiGel Tab, Search from some lookandfeels.
    • updated Lookandfeel#zones method as switch to activate/deactivate migel.
  • Updated SBSM::State#http_headers
    • learned about recycled object of dRuby

Commits

oddb.org
sbsm

Index


Remove migel tab

Removed MiGel tab from navigation in following lookandefeels.

  • atupri
  • just-medical
  • provita
  • santesuisse
  • mymigel
  • mymedi

only show in

  • gcc
  • generika

in src/custom/lookandfeelwrapper.rb

    def zones(filter=false)
      [ :drugs, :migel]
    end

Updated to activate/deactivate MiGel' by values of this zones.

  • MiGel Tab (show/hide)
  • search result in flavor (if deactive, request is redirected to gcc)

http_headers and Recycled object error

Sometimes, I got recycled object error at following request.
If this error happens, HTML Response are returned as text.

error in SBSM::Session#http_headers: /de/gcc/users/
RangeError
0xdb7d25de is recycled object
(drbssl://localhost:9997) /usr/lib/ruby/1.8/drb/drb.rb:375:in `_id2ref'
(drbssl://localhost:9997) /usr/lib/ruby/1.8/drb/drb.rb:375:in `to_obj'
(drbssl://localhost:9997) /usr/lib/ruby/gems/1.8/gems/odba-1.0.8/lib/odba/drbwrapper.rb:70:in `to_obj'
(drbssl://localhost:9997) /usr/lib/ruby/1.8/drb/drb.rb:1405:in `to_obj'
(drbssl://localhost:9997) /usr/lib/ruby/1.8/drb/drb.rb:1713:in `to_obj'
NOTE
  • 9997 is URI of yusd.
  • yusd use odba via ruby 1.8.
  • yusd does not have any errors.

Refs

In some state does not have http_headers, When state does not have http_headers, this error comes.
How does http_headers be related with this error?
I could to prevent displaying of this Range error by http_headers

in @lib/sbsm/session.rb@

    def http_headers
      @state.http_headers
    rescue DRb::DRbConnError
      raise
    rescue NameError, StandardError => err 
      puts "error in SBSM::Session#http_headers: #@request_path"
      puts err.class, err.message
      puts err.backtrace[0,5]
      {'Content-Type' => 'text/plain'}
    end

in @lib/sbsm/state.rb@

    def http_headers
      @http_headers || view.http_headers
    end

reverted to use http_headers of view if state does not have http_headers

State#view

      model = @filter ? @filter.call(@model) : @model
      view = klass.new(model, @session)
      warn "http_headers #{@http_headers}"
      @http_headers = view.http_headers unless @http_headers
      warn "http_headers #{@http_headers}"
      view
http_headers 
http_headers {"Content-Type"=>"text/html; charset=UTF-8", "Cache-Control"=>"private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0", "Pragma"=>"no-cache", "Expires"=>"Tue, 15 May 2012 12:37:13 UTC", "P3P"=>"CP='OTI NID CUR OUR STP ONL UNI PRE'"}

suspend

TODO

  • to learn about reference of druby
  • to check recycled object error

encoding_of_sbsm?

$ sudo gem install sbsm

Successfully installed sbsm-1.1.7
1 gem installed
Installing ri documentation for sbsm-1.1.7...
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeelfactory.rb, skipping
unable to convert "\xA4" from ASCII-8BIT to UTF-8 for lib/sbsm/uri_parser.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/state.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/cgi.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/exception.rb, skipping
unable to convert "\xA4" from ASCII-8BIT to UTF-8 for lib/sbsm/flavored_uri_parser.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/request.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeel.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/validator.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/time.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/index.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/drbserver.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeelwrapper.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/user.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/viralstate.rb, skipping
Installing RDoc documentation for sbsm-1.1.7...
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeelfactory.rb, skipping
unable to convert "\xA4" from ASCII-8BIT to UTF-8 for lib/sbsm/uri_parser.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/state.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/cgi.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/exception.rb, skipping
unable to convert "\xA4" from ASCII-8BIT to UTF-8 for lib/sbsm/flavored_uri_parser.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/request.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeel.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/validator.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/time.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/index.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/drbserver.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/lookandfeelwrapper.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/user.rb, skipping
unable to convert "\xFC" from ASCII-8BIT to UTF-8 for lib/sbsm/viralstate.rb, skipping
NOTE
  • U+00FC ü
  • U+00A4 ¤

gem install test with fileencoding

$ vim sbsm/uri_parser.rb
:set fileencoding=utf8
:wq
$ sudo rake gem
$ sudo gem install pkg/sbsm-1.1.7.gem

Refs


Debug import_daily job by crontab

Problem
  • jobs/import_daily by crontab does not work.
  • it seems that update_bsv and update_bsv_followers have some problems.
  • update_swissmedic, update_swissmedic_followers works.

output log

2012-05-11 09:01:21 CEST getin update_bsv
2012-05-11 09:01:30 CEST getin BsvXmlPlugin.update
2012-05-11 09:01:30 CEST target_url = http://bag.e-mediat.net/SL2007.Web.External/File.axd?file=XMLPublications.zip
2012-05-11 09:01:30 CEST save_dir   = /var/www/oddb.org/data/xml
2012-05-11 09:01:30 CEST getin download_file
2012-05-11 09:01:32 CEST save_file   = /var/www/oddb.org/data/xml/XMLPublications-2012.05.11.zip
2012-05-11 09:01:32 CEST latest_file = /var/www/oddb.org/data/xml/XMLPublications-latest.zip
2012-05-11 09:01:32 CEST File.exists?(/var/www/oddb.org/data/xml/XMLPublications-latest.zip) = true
2012-05-11 09:01:32 CEST FileUtils.compare_file(/tmp/foo20120511-19695-9a9sqr, /var/www/oddb.org/data/xml/XMLPublications-latest.zip) = true
2012-05-11 09:01:32 CEST path = nil
2012-05-11 09:01:32 CEST return_value_BsvXmlPlugin.update = nil
2012-05-11 09:01:32 CEST return_value_update_bsv=nil
view · edit · sidebar · attach · print · history
Page last modified on May 15, 2012, at 06:54 PM