<< Masa.20100917-hack-limitationText-class | 2010 | Masa.20100915-update-limitation-text >>
Suspend at HtmlGrid::Grid class
On the top page
<FORM ACCEPT-CHARSET="ISO-8859-1" NAME="stdform" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" ACTION="http://oddb.masa.org/en/gcc" onSubmit=" if(search_query.value!='Enter Drug or Active Agent here'){ var href = 'http://oddb.masa.org/en/gcc/search/zone/drugs/search_query/'+encodeURIComponent(search_query.value.replace(/\//, '%2F')); if(this.search_type) href += '/search_type/' + this.search_type.value;href += '#best_result'; document.location.href=href; } return false " >
Alert check
Experiment
<FORM ACCEPT-CHARSET="ISO-8859-1" NAME="stdform" METHOD="POST" ENCTYPE="application/x-www-form-urlencoded" ACTION="http://oddb.masa.org/en/gcc" onSubmit=" if(search_query.value!='Enter Drug or Active Agent here'){ var href = 'http://oddb.masa.org/en/gcc/search/zone/drugs/search_query/'+encodeURIComponent(search_query.value.replace(/\//, '%2F')); if(this.search_type) href += '/search_type/' + this.search_type.value;href += '#best_result'; alert(href); alert(this.search_type); document.location.href=href; } return false " >
Result
http://oddb.masa.org/en/gcc/search/zone/drugs/search_query/7680382940243/search_type/st_oddb#best_result [object HTMLSelectElement]
BraSt
Experiment & Result & Consider
Experiment
/usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb
def process begin @cgi.params.store('default_flavor', ENV['DEFAULT_FLAVOR']) @request.notes.each { |key, val| print "key=", key, " val=",val, "<br>"
Result (direct access to http://oddb.masa.org/en/gcc/search/zone/drugs/search_query/7680382940243)
key=language val=en key=flavor val=gcc key=event val=search key=zone val=drugs key=search_query val=7680382940243
Notes
Experiment
/usr/lib64/ruby/site_ruby/1.8/sbsm/request.rb
begin headers = @proxy.http_headers unless(cookie_input.empty?) cookie = generate_cookie(cookie_input) headers.store('Set-Cookie', [cookie]) end @cgi.out(headers) { print res.include?("Lexotanil 1,5") (@cgi.params.has_key?("pretty")) ? CGI.pretty( res ) : res } rescue StandardError => e handle_exception(e) end
Result
true
Notes
Experiment
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb
def drb_process(request) start = Time.now html = @mutex.synchronize do process(request) to_html end (@@stats[@request_path] ||= []).push(Time.now - start) open("/home/masa/work/test.dat","a"){|f| f.print html} html end
Result
Notes
Experiment
/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb
def to_html open("/home/masa/work/test.dat","a"){|f| f.print @state.class} @state.to_html(@@cgi)
Result
ODDB::State::Drugs::Result
Notes
Search to_html method
Experiment
/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb
def to_html(context) open("/home/masa/work/test.dat","a"){|f| f.print view.class} view.to_html(context) end
Result
ODDB::View::Drugs::Result
Search ODDB::View::Drugs::Result#to_html
There is to_html method in /usr/lib64/ruby/site_ruby/1.8/htmlgrid/template.rb
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb
def to_html(context) @grid.set_attributes(@attributes) super << @grid.to_html(context) end
Experiment
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb
def to_html(context) @grid.set_attributes(@attributes) open("/home/masa/work/test.dat","a"){|f| f.print @grid.to_html(context), "\n\n"} super << @grid.to_html(context) end
Result
Experiment2
/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb
def to_html(context) @grid.set_attributes(@attributes) open("/home/masa/work/test.dat","a"){|f| f.print @grid.class, "\n"} super << @grid.to_html(context) end
Result
HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid HtmlGrid::Grid
Notes
Set-p experiment /usr/lib64/ruby/site_ruby/1.8/htmlgrid/grid.rb
suspend
The last commit
Experiment
src/view/dataformat.rb
if (ean_code = model.barcode) pp caller(0)
Result (the following is outputted 6 times => it is called for each package)
["/home/masa/ywesee/oddb.org/src/view/dataformat.rb:66:in `name_base'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:286:in `compose_component'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `_compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `_compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:67:in `compose_list'", "/usr/lib64/ruby/1.8/delegate.rb:136:in `each_with_index'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:65:in `each'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:65:in `each_with_index'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:65:in `compose_list'", "/home/masa/ywesee/oddb.org/src/view/drugs/resultlist.rb:222:in `compose_list'", "/home/masa/ywesee/oddb.org/src/model/search_result.rb:120:in `each'", "/home/masa/ywesee/oddb.org/src/model/search_result.rb:120:in `each'", "/home/masa/ywesee/oddb.org/src/view/drugs/resultlist.rb:217:in `compose_list'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:54:in `compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/list.rb:129:in `init'", "/home/masa/ywesee/oddb.org/src/view/drugs/resultlist.rb:191:in `init'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:59:in `new'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:59:in `create'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:286:in `compose_component'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'", "/home/masa/ywesee/oddb.org/src/view/drugs/result.rb:116:in `init'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'", "/home/masa/ywesee/oddb.org/src/view/publictemplate.rb:53:in `new'", "/home/masa/ywesee/oddb.org/src/view/publictemplate.rb:53:in `content'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `send'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:66:in `create'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:286:in `compose_component'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:209:in `compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `each'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:203:in `compose'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/composite.rb:55:in `init'", "/home/masa/ywesee/oddb.org/src/view/publictemplate.rb:50:in `init'", "/home/masa/ywesee/oddb.org/src/view/resulttemplate.rb:28:in `init'", "/usr/lib64/ruby/site_ruby/1.8/htmlgrid/component.rb:138:in `initialize'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:271:in `new'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:271:in `view'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/state.rb:191:in `to_html'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:496:in `to_html'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:174:in `drb_process'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `synchronize'", "/usr/lib64/ruby/site_ruby/1.8/sbsm/session.rb:171:in `drb_process'", "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'", "/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'", "/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'", "/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'", "/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'", "/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'", "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'", "/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'", "/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'", "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'", "/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'", "bin/oddbd:38"]
Experiment
if (ean_code = model.barcode) #pp caller(0) pp model.limitation_text
Result
#<ODDB::LimitationText:0x7f9d3a9eef88 @odba_class=nil, @odba_container=nil, @odba_id=10899115, @receiver=nil, @receiver_loaded=nil> nil #<ODDB::LimitationText:0x7f9d3a862e08 @odba_class=nil, @odba_container=nil, @odba_id=23135746, @receiver=nil, @receiver_loaded=nil> #<ODDB::LimitationText:0x7f9d3a7a4a70 @odba_class=nil, @odba_container=nil, @odba_id=24323050, @receiver=nil, @receiver_loaded=nil> #<ODDB::LimitationText:0x7f9d3a684d20 @odba_class=nil, @odba_container=nil, @odba_id=10899116, @receiver=nil, @receiver_loaded=nil> nil
Notes
grep search
masa@masa ~/ywesee/oddb.org $ grep -r "class LimitationText" src src/model/limitationtext.rb: class LimitationText src/state/drugs/limitationtext.rb:class LimitationText < State::Drugs::Global src/state/drugs/limitationtexts.rb:class LimitationTexts < Global src/state/migel/limitationtext.rb:class LimitationText < State::Migel::Global src/view/drugs/limitationtext.rb:class LimitationTextInnerComposite < HtmlGrid::Composite src/view/drugs/limitationtext.rb:class LimitationTextComposite < HtmlGrid::Composite src/view/drugs/limitationtext.rb:class LimitationText < PrivateTemplate src/view/drugs/limitationtexts.rb:class LimitationTextList < HtmlGrid::List src/view/drugs/limitationtexts.rb:class LimitationTextsComposite < HtmlGrid::Composite src/view/drugs/limitationtexts.rb:class LimitationTexts < ResultTemplate src/view/migel/limitationtext.rb:class LimitationTextInnerComposite < View::Drugs::LimitationTextInnerComposite src/view/migel/limitationtext.rb:class LimitationTextComposite < HtmlGrid::Composite src/view/migel/limitationtext.rb:class LimitationText < View::PrivateTemplate
BraSt
ODDB::LimitationText class is definitely defined src/model/limitationtext.rb!!