NAME

Apache::PageKit::Config - Reads and provides configuration data.

SYNOPSIS

This is a wrapper class to the global, server and page configuration settings stored in the pagekit_root/Config/Config.xml file.

METHODS

new

Constructor method, takes configuration directory and server as arguments.

  my $config = Apache::PageKit::Config->new(config_dir => $config_dir,
					server => $server);

If server is not specified, defaults to 'Default'.

parse_xml

Load settings from pagekit_root/Config/Config.xml.

$config->parse_xml;
get_global_attr
$config->get_global_attr('fill_in_form');

Gets the global fill_in_form attribute.

get_server_attr
$config->get_server_attr('cookie_domain');

Gets the cookie_domain attribute for the server associated with $config.

get_page_attr
$config->get_page_attr($page_id,'use_bread_crumb');

Gets the value of the use_bread_crumb attribute of $page_id.

CONFIGURATION VARIABLES

Global Attributes

These settings are global in the sense that they apply over all pages and servers. They are attributes of the <GLOBAL> tag in Config.xml

cookies_not_set_page

This is the page that gets displayed if the user attempts to log in, but their cookies are not enabled. Defaults to login_page.

default_page

Default page user gets when no page is specified. Defaults to index.

login_page

Page that gets displayed when user attempts to log in. Defaults to login.

model_dispatch_prefix

This prefixes the class that the contains the model code. Defaults to MyPageKit::MyModel.

Methods in this class take an Apache::PageKit::Model object as their only argument.

not_found_page

Error page when page cannot be found. Defaults to default_page.

post_max

Maximum size of file uploads. Defaults to 100,000,000 (100 MB).

recent_login_timeout

Seconds that user's session has to be inactive before a user is asked to verify a password on pages with the require_login attribute set to recent. Defaults to 3600 (1 hour).

uri_prefix

Prefix of URI that should be trimmed before dispatching to the Model code.

verify_page

Verify password form. Defaults to login_page.

Server Attributes

These options are global over all pages, but are local to each server configuration (e.g. production, staging, development). They are located in the <SERVERS> tag of Config.xml

Domain for that cookies are issued. Note that you must have at least two periods in the cookie domain.

files_match
files_match = "\.html?$"

Declines requests that match value.

html_clean_level

Sets optimization level for HTML::Clean. If set to 0, disables use of HTML::Clean. Levels range from 1 to 9. Level 1 includes only simple fast optimizations. Level 9 includes all optimizations. Defaults to level 9.

reload

If set to yes, check for new content and config xml files on each request. Should be set to no on production servers. Default is no.

search_engine_headers

If set to yes, sends Content-Length and Last-Modified headers on pages that don't require a login. Some search engines might that these headers be set in order to index a page.

META: I'm not sure if this works or is necessary with search engines. Please send me any comments or suggestions.

Default is no.

Page Attributes

These options are local to each page on the site, but are global across each server. The are located in the <PAGES> tag of Config.xml.

page_id (required)

Page ID for this page.

browser_cache

If set to no, sends an Expires = -1 header to disable client-side caching on the browser.

error_page

If a submitted form includes invalid data, then this is the page that is displayed.

error_page_run_code

If set to yes, then page_code on error_page is run. Defaults to no.

fill_in_form

When set to yes, automatically fills in HTML forms with values from the $apr (Apache::Request) object. If set to auto, fills in HTML forms when it detects a <form> tag. Default is auto.

internal_title

Title of page displayed on Content Management System. (Forthcoming)

Title used in navigation bar - used in <TMPL_LOOP NAME="PKIT_NAV"> </TMPL_LOOP> tag.

new_credential

Should be set to yes for pages that process credentials and update the database, such as pages that process new registration and forms that set a new login and/or password.

If set to yes, then it reissues the cookie that contains the credentials and authenticates the user.

parent_id

Parent page id - used for navigation bar.

require_login

If set to yes, page requires a login. If set to recent, page requires a login and that the user has been active in the last recent_login_timeout seconds. Default is no.

template_cache

If set to normal, enables cache option of HTML::Template for the Page and Include templates.

If set to shared, enables shared_cache option of HTML::Template.

uri_match

Value should be a regular expression. Servers requests whose URL (after the host name) match the regular expression. For example, ^member\/\d*$ matches http://yourdomain.tld/member/4444.

use_bread_crumb

If set to yes, creates bread crumb trail in location specified by <PKIT_LOOP NAME="BREAD_CRUMB"> </PKIT_LOOP> in the template.

use_template

If set to yes, uses HTML::Template files. If set to no page code is responsible for sending output. Default is yes.

AUTHOR

T.J. Mather (tjmather@anidea.com)

COPYRIGHT

Copyright (c) 2000, AnIdea Corporation. All rights Reserved. PageKit is a trademark of AnIdea Corporation.

LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Ricoh Source Code Public License for more details.

You can redistribute this module and/or modify it only under the terms of the Ricoh Source Code Public License.

You should have received a copy of the Ricoh Source Code Public License along with this program; if not, obtain one at http://www.pagekit.org/license