library.comp Subroutines

The library component is the MasonSQL root component which initializes logging, includes most essential Perl modules and provides a couple of commonly used subroutines.

Subroutine Name Parameters Description Example
request_to_comp_path() $comp_name Tries to find component file-path using the comp_root parameter. my $report_file = request_to_comp_path($r->dir_config('DataBaseUrl').'/'.$report_name.'.rep');
LoadHeader() $comp Tries to determine component type then loads the $Global{LoadHeader_<component_type>} with corresponding HTML header string. LoadHeader 'SELF';
&LoadHeader('/lib/httpRequestMason.js', '/lib/library.js', '/lib/databinding.js', '/lib/displaybinding.js');
&LoadHeader('/lib/hReqMason_ClientMason.js');br>&LoadHeader('/test/dojo/test_dojo_buttons.css');

Many more similar examples can be found in the /opt/masonsql/htdocs/ directory tree.
initBrowserDetect()   Detects browser and uses the acquired information to set the following variables:
$Session{Browser},
$Session{IE},
$Session{IE8},
$Session{IE7}

For IE browsers also sets the Apache2 compatibility mode: $r->headers_out->{'X-UA-Compatible'}
initBrowserDetect();

The subroutines are defined inside the <%once> block.
Topic revision: r6 - 22 Apr 2018, GuidoBrugnara
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies