view · edit · sidebar · attach · print · history

Index>

20160627-setup-virbac

Summary

  • setup virbac.bbmb.ngiger.ch
  • setup vetoquinol.bbmb.ngiger.ch
  • Keep in Mind

Commits

Index

setup virbac.bbmb.ngiger.ch

Verifying what works under virbac.bbmb.ngiger.ch

  • Navigation to orders works.
  • "Schnellbestellung" directs to http://virbac.bbmb.ngiger.ch/de/sandoz/favorites/ which throws the error NoMethodError undefined method `article_number' for nil:NilClass. But I have the same problem in http://virbac.bbmb.ch/de/favorites/
  • Navigating the catalog works.
  • "Abschlüsse" (quotas) displays an empty list.
  • "Promotionen" (promotions) display a list of articles with discount and a remark
  • "Kalkulieren" (calculator) shows the list of articles with factor between public price and list price.
  • Sending an order worked and it is shown now in the archive

Looking at why setting the enviornmnet variable DEFAULT_FLAVOR to virbac did not work, as it still uses the name "sandoz".

While looking at the bbmb I found that it contains a (in my opinion unused) class PopMission, which still uses the rmail gem. This must be fixed, too. Replaced it with the same implementation as found in xmlconv/lib/xmlconv/util/polling_manager.rb. Postponing fixing the corresponding unit test test/util/test_polling_manager.rb

Debugging using the chromium developer tools gives this error

The Ajax scripts fails with the following error messages

virbac.bbmb.ngiger.ch/:11 Uncaught ReferenceError: require is not defined
http://virbac.bbmb.ngiger.ch/resources/dojo/resources/dojo.css Failed to load resource: the server responded with a status of 404 (Not Found)
Failed to load resource: the server responded with a status of 404 (Not Found)
http://virbac.bbmb.ngiger.ch/resources/dojo/resources/dojo.css Failed to load resource: the server responded with a status of 404 (Not Found)

The file /var/www/virbac.bbmb.ch/doc/resources/javascript/widget/ContentToggler.js is on fastpower and oddb-ci2.

To debug I changed in /var/www/virbac.bbmb.ch/lib/bbmb/virbac/html/view/login.rb the line 106 to

  DOJO_REQUIRE = [ 'ywesee.widget.ContentToggler' ]

The chromium debugger shows me that the following DOJO statement fails require(['ywesee.widget.ContentToggler']. Why?

The file was read without problem from the server as seen in /var/www/virbac.bbmb.ch/log/access_log when being request by a normal http.

::1 - - [27/Jun/2016:11:50:22 +0200] "GET /resources/javascript/widget/ContentToggler.js HTTP/1.1" 200 1611 "-" "Wget/1.14 (linux-gnu)"

Loading http://virbac.bbmb.ngiger.ch/

::1 - - [27/Jun/2016:11:52:13 +0200] "GET /de/bbmb/logout/ HTTP/1.1" 200 6937 "http://virbac.bbmb.ngiger.ch/de/bbmb" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/dojo/dojo.js HTTP/1.1" 200 129227 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/dojo/resources/dojo.css HTTP/1.1" 404 302 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/dijit/themes/tundra/tundra.css HTTP/1.1" 404 309 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHT
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/bbmb/bbmb.css HTTP/1.1" 200 4612 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) 
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/bbmb/logo.gif HTTP/1.1" 200 1263 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) 
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/dojo/resources/dojo.css HTTP/1.1" 404 302 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik
::1 - - [27/Jun/2016:11:52:13 +0200] "GET /resources/dijit/themes/tundra/tundra.css HTTP/1.1" 404 309 "http://virbac.bbmb.ngiger.ch/de/bbmb/logout/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHT

After changing in

 /var/www/virbac.bbmb.ch/lib/bbmb/virbac/html/view/login.rb 
 DOJO_PREFIX [ 'ContentToggler' ] 

and

 DOJO_PREFIX @@{  'widget' => '/resources/javascript/widget',}

I get the following errors

dojo.js:8 GET http://virbac.bbmb.ngiger.ch/resources/ContentToggler.js 
req.injectUrl @ dojo.js:8
_33 @ dojo.js:8
_9  @ dojo.js:8
(anonymous function)  @ dojo.js:8
_38 @ dojo.js:8
_7c @ dojo.js:8
_16 @ dojo.js:8
req @ dojo.js:8
(anonymous function)  @ (index):11
Navigated to http://virbac.bbmb.ngiger.ch/
dojo.js:8 Error: scriptError(…)
(anonymous function)  @ dojo.js:8
(anonymous function)  @ dojo.js:8
_9  @ dojo.js:8
req.signal  @ dojo.js:8
(anonymous function)  @ dojo.js:8
(index):13 GET http://virbac.bbmb.ngiger.ch/resources/dijit/themes/tundra/tundra.css 404 (Not Found)


With a DOJO_REQUIRE of 'dojo/dom' alone, I was able to see the newly installed dojo version 1.11 in the chromium console.

Now I must adapt ContentToggler.js to the new dojo version 1.11. E.g. dojo.provide is no long supported, see https://dojotoolkit.org/reference-guide/1.10/dojo/provide.html (which is no longer found in the 1.11 doc).

Change on line 462 of lib/bbmb/html/util/lookandfeel.rb/lib/bbmb/html/util/lookandfeel.rb to :dojo_js => 'dojo/dojo.js.uncompressed.js',. Now I get much clearer error messages in the console.

doc/resources/javascript/widget/ContentToggler.js starts now with the following line

  define(["dijit/_Widget","dojo/lfx/html"], function(_Widget, ContentToggler){  

The dojo/lfx/html library is now longer supported. The https://dojotoolkit.org/reference-guide/1.10/dojo/fx/Toggler.html has a nice replacement function.

I spent too much time trying to find a solution which works directly with the existing code and failed miserably. I looks for me that between dojo 1.3 and 1.11 things changed dramatically. I think I must from scratch, with a hand created HTML page with contains the needed content toggling and having resolved that change the ruby code to produce the correct HTML. To use the fx/Toggler we should then generate different DOM-id for hide and show

setup vetoquinol.bbmb.ngiger.ch

Make vetoquinol.bbmb.ngiger.ch start up. To avoid problems with SSL I only use the port 80. Now it starts.

Pending problems are:

  • virbac.bbmb.ngiger: Ajax does not work correctly. It should be possible to toggle the details of Geschäftsbedingungen.
view · edit · sidebar · attach · print · history
Page last modified on June 28, 2016, at 02:59 PM