NAME

CatalystX::ASP - PerlScript/ASP on Catalyst

VERSION

version 1.15

SYNOPSIS

package MyApp;
use Moose;
use Catalyst;
extends 'Catalyst';

with 'CatalystX::ASP::Role';

1;

DESCRIPTION

CatalystX::ASP is a plugin for Catalyst to support ASP (PerlScript). This is largely based off of Joshua Chamas's Apache::ASP, as the application I've been working with was written for Apache::ASP. Thus, this was designed to be almost a drop-in replacement. However, there were many features that I chose not to implement.

This plugin basically creates a Catalyst View which can process ASP scripts. As an added bonus, a simple CatalystX::ASP::Role can be included to allow for automatical processing of files with .asp extension in the application root directory.

Just to be clear, the Parser is almost totally ripped off of Joshua Chamas's parser in Apache::ASP. Similarly with the Compiler and GlobalASA. However, the other components are reimplementations.

CONFIGURATION

You can configure CatalystX::ASP in Catalyst under the CatalystX::ASP section of the configuration

__PACKAGE__->config('CatalystX::ASP' => {
  Global        => 'lib',
  GlobalPackage => 'MyApp',
  IncludesDir   => 'templates',
  MailHost      => 'localhost',
  MailFrom      => 'myapp@localhost',
  XMLSubsMatch  => '(?:myapp):\w+',
  Debug         => 0,
}):

The following documentation is also plagiarized from Joshua Chamas.

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.

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:

use vars qw( $Form $App ); # declare globals
sub Script_OnStart {
  $App  = MyApp->new;     # init $App object
  $Form = $Request->Form; # alias form data
}

In this way you can create site wide application objects and simple aliases for common functions.

METHODS

These are methods available for the CatalystX::ASP object

BUGS/CAVEATS

Obviously there are no bugs ;-) As of now, every known bug has been addressed. However, a caveat is that not everything from Apache::ASP is implemented here. Though the module touts itself to be a drop-in replacement, don't believe the author and try it out for yourself first. You've been warned :-)

AUTHOR

Steven Leung < sleung@cpan.org >

Joshua Chamas < asp-dev@chamas.com >

SEE ALSO

LICENSE AND COPYRIGHT

Copyright (C) 2016 Steven Leung

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.