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
- cache_dir
-
Specifies the directory where the HTML::Template file cache and the content cache files are stored. Defaults to
/tmp
. -
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_base_class
-
Specifies the base Model class that typically contains code that used across entire the web application, including methods for authentication and connecting to the database.
If you have multiple PageKit applications running on the same mod_perl server, then you'll need to specify a unique
model_base_class
for each application.Defaults to MyPageKit::Common.
- 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). - request_param_in_tmpl
-
If set to yes, then <MODEL_VAR> tags in template automatically get filled in with corresponding request values across all pages. Can be overriden by the corresponding page attribute. Defaults to no.
- session_expires
-
Sets the expire time for the cookie that stores the session id on the user's computer. If it is not set, then the expire time on the cookie will not be set, and the cookie will expire when the user closes their browser.
session = "+3h"
- uri_prefix
-
Prefix of URI that should be trimmed before dispatching to the Model code.
See also
pkit_fixup_uri
in Apache::PageKit::Model. - 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
- can_edit
-
If set to
yes
, enables on-line editing tools that are provided with PageKit CMS. PageKit CMS is a Commercial Content Management System for PageKit and should be released by June 2001. -
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.
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.
- fill_in_form
-
When set to yes, automatically fills in HTML forms with values from the
$apr
(Apache::Request) object when it detects a <form> tag. Default is yes. - request_param_in_tmpl
-
If set to yes, then <MODEL_VAR> tags in template automatically get filled in with corresponding request values. Defaults to the value set by the global request_param_in_tmpl attribute, or if that is not set, then it defaults to no.
- 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
-
This is currently not in use, but if enabled, will cache page templates in memory instead of on disk.
- 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_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