<< | Index | >>
Remove the title 'Medikamente A-Z' from
Note
class LookandfeelMyMedi < SBSM::LookandfeelWrapper
...
DICTIONARIES = {
'de' => {
...
:sequences => 'Medikamente A-Z',
Note (trace)
Experiment
def build_custom_navigation
@lookandfeel.zones.each_with_index { |zone, idx|
if(zone.is_a?(Class))
zone = zone.direct_event
symbol_map.store(zone, View::NavigationLink)
else
symbol_map.store(zone, View::TabNavigationLink)
end
pos = [idx*2,0]
components.store(pos, zone)
component_css_map.store(pos, 'tabnavigation')
if(idx > 0)
components.store([idx*2-1,0], :tabnavigation_divider)
end
require 'pp'
pp components
}
end
Access
Result
{[0, 0]=>:sequences}
Note
Experiment
def build_custom_navigation
@lookandfeel.zones.each_with_index { |zone, idx|
if(zone.is_a?(Class))
zone = zone.direct_event
symbol_map.store(zone, View::NavigationLink)
else
symbol_map.store(zone, View::TabNavigationLink)
end
pos = [idx*2,0]
components.store(pos, zone)
component_css_map.store(pos, 'tabnavigation')
if(idx > 0)
components.store([idx*2-1,0], :tabnavigation_divider)
end
components.clear
}
end
Access
Result
Experiment
def zones
#[ State::Drugs::Sequences ]
[]
end
Access
Result
Note
Commit
Problem
Note
run_emediat_books
rm _DE.zip rm _DE.xml wget ftp://server/_DE.zip unzip _DE.zip
Task
module Decorator
module ChOddb
def self.decorate model
if codes = model.metadata['article_codes']
ean13s = codes.collect do |hash| hash[:article_ean13] end.compact
unless ean13s.empty?
chapter = Text::Chapter.new
chapter.heading << 'Preisvergleich'
ean13s.each do |ean13|
href = "http://ch.oddb.org/de/gcc/compare/ean13/#{ean13}"
#chapter.add_paragraph Text::LinkedParagraph.new(href, ean13)
chapter.add_paragraph Text::LinkedParagraph.new(href, model.title + " " + ean13)
end
model.add_chapter chapter
end
end
end
end
end
... decorate: - - /var/ebps/bin/decorators/ch_oddb_de.rb - ChOddb
Task
Experiment
:download_ebook => 'Download ebook',
def download_ebook(model, session)
link = HtmlGrid::Link.new(:download_ebook,
model, session, self)
=begin
args = {
'download[compendium_ch.oddb.org.firefox.epub]' => 1,
'download[compendium_ch.oddb.org.htc.prc]' => 1,
'download[compendium_ch.oddb.org.kindle.mobi]' => 1,
'download[compendium_ch.oddb.org.stanza.epub]' => 1,
}
link.href = @lookandfeel._event_url(:download_export, args)
link.set_attribute('class', 'list')
=end
link.href = "http://hogehoge"
link
end
Access
Result
Create a download link by bin/admin command, grant_download
ch.oddb> grant_download 'free_kindle_ebook@ywesee.com', 'compendium_ch.oddb.org.kindle.mobi', 0, Time.local(2011,12,31) -> http://ch.oddb.org/de/gcc/download/invoice/27397543/email/free_kindle_ebook@ywesee.com/filename/compendium_ch.oddb.org.kindle.mobi
Reference
Note
Result

Commit
Review
Encoding::CompatibilityError incompatible character encodings: ASCII-8BIT and UTF-8
error in SBSM::Session#to_html: / Encoding::CompatibilityError incompatible character encodings: ASCII-8BIT and UTF-8 /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:152:in `block in field_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:144:in `each' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:144:in `field_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:135:in `block in to_html' (eval):1256:in `tr' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:134:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `block (2 levels) in to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `collect' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `block in to_html' (eval):769:in `table' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:283:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:263:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:93:in `block in component_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:91:in `each' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:91:in `component_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:110:in `block in to_html' (eval):1290:in `td' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:109:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:152:in `block in field_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:144:in `each' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:144:in `field_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:135:in `block in to_html' (eval):1256:in `tr' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:134:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `block (2 levels) in to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `collect' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:284:in `block in to_html' (eval):769:in `table' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/grid.rb:283:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:263:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:123:in `block in to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:116:in `call' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:116:in `template_tags' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:111:in `block (2 levels) in template_html' (eval):1086:in `body' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:110:in `block in template_html' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/cgi/html.rb:432:in `block in html' (eval):1069:in `html' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/cgi/html.rb:432:in `html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:109:in `template_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:122:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:180:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:446:in `to_html' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:170:in `block in drb_process' <internal:prelude>:10:in `synchronize' /home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:168:in `drb_process' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' /home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
Trace
Experiment
def to_html(context)
@grid.set_attributes(@attributes)
p super.encoding
#super << @grid.to_html(context)
# super
end
Access
Result
#<Encoding:US-ASCII>
Experiment
def field_html(cgi)
html = ""
span = 1
@fields.each { |field|
if(span < 2)
#p field.to_html(cgi).encoding
html << field.to_html(cgi).force_encoding('utf-8')
span = field.colspan
else
span.step(-1)
end
}
html
end
def to_html(context)
#_to_html(context, @value).to_s
_to_html(context, @value).to_s.force_encoding('utf-8')
end
Access
Result
Note