view · edit · sidebar · attach · print · history

Yasu.20120803-improve-prescription-view-debug-ebps-output-error

<< | Index | >>


Summary

  • Improved prescription ui, text, style.
    • updated label as clickable with for attribute.
  • Debuged ebps output error

Commits

ch.oddb.org
ebps

Index


Improved prescription view

NOTE

  • HtmlGrid::LabelText
  • HtmlGrid::Label

Label class is used as container of components(LabelText, Text usw.)

class Label < SimpleDelegator
    include Enumerable
    def initialize(component, session, label_key=nil)
      @component = component
      @attributes = {}
      @session = session
      @lookandfeel = session.lookandfeel
      @label_key = label_key 
      if(@component.respond_to? :name)
        @attributes['for'] = @component.name.to_s
        @label_key ||= @component.name
      end 
      if(@component.respond_to?(:data_origin) \
         && (origin = @component.data_origin))
        @attributes.store('title', origin.to_s)
      end 
      ...
    end
  ...
end
commit

Debug ebps output error

currently, ebps does not have support of Image in Table.

Error
NoMethodError: undefined method `length' for #<YAML::Object:0x000000040b9dc8>
/usr/lib64/ruby19/site_ruby/1.9.1/ebps/text/table.rb:40:in `block (2
levels) in column_widths'
/usr/lib64/ruby19/site_ruby/1.9.1/ebps/text/table.rb:35:in `each'
/usr/lib64/ruby19/site_ruby/1.9.1/ebps/text/table.rb:35:in `each_with_index'
/usr/lib64/ruby19/site_ruby/1.9.1/ebps/text/table.rb:35:in `block in
column_widths'

Text in ch.oddb.org does have this support.

updated yaml exporter

Updated domain type of MultiCell.

  • (invalid) !ruby/object:ODDB::Text::MultiCell
  • (updated) !oddb.org,2003/ODDB::Text::MultiCell
      paragraphs: 
        - !oddb.org,2003/ODDB::Text::Table
          rows: 
          - - !oddb.org,2003/ODDB::Text::MultiCell
              col_span: 1
              contents: []

              row_span: 1
            - !oddb.org,2003/ODDB::Text::MultiCell
              col_span: 1
              contents: 

Improved nil value handling

TypeError: can't convert nil into Array
/var/ebps/lib/ebps/conversion/fachinfo_yaml.rb:97:in `replace'
/var/ebps/lib/ebps/conversion/fachinfo_yaml.rb:97:in `block in <module:EBPS>'
/path/to/ruby/1.9.1/syck.rb:220:in `call'

encoding problem

I found some strange character code in fachinfo.

\x1F

[1] 1.9.3-p194(main)> "f\xC3\xBCh\x1Fren"
=> "füh\u001Fren"
[2] 1.9.3-p194(main)> "vor\xC3\xBC\x1Fbergehend"
=> "vorü\u001Fbergehend"

lib/ebps/conversion/fachinfo_yaml.rb

  YAML.add_domain_type 'oddb.org,2003', 'ODDB::Text::Paragraph' do |type, val|
    par = Text::Paragraph.new
    ...
    # TODO
    # remove gsub, after fix escaped character problem in fachinfo.yaml of oddb
    par << val['text'].gsub(/\u001F/, '')
    ...
  end
commits
view · edit · sidebar · attach · print · history
Page last modified on August 03, 2012, at 04:09 PM