CatalystX-ASP

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

      IncludesDir   => 'templates',
      MailHost      => 'localhost',
      MailFrom      => 'myapp@localhost',
      XMLSubsMatch  => '(?:myapp):\w+',
      Debug         => 0,
    }):

The following documentation is also plagiarized from Joshua Chamas.

- Global

    Global is the nerve center of an Apache::ASP application, in which the
    global.asa may reside defining the web application's event handlers.

    Includes, specified with `<!--#include file=somefile.inc-->` or
    `$Response->Include()` syntax, may also be in this directory, please see
    section on includes for more information.

- GlobalPackage

    Perl package namespace that all scripts, includes, & global.asa events are
    compiled into.  By default, GlobalPackage is some obscure name that is uniquely
    generated from the file path of the Global directory, and global.asa file. The
    use of explicitly naming the GlobalPackage is to allow scripts access to globals
    and subs defined in a perl module that is included with commands like:

        __PACKAGE__->config('CatalystX::ASP' => {
          GlobalPackage => 'MyApp' });

- IncludesDir

    No default. If set, this directory will also be used to look for includes when
    compiling scripts. By default the directory the script is in, and the Global
    directory are checked for includes.

    This extension was added so that includes could be easily shared between ASP
    applications, whereas placing includes in the Global directory only allows
    sharing between scripts in an application.

        __PACKAGE__->config('CatalystX::ASP' => {
          IncludeDirs => '.' });

    Also, multiple includes directories may be set:

        __PACKAGE__->config('CatalystX::ASP' => {
          IncludeDirs => ['../shared', '/usr/local/asp/shared'] });

    Using IncludesDir in this way creates an includes search path that would look
    like `.`, `Global`, `../shared`, `/usr/local/asp/shared`. The current
    directory of the executing script is checked first whenever an include is
    specified, then the `Global` directory in which the `global.asa` resides, and
    finally the `IncludesDir` setting.

- MailHost

    The mail host is the SMTP server that the below Mail\* config directives will
    use when sending their emails. By default [Net::SMTP](https://metacpan.org/pod/Net::SMTP) uses SMTP mail hosts
    configured in [Net::Config](https://metacpan.org/pod/Net::Config), which is set up at install time, but this setting
    can be used to override this config.

    The mail hosts specified in the Net::Config file will be used as backup SMTP
    servers to the `MailHost` specified here, should this primary server not be
    working.

        __PACKAGE__->config('CatalystX::ASP' => {
          MailHost => 'smtp.yourdomain.com.foobar' });

- MailFrom

    No default. Set this to specify the default mail address placed in the `From:`
    mail header for the `$Server->Mail()` API extension

        __PACKAGE__->config('CatalystX::ASP' => {
          MailFrom => 'youremail@yourdomain.com.foobar' });

- XMLSubsMatch

    Default is not defined. Set to some regexp pattern that will match all XML and
    HTML tags that you want to have perl subroutines handle. The is
    ["XMLSubs" in Apache::ASP](https://metacpan.org/pod/Apache::ASP#XMLSubs)'s custom tag technology ported to CatalystX::ASP, and can
     be used to create powerful extensions to your XML and HTML rendering.

    Please see XML/XSLT section for instructions on its use.

        __PACKAGE__->config('CatalystX::ASP' => {
          XMLSubsMatch => 'my:[\w\-]+' });

- Debug

    Currently only a placeholder. Only effect is to turn on stacktrace on `__DIE__`
    signal.

# OBJECTS

The beauty of the ASP Object Model is that it takes the burden of CGI and
Session Management off the developer, and puts them in objects accessible from
any ASP script and include. For the perl programmer, treat these objects as
globals accessible from anywhere in your ASP application.

The CatalystX::ASP object model supports the following:

    Object        Function
    ------        --------
    $Session      - user session state
    $Response     - output to browser
    $Request      - input from browser
    $Application  - application state
    $Server       - general methods

These objects, and their methods are further defined in their respective
pod.

- [CatalystX::ASP::Session](https://metacpan.org/pod/CatalystX::ASP::Session)
- [CatalystX::ASP::Response](https://metacpan.org/pod/CatalystX::ASP::Response)
- [CatalystX::ASP::Request](https://metacpan.org/pod/CatalystX::ASP::Request)
- [CatalystX::ASP::Application](https://metacpan.org/pod/CatalystX::ASP::Application)
- [CatalystX::ASP::Server](https://metacpan.org/pod/CatalystX::ASP::Server)

If you would like to define your own global objects for use in your scripts and
includes, you can initialize them in the `global.asa` `Script_OnStart` like:



( run in 3.096 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )