Apache2-PageKit
view release on metacpan or search on metacpan
docsrc/reference.xml view on Meta::CPAN
</varlistentry>
<varlistentry id="config.server.html_clean_level">
<term>html_clean_level</term>
<listitem>
<para>
Sets optimization level for <ulink url="http://kobesearch.cpan.org/search?dist=HTML-Clean">HTML::Clean</ulink>. If set to 0, disables use of
<ulink url="http://kobesearch.cpan.org/search?dist=HTML-Clean">HTML::Clean</ulink>. Levels range from 1 to 9.
Level 1 includes only simple fast optimizations. Level 9 includes all
optimizations. Defaults to <emphasis>0</emphasis>. A good choice for production is 3. Higher Levels might end up in wrong pages.
</para>
</listitem>
</varlistentry>
<varlistentry id="config.server.reload">
<term>reload</term>
<listitem>
<para>
If set to <emphasis>yes</emphasis>, check for new view, content and config xml files
on each request. Should be set to <emphasis>no</emphasis> on production servers.
Default is <emphasis>no</emphasis>.
</para>
<para>
If you change this from <emphasis>no</emphasis> to <emphasis>yes</emphasis> it is
certainly that the server must be restarted to notice the change.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
<title>User Attributes</title>
<para>
These options are like the <GLOBAL> tag. With the difference, that you can store any information here that you like.
The are located in the <USER> tag of <filename>Config/Config.xml</filename>.
</para>
<para>
You can retrieve this information with the
<link linkend="model.api.pkit_get_config_attr">pkit_get_config_attr</link> function.
</para>
</sect2>
<sect2>
<title>View Attributes</title>
<para>
These options are local to each view, but are global across servers and pages. Currently only the output media can be set, but there are plans to have a <literal>parent_view</literal>, so that there can be multiple levels of
derived views.
</para>
<variablelist>
<varlistentry id="config.view.content_type">
<term>content_type</term>
<listitem>
<para>
Sets the content type of the output sent to the client.
Content types are strings like "text/plain", "text/html" or "application/xml".
This corresponds to the "Content-Type" header in the HTTP protocol.
The following content types have default views and/or special handing
associated with them:
</para>
<informaltable frame="all">
<tgroup cols="4">
<tbody>
<row rowsep="1" role="attrheader">
<entry role="th"><para><emphasis role="bold">content_type</emphasis></para></entry>
<entry role="th"><para><emphasis role="bold">Description</emphasis></para></entry>
<entry role="th"><para><emphasis role="bold">Default Views</emphasis></para></entry>
<entry role="th"><para><emphasis role="bold">Special Handing</emphasis></para></entry>
</row>
<row>
<entry>text/html</entry>
<entry>
HTML output. This is for traditional screen browsers such as
Netscape and Internet Explorer.
</entry>
<entry>This is the default content_type for all views except for
those listed below</entry>
<entry>PageKit translates sets the charset in the Content-Type headers and translates the output according
to the <literal>Accept-Charset</literal> header.</entry>
</row>
<row>
<entry>application/pdf</entry>
<entry>
PDF Output, for display in Acrobat Reader. Uses Apache XML FOP
</entry>
<entry>pdf</entry>
<entry>PageKit uses Apache XML FOP to generate the PDF, if
<link linkend="config.global.fop_command">fop_command</link>
is set.</entry>
</row>
<row>
<entry>text/vnd.wap.wml</entry>
<entry>
WML output. This is for WAP handhelds such as Palmpilots
and cellphones.
</entry>
<entry>wml</entry>
<entry><emphasis>None</emphasis></entry>
</row>
<row>
<entry>application/xml</entry>
<entry>
XML output, for Internet Explorer 5.0 and above.
</entry>
<entry>xml</entry>
<entry><emphasis>None</emphasis></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2>
<title>Page Attributes</title>
<para>
These options are local to each page on the site, but are global across each server and all views.
The are located in the <PAGES> tag of <filename>Config/Config.xml</filename>.
</para>
<varlistentry id="config.page.browser_cache">
<term>browser_cache</term>
<listitem>
<para>
If set to <emphasis>no</emphasis>, sends an Expires = -1 header to disable client-side
caching on the browser.
</para>
</listitem>
docsrc/reference.xml view on Meta::CPAN
The optional third argument if the content_encoding (ie: gzip|x-gzip|compress|x-compress) it is only used if the
media_type is html/text.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_component_params_hashref">
<refnamediv>
<refname>pkit_component_params_hashref</refname>
<refpurpose>
Get access to the component parameters.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis><![CDATA[
<PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table">
<PKIT_COMPONENT NAME="xxx" headline="another_title" datasrc="select * from another_table">
<PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table">
sub xxx {
my $model = shift;
my $fields = $model->pkit_component_params_hashref;
my $select_statement = $fields->{DATASRC};
...
}
]]>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
This method return a hashref that contain the component parameters (or undef if the calling routine is not a component).
All keys are uppercase and the NAME of the component is not present in the hash. If the same component is used twice or more,
the component code is called only once.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_input_hashref">
<refnamediv>
<refname>pkit_input_hashref</refname>
<refpurpose>
Gets all request paramaters.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$params = $model->pkit_input_hashref;
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
This method fetches all of the parameters from the Apache request object,
returning a reference to a hash containing the parameters as keys, and
the parameters' values as values. Note a multivalued parameters
is returned as a reference to an array.
</para>
<para>
Note, that the values in this hash are <emphasis role="bold">readonly</emphasis>.
To modify something use $model-><literal>input</literal>( key => $value );.
</para>
</refsect1>
</refentry>
<refentry id="model.api.fillinform">
<refnamediv>
<refname>fillinform</refname>
<refpurpose>
Fills in HTML Forms
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->fillinform(email => $email);
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Used with <ulink uri="http://kobesearch.cpan.org/search?dist=HTML-FillInForm">HTML::FillInForm</ulink> to fill in HTML forms. Useful for example
when you want to fill an edit form with data from the database.
</para>
</refsect1>
</refentry>
<refentry id="model.api.ignore_fillinform_fields">
<refnamediv>
<refname>ignore_fillinform_fields</refname>
<refpurpose>
Fills in HTML Forms
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->ignore_fillinform_fields( qw/email name/ );
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
All fields named in this call are NOT changed by fillinform.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pnotes">
<refnamediv>
<refname>pnotes</refname>
<refpurpose>
Pass values from one method/handler to another
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
sub pkit_auth_credential {
# ...
$model->pnotes(user_id => $user_id);
# ...
}
</synopsis>
docsrc/reference.xml view on Meta::CPAN
<para>
Translates the text to the clients language, if a .mo file in that language is found.
See also <link linkend="model.api.pkit_gettext_message">pkit_gettext_message</link>.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_internal_execute_redirect">
<refnamediv>
<refname>pkit_internal_execute_redirect</refname>
<refpurpose>
Internal redirection to another page inside the PageKit application.
Also execute the code for the new destination page.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->pkit_internal_execute_redirect('myotherpage');
return;
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Resets the page_id. This is usually used "redirect" to different template inside your application and execute the modelcode for the new page.
</para>
<para>
From PageKit v1.12 on pkit_internal_redirect handle full url's and strip them.
Parameters at the end of request are removed.
This is usefull if you get the url from a pkit_done like parameter.
See also <link linkend="model.api.pkit_redirect">pkit_redirect</link> and
<link linkend="model.api.pkit_internal_redirect">pkit_internal_redirect</link>
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_internal_redirect">
<refnamediv>
<refname>pkit_internal_redirect</refname>
<refpurpose>
Internal redirection to another page inside the PageKit application
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->pkit_internal_redirect('myaccount');
return;
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Resets the page_id. This is usually used "redirect" to different template.
</para>
<para>
Note that you should perform a <link linkend="model.api.pkit_redirect">pkit_redirect</link>
for <emphasis role="bold">POST</emphasis> requests.
From PageKit v1.12 on pkit_internal_redirect handle full url's and strip them.
Parameters at the end of request are removed.
This is usefull if you get the url from a pkit_done like parameter.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_redirect">
<refnamediv>
<refname>pkit_redirect</refname>
<refpurpose>
Redirect to another URL.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->pkit_redirect("http://www.pagekit.org/");
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
It is strongly recommend that you use this method on pages where a
query that changes the state of the application is executed. Typically
these are POST queries that update the database.
</para>
<para>
Note that this passes along the messages set my <link linkend="model.api.pkit_message">pkit_message</link> if applicable.
</para>
</refsect1>
</refentry>
<refentry id="model.api.pkit_set_errorfont">
<refnamediv>
<refname>pkit_set_errorfont</refname>
<refpurpose>
Sets PKIT_ERRORSPAN tags
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
$model->pkit_set_errorfont('state');
# possible since version 1.08
$model->pkit_set_errorfont( 'state', '#00ff00' );
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Superfluous since PageKit 1.08 please use <link linkend="model.api.pkit_set_errorspan">pkit_set_errorspan</link>.
</para>
<para>
Sets the corresponding <link linkend="pkit.errorspan">PKIT_ERRORSPAN</link> tag in the template. Useful
for implementing your own custom constraints. Since version 1.08 it is possible to select the errorstr. This
is done with the second parameter. The color must be a string thar starts with a # followed by exactly six hexdigits.
If you do not specify the errorstr, the string is taken from the
<literal><link linkend="config.global.default_errorstr">default_errorstr</link></literal>.
See also <link linkend="pkit.errorstr">PKIT_ERRORSTR</link>.
</para>
</refsect1>
</refentry>
docsrc/reference.xml view on Meta::CPAN
]]>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Used to display messages only if it is a errormessage. Or display errors and warnings in different places.
</para>
</refsect1>
</refentry>
<refentry id="pkit.not_error">
<refnamediv>
<refname>PKIT_NOT_ERROR</refname>
<refpurpose>
Used to display messages only if it is a NOT a errormessage.
</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
<![CDATA[
<PKIT_HAVE_MESSAGES>
Here are some warnings messages for you: <p>
<PKIT_MESSAGES>
<PKIT_NOT_ERROR>
<PKIT_MESSAGE>
</PKIT_NOT_ERROR>
</PKIT_MESSAGES>
</p>
</PKIT_HAVE_MESSAGES>
<PKIT_HAVE_MESSAGES>
Here are some error messages for you: <p>
<PKIT_MESSAGES>
<PKIT_IS_ERROR>
<PKIT_MESSAGE>
</PKIT_IS_ERROR>
</PKIT_MESSAGES>
</p>
</PKIT_HAVE_MESSAGES>
]]>
</synopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
Used to display messages only if it is NOT a errormessage. Or display errors and warnings in different places.
</para>
</refsect1>
</refentry>
</sect2>
</sect1>
<sect1>
<title>Request parameters</title>
<para>
These are parameters that are specified in <emphasis role="bold">GET</emphasis> requests and <emphasis role="bold">POST</emphasis> requests where Content-type is one of
<constant>application/x-www-form-urlencoded</constant> or <constant>multipart/form-data</constant>.
</para>
<variablelist>
<varlistentry id="request.pkit_done">
<term>pkit_done</term>
<listitem>
<para>
The page to return to after the user has finished logging in or creating a new account.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_lang">
<term>pkit_lang</term>
<listitem>
<para>
Sets the user's preferred language, using a <ulink url="http://www.oasis-open.org/cover/iso639a.html">ISO 639</ulink> identifier.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_login_page">
<term>pkit_login_page</term>
<listitem>
<para>
This parameter is used to specify the page that user attempted to login from.
If the login fails, this page is redisplayed.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_login">
<term>pkit_login</term>
<listitem>
<para>
If this is set to true, then an attempt to log in is made.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_logout">
<term>pkit_logout</term>
<listitem>
<para>
If this is set to true, logs user out.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_remember">
<term>pkit_remember</term>
<listitem>
<para>
If set to true upon login, will save user's cookie so that they are still logged
in next time they restart their browser.
</para>
</listitem>
</varlistentry>
<varlistentry id="request.pkit_view">
<term>pkit_view</term>
<listitem>
<para>
Used to implement multiple views/co-branding. For example, if set to print,
will search for templates in the <filename>View/print</filename> directory before using
templates in the <filename>View/Default</filename> directory, and sets the
( run in 2.036 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )