NAME

Hyper::Config::Reader::Container - ini style Container Control config reader

VERSION

This document describes Hyper::Config::Reader::Container 0.01

SYNOPSIS

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',
});

DESCRIPTION

This module is used for reading ini config files into Hyper config objects.

SUBROUTINES/METHODS

_read_config :PROTECTED

Internally used to read the config file into an object hierarchy.

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

The ini style configuration files are stored within the following structure:

$BASE_PATH/etc/$NAMESPACE/Control/Container/$SERVICE/$USECASE.ini

CONFIG FILE SYNTAX

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.

Config file sections

[Global]

Global configuration data goes here.

The attributes allowed in [Global] are described below.

attributes

Attributes for this Control. Multiple attributes can be specified using the heredoc syntax.

Example:

[Global]
attributes=<<EOT
mMyAttribute
mAnotherOne
EOT

[Control $NAME Validator Single] - attach single validators

You can attach Single Validators to Controls (eg. Required Validator for a Hyper::Control::Base::BInput Control).

template :OPTIONAL

Template for the Hyper::Validator::Control::Container object which is used as container where the validator messages should be shown.

[Control $NAME Validator Single $VALIDATOR_CLASS]

Attach a specific validator to the control.

template :OPTIONAL

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]

[Control $NAME Validator Group $CLASS] - be a group validator

This Control is used to show the group validator.

Full example:

[Control]
[Control vComparePasswords]
class=Hyper.Control.Validator.Group
[Control vComparePassword Validator Group Hyper.Validator.Group.Compare]

[Control $NAME Validator Named $GROUP] - attach named group validators

Let the Control act as a object in a group validator. $GROUP is the name of the Group Validator Control.

act_as :MANDATORY

Act as named role in the group validator.

Full example:

[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

CODE GENERATION

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

YOUR CODE

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

$BASE_PATH/lib/Hyper/Control/Container/$SERVICE/C$USECASE.pm
$BASE_PATH/var/Hyper/Control/Container/$SERVICE/$USECASE.htc

DEPENDENCIES

  • 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

INCOMPATIBILITIES

BUGS AND LIMITATIONS

RCS INFORMATIONS

Last changed by

$Author: $

Id

$Id: $

Revision

$Revision: $

Date

$Date: $

HeadURL

$HeadURL: $

AUTHOR

Andreas Specht <ACID@cpan.org>

LICENSE AND COPYRIGHT

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.