cvsuser 02/02/05 14:23:29
Modified: P5EEx/Blue/P5EEx/Blue P5EE.pm Exceptions.pm Config.pod
Added: P5EEx/Blue/P5EEx/Blue TemplateEngine.pm
Log:
changed Template to TemplateEngine
Revision Changes Path
1.7 +18 -2 p5ee/P5EEx/Blue/P5EEx/Blue/P5EE.pm
Index: P5EE.pm
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/P5EE.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- P5EE.pm 11 Dec 2001 05:03:46 -0000 1.6
+++ P5EE.pm 5 Feb 2002 22:23:29 -0000 1.7
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: P5EE.pm,v 1.6 2001/12/11 05:03:46 spadkins Exp $
+## $Id: P5EE.pm,v 1.7 2002/02/05 22:23:29 spadkins Exp $
#############################################################################
package P5EEx::Blue::P5EE;
@@ -116,7 +116,7 @@
=item * Class Group: L<C<Serializer>|P5EEx::Blue::Serializer>
- transforms a perl struct to a scalar and back
-=item * Class Group: L<C<Template>|P5EEx::Blue::Template>
+=item * Class Group: L<C<TemplateEngine>|P5EEx::Blue::TemplateEngine>
- encapsulates template system details
=item * Class Group: L<C<Procedure>|P5EEx::Blue::Procedure>
@@ -295,6 +295,22 @@
contextClass => "P5EEx::Blue::Context::CGI",
configFile => "config.xml",
);
+
+This static (class) method returns the $context object
+of the context in which you are running.
+It tries to use some intelligence in determining which
+context is the right one to instantiate, although you
+can override it explicitly.
+
+It implements a "Factory" design pattern. Instead of using the
+constructor of a class itself to get an instance of that
+class, the context() method of P5EE is used. The former
+technique would require us to know at development time
+which class was to be instantiated. Using the factory
+style constructor, the developer need not ever know what physical class
+is implementing the "Context" interface. Rather, it is
+configured at deployment-time, and the proper physical class
+is instantiated at run-time.
=cut
1.6 +5 -5 p5ee/P5EEx/Blue/P5EEx/Blue/Exceptions.pm
Index: Exceptions.pm
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Exceptions.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- Exceptions.pm 4 Jan 2002 15:11:19 -0000 1.5
+++ Exceptions.pm 5 Feb 2002 22:23:29 -0000 1.6
@@ -11,7 +11,7 @@
use strict;
use vars qw($VERSION);
-$VERSION = sprintf '%2d.%02d', q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf '%2d.%02d', q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
my %e;
@@ -56,8 +56,8 @@
isa => 'P5EEx::Blue::Exception',
},
- 'P5EEx::Blue::Exception::Template' => {
- description => 'An exception in the Template service.',
+ 'P5EEx::Blue::Exception::TemplateEngine' => {
+ description => 'An exception in the TemplateEngine service.',
isa => 'P5EEx::Blue::Exception',
},
@@ -156,9 +156,9 @@
Base class for all Widget-related exceptions.
-=item * P5EEx::Blue::Exception::Template
+=item * P5EEx::Blue::Exception::TemplateEngine
-Base class for all Template-related exceptions.
+Base class for all TemplateEngine-related exceptions.
=item * P5EEx::Blue::Exception::Procedure
1.5 +6 -6 p5ee/P5EEx/Blue/P5EEx/Blue/Config.pod
Index: Config.pod
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Config.pod,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -r1.4 -r1.5
--- Config.pod 5 Dec 2001 22:45:03 -0000 1.4
+++ Config.pod 5 Feb 2002 22:23:29 -0000 1.5
@@ -1,6 +1,6 @@
######################################################################
-## $Id: Config.pod,v 1.4 2001/12/05 22:45:03 spadkins Exp $
+## $Id: Config.pod,v 1.5 2002/02/05 22:23:29 spadkins Exp $
######################################################################
=head1 NAME
@@ -32,7 +32,7 @@
$config->{Config}{default} # config settings for the default Config service
$config->{Security} # config settings for all Security services
$config->{Security}{default} # config settings for the default Security service
- $config->{Template}{tt} # config settings for the Template service named
"tt"
+ $config->{TemplateEngine}{tt} # config settings for the Template service named
"tt"
# The default driver (if "configClass" not supplied) reads in a Perl
# data structure from the file. Alternate drivers can read a Storable,
1.1 p5ee/P5EEx/Blue/P5EEx/Blue/TemplateEngine.pm
Index: TemplateEngine.pm
===================================================================
#############################################################################
## $Id: TemplateEngine.pm,v 1.1 2002/02/05 22:23:29 spadkins Exp $
#############################################################################
package P5EEx::Blue::TemplateEngine;
use P5EEx::Blue::P5EE;
use P5EEx::Blue::Service;
@ISA = ( "P5EEx::Blue::Service" );
use strict;
=head1 NAME
P5EEx::Blue::TemplateEngine - Interface for rendering HTML templates
=head1 SYNOPSIS
use P5EEx::Blue::P5EE;
$context = P5EEx::Blue::P5EE->context();
$template = $context->service("TemplateEngine"); # or ...
$template = $context->template();
... TBD ...
=head1 DESCRIPTION
A TemplateEngine Service is a means by which a template (such as an
HTML template) may be rendered (with variables interpolated).
=cut
#############################################################################
# CLASS GROUP
#############################################################################
=head1 Class Group: TemplateEngine
The following classes might be a part of the TemplateEngine Class Group.
=over
=item * Class: P5EEx::Blue::TemplateEngine
=item * Class: P5EEx::Blue::TemplateEngine::TemplateToolkit
=item * Class: P5EEx::Blue::TemplateEngine::Embperl
=item * Class: P5EEx::Blue::TemplateEngine::Mason
=item * Class: P5EEx::Blue::TemplateEngine::AxKit
=item * Class: P5EEx::Blue::TemplateEngine::ASP
=item * Class: P5EEx::Blue::TemplateEngine::CGIFastTemplate
=item * Class: P5EEx::Blue::TemplateEngine::TextTemplate
=item * Class: P5EEx::Blue::TemplateEngine::HTMLTemplate
=back
=cut
#############################################################################
# CLASS
#############################################################################
=head1 Class: P5EEx::Blue::TemplateEngine
A TemplateEngine Service is a means by which a template (such as an
HTML template) may be rendered (with variables interpolated).
* Throws: P5EEx::Blue::Exception::TemplateEngine
* Since: 0.01
=head2 Class Design
...
=cut
#############################################################################
# CONSTRUCTOR METHODS
#############################################################################
=head1 Constructor Methods:
=cut
#############################################################################
# new()
#############################################################################
=head2 new()
The constructor is inherited from
L<C<P5EEx::Blue::Service>|P5EEx::Blue::Service/"new()">.
=cut
#############################################################################
# PUBLIC METHODS
#############################################################################
=head1 Public Methods:
=cut
#############################################################################
# TBD()
#############################################################################
=head2 TBD()
* Signature: $tbd_return = $repository->tbd($tbd_param);
* Param: $tbd_param integer
* Return: $tbd_return integer
* Throws: P5EEx::Blue::Exception::Repository
* Since: 0.01
Sample Usage:
$tbd_return = $repository->tbd($tbd_param);
=cut
sub tbd {
my ($self) = @_;
}
#############################################################################
# PROTECTED METHODS
#############################################################################
=head1 Protected Methods:
=cut
#############################################################################
# Method: service_type()
#############################################################################
=head2 service_type()
Returns 'TemplateEngine';
* Signature: $service_type = P5EEx::Blue::TemplateEngine->service_type();
* Param: void
* Return: $service_type string
* Since: 0.01
$service_type = $widget->service_type();
=cut
sub service_type () { 'TemplateEngine'; }
=head1 ACKNOWLEDGEMENTS
* Author: Stephen Adkins <[EMAIL PROTECTED]>
* License: This is free software. It is licensed under the same terms as Perl
itself.
=head1 SEE ALSO
L<C<P5EEx::Blue::Context>|P5EEx::Blue::Context>,
L<C<P5EEx::Blue::Service>|P5EEx::Blue::Service>
=cut
1;