Hyper::Config::Reader::Container - ini style Container Control config reader
This document describes Hyper::Config::Reader::Container 0.01
use Hyper::Config::Reader::Container; my $object = Hyper::Config::Reader::Container->new({ base_path => '/srv/web/www.example.com/', file => 'MyPortal/Control/Container/FTest.ini', });
This module is used for reading ini config files into Hyper config objects.
Internally used to read the config file into an object hierarchy.
The ini style configuration files are stored within the following structure:
$BASE_PATH/etc/$NAMESPACE/Control/Container/$SERVICE/$USECASE.ini
See Hyper::Config::Reader::Flow for more options. Hyper::Control::Container are Flow Controls but they can also have some validation stuff.
The config file is split into several sections.
Global configuration data goes here.
The attributes allowed in [Global] are described below.
Attributes for this Control. Multiple attributes can be specified using the heredoc syntax.
Example:
[Global] attributes=<<EOT mMyAttribute mAnotherOne EOT
You can attach Single Validators to Controls (eg. Required Validator for a Hyper::Control::Base::BInput Control).
Template for the Hyper::Validator::Control::Container object which is used as container where the validator messages should be shown.
Attach a specific validator to the control.
Template with the Validator message.
Full example:
[Control] [Control cExampleControl] class=ControlType.myService.myUsecase template=/path/to/template [Control cExampleControl Validator Single Hyper.Validator.Single.Required] [Control cExampleControl Validator Single Hyper.Validator.Single.EMail]
This Control is used to show the group validator.
[Control] [Control vComparePasswords] class=Hyper.Control.Validator.Group [Control vComparePassword Validator Group Hyper.Validator.Group.Compare]
Let the Control act as a object in a group validator. $GROUP is the name of the Group Validator Control.
Act as named role in the group validator.
[Control] [Control vComparePasswords] class=Hyper.Control.Validator.Group [Control vComparePassword Validator Group Hyper.Validator.Group.Compare] [Control cNewPassword] class=Hyper.Control.Base.BInput [Control cNewPassword Validator Named vComparePasswords] act_as=first [Control cRepeatNewPassword] class=Hyper.Control.Base.BInput [Control cRepeatNewPassword Validator Named vComparePasswords] act_as=second
use generate-flow.pl to generate a perl class for yout flow control with a shadow class and a basic template.
hyper.pl -b $BASE_PATH -s $SERVICE -u $USECASE -t container
The following files will be generated:
if not existant:
$BASE_PATH/lib/Hyper/Control/Container/$SERVICE/C$USECASE.pm $BASE_PATH/var/Hyper/Control/Container/$SERVICE/$USECASE.htc
always (previous files will be overwritten):
$BASE_PATH/lib/Hyper/Control/Container/$SERVICE/_C$USECASE.pm
Each Step will call a method named action_$STEP_NAME if existant.
This methods may gather data from interfaces, perform interface calls etc.
You should place your code and template into
version
Hyper::Config::Reader::Flow
Class::Std::Storable
Hyper::Config::Object::Control::Validator
Hyper::Config::Object::Validator::Group
Hyper::Config::Object::Validator::Named
Hyper::Config::Object::Validator::Single
Hyper::Functions
Hyper::Error
Hyper::Config::Reader
$Author: ac0v $
$Id: Container.pm 317 2008-02-16 01:52:33Z ac0v $
$Revision: 317 $
$Date: 2008-02-16 02:52:33 +0100 (Sa, 16 Feb 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Config/Reader/Container.pm $
Andreas Specht <ACID@cpan.org>
<ACID@cpan.org>
Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Hyper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hyper
CPAN shell
perl -MCPAN -e shell install Hyper
For more information on module installation, please visit the detailed CPAN module installation guide.