<< 20121003-debug-migel-index-creation-search-option | 2012 | 20121001-sponsorlink-update-fi-search-update-style-chooser >>
migel/lib/importer.rb
def save_all_products(file_name = 'migel_products_de.csv', lang = 'de', estimate = false)
plugin = Migel::SwissindexNonpharmaPlugin.new(migel_code_list)
@saved_products, @migel_codes_with_products, @migel_codes_without_products =
plugin.save_all_products(file_name, lang, estimate)
end
migel/lib/migel/plugin/swissindex.rb
table = swissindex.search_migel_table(migel_code, 'MiGelCode', lang) p table # => [] empty
via bin/admin
migel> DRbObject.new(nil, 'druby://localhost:50002').session(ODDB::Swissindex::SwissindexNonpharma){|swissindex| swissindex.search_migel_table('010201002', 'MiGelCode', 'de')}
-> []
SSL Certificate of prod.ws.emediat.net was changed as untrusted one.
agent = Mechanize.new { |a|
a.ssl_version, a.verify_mode = 'SSLv3',
OpenSSL::SSL::VERIFY_NONE
}
p agent.get(@base_url.gsub(/DE/,lang) + query_key + '=' + code)
"https://prod.ws.emediat.net/wv_getMigel/wv_getMigel.aspx?Lang=DE&Query="
#<Mechanize::Page
{url
#<URI::HTTPS:0x000000009ebad8 URL:https://prod.ws.emediat.net/wv_getMigel/wv_getMigel.aspx?Lang=de&Query=MiGelCode=010201002>}
{meta_refresh}
{title "MiGel - Mittel- und Gegenstandsliste"}
{iframes}
{frames}
{links
#<Mechanize::Page::Link
"\r\n Legende\r\n "
"\n legende_DE.pdf\n ">
#<Mechanize::Page::Link
"3039103"
"\n javascript:window.showModalDialog(\"https://prod.ws.emediat.net/wv_getmigel/wv_getMigelPrice.aspx?Lang=DE&Query=Pharmacode=3039103\")\n ">
#<Mechanize::Page::Link
"3039126"
"\n javascript:window.showModalDialog(\"https://prod.ws.emediat.net/wv_getmigel/wv_getMigelPrice.aspx?Lang=DE&Query=Pharmacode=3039126\")\n ">
#<Mechanize::Page::Link
"3039095"
"\n javascript:window.showModalDialog(\"https://prod.ws.emediat.net/wv_getmigel/wv_getMigelPrice.aspx?Lang=DE&Query=Pharmacode=3039095\")\n ">}
{forms}>
...
Currently company's contact_email is user contact_email.
Change this email.
$ bin/admin ch.oddb> company(215) -> Desitin Pharma GmbH ch.oddb> company(215).contact_email -> db.apotheke.waid@waid.zuerich.ch ch.oddb> company(215).email -> info@desitin.ch ch.oddb>

update_migel job cause many encoding errors.
Many old MiGel Objects have already invalid Encoding.
Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT when updating index 'migel_fulltext_index_de' with a Migel::Model::Migelid ["/var/migel/lib/migel/model/migelid.rb:51:in `join'", "/var/migel/lib/migel/model/migelid.rb:51:in `full_description'", "(eval):3:in `block in proc_resolve_search_term'", "/path/to/ruby/lib/ruby/gems/1.9.1/gems/odba-1.0.8/lib/odba/index.rb:146:in `call'"] [...]
in index creation.
/path/to/ruby/gems/1.9.1/gems/odba-1.0.8/lib/odba/storage.rb:594:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
from /path/to/ruby/gems/1.9.1/gems/odba-1.0.8/lib/odba/storage.rb:594:in `update_fulltext_index'
Maybe Locale setting of Production server is also related in this Error.
In my Local (After these commits), works correctly (in UTF-8).