view · edit · sidebar · attach · print · history

Index>

20160607-sandoz-bbmb-ch

Summary

  • Setup sandoz.bbmb.ch on oddb-ci2 in clean git repository

Commits

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Remove parser for minifi (but keep the minifi)
  • BSV-Plugin does not send mail. Is it sending two mails at once?
  • remove obsolete pdf_patinfo in model, admin/views
  • Fix sbsm/htmlgrid when DEFAULT_FLAVOUR is nil

Setup sandoz.bbmb.ch on oddb-ci2 in clean git repository

Todo for today:

  • are the following changes correct in
    • include SBSM::Redirector (removed)
    • PERSISTENT_COOKIE_NAME (removed)
    • EXPIRES (removed)
    • invoices (addded)
    • validate (removed)
    • method_missing (added)

needed?

The PERSISTENT_COOKIE_NAME is needed to fix the cookie name to "bbmb-barcodereader".

When I include the SBSM::Redirector I get the ERR_TOO_MANY_REDIRECTS.

Readded method_missing and validate. Validate seems to be never called. Keeping it (with a puts) till I am sure, that everything works.

Readded EXPIRES at it should define the expire date of the cookie.

Added a require 'bbmb/html/state/login' after require 'bbmb/html/state/global' in lib/bbmb/html/util/session.rb and removed it from lib/bbmb/html/state/global.rb, where it was placed very unusal at the end of the file.

With a pry breakpoint at line 122 of /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/view/customers.rb I see

[9] pry(#<BBMB::Html::View::CustomersComposite>)> @session.persistent_user_input(:language)
=> "de"
[10] pry(#<BBMB::Html::View::CustomersComposite>)> @session.persistent_user_input(:sortvalue)
=> nil
[11] pry(#<BBMB::Html::View::CustomersComposite>)> @session.request_path
=> "/de/customers/sortvalue/last_login"

Somehow the sortvalue (which is part of the STRINGS constants of the validator) does not get passed. I will rework the bbmb state module by adding an init.rb as in ydim-html. Had to add a lib/bbmb/html/state/global_predefine.rb, too. Now I can login again, but the problems with the sortvalue persists.

Debugging user_input in lib/bbmb/html/state/global.rb. But I never reach the binding.pry statement, there. Why?

Looks like the sbsm is not setup correctly. Using pry I see

From: /usr/local/lib/ruby/gems/2.3.0/gems/sbsm-1.2.7/lib/sbsm/session.rb @ line 366 SBSM::Session#process:

    361:                                import_cookies(request)
    362:                                @state = active_state.trigger(event())
    363:         #FIXME: is there a better way to distinguish returning states?
    364:         #       ... we could simply refuse to init if event == :sort, but that
    365:         #       would not solve the problem cleanly, I think.
 => 366:         unless(@state.request_path)
    367:           @state.request_path = @request_path
    368:           @state.init
    369:         end
    370:                                unless @state.volatile?
    371:                                        @active_state = @state

[19] pry(#<BBMB::Html::Util::Session>)> @state.request_path
=> "/de"
[20] pry(#<BBMB::Html::Util::Session>)> @request_path
=> "/de/customers/sortvalue/last_login"

I searched in the wrong direction as on http://sandoz.bbmb.ch/de/customers/sortvalue/last_login does NOT sort the customers. Instead I must focus on the question why http://sandoz.bbmb.ch/de/customer/customer_id/4100609297 displays the details of the customer whereas http://sandoz.bbmb.ngiger.ch/de/customer/customer_id/4100609297 shows the same list of customers as after the login.

The filtering http://sandoz.bbmb.ch/de/customers/filter/1700 shows only the customers having the PLZ 1700 (Fribourg). This does not work with http://sandoz.bbmb.ngiger.ch/de/customers/filter/1700 neither.

Added require 'ydim/invoice' at line 10 of bin/bbmbd to get rid of the parameter -rydim/invoice when starting bin/bbmbd.

Using pry I found out that I pass by at the init method of BBMB::Html::State::Customers after a login, but not after going to http://sandoz.bbmb.ngiger.ch/de/customer/customer_id/4100609297. It was reached by "/usr/local/lib/ruby/gems/2.3.0/gems/sbsm-1.2.7/lib/sbsm/session.rb:369:in `process'".

Debugging the method import_user_input in /usr/local/lib/ruby/gems/2.3.0/gems/sbsm-1.2.7/lib/sbsm/session.rb shows for request.unparsed_uri of /de/customer/customer_id/4100609297

[1] pry(#<BBMB::Html::Util::Session>)> @unsafe_input
=> [["default_flavor", "sandoz"], ["language", "de"], ["flavor", "customer"], ["event", "customer_id"], ["4100609297", ""]]
[2] pry(#<BBMB::Html::Util::Session>)> @valid_input
=> {:default_flavor=>"sandoz", :language=>"de", :flavor=>"customer", :event=>nil, :"4100609297"=>nil}
[3] pry(#<BBMB::Html::Util::Session>)> request.unparsed_uri
=> "/de/customer/customer_id/4100609297"
<..>
[9] pry(#<BBMB::Html::Util::Session>)> request.params
=> {"default_flavor"=>"sandoz", "language"=>"de", "flavor"=>"customer", "event"=>"customer_id", "4100603406"=>""}

Why did 'customer' not get recogized as a valid element?

Why contain request.params "flavor"=>"customer" ?

Added a initialize procedure in lib/bbmb/html/state/global.rb and now I can see a single customer, but the lookandfeel has gone. See

Pressing back when being in http://sandoz.bbmb.ngiger.ch/de/bbmb/customer/customer_id/4100611615 does not work, shows ERR_CACHE_MISS.

The change that made the customer/customer_id/4100611615 was adding a line 'DEFAULT_FLAVOR = "bbmb"' in lib/bbmb/html/util/session.rb.

Saving and comparing the generated HTML source of http://sandoz.bbmb.ch/de/customers/ and http://sandoz.bbmb.ngiger.ch/de/bbmb/customer. Looking at the difference in the div with id "filter" as the POST method looks different. Comparing all elements is tricky, as the ordering of html attributes differ in Ruby 1.8 and 2.3. But I cannot find any signifcant change.

Debugging the request.params with DEFAULT_FLAVOR='sandoz' (when the links work) shows

/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/session.rb Processing request KnownUser? false /de/sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation email: admin@sandoz.ch res admin@sandoz.ch
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation login: Anmelden res 
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation flavor: sandoz res sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation language: de res de
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation event: login res login
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation state_id: 70074511935380 res 70074511935380
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation default_flavor: sandoz res sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation language: de res de
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/session.rb login? admin@sandoz.ch

After uncommenting DEFAULT_FLAVOR in lib/bbmb/html/util/session.rb I get

/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/session.rb Processing request KnownUser? false /de/sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation email: admin@sandoz.ch res admin@sandoz.ch
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation login: Anmelden res 
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation flavor: sandoz res sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation language: de res de
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation event: login res login
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation state_id: 70074511935380 res 70074511935380
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation default_flavor: sandoz res sandoz
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/validator.rb:52 perform_validation language: de res de
/usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/util/session.rb login? admin@sandoz.ch

With DEFAULT_FLAVOR='sandoz' I see the following warnings /usr/local/lib/ruby/gems/2.3.0/gems/bbmb-2.0.3/lib/bbmb/html/view/customer.rb:75: warning: Hash#index is deprecated; use Hash#key. This is simple.

I think the problem stems from the fact, that I changed sbsm to expect always a lookandfeel parameter in the request_url, as this ways always the case for ydim and oddb.org. This could have happen because I removed the rock parser for zone uri. Or by removing the line 205 from lib/sbsm/session.rb return if request.cookies.is_a?(DRb::DRbUnknown).

Resolving the request does not work correctly, because somehow the direct_events are not recognized. Direct_events are not used in ydim.

Must find a way that the default URL is passed too, as http://sandoz.bbmb.ngiger.ch/de/bbmb/customer/customer_id/4100609297 displays a customer correctly, but not http://sandoz.bbmb.ngiger.ch/de/customer/customer_id/4100609297.

Now I changed the DEFAULT_FLAVOR to sandoz and after moving bbmb.css and logo.png from var/www/sandoz.bbmb.ch/doc/resources/ /var/www/sandoz.bbmb.ch/doc/resources/sandoz/ the links work. See

view · edit · sidebar · attach · print · history
Page last modified on June 07, 2016, at 06:00 PM