view · edit · sidebar · attach · print · history

20120224-sbsm-and-htmlgrid

<< | Index | >>


summary

  • traced request flow.
    • Apache -> SBSM::Request -> SBSM::Session -> ODDB::State -> ODDB::View -> ODDB::Template -> HtmlGrid::Grid-> render HTML
  • checked updating of htmlgrid

index


trace Request

I asked Masa-san and Zeno-san about HTTP Request flow to understand relation of sbsm and htmlgrid
Then traced it.

  1. . SBSM::Request.new called By Apache (in /path/to/gem/sbsm/lib/request.rb)
    connects ODDB::Session(as proxy) via druby in drb_prosess
    creates cookie
  2. . ODDB::Session (in src/util/session.rb)
    extends SBSM::Session (in /path/to/gem/sbsm/lib/session.rb)
    calls process() by request
  3. . ODDB::State::Global (in src/state/global.rb) is created.
    switched event by request as action controller. call view class
  4. . Each state Object (extends ODDB::State::Global < SBSM:State::Global)
    call to_html() of view object like a ODDB::View::Drugs::Search (in src/view/drugs/search.rb)
    extends view template class (and mixin some custome classes)
  5. . These template class extends Htmlgrid::Template
    $ cd /var/www/oddb.org/src/view/
    $ find . -type f | grep template
    ./drugs/privatetemplate.rb
    ./resulttemplate.rb
    ./privatetemplate.rb
    ./publictemplate.rb
    ./popuptemplate.rb
    ./printtemplate.rb
    
  6. . HtmlGrid::Template (in /path/to/htmlgrid/template.rb) extneds HtmlGrid::Composite
    mixin HtmlGrid::TemplateMethods also.
  7. . HtmlGrid::Composite extends AbstractComposite < Component
    transfer CGI object as context to @grid.to_html
  8. . HtmlGrid::Grid (in /path/to/htmlgrid/grid.rb)
    create html via CGI object
  9. . ODDB::Session
    return response of to_html()

refs


checked constants for HtmlGrid

checked how set these constants it oddb.org.

z.B.

admin login form on http://oddb.yasuhiro.org/de/gcc/login_form/

  1. . COMPONENTS
{[0, 0]=>:head, [0, 1]=>:content, [0, 2]=>:foot}
{[0, 0]=>ODDB::View::Logo, [1, 0, 0]=>:sponsor, [1, 0, 1]=>:welcome, [0, 1]=>:language_chooser, [1, 1]=>ODDB::View::TabNavigation}
{[0, 0]=>:de, [2, 0]=>:en, [1, 0]=>:navigation_divider, [4, 0]=>:fr, [3, 0]=>:navigation_divider, [5, 0]=>"dash_separator", [6, 0]=>:CHF, [8, 0]=>:EUR, [7, 0]=>:navigation_divider, [10, 0]=>:USD, [9, 0]=>:navigation_divider}
{[0, 0]=>:analysis, [2, 0]=>:doctors, [1, 0]=>:tabnavigation_divider, [4, 0]=>:interactions, [3, 0]=>:tabnavigation_divider, [6, 0]=>:drugs, [5, 0]=>:tabnavigation_divider, [8, 0]=>:migel, [7, 0]=>:tabnavigation_divider, [10, 0]=>:user, [9, 0]=>:tabnavigation_divider, [12, 0]=>:hospitals, [11, 0]=>:tabnavigation_divider, [14, 0]=>:companies, [13, 0]=>:tabnavigation_divider}
{[0, 0]=>"login_welcome", [0, 1]=>ODDB::View::Admin::LoginForm}
{[0, 0]=>:email, [0, 1]=>:pass, [1, 2, 0]=>:remember_me, [1, 2, 1]=>"remember_me", [1, 3]=>:submit, [1, 4]=>:password_lost}
{[0, 0]=>ODDB::View::Copyright, [1, 0]=>ODDB::View::Navigation}
{[0, 0]=>:lgpl_license, [1, 0]=>"comma_separator", [2, 0]=>:current_year, [3, 0]=>:cpr_link, [4, 0]=>:oddb_version}
{[0, 0]=>:help_link, [2, 0]=>:faq_link, [1, 0]=>"navigation_divider", [4, 0]=>:login_form, [3, 0]=>"navigation_divider", [6, 0]=>:ywesee_contact, [5, 0]=>"navigation_divider", [8, 0]=>:home_drugs, [7, 0]=>"navigation_divider"}
{[0, 0]=>:analysis, [2, 0]=>:doctors, [1, 0]=>:tabnavigation_divider, [4, 0]=>:interactions, [3, 0]=>:tabnavigation_divider, [6, 0]=>:drugs, [5, 0]=>:tabnavigation_divider, [8, 0]=>:migel, [7, 0]=>:tabnavigation_divider, [10, 0]=>:user, [9, 0]=>:tabnavigation_divider, [12, 0]=>:hospitals, [11, 0]=>:tabnavigation_divider, [14, 0]=>:companies, [13, 0]=>:tabnavigation_divider}
  1. . CSS_MAP
{[0, 0]=>"logo", [1, 0]=>"right", [0, 1]=>"list", [1, 1]=>"tabnavigation right"}
{[0, 0]=>"th"}
{[0, 0, 2, 5]=>"list"}
{[0, 0]=>"subheading", [1, 0]=>"subheading right"}

CSS_ID_MAP and CSS_STYLE_MAP are not found in oddb.org

$ grep -r CSS_ID_MAP /var/www/oddb.org/src
$ grep -r CSS_STYLE_MAP /var/www/oddb.org/src

main constants are

  • CONTENT
  • CSS_CLASS
  • COMPONENTS
  • HEAD
  • HTTP_HEADERS
  • FOOT
  • META_TAGS

checked update of htmlgrid

refs

invalid HTML before pull commit.

<td class="list migel-group">
<a class="square infos" title="Limitationstext" href="http://oddb.yasuhiro.org/de/gcc/migel_search/migel_limitation/34" name="square_limitation">L</a>
34
<a class="list" name="to_s" href="http://oddb.yasuhiro.org/de/gcc/migel_search/migel_group/34">VERBANDMATERIAL</a>
</td>
<td class="list migel-group">&nbsp;</td>
<td class="list migel-group" colspan="7">&nbsp;</td>
</tr>

expected HTML after pull commit. (and updated sbsm gem to 1.1.3)

<tr>
<td class="list migel-group">
<a class="square infos" title="Limitationstext" href="http://oddb.yasuhiro.org/de/gcc/migel_search/migel_limitation/34" name="square_limitation">L</a>
</td>
<td class="list migel-group">34</td>
<td class="list migel-group" colspan="7">
<a class="list" name="to_s" href="http://oddb.yasuhiro.org/de/gcc/migel_search/migel_group/34">VERBANDMATERIAL</a>
</td>
</tr>
view · edit · sidebar · attach · print · history
Page last modified on February 25, 2012, at 04:06 PM