<< | Index | >>
table in pre format.
in src/plugin/text_info.rb
def import_fulltext terms, agent=init_agent
@search_term = terms.to_a.join ', '
terms.to_a.each do |term|
@current_search = [:search_fulltext, term]
page = search_fulltext term, agent
import_products page, agent
end
end
How check this table.
ch.oddb> TextInfoPlugin.new(self, {:reparse => true}).parse_fachinfo('/home/yasuhiro/Downloads/keppra.htm')
-> #<ODDB::FachinfoDocument2001:0x0000000c00d938>
ch.oddb> TextInfoPlugin.new(self, {:reparse => true}).import_fulltext(['keppra'])
-> ["keppra"]
in ext/fiparse/src/textinfo_hpricot.rb
...
when 'td', 'th'
## the new format uses td-borders as "row-separators"
p child.classes
if(child.classes.include?("rowSepBelow"))
ptr.target << preformatted_text(child)
...
Some td tag dose not have expected class attribute.
[] [] [] [] ["rowSepBelow"] [] ["rowSepBelow"] [] ...
I tried to use attributes of table tag.
created Table detection.
and improved pre-style table format.
def detect_table?(elem)
found = true
if elem.attributes['border'] == '0'
classes = []
(elem/:thead/:tr/:th).each do |th|
classes << true if th.attributes['class'] == 'rowSepBelow'
end
(elem/:tbody/:tr/:td).each do |td|
classes << true if td.attributes['class'] == 'rowSepBelow'
end
unless classes.empty? # as pre-format style paragraph
found = false
end
end
found
end
$ jobs/update_company_textinfos 'UCB Pharma'
ch.oddb> TextInfoPlugin.new(self, {:reparse => true}).import_company ['UCB Pharma']
ch.oddb> TextInfoPlugin.new(self, {:reparse => true}).import_fulltext ['Xyzal']

I found logo of Company.

I tried to get Compyn.logo via yus by user.
if @session.user.is_a?(ODDB::YusUser)
name = @session.user.name
company = @session.app.yus_model(name)
priv = company.pointer.to_yus_privilege
...
end
