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/Controller/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/Controller/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_nav');

Gets the value of the use_nav 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.

fill_in_form

When set to 1, automatically fills in HTML forms with values from the $apr (Apache::Request) object. Defaults to 1.

include_dispatch_prefix

This prefixes the class that the contains the include code. Defaults to MyPageKit::IncludeCode.

Methods in this class must be named include_include_id where include_id is the ID of the include, and take an Apache::PageKit object as their only argument.

login_page

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

not_found_page

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

page_dispatch_prefix

This prefixes the class that the contains the page code. Defaults to MyPageKit::PageCode.

Methods in this class must be named page_page_id where page_id is the ID of the include, and take an Apache::PageKit object as their only argument.

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 Page 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.

error_handler

Specifies the type of error handling. email e-mails the server administrator, display displays the error on the web page. Defaults to none.

files_match
files_match = "\.html?$"

Declines requests that match value.

page_domain

If yes, multiple domains are used for the site. Domains can be used to map to pages. Default is no.

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.

subdomain
subdomain = "staging"

This specifies the subdomain under the domain that this particular server is running. Only needs to be set if page_domain is set to yes.

Used in development environments where the hostname is different from the production environment. For example www.mywebsite.com will become www.staging.mywebsite.com under staging.

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.

domain

The domain name that is associated with the page.

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.

internal_title

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

is_popup

If set to yes, links to this page popup a window using javascript.

is_secure

If set to yes, links to this page will begin with https://.

is_topdomain

If set to yes, page will be the default page for the domain specified in the domain field.

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.

page_id_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.

parent_id

Parent page id - used for navigation bar.

Width of popup window. Used when is_popup is set to yes.

Height of popup window. Used when is_popup is set to yes.

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.

use_nav

If set to yes, creates navigation bar in location specified by <TMPL_LOOP NAME="PKIT_NAV"> </TMPL_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