NAME

Apache::AppWrap::Subs::Webify - Perl subroutine which formats for display all data retrieved from this site.


SYNOPSIS

&Apache::AppWrap::Subs::Webify() expects data to be populated in various elements of the %opts hash. These elements are populated by upstream subroutines and handlers based upon the request. If an element is not populated and a value is required a default value is provided, usually by values in table my_tables or in table my_defaults. Otherwise if no value is present the element is unused.


DESCRIPTION

All AppWrap handlers and subroutines use a common convention for deriving and passing data for onscreen display. This convention is to store data in elements of the %opts hash. Any subroutine or handler can store data in any of these elments by setting the appropriate element is %opts.

For consistency these hash elements would align well with entries in tables my_defaults and my_tables, although that presently is not so. That is a longer term goal. Additionally, these elements have been added somewhat ad hoc. The entire AppWrap application would benefit from a holistic approach to provide comprehensive support for these globals throughout the application. Another longer term goal.

Please note element names are case sensitive.

Title
The in-browser title for the current page. If this hash element is undefined or null no title is displayed.

SubTitle
The in-browser subtitle for the current page. If this hash element is undefined or null no subtitle is displayed.

ScreenTitle
The name that appears in the top border of the browser window. If this element is defined in %opts its value is concatenated with the 'title' value set in table my_defaults. If not defined the value is as set in table my_defaults.

Rows
All requested data to be displayed onscreen is stored as an array reference in $opts{Rows}. Typically the data to display is generated by the subroutine &Apache::AppWrap::Pager::paginator(), although other subroutines and handlers also can create this array reference.

The only structure to the array is that the data it contains is displayed first in, first out (FIFO.) That is, the first data 'push'ed onto the array is the first data appearing on the displayed page. Handlers and subroutines must be called in the proper order.

stylesheet
The default stylesheet is always concatenated with the full path to the directory for storing stylesheets as defined in the global %config hash (see AppWrap_Config.pm) If a separate stylesheet is desired for a particular request, store a fully qualified path name on the local machine to $opts{stylesheet}.

vbar_width
&Apache::AppWrap::Subs::Webify() shows a vertical bar on the left side of every displayed page. This element defines how wide will be that verticval bar. Units must be included in the definition, such as 'px' or '%'. (See http://www.w3c.org/TR/REC-CSS1 and other W3C styles references.)

vbar_class
Use a CSS class to set various display parameters for the vertical bar area. The default class is called 'vbar' and presently is hardcoded into &Webify. (The hardcode probably should be moved into table 'my_defaults'.) See the definition of the default class in the global stylesheet for an example.

menuitems
This is an array reference, similar to $opts{Rows}. The only structure is that the data is FIFO.

main_table_width
The width of the HTML table which comprises each displayed page. Logically this should be the sum of the width of the 'vbar' vertical bar on the left side and the body_table_width. However this is not enforced. If not specified the default value comes from table my_defaults.

body_table_width
The width of the table which contains all the data, not including the vertical bar on the left side. If not specified the default value comes from table my_defaults.

body_table_align
The horizontal alignment of the body table. If not specified the default value comes from table my_defaults.

body_table_valign
The vertical alignment of the body table. If not specified the default value comes from table my_defaults.

Image
Image is a bit of a fudge to allow the graphing subroutines to create images which display using Webify. Image is the name of a temporary file, created on the fly by a subroutine, and stored in the global $config{images} directory.

We should note it would be appropriate for the graphing subs to cache the created image in memory thus avoiding the overhead of writing (and reading) an image to disk. It's on the TODO list.


EXPORT

None by default.


AUTHOR

Russell Lundberg <russell_lundberg@csi.com>


SEE ALSO

Apache::AppWrap::my_tables, Apache::AppWrap::my_defaults, http://www.w3c.org/TR/REC-CSS1