view · edit · sidebar · attach · print · history

20120816-create-oddb-dat-zip-notification

<< | Index | >>


Summary

  • Create new 2 jobs in Updater and Exporter.
    • export_oddbdat and export_oddbdat_with_migel.
  • Update update_bsv_followers.

Commits

- NOTE:
- Updater and Exporter have old migel methods.
- MiGel has 2 format csv files. (oddb2tdat use migel_all_products_lang.csv)
  - migel_all_products_lang.csv
  - migel_product_lang.csv (default name is migel_products_lang)]]

Index


Create exporter for oddb dat zip

In Update_bsv_followers@ Job, create oddbdat exporter task with oddb2tdat@@ gem.

NOTE

Exporter has follwing exporter tasks.

  • export_csv (oddb.csv, oddb2.csv)
  • export_migel_csv
  • export_oddbdat (use ext/exportd/src/oddbdat.rb)

I found export_oddbdat and export_oddb2tdat Jobs in exporter.
Tried this jobs.

OddbDatExporter creates oddbdat.zip and oddbdat.zip.tar.gz.
CsvExport#export_oddbdat creates oddb.dat (via oddb2tdat gem).

Finaly, I decide to use CsvExport#export_oddbdat. (Because OddbDatExporter does not use oddb2tdat gem)
And create export_oddb2tdat_with_migel.

update_bsv_followers
  export_oddb_csv (Updater.new(self).export_oddb_csv)
    -> export_oddb2tdat
  export_migel_csv
    -> export_oddb2tdat_with_migel
  • Updater*export_oddb2tdat -> Exporter#export_oddb2tdat
  • Updater*export_oddb2tdat_with_migel -> Exporter#export_oddb2tdat_with_migel

We can call directly via Exporter class.

ch.oddb> Updater.new(self).export_oddb2tdat
ch.oddb> Updater.new(self).export_oddb2tdat_with_migel

same with

ch.oddb> Exporter.new(self).export_oddb2tdat
ch.oddb> Exporter.new(self).export_oddb2tdat_with_migel

Updated update_bsv_followers

Added new 2 jobs for oddb.dat in above into update_bsv_followers.


Debug export_migel

export_migel (in src/util/csv_exporter.rb) does not work.
Because App class dose not have miel_products method.

Tried to use :all_products in Migel server.

      def products
        @products ||= ODBA.cache.fetch_named('all_products', self){
          {}
         }
      end
      alias :all_products :products
ODBA::Stub was unable to replace Migel::Model::Product#9950 from Hash:#32287

This method does not work. It seems that this is old way.

MiGel exporter was following (in migel/lib/migel/lib/server.rb)

Importer.new.reported_save_all_products('migel_product_de.csv', 'de', true)

export_products('/var/www/migel/data/csv/migel_all_products_de.csv', 'de')
export_products('/var/www/migel/data/csv/migel_all_products_fr.csv', 'fr')

use this exported migel_all_products_de.csv file.

view · edit · sidebar · attach · print · history
Page last modified on August 16, 2012, at 12:31 PM