view · edit · sidebar · attach · print · history

20120402-update-ebps-yus-de-oddb-org-fachinfo-exporter-word-file-uploadnig

<< | Index | >>


summary

  • Fixed error of Picture, Link width in emediat epub
  • Setuped yus grant for de.oddb.org
  • Checked oddb yaml exporter job
  • Checkd fachinfo word file

commit

index


emediat_photo_epub

Problem
NoMethodError: undefined method `col_span' for #<EBPS::Text::Picture:0x16ad6758>
/home/yasu/Documents/workspace/ywesee/ebps/repo/lib/ebps/text/table.rb:38:in `block (2 levels) in column_widths'
/home/yasu/Documents/workspace/ywesee/ebps/repo/lib/ebps/text/table.rb:35:in `each'
/home/yasu/Documents/workspace/ywesee/ebps/repo/lib/ebps/text/table.rb:35:in `each_with_index'
...

Picture(< String) in Table.

  • EBPS::Text::LinkedParagraph
  • EBPS::Text::Picture
Update

Fixed width error of Picture, LinkedParagraph

In production server converter job (cron)

$ sudo -u xxx /var/ebps/bin/run_emediat_ebooks

Yus grant for de.oddb.org

to add grant exist user.

yus_grant
  • yus_grant email@ywesee.com view org.oddb.de
  • yus_grant email@ywesee.com login org.oddb.de.PowerUser
  • yus_grant email@ywesee.com login org.oddb.de.Admin

Debug oddb_yaml exporter

in src/util/exporter.rb

...
    def export_yaml
      exporter = YamlExporter.new(@app)
      safe_export 'oddb.yaml' do
        exporter.export
      end
...
ch.oddb>YamlExporter.new(self).export
debug

in @src/ext/exporter/src/odba_exporter.rb@

..
    def OdbaExporter.export_yaml(odba_ids, dir, name, opts={})
      p odba_ids.length
      opts.each do |key, val| Thread.current[key] = val end 
      safe_export(dir, name) { |fh|
...
result
[1]

then empty oddb.yaml are generated.
But we don't have any changes, recently.

$ git blame -L 15,17 src/plugin/yaml.rb
$ git blame -L 77,79 src/plugin/yaml.rb
$ git blame -L 233,245 ext/export/src/odba_exporter.rb

Experiment

Update expected method

in src/plugin/yaml.rb

...
    def export(name='oddb.yaml')
      export_array(name, @app.companies.values)
      #export_obj(name, @app.companies)
    end
...

in ext/export/src/odba_exporter.rb

        def OdbaExporter.export_yaml(odba_ids, dir, name, opts={})
          ...
          begin
            YAML.dump(ODBA.cache.fetch(odba_id, nil), fh) 
            fh.puts
          rescue StandardError => e
            p e 
          end 
          ...
        end

oddb.yaml generated.
But other (rescued) error caused.

#<NoMethodError: undefined method `collect' for nil:NilClass>
#<NoMethodError: undefined method `collect' for nil:NilClass>
#<NoMethodError: undefined method `collect' for nil:NilClass>
#<NoMethodError: undefined method `collect' for nil:NilClass>
...
x 45 lines

Attach:backtrace-rescued-error-in-export-yaml-20120402.txt

Refs

Check uploadnig in fachinfo word file

Error
NoMethodError
undefined method `registrations' for
#<ODDB::FachinfoDocument2001:0x0000000816d4f8>
/var/www/oddb.org/src/view/drugs/fachinfo.rb:195:in `_load_photos'
/var/www/oddb.org/src/view/drugs/fachinfo.rb:151:in `init'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.5/lib/htmlgrid/component.rb:139:in
`initialize'
/usr/local/lib64/ruby/gems/1.9.1/gems/htmlgrid-1.0.5/lib/htmlgrid/composite.rb:60:in
`new'

But, now src/view/drugs/fachinfo.rb have not _load_photos (This is old method....)
IT seems that this error caused by old commit.

Refs

Check word file and fiparsed

checked broken word layout for Fachinfo upload.

Problem

Main contents were in (transparent) table.

Tips
  • To Check Table Format window (popup) in Table.
  • To check layout in Web-View-Layout in OpenOffice.

MenuBar > View > Web Layout

Refs

Character replacing in fiparse

Experiment

sample text

in ext/fiparse/src/fachinfo_doc.rb

...
      def _run_of_text(text, char_props)
        p text
        #puts sprintf("%2i %s -> %s",char_props.fontsize, same_font?(@current_char_props, char_props), text[0,10])
        if(!same_font?(@current_char_props, char_props))
...
Output
"1"
" "
"="
" "
" ="
" "
""
" "
"="
"@"
" "
"="
Before convertiosn by iconv
"1\x00"
" \x00"
"=\x00"
" \x00"
"\xB2\x00 \x00=\x00"
" \x00"
"\xAB\x00"
" \x00"
"=\x00"
"@\x00"
" \x00"
"=\x00"

When text are loaded by Ruby, already be invalid charcter.
I updated character in Word file ;)

Result
 =
 =
&#8596; =
&#8773; =

Refs

view · edit · sidebar · attach · print · history
Page last modified on April 03, 2012, at 07:50 AM