NAME

Hyper::Manual::Control::Setup - How to create new controls

DESCRIPTION

To create a new control element, for a service usecase, the following files are required:

  • etc/Hyper/Control/Container/$service/$usecase.ini

    Defines the components and steps a control consists of. See usecase.ini.

  • var/Hyper/Control/Container/$service/usecase.htm

    Template for displaying the usecase. See <template.htm|template.htm>

  • var/Hyper/Control/Container/$service/labels.ini

    Labels configuration file for the service. See <labels.ini|labels.ini>

After creating these files, classes are generated by a Hyper::Generator::Control::Container run.

You may also use generate-control.pl to create the control classes.

FILES

usecase.ini

usecase.ini is the control container definition file. It consists of the following sections:

[global]

Global settings.

Valid keys are:

  • attributes

    Multi-Value field. All values specified will be included as object attributes in the control container. get_$name and set_$name methods will be generated, too.

[Control]

Define the controls for this container here. To define a control, add a [Control Name] subsection. Controls may have the following attributes:

  • class

    The implementation class of the control with Hyper::Control stripped of in . notation.

    Examples:

    Primitive.PAccountSelect  (expands to Hyper::Control::Primitive::PAccountSelect)
    Base.BCheckBox            (expands to Hyper::Control::Base::BCheckBox)
  • template

    Template to use (if any).

  • validators

    Validators to use (if any).

  • group_validators

    Group validators to use. Group validators are used for validating groups of fields - like name and given name for a "full name" control container.

    Group validators return OK if, and only if, all single validators grouped together into a group validator return OK.

    Group validators return all error messages of all single validators grouped together (if any).

    When validating groups of fields, group validators are recommended for usability.

Example:

[Control cSelectURAAccount]
class=Base.BSelectList
template=SelectAccount.htc

[Step]

Define the steps for the container here.

For every Step, place a [Step Name] section here.

Steps may include the following attributes:

  • controls

    A list of controls. Only controls defined in the same file may be used here.

  • action

    Actions to perform for this control. For the grammar of action definitions, see Hyper::Generator::Control::ContainerFlow

  • params

For transitions, place a [Step Name Next_Name] subsection here.

template.htm

labels.ini

labels.ini is a UNIX-Style ini file defining the label namespaces used in the service's templates.

It contains a section [global] for namespaces required in all service templates.

For every usecase template, a section named like the template (without suffix) may be specified.

In all sections, namespaces may be specified by the key namespace. namespace is a multi-value field, so you may set more than one namespace by heredocs.

; global settings for all templates in this directory
; namespace: label namespace
[global]
namespace=GlobalData

; global setting may be overridden on a per-file base.
;[CSelectPerson]
;namespace=<<EON
;GlobalData
;SpecialNamespace
;EON

AUTHOR

Martin Kutter <kutterma@users.sourceforge.net>

COPYING

Repository information

$ID: $

$LastChangedDate: $
$LastChangedRevision: $
$LastChangedBy: $

$HeadURL: $