Skip to content

How to import Daily XML Files

gordonleacock edited this page May 27, 2016 · 6 revisions

Installing Issue Data

Issue data should be installed in tmp/sdr1/obj/mdp, e.g. the OCR for barcode mdp.39015071754159 should be installed in tmp/sdr1/obj/mdp/39015071754159.

Rake Task to import daily xml via active record

Closes issue #29

  • daily_xml_to_db v1
  • updating xml import
  • remove issue_no from pages create call

Gets xml files from directory tmp/xml_data; so create this directory if it is not there, then place *.xml files there before running the rake task.

To use: bundle exec rake data:daily_xml_to_db --trace

NOTE: The txt files should be stored in tmp/txt_files folder

Less output for now; to increase output per file alter lib/task/data/daily_xml_to_db.rake L7, change "NOtesting" to "testing".

The rake task itself is in lib/task/data/daily_xml_to_db.rake, it calls the class DailyXmlToDb_v2.new("the-michigan-daily", "NOtesting") . The class DailyXmlToDb_v2 is defined in service/daily_xml_to_db_v2.rb.

Elements

Clone this wiki locally